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

Commiteeef56a

Browse files
authored
feat(cli): show workspace favorite status in list output (#11878)
1 parent9abf6ec commiteeef56a

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

‎cli/list.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type workspaceListRow struct {
2222
codersdk.Workspace`table:"-"`
2323

2424
// For table format:
25+
Favoritebool`json:"-" table:"favorite"`
2526
WorkspaceNamestring`json:"-" table:"workspace,default_sort"`
2627
Templatestring`json:"-" table:"template"`
2728
Statusstring`json:"-" table:"status"`
@@ -46,9 +47,15 @@ func workspaceListRowFromWorkspace(now time.Time, workspace codersdk.Workspace)
4647
ifstatus=="Starting"||status=="Started" {
4748
healthy=strconv.FormatBool(workspace.Health.Healthy)
4849
}
50+
favIco:=" "
51+
ifworkspace.Favorite {
52+
favIco="★"
53+
}
54+
workspaceName:=favIco+" "+workspace.OwnerName+"/"+workspace.Name
4955
returnworkspaceListRow{
56+
Favorite:workspace.Favorite,
5057
Workspace:workspace,
51-
WorkspaceName:workspace.OwnerName+"/"+workspace.Name,
58+
WorkspaceName:workspaceName,
5259
Template:workspace.TemplateName,
5360
Status:status,
5461
Healthy:healthy,

‎cli/testdata/coder_list_--help.golden

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

1414
-c, --column string-array (default: workspace,template,status,healthy,last built,current version,outdated,starts at,stops after)
15-
Columns to display in table output. Available columns:workspace,
16-
template, status, healthy, last built, current version, outdated,
17-
starts at, starts next, stops after, stops next, daily cost.
15+
Columns to display in table output. Available columns:favorite,
16+
workspace,template, status, healthy, last built, current version,
17+
outdated,starts at, starts next, 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: 1 addition & 1 deletion
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