1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-08 02:39:26 +00:00

Improve counts and columns

This commit is contained in:
Darren Shepherd
2019-09-09 14:28:55 -07:00
parent 46f5e218e9
commit f81721ef93
18 changed files with 1001 additions and 215 deletions

View File

@@ -6,6 +6,21 @@ import (
"github.com/rancher/norman/pkg/types"
)
var (
NameColumn = table.Column{
Name: "Name",
Field: "metadata.name",
Type: "string",
Format: "name",
}
CreatedColumn = table.Column{
Name: "Created",
Field: "metadata.creationTimestamp",
Type: "string",
Format: "date",
}
)
type DefaultColumns struct {
types.EmptyMapper
}
@@ -13,18 +28,8 @@ type DefaultColumns struct {
func (d *DefaultColumns) ModifySchema(schema *types.Schema, schemas *types.Schemas) error {
if attributes.Columns(schema) == nil {
attributes.SetColumns(schema, []table.Column{
{
Name: "Name",
Field: "metadata.name",
Type: "string",
Format: "name",
},
{
Name: "Created",
Field: "metadata.creationTimestamp",
Type: "string",
Format: "date",
},
NameColumn,
CreatedColumn,
})
}