2019-08-14 18:08:34 +00:00
|
|
|
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{
|
|
|
|
{
|
2019-08-14 18:16:37 +00:00
|
|
|
Name: "Name",
|
|
|
|
Field: "metadata.name",
|
|
|
|
Type: "string",
|
|
|
|
Format: "name",
|
2019-08-14 18:08:34 +00:00
|
|
|
},
|
|
|
|
{
|
2019-08-14 18:16:37 +00:00
|
|
|
Name: "Created",
|
|
|
|
Field: "metadata.creationTimestamp",
|
|
|
|
Type: "string",
|
|
|
|
Format: "date",
|
2019-08-14 18:08:34 +00:00
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|