mirror of
https://github.com/rancher/steve.git
synced 2025-08-31 15:11:31 +00:00
Show server side columns
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
package schema
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/rancher/steve/pkg/schemaserver/types"
|
||||
"github.com/rancher/wrangler/pkg/data"
|
||||
"github.com/rancher/wrangler/pkg/schemas"
|
||||
"github.com/rancher/wrangler/pkg/schemas/mappers"
|
||||
)
|
||||
|
||||
func newDefaultMapper() schemas.Mapper {
|
||||
return &defaultMapper{}
|
||||
}
|
||||
|
||||
type defaultMapper struct {
|
||||
mappers.EmptyMapper
|
||||
}
|
||||
|
||||
func (d *defaultMapper) FromInternal(data data.Object) {
|
||||
if data["kind"] != "" && data["apiVersion"] != "" {
|
||||
if t, ok := data["type"]; ok && data != nil {
|
||||
data["_type"] = t
|
||||
}
|
||||
}
|
||||
|
||||
if _, ok := data["id"]; ok || data == nil {
|
||||
return
|
||||
}
|
||||
|
||||
name := types.Name(data)
|
||||
namespace := types.Namespace(data)
|
||||
|
||||
if namespace == "" {
|
||||
data["id"] = name
|
||||
} else {
|
||||
data["id"] = fmt.Sprintf("%s/%s", namespace, name)
|
||||
}
|
||||
}
|
@@ -9,10 +9,12 @@ import (
|
||||
)
|
||||
|
||||
type Column struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Field string `json:"field,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Format string `json:"format,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Field string `json:"field,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Format string `json:"format,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Priority int `json:"priority,omitempty"`
|
||||
}
|
||||
|
||||
type Table struct {
|
||||
|
Reference in New Issue
Block a user