mirror of
https://github.com/rancher/steve.git
synced 2025-06-20 12:12:20 +00:00
31 lines
572 B
Go
31 lines
572 B
Go
|
package common
|
||
|
|
||
|
import (
|
||
|
"github.com/rancher/naok/pkg/attributes"
|
||
|
"github.com/rancher/naok/pkg/table"
|
||
|
"github.com/rancher/norman/pkg/types"
|
||
|
)
|
||
|
|
||
|
type DefaultColumns struct {
|
||
|
types.EmptyMapper
|
||
|
}
|
||
|
|
||
|
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",
|
||
|
},
|
||
|
{
|
||
|
Name: "Created",
|
||
|
Field: "metadata.creationTimestamp",
|
||
|
Type: "date",
|
||
|
},
|
||
|
})
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|