|
1 | 1 | import { Api } from "coder/site/src/api/api"
|
2 |
| -import { Workspace, WorkspaceAgent } from "coder/site/src/api/typesGenerated" |
| 2 | +import { Workspace, WorkspaceAgent, WorkspaceApp } from "coder/site/src/api/typesGenerated" |
3 | 3 | import { EventSource } from "eventsource"
|
4 | 4 | import * as path from "path"
|
5 | 5 | import * as vscode from "vscode"
|
@@ -156,29 +156,20 @@ export class WorkspaceProvider implements vscode.TreeDataProvider<vscode.TreeIte
|
156 | 156 | )
|
157 | 157 |
|
158 | 158 | // Get app status from the workspace agents
|
159 |
| - try { |
160 |
| - const agents = extractAgents(workspace) |
161 |
| - agents.forEach((agent) => { |
162 |
| - // Check if agent has apps property with status reporting |
163 |
| - if (agent.apps && Array.isArray(agent.apps)) { |
164 |
| - workspaceTreeItem.appStatus = agent.apps.map((app) => ({ |
165 |
| - name: app.display_name || app.name || "App", |
166 |
| - status: app.status || "Running", |
167 |
| - icon: app.icon || "$(pulse)", |
168 |
| - url: app.url, |
169 |
| - agent_id: agent.id, |
170 |
| - agent_name: agent.name, |
171 |
| - command: app.command, |
172 |
| - workspace_name: workspace.name, |
173 |
| - })) |
174 |
| - } |
175 |
| - }) |
176 |
| - } catch (error) { |
177 |
| - // Log the error but continue - we don't want to fail the whole tree if app status fails |
178 |
| - this.storage.writeToCoderOutputChannel( |
179 |
| - `Failed to get app status for workspace ${workspace.name}: ${errToStr(error, "unknown error")}`, |
180 |
| - ) |
181 |
| - } |
| 159 | + const agents = extractAgents(workspace) |
| 160 | + agents.forEach((agent) => { |
| 161 | + // Check if agent has apps property with status reporting |
| 162 | + if (agent.apps && Array.isArray(agent.apps)) { |
| 163 | + workspaceTreeItem.appStatus = agent.apps.map((app: WorkspaceApp) => ({ |
| 164 | + name: app.display_name, |
| 165 | + url: app.url, |
| 166 | + agent_id: agent.id, |
| 167 | + agent_name: agent.name, |
| 168 | + command: app.command, |
| 169 | + workspace_name: workspace.name, |
| 170 | + })) |
| 171 | + } |
| 172 | + }) |
182 | 173 |
|
183 | 174 | return workspaceTreeItem
|
184 | 175 | }),
|
@@ -459,8 +450,6 @@ class AgentTreeItem extends OpenableTreeItem {
|
459 | 450 | export class WorkspaceTreeItem extends OpenableTreeItem {
|
460 | 451 | public appStatus: {
|
461 | 452 | name: string
|
462 |
| - status: string |
463 |
| - icon?: string |
464 | 453 | url?: string
|
465 | 454 | agent_id?: string
|
466 | 455 | agent_name?: string
|
|
0 commit comments