chore(ui): Move some field definitions server side

This commit is contained in:
Richard Palethorpe
2025-03-26 15:56:14 +00:00
parent 7fb99ecf21
commit 319caf8e91
62 changed files with 1534 additions and 1574 deletions

42
pkg/config/meta.go Normal file
View File

@@ -0,0 +1,42 @@
package config
type FieldType string
const (
FieldTypeNumber FieldType = "number"
FieldTypeText FieldType = "text"
FieldTypeTextarea FieldType = "textarea"
FieldTypeCheckbox FieldType = "checkbox"
FieldTypeSelect FieldType = "select"
)
type Tags struct {
Section string `json:"section,omitempty"`
}
type FieldOption struct {
Value string `json:"value"`
Label string `json:"label"`
}
type Field struct {
Name string `json:"name"`
Type FieldType `json:"type"`
Label string `json:"label"`
DefaultValue any `json:"defaultValue"`
Placeholder string `json:"placeholder,omitempty"`
HelpText string `json:"helpText,omitempty"`
Required bool `json:"required,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Options []FieldOption `json:"options,omitempty"`
Min float32 `json:"min,omitempty"`
Max float32 `json:"max,omitempty"`
Step float32 `json:"step,omitempty"`
Tags Tags `json:"tags,omitempty"`
}
type FieldGroup struct {
Name string `json:"name"`
Label string `json:"label"`
Fields []Field `json:"fields"`
}