()
| 363 | } |
| 364 | |
| 365 | func (h *Handler) cmdWatcherStatus() string { |
| 366 | if h.watcherContextFunc == nil { |
| 367 | return i18n.T("server.session.cmd_watcher_inactive") |
| 368 | } |
| 369 | |
| 370 | var b strings.Builder |
| 371 | b.WriteString(i18n.T("server.session.cmd_watcher_header")) |
| 372 | b.WriteString(i18n.T("server.session.cmd_watcher_status_active")) |
| 373 | if h.watcherDeployment != "" { |
| 374 | b.WriteString(i18n.T("server.session.cmd_watcher_deployment", h.watcherDeployment)) |
| 375 | b.WriteString(i18n.T("server.session.cmd_watcher_namespace", h.watcherNamespace)) |
| 376 | } |
| 377 | if h.watcherStatusFunc != nil { |
| 378 | b.WriteString(i18n.T("server.session.cmd_watcher_summary", h.watcherStatusFunc())) |
| 379 | } |
| 380 | if h.watcherStatsFunc != nil { |
| 381 | alertCount, snapshotCount, podCount := h.watcherStatsFunc() |
| 382 | b.WriteString(i18n.T("server.session.cmd_watcher_alerts", alertCount)) |
| 383 | b.WriteString(i18n.T("server.session.cmd_watcher_snapshots", snapshotCount)) |
| 384 | b.WriteString(i18n.T("server.session.cmd_watcher_pods", podCount)) |
| 385 | } |
| 386 | |
| 387 | return b.String() |
| 388 | } |
| 389 | |
| 390 | func (h *Handler) cmdPluginsList() string { |
| 391 | if h.pluginManager == nil { |
no test coverage detected