Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdfac074

Browse files
authored
feat(cli): show workspace health in list (#8541)
Ref#6461
1 parent616e1d7 commitdfac074

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

‎cli/list.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cli
22

33
import (
44
"fmt"
5+
"strconv"
56
"time"
67

78
"github.com/google/uuid"
@@ -24,6 +25,7 @@ type workspaceListRow struct {
2425
WorkspaceNamestring`json:"-" table:"workspace,default_sort"`
2526
Templatestring`json:"-" table:"template"`
2627
Statusstring`json:"-" table:"status"`
28+
Healthystring`json:"-" table:"healthy"`
2729
LastBuiltstring`json:"-" table:"last built"`
2830
Outdatedbool`json:"-" table:"outdated"`
2931
StartsAtstring`json:"-" table:"starts at"`
@@ -51,12 +53,17 @@ func workspaceListRowFromWorkspace(now time.Time, usersByID map[uuid.UUID]coders
5153
}
5254
}
5355

56+
healthy:=""
57+
ifstatus=="Starting"||status=="Started" {
58+
healthy=strconv.FormatBool(workspace.Health.Healthy)
59+
}
5460
user:=usersByID[workspace.OwnerID]
5561
returnworkspaceListRow{
5662
Workspace:workspace,
5763
WorkspaceName:user.Username+"/"+workspace.Name,
5864
Template:workspace.TemplateName,
5965
Status:status,
66+
Healthy:healthy,
6067
LastBuilt:durationDisplay(lastBuilt),
6168
Outdated:workspace.Outdated,
6269
StartsAt:autostartDisplay,

‎cli/testdata/coder_list_--help.golden‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ Aliases: ls
88
-a, --all bool
99
Specifies whether all workspaces will be listed or not.
1010

11-
-c, --column string-array (default: workspace,template,status,last built,outdated,starts at,stops after)
11+
-c, --column string-array (default: workspace,template,status,healthy,last built,outdated,starts at,stops after)
1212
Columns to display in table output. Available columns: workspace,
13-
template, status, last built, outdated, starts at, stops after.
13+
template, status, healthy, last built, outdated, starts at, stops
14+
after.
1415

1516
-o, --output string (default: table)
1617
Output format. Available formats: table, json.

‎docs/cli/list.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ Specifies whether all workspaces will be listed or not.
2626

2727
###-c, --column
2828

29-
|||
30-
| -------| --------------------------------------------------------------------------------|
31-
| Type| <code>string-array</code>|
32-
| Default| <code>workspace,template,status,last built,outdated,starts at,stops after</code>|
29+
|||
30+
| -------| ----------------------------------------------------------------------------------------|
31+
| Type| <code>string-array</code>|
32+
| Default| <code>workspace,template,status,healthy,last built,outdated,starts at,stops after</code>|
3333

34-
Columns to display in table output. Available columns: workspace, template, status, last built, outdated, starts at, stops after.
34+
Columns to display in table output. Available columns: workspace, template, status,healthy,last built, outdated, starts at, stops after.
3535

3636
###-o, --output
3737

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp