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:
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user