Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions cmd/browsers.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
}

// Prepare table data
headers := []string{"Browser ID", "Created At", "Persistent ID", "Profile", "CDP WS URL", "Live View URL"}
headers := []string{"Browser ID", "Created At", "Persistent ID", "Profile", "Pool", "CDP WS URL", "Live View URL"}
if in.IncludeDeleted {
headers = append(headers, "Deleted At")
}
Expand All @@ -261,11 +261,18 @@
profile = browser.Profile.ID
}

// Check for pool_id in ExtraFields (until SDK is updated with PoolID field)
poolID := "-"
if browser.PoolID != "" {

Check failure on line 266 in cmd/browsers.go

View workflow job for this annotation

GitHub Actions / test

browser.PoolID undefined (type kernel.BrowserListResponse has no field or method PoolID)
poolID = browser.PoolID

Check failure on line 267 in cmd/browsers.go

View workflow job for this annotation

GitHub Actions / test

browser.PoolID undefined (type kernel.BrowserListResponse has no field or method PoolID)
}

row := []string{
browser.SessionID,
util.FormatLocal(browser.CreatedAt),
persistentID,
profile,
poolID,
truncateURL(browser.CdpWsURL, 50),
truncateURL(browser.BrowserLiveViewURL, 50),
}
Expand Down Expand Up @@ -372,17 +379,17 @@
return util.PrintPrettyJSON(browser)
}

printBrowserSessionResult(browser.SessionID, browser.CdpWsURL, browser.BrowserLiveViewURL, browser.Persistence, browser.Profile)
printBrowserSessionResult(browser.SessionID, browser.CdpWsURL, browser.BrowserLiveViewURL, browser.PoolID, browser.Persistence, browser.Profile)

Check failure on line 382 in cmd/browsers.go

View workflow job for this annotation

GitHub Actions / test

browser.PoolID undefined (type *kernel.BrowserNewResponse has no field or method PoolID)
return nil
}

func printBrowserSessionResult(sessionID, cdpURL, liveViewURL string, persistence kernel.BrowserPersistence, profile kernel.Profile) {
tableData := buildBrowserTableData(sessionID, cdpURL, liveViewURL, persistence, profile)
func printBrowserSessionResult(sessionID, cdpURL, liveViewURL, poolID string, persistence kernel.BrowserPersistence, profile kernel.Profile) {
tableData := buildBrowserTableData(sessionID, cdpURL, liveViewURL, poolID, persistence, profile)
PrintTableNoPad(tableData, true)
}

// buildBrowserTableData creates a base table with common browser session fields.
func buildBrowserTableData(sessionID, cdpURL, liveViewURL string, persistence kernel.BrowserPersistence, profile kernel.Profile) pterm.TableData {
func buildBrowserTableData(sessionID, cdpURL, liveViewURL, poolID string, persistence kernel.BrowserPersistence, profile kernel.Profile) pterm.TableData {
tableData := pterm.TableData{
{"Property", "Value"},
{"Session ID", sessionID},
Expand All @@ -401,6 +408,9 @@
}
tableData = append(tableData, []string{"Profile", profVal})
}
if poolID != "" {
tableData = append(tableData, []string{"Pool ID", poolID})
}
return tableData
}

Expand Down Expand Up @@ -484,6 +494,7 @@
browser.SessionID,
browser.CdpWsURL,
browser.BrowserLiveViewURL,
browser.PoolID,

Check failure on line 497 in cmd/browsers.go

View workflow job for this annotation

GitHub Actions / test

browser.PoolID undefined (type *kernel.BrowserGetResponse has no field or method PoolID)
browser.Persistence,
browser.Profile,
)
Expand Down Expand Up @@ -2227,7 +2238,7 @@
if output == "json" {
return util.PrintPrettyJSON(resp)
}
printBrowserSessionResult(resp.SessionID, resp.CdpWsURL, resp.BrowserLiveViewURL, resp.Persistence, resp.Profile)
printBrowserSessionResult(resp.SessionID, resp.CdpWsURL, resp.BrowserLiveViewURL, resp.PoolID, resp.Persistence, resp.Profile)

Check failure on line 2241 in cmd/browsers.go

View workflow job for this annotation

GitHub Actions / test

resp.PoolID undefined (type *kernel.BrowserPoolAcquireResponse has no field or method PoolID)
return nil
}

Expand Down
Loading