@@ -14,9 +14,6 @@ func RegisterHAProxyWidgets(registry *widget.Registry) error {
1414 widgets := []* widget.WidgetDefinition {
1515 statusSummaryDoughnutsDefinition (),
1616 backendStatusGridDefinition (),
17- systemMetricsWidgetDefinition (),
18- serviceStatusWidgetDefinition (),
19- certificateWarningsWidgetDefinition (),
2017 }
2118
2219 for _ , w := range widgets {
@@ -100,92 +97,3 @@ func backendStatusGridDefinition() *widget.WidgetDefinition {
10097 }
10198}
10299
103- // systemMetricsWidgetDefinition creates the System Metrics widget.
104- // Shows CPU, Memory, Disk, and Network metrics.
105- func systemMetricsWidgetDefinition () * widget.WidgetDefinition {
106- return & widget.WidgetDefinition {
107- Type : "system-metrics" ,
108- Name : "System Metrics" ,
109- Description : "CPU, memory, disk, and network metrics with real-time updates" ,
110- Category : "system-monitoring" ,
111- PluginName : "metrics" ,
112- Icon : "cpu" ,
113- ConfigSchema : widget.ConfigSchema {
114- Properties : map [string ]widget.Property {
115- "box_id" : {
116- Type : "string" ,
117- Description : "Server ID to monitor (optional, uses current server if not specified)" ,
118- },
119- "show_title" : {
120- Type : "boolean" ,
121- Description : "Show section title" ,
122- Default : true ,
123- },
124- },
125- Required : []string {},
126- },
127- Renderer : func (ctx context.Context , config map [string ]any , data any ) (templ.Component , error ) {
128- boxID := getStringFromConfig (config , "box_id" , "" )
129- return SystemMetricsWidgetHTMX (boxID ), nil
130- },
131- }
132- }
133-
134- // serviceStatusWidgetDefinition creates the Service Status widget.
135- // Shows status of HAProxy, gearbox-agent, nftables, and fail2ban services.
136- func serviceStatusWidgetDefinition () * widget.WidgetDefinition {
137- return & widget.WidgetDefinition {
138- Type : "service-status" ,
139- Name : "Service Status" ,
140- Description : "Status indicators for critical system services" ,
141- Category : "system-monitoring" ,
142- PluginName : "services" ,
143- Icon : "shield" ,
144- ConfigSchema : widget.ConfigSchema {
145- Properties : map [string ]widget.Property {
146- "box_id" : {
147- Type : "string" ,
148- Description : "Server ID to monitor (optional, uses current server if not specified)" ,
149- },
150- },
151- Required : []string {},
152- },
153- Renderer : func (ctx context.Context , config map [string ]any , data any ) (templ.Component , error ) {
154- boxID := getStringFromConfig (config , "box_id" , "" )
155- // Service status is included in the metrics widget, so just show metrics
156- return SystemMetricsWidgetHTMX (boxID ), nil
157- },
158- }
159- }
160-
161- // certificateWarningsWidgetDefinition creates the Certificate Warnings widget.
162- // Shows warnings for expired or expiring SSL/TLS certificates.
163- func certificateWarningsWidgetDefinition () * widget.WidgetDefinition {
164- return & widget.WidgetDefinition {
165- Type : "certificate-warnings" ,
166- Name : "Certificate Warnings" ,
167- Description : "Warnings for expired or expiring SSL/TLS certificates" ,
168- Category : "security-monitoring" ,
169- PluginName : "certificates" ,
170- Icon : "alert-triangle" ,
171- ConfigSchema : widget.ConfigSchema {
172- Properties : map [string ]widget.Property {
173- "box_id" : {
174- Type : "string" ,
175- Description : "Server ID to monitor (optional, uses current server if not specified)" ,
176- },
177- "hide_when_empty" : {
178- Type : "boolean" ,
179- Description : "Hide widget when there are no warnings" ,
180- Default : true ,
181- },
182- },
183- Required : []string {},
184- },
185- Renderer : func (ctx context.Context , config map [string ]any , data any ) (templ.Component , error ) {
186- // Certificate warnings are loaded via JavaScript on the overview page
187- // For now, return an empty component - this will be implemented with proper data sources later
188- return templ .Raw ("<!-- Certificate warnings loaded via JavaScript -->" ), nil
189- },
190- }
191- }
0 commit comments