Skip to content

Commit 7faef87

Browse files
committed
feat(browsers): add Pool column to browsers list
Shows 'Pooled' when a browser session was acquired from a pool. Uses ExtraFields to detect pool_id until SDK is updated with the field.
1 parent b1a3793 commit 7faef87

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

cmd/browsers.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func (b BrowsersCmd) List(ctx context.Context, in BrowsersListInput) error {
243243
}
244244

245245
// Prepare table data
246-
headers := []string{"Browser ID", "Created At", "Persistent ID", "Profile", "CDP WS URL", "Live View URL"}
246+
headers := []string{"Browser ID", "Created At", "Persistent ID", "Profile", "Pool", "CDP WS URL", "Live View URL"}
247247
if in.IncludeDeleted {
248248
headers = append(headers, "Deleted At")
249249
}
@@ -262,11 +262,18 @@ func (b BrowsersCmd) List(ctx context.Context, in BrowsersListInput) error {
262262
profile = browser.Profile.ID
263263
}
264264

265+
// Check for pool_id in ExtraFields (until SDK is updated with PoolID field)
266+
poolID := "-"
267+
if pf, ok := browser.JSON.ExtraFields["pool_id"]; ok && pf.Valid() {
268+
poolID = "Pooled"
269+
}
270+
265271
row := []string{
266272
browser.SessionID,
267273
util.FormatLocal(browser.CreatedAt),
268274
persistentID,
269275
profile,
276+
poolID,
270277
truncateURL(browser.CdpWsURL, 50),
271278
truncateURL(browser.BrowserLiveViewURL, 50),
272279
}

0 commit comments

Comments
 (0)