@@ -83,14 +83,15 @@ type templateTableRow struct {
83
83
Template codersdk.Template
84
84
85
85
// Used by table format:
86
- Name string `json:"-" table:"name,default_sort"`
87
- CreatedAt string `json:"-" table:"created at"`
88
- LastUpdated string `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
- UsedBy string `json:"-" table:"used by"`
93
- DefaultTTL time.Duration `json:"-" table:"default ttl"`
86
+ Name string `json:"-" table:"name,default_sort"`
87
+ CreatedAt string `json:"-" table:"created at"`
88
+ LastUpdated string `json:"-" table:"last updated"`
89
+ OrganizationID uuid.UUID `json:"-" table:"organization id"`
90
+ OrganizationName string `json:"-" table:"organization name"`
91
+ Provisioner codersdk.ProvisionerType `json:"-" table:"provisioner"`
92
+ ActiveVersionID uuid.UUID `json:"-" table:"active version id"`
93
+ UsedBy string `json:"-" table:"used by"`
94
+ DefaultTTL time.Duration `json:"-" table:"default ttl"`
94
95
}
95
96
96
97
// templateToRows converts a list of templates to a list of templateTableRow for
@@ -99,15 +100,16 @@ func templatesToRows(templates ...codersdk.Template) []templateTableRow {
99
100
rows := make ([]templateTableRow ,len (templates ))
100
101
for i ,template := range templates {
101
102
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 ),
111
113
}
112
114
}
113
115