Skip to content

Commit f866b7c

Browse files
feat: add Pool column to browsers list
Show pool_id in the browser list table for browsers acquired from a pool. Extracts pool_id from SDK ExtraFields until the SDK is regenerated with the new field. Related: kernel/kernel#1286 Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 2ce4c7e commit f866b7c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

cmd/browsers.go

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

280280
// Prepare table data
281-
headers := []string{"Browser ID", "Created At", "Persistent ID", "Profile", "CDP WS URL", "Live View URL"}
281+
headers := []string{"Browser ID", "Created At", "Persistent ID", "Profile", "Pool", "CDP WS URL", "Live View URL"}
282282
showDeletedAt := in.IncludeDeleted || in.Status == "deleted" || in.Status == "all"
283283
if showDeletedAt {
284284
headers = append(headers, "Deleted At")
@@ -298,11 +298,17 @@ func (b BrowsersCmd) List(ctx context.Context, in BrowsersListInput) error {
298298
profile = browser.Profile.ID
299299
}
300300

301+
poolID := "-"
302+
if f, ok := browser.JSON.ExtraFields["pool_id"]; ok && f.Raw() != "" && f.Raw() != "null" {
303+
poolID = strings.Trim(f.Raw(), `"`)
304+
}
305+
301306
row := []string{
302307
browser.SessionID,
303308
util.FormatLocal(browser.CreatedAt),
304309
persistentID,
305310
profile,
311+
poolID,
306312
truncateURL(browser.CdpWsURL, 50),
307313
truncateURL(browser.BrowserLiveViewURL, 50),
308314
}

0 commit comments

Comments
 (0)