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

Commit4f6a985

Browse files
committed
make gen
1 parent3a0a33a commit4f6a985

File tree

11 files changed

+69
-45
lines changed

11 files changed

+69
-45
lines changed

‎cli/templates.go‎

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,15 @@ type templateTableRow struct {
8383
Template codersdk.Template
8484

8585
// Used by table format:
86-
Namestring`json:"-" table:"name,default_sort"`
87-
CreatedAtstring`json:"-" table:"created at"`
88-
LastUpdatedstring`json:"-" table:"last updated"`
89-
OrganizationID uuid.UUID`json:"-" table:"organization id"`
90-
Provisioner codersdk.ProvisionerType`json:"-" table:"provisioner"`
91-
ActiveVersionID uuid.UUID`json:"-" table:"active version id"`
92-
UsedBystring`json:"-" table:"used by"`
93-
DefaultTTL time.Duration`json:"-" table:"default ttl"`
86+
Namestring`json:"-" table:"name,default_sort"`
87+
CreatedAtstring`json:"-" table:"created at"`
88+
LastUpdatedstring`json:"-" table:"last updated"`
89+
OrganizationID uuid.UUID`json:"-" table:"organization id"`
90+
OrganizationNamestring`json:"-" table:"organization name"`
91+
Provisioner codersdk.ProvisionerType`json:"-" table:"provisioner"`
92+
ActiveVersionID uuid.UUID`json:"-" table:"active version id"`
93+
UsedBystring`json:"-" table:"used by"`
94+
DefaultTTL time.Duration`json:"-" table:"default ttl"`
9495
}
9596

9697
// templateToRows converts a list of templates to a list of templateTableRow for
@@ -99,15 +100,16 @@ func templatesToRows(templates ...codersdk.Template) []templateTableRow {
99100
rows:=make([]templateTableRow,len(templates))
100101
fori,template:=rangetemplates {
101102
rows[i]=templateTableRow{
102-
Template:template,
103-
Name:template.Name,
104-
CreatedAt:template.CreatedAt.Format("January 2, 2006"),
105-
LastUpdated:template.UpdatedAt.Format("January 2, 2006"),
106-
OrganizationID:template.OrganizationID,
107-
Provisioner:template.Provisioner,
108-
ActiveVersionID:template.ActiveVersionID,
109-
UsedBy:pretty.Sprint(cliui.DefaultStyles.Fuchsia,formatActiveDevelopers(template.ActiveUserCount)),
110-
DefaultTTL: (time.Duration(template.DefaultTTLMillis)*time.Millisecond),
103+
Template:template,
104+
Name:template.Name,
105+
CreatedAt:template.CreatedAt.Format("January 2, 2006"),
106+
LastUpdated:template.UpdatedAt.Format("January 2, 2006"),
107+
OrganizationID:template.OrganizationID,
108+
OrganizationName:template.OrganizationName,
109+
Provisioner:template.Provisioner,
110+
ActiveVersionID:template.ActiveVersionID,
111+
UsedBy:pretty.Sprint(cliui.DefaultStyles.Fuchsia,formatActiveDevelopers(template.ActiveUserCount)),
112+
DefaultTTL: (time.Duration(template.DefaultTTLMillis)*time.Millisecond),
111113
}
112114
}
113115

‎coderd/apidoc/docs.go‎

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

‎coderd/apidoc/swagger.json‎

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

‎coderd/templates.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,7 @@ func (api *API) convertTemplate(
894894
CreatedAt:template.CreatedAt,
895895
UpdatedAt:template.UpdatedAt,
896896
OrganizationID:template.OrganizationID,
897+
OrganizationName:template.OrganizationName,
897898
Name:template.Name,
898899
DisplayName:template.DisplayName,
899900
Provisioner:codersdk.ProvisionerType(template.Provisioner),

‎codersdk/templates.go‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ import (
1515
// Template is the JSON representation of a Coder template. This type matches the
1616
// database object for now, but is abstracted for ease of change later on.
1717
typeTemplatestruct {
18-
ID uuid.UUID`json:"id" format:"uuid"`
19-
CreatedAt time.Time`json:"created_at" format:"date-time"`
20-
UpdatedAt time.Time`json:"updated_at" format:"date-time"`
21-
OrganizationID uuid.UUID`json:"organization_id" format:"uuid"`
22-
Namestring`json:"name"`
23-
DisplayNamestring`json:"display_name"`
24-
ProvisionerProvisionerType`json:"provisioner" enums:"terraform"`
25-
ActiveVersionID uuid.UUID`json:"active_version_id" format:"uuid"`
18+
ID uuid.UUID`json:"id" format:"uuid"`
19+
CreatedAt time.Time`json:"created_at" format:"date-time"`
20+
UpdatedAt time.Time`json:"updated_at" format:"date-time"`
21+
OrganizationID uuid.UUID`json:"organization_id" format:"uuid"`
22+
OrganizationNamestring`json:"organization_name" format:"url"`
23+
Namestring`json:"name"`
24+
DisplayNamestring`json:"display_name"`
25+
ProvisionerProvisionerType`json:"provisioner" enums:"terraform"`
26+
ActiveVersionID uuid.UUID`json:"active_version_id" format:"uuid"`
2627
// ActiveUserCount is set to -1 when loading.
2728
ActiveUserCountint`json:"active_user_count"`
2829
BuildTimeStatsTemplateBuildTimeStats`json:"build_time_stats"`

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp