Skip to content

Commit a75f90f

Browse files
committed
Enhance ScalityUI API and CRD
1 parent be71c66 commit a75f90f

File tree

5 files changed

+846
-174
lines changed

5 files changed

+846
-174
lines changed

api/v1alpha1/scalityui_types.go

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,81 @@ import (
2727
type ScalityUISpec struct {
2828
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
2929
// Important: Run "make" to regenerate code after modifying this file
30+
Image string `json:"image"`
31+
ProductName string `json:"productName"`
32+
CanChangeTheme bool `json:"canChangeTheme,omitempty"`
33+
CanChangeInstanceName bool `json:"canChangeInstanceName,omitempty"`
34+
CanChangeLanguage bool `json:"canChangeLanguage,omitempty"`
35+
Favicon string `json:"favicon,omitempty"`
36+
Logo string `json:"logo,omitempty"`
37+
Themes Themes `json:"themes,omitempty"`
38+
Navbar Navbar `json:"navbar,omitempty"`
39+
Networks UINetworks `json:"networks,omitempty"`
40+
}
41+
42+
// Themes defines the various themes supported by the UI.
43+
type Themes struct {
44+
// Light is the light theme configuration for the UI.
45+
Light Theme `json:"light"`
46+
// Dark is the dark theme configuration for the UI.
47+
Dark Theme `json:"dark"`
48+
}
49+
50+
// Theme defines a theme supported by the UI.
51+
type Theme struct {
52+
// Type specifies the theme's category or system (e.g., 'core-ui').
53+
Type string `json:"type"`
54+
// Name is the unique identifier for the theme.
55+
Name string `json:"name"`
56+
// LogoPath is the path to the logo image file to use with this theme.
57+
LogoPath string `json:"logoPath"`
58+
}
59+
60+
// Navbar configures the UI navbar.
61+
type Navbar struct {
62+
// Main contains configuration for the main navigation items in the navbar.
63+
Main []NavbarItem `json:"main,omitempty"`
64+
// SubLogin contains configuration for navigation items displayed in the sub-login area.
65+
SubLogin []NavbarItem `json:"subLogin,omitempty"`
66+
}
67+
68+
// NavbarItem defines an item in the navbar.
69+
type NavbarItem struct {
70+
// Kind specifies the type of navbar item.
71+
Kind string `json:"kind"`
72+
// View identifies the associated view for this navbar item.
73+
View string `json:"view"`
74+
// Groups contains a list of user groups that can see this navbar item.
75+
// If empty, the item is visible to all users.
76+
Groups []string `json:"groups,omitempty"`
77+
// Icon is the name or path of the icon to display for this navbar item.
78+
Icon string `json:"icon,omitempty"`
79+
// IsExternal indicates whether the item links to an external resource.
80+
IsExternal bool `json:"isExternal,omitempty"`
81+
// Label contains localized text for the navbar item, keyed by language code.
82+
Label map[string]string `json:"label,omitempty"`
83+
// URL specifies the link destination when IsExternal is true.
84+
URL string `json:"url,omitempty"`
85+
}
86+
87+
// UINetworks configures network parameters for the UI.
88+
type UINetworks struct {
89+
// IngressClassName specifies which ingress controller should implement the resource.
90+
IngressClassName string `json:"ingressClassName"`
91+
// Host specifies the hostname for the UI ingress.
92+
Host string `json:"host"`
93+
// TLS configures the TLS settings for the ingress.
94+
TLS []IngressTLS `json:"tls,omitempty"`
95+
// IngressAnnotations provides custom annotations for the ingress resource.
96+
IngressAnnotations map[string]string `json:"ingressAnnotations,omitempty"`
97+
}
3098

31-
Image string `json:"image"`
32-
ProductName string `json:"productName"`
33-
MountPath string `json:"mountPath,omitempty"`
99+
// IngressTLS defines the TLS configuration for the ingress.
100+
type IngressTLS struct {
101+
// Hosts is a list of hosts included in the TLS certificate.
102+
Hosts []string `json:"hosts,omitempty"`
103+
// SecretName is the name of the secret used to terminate TLS traffic.
104+
SecretName string `json:"secretName,omitempty"`
34105
}
35106

36107
// ScalityUIStatus defines the observed state of ScalityUI

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 141 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)