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

Commit3d54bc0

Browse files
authored
feat: display current version on coder list (#11450)
* feat: display current version on coder list* fix make gen* update golden
1 parent31f7b39 commit3d54bc0

File tree

3 files changed

+34
-31
lines changed

3 files changed

+34
-31
lines changed

‎cli/list.go

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,18 @@ type workspaceListRow struct {
2222
codersdk.Workspace`table:"-"`
2323

2424
// For table format:
25-
WorkspaceNamestring`json:"-" table:"workspace,default_sort"`
26-
Templatestring`json:"-" table:"template"`
27-
Statusstring`json:"-" table:"status"`
28-
Healthystring`json:"-" table:"healthy"`
29-
LastBuiltstring`json:"-" table:"last built"`
30-
Outdatedbool`json:"-" table:"outdated"`
31-
StartsAtstring`json:"-" table:"starts at"`
32-
StartsNextstring`json:"-" table:"starts next"`
33-
StopsAfterstring`json:"-" table:"stops after"`
34-
StopsNextstring`json:"-" table:"stops next"`
35-
DailyCoststring`json:"-" table:"daily cost"`
25+
WorkspaceNamestring`json:"-" table:"workspace,default_sort"`
26+
Templatestring`json:"-" table:"template"`
27+
Statusstring`json:"-" table:"status"`
28+
Healthystring`json:"-" table:"healthy"`
29+
LastBuiltstring`json:"-" table:"last built"`
30+
CurrentVersionstring`json:"-" table:"current version"`
31+
Outdatedbool`json:"-" table:"outdated"`
32+
StartsAtstring`json:"-" table:"starts at"`
33+
StartsNextstring`json:"-" table:"starts next"`
34+
StopsAfterstring`json:"-" table:"stops after"`
35+
StopsNextstring`json:"-" table:"stops next"`
36+
DailyCoststring`json:"-" table:"daily cost"`
3637
}
3738

3839
funcworkspaceListRowFromWorkspace(now time.Time,workspace codersdk.Workspace)workspaceListRow {
@@ -46,18 +47,19 @@ func workspaceListRowFromWorkspace(now time.Time, workspace codersdk.Workspace)
4647
healthy=strconv.FormatBool(workspace.Health.Healthy)
4748
}
4849
returnworkspaceListRow{
49-
Workspace:workspace,
50-
WorkspaceName:workspace.OwnerName+"/"+workspace.Name,
51-
Template:workspace.TemplateName,
52-
Status:status,
53-
Healthy:healthy,
54-
LastBuilt:durationDisplay(lastBuilt),
55-
Outdated:workspace.Outdated,
56-
StartsAt:schedRow.StartsAt,
57-
StartsNext:schedRow.StartsNext,
58-
StopsAfter:schedRow.StopsAfter,
59-
StopsNext:schedRow.StopsNext,
60-
DailyCost:strconv.Itoa(int(workspace.LatestBuild.DailyCost)),
50+
Workspace:workspace,
51+
WorkspaceName:workspace.OwnerName+"/"+workspace.Name,
52+
Template:workspace.TemplateName,
53+
Status:status,
54+
Healthy:healthy,
55+
LastBuilt:durationDisplay(lastBuilt),
56+
CurrentVersion:workspace.LatestBuild.TemplateVersionName,
57+
Outdated:workspace.Outdated,
58+
StartsAt:schedRow.StartsAt,
59+
StartsNext:schedRow.StartsNext,
60+
StopsAfter:schedRow.StopsAfter,
61+
StopsNext:schedRow.StopsNext,
62+
DailyCost:strconv.Itoa(int(workspace.LatestBuild.DailyCost)),
6163
}
6264
}
6365

@@ -73,6 +75,7 @@ func (r *RootCmd) list() *clibase.Cmd {
7375
"status",
7476
"healthy",
7577
"last built",
78+
"current version",
7679
"outdated",
7780
"starts at",
7881
"stops after",

‎cli/testdata/coder_list_--help.golden

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ OPTIONS:
1111
-a, --all bool
1212
Specifies whether all workspaces will be listed or not.
1313

14-
-c, --column string-array (default: workspace,template,status,healthy,last built,outdated,starts at,stops after)
14+
-c, --column string-array (default: workspace,template,status,healthy,last built,current version,outdated,starts at,stops after)
1515
Columns to display in table output. Available columns: workspace,
16-
template, status, healthy, last built,outdated, starts at, starts
17-
next, stops after, stops next, daily cost.
16+
template, status, healthy, last built,current version, outdated,
17+
starts at, startsnext, stops after, stops next, daily cost.
1818

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

‎docs/cli/list.md

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp