Documentation
¶
Overview ¶
Package console contains the `superplane console` command group. It reads and writes canvas console configuration as canonical Console YAML (the same shape used by the UI Console YAML modal and `console.yaml` shipped with installable apps).
Index ¶
Constants ¶
const ConsoleAPIVersion = "v1"
ConsoleAPIVersion is the only supported apiVersion for Console files.
const ConsoleKind = "Console"
ConsoleKind is the canonical YAML kind for canvas consoles. The product name is "Console"; the backend type and folder use the legacy "dashboard" name internally, but every user-facing YAML carries `kind: Console`.
Variables ¶
This section is empty.
Functions ¶
func NewCommand ¶
func NewCommand(options core.BindOptions) *cobra.Command
Types ¶
type ConsoleYAML ¶
type ConsoleYAML struct {
APIVersion string `json:"apiVersion" yaml:"apiVersion"`
Kind string `json:"kind" yaml:"kind"`
Metadata ConsoleYAMLMetadata `json:"metadata" yaml:"metadata"`
Spec ConsoleYAMLSpec `json:"spec" yaml:"spec"`
}
ConsoleYAML mirrors the canonical Console YAML used everywhere else (frontend `dashboardYaml.ts`, backend `models.DashboardYAML`, install `console.yaml`). The CLI keeps its own minimal definition so the shipped binary does not need to depend on `pkg/models`.
func ParseConsoleYAML ¶
func ParseConsoleYAML(raw []byte) (*ConsoleYAML, error)
ParseConsoleYAML decodes raw YAML bytes into a ConsoleYAML and verifies the apiVersion/kind headers. Deeper validation (panel types, size limits, content shapes) is left to the backend so that one set of rules applies regardless of the entry point.
type ConsoleYAMLLayoutItem ¶
type ConsoleYAMLLayoutItem struct {
I string `json:"i" yaml:"i"`
X int `json:"x" yaml:"x"`
Y int `json:"y" yaml:"y"`
W int `json:"w" yaml:"w"`
H int `json:"h" yaml:"h"`
MinW *int `json:"minW,omitempty" yaml:"minW,omitempty"`
MinH *int `json:"minH,omitempty" yaml:"minH,omitempty"`
}
ConsoleYAMLLayoutItem matches `models.DashboardLayoutItem`.
type ConsoleYAMLMetadata ¶
type ConsoleYAMLMetadata struct {
CanvasID string `json:"canvasId,omitempty" yaml:"canvasId,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
}
ConsoleYAMLMetadata is informational only on both export and import.
type ConsoleYAMLPanel ¶
type ConsoleYAMLPanel struct {
ID string `json:"id" yaml:"id"`
Type string `json:"type" yaml:"type"`
Content map[string]any `json:"content" yaml:"content"`
}
ConsoleYAMLPanel matches `models.DashboardPanel`.
type ConsoleYAMLSpec ¶
type ConsoleYAMLSpec struct {
Panels []ConsoleYAMLPanel `json:"panels" yaml:"panels"`
Layout []ConsoleYAMLLayoutItem `json:"layout" yaml:"layout"`
}
ConsoleYAMLSpec carries panels and layout.