Skip to content

Commit 945cc85

Browse files
committed
feat: display current version on coder list
1 parent c428395 commit 945cc85

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
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-
WorkspaceName string `json:"-" table:"workspace,default_sort"`
26-
Template string `json:"-" table:"template"`
27-
Status string `json:"-" table:"status"`
28-
Healthy string `json:"-" table:"healthy"`
29-
LastBuilt string `json:"-" table:"last built"`
30-
Outdated bool `json:"-" table:"outdated"`
31-
StartsAt string `json:"-" table:"starts at"`
32-
StartsNext string `json:"-" table:"starts next"`
33-
StopsAfter string `json:"-" table:"stops after"`
34-
StopsNext string `json:"-" table:"stops next"`
35-
DailyCost string `json:"-" table:"daily cost"`
25+
WorkspaceName string `json:"-" table:"workspace,default_sort"`
26+
Template string `json:"-" table:"template"`
27+
Status string `json:"-" table:"status"`
28+
Healthy string `json:"-" table:"healthy"`
29+
LastBuilt string `json:"-" table:"last built"`
30+
CurrentVersion string `json:"-" table:"current version"`
31+
Outdated bool `json:"-" table:"outdated"`
32+
StartsAt string `json:"-" table:"starts at"`
33+
StartsNext string `json:"-" table:"starts next"`
34+
StopsAfter string `json:"-" table:"stops after"`
35+
StopsNext string `json:"-" table:"stops next"`
36+
DailyCost string `json:"-" table:"daily cost"`
3637
}
3738

3839
func workspaceListRowFromWorkspace(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
return workspaceListRow{
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",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy