diff --git a/changelog/highlights/316.json b/changelog/highlights/316.json new file mode 100644 index 000000000..67d094c63 --- /dev/null +++ b/changelog/highlights/316.json @@ -0,0 +1,26 @@ +{ + "de": { + "*": "Kompakte Kopfzeile, deren Status-Chip die Ursache einer Störung nennt" + }, + "en": { + "*": "A compact header whose status chip names the cause of a problem" + }, + "tour": { + "*": { + "steps": [ + { + "device": "any", + "target": "status-chip", + "text": { + "de": "Titel, Status und Sprache stehen jetzt in einer Zeile. Der Status ist grün, solange alles läuft. Bei einer Störung wird er gelb oder rot und nennt die Ursache. Ein Klick zeigt alle Werte.", + "en": "Title, status and language now share one row. The status stays green while everything runs. When something is wrong it turns yellow or red and names the cause. A click shows all values." + }, + "title": { + "de": "Neue Kopfzeile", + "en": "New header" + } + } + ] + } + } +} diff --git a/dashboard/CHANGELOG.md b/dashboard/CHANGELOG.md index abf229636..0547da38f 100644 --- a/dashboard/CHANGELOG.md +++ b/dashboard/CHANGELOG.md @@ -1,5 +1,43 @@ # Changelog +## v0.12.1-pre.1 (2026-12-03) + +### Features + +- **health:** derive a ranked issue list from the node state (c7c1a75) +- **health:** report issues and level, count only installed services (f290fb2) +- **dashboard:** one title row with a status chip that names its cause (0c99637) +- **dashboard:** slide one tab indicator to the active tab (d2cc213) +- **dashboard:** show CPU temperature and load in one status row (be61f28) +- **dashboard:** show the remaining storage life in the status popover (c1e5e20) +- **dashboard:** give the status chip a tour target (d753b60) +- **dashboard:** A compact header whose status chip names the cause of a problem (#316) + +### Fixes + +- **dashboard:** format the status chip values for the locale (ce581a5) +- **health:** warn when the storage medium reports its end of life (327b355) +- **dashboard:** record the cache-bust marks for the prerelease line (7490abd) + +### Refactors + +- **settings:** retire status_bar_items, the status popover shows every value (4a944fb) +- **settings:** drop the status field chooser from settings and installer (1b4cce1) + +### Documentation + +- **dashboard:** describe the status chip and bump the changed assets (97f7d92) + +### Tests + +- **dashboard:** check that the title row never truncates (28ca2c5) + +### Style + +- **dashboard:** style the title row and the status chip (d28e19e) +- **dashboard:** give update, guest and example notes one slim row form (10a1384) +- **dashboard:** darken the install button on hover so its label keeps contrast (8cb0b15) + ## v0.12.0 (2026-12-02) ### Features @@ -375,6 +413,7 @@ - **automations:** correct the learning methods after the spec check (#306) (0296218) - **dashboard:** keep the Run at most field of the scenario editor in one row (#310) (9e29569) - **auth:** give existing admins the network permission (#313) (5766220) +- **release:** align the cache-bust marks with main for v0.12.0 (2ad3918) - **history:** keep proxies from compressing the event streams (#304) (0298760) - **automations:** correct the learning feature after the full review (#296) (88f3c75) - Monitoring names values without a role and links to the learning settings (#303) (29450b8) diff --git a/dashboard/VERSION b/dashboard/VERSION index 87a1cf595..6e96d4b15 100644 --- a/dashboard/VERSION +++ b/dashboard/VERSION @@ -1 +1 @@ -v0.12.0 +v0.12.1-pre.1 diff --git a/dashboard/cmd/dashboard/main.go b/dashboard/cmd/dashboard/main.go index 313f47563..7f16cbbad 100644 --- a/dashboard/cmd/dashboard/main.go +++ b/dashboard/cmd/dashboard/main.go @@ -1565,9 +1565,10 @@ func main() { "tailscale": cfg.ServiceInstalled("tailscale"), "tuya": cfg.ServiceInstalled("tuya"), }, - MQTTBase: mqttBase, - NodeAgent: nodeAgent, - NodeSimulation: nodeSimPublisher, + ServiceInstalled: cfg.ServiceInstalled, + MQTTBase: mqttBase, + NodeAgent: nodeAgent, + NodeSimulation: nodeSimPublisher, // Die API zeigt alle passenden Sensoren, ungefiltert, damit der // MQTT-Tab sie abwaehlen kann. EnergySensorOptions: func() []energydiscovery.OptionalSensor { diff --git a/dashboard/internal/httpapi/healthissues.go b/dashboard/internal/httpapi/healthissues.go new file mode 100644 index 000000000..49d0c3cac --- /dev/null +++ b/dashboard/internal/httpapi/healthissues.go @@ -0,0 +1,119 @@ +package httpapi + +import ( + "math" + "time" + + "github.com/Developer-Simon/energy-node-dashboard/internal/mqttclient" + "github.com/Developer-Simon/energy-node-dashboard/internal/nodeagent" + "github.com/Developer-Simon/energy-node-dashboard/internal/runtimecache" + "github.com/Developer-Simon/energy-node-dashboard/internal/storagehealth" +) + +const ( + healthCPUHotC = 80.0 + healthRAMFullPct = 90.0 +) + +// healthIssue is one finding about the node state. Key is a catalog key the +// UI translates, Params fill its placeholders. +type healthIssue struct { + Key string `json:"key"` + Level string `json:"level"` // "warn" | "bad" + Params map[string]any `json:"params,omitempty"` +} + +// healthIssueInput is the node state the issue list is derived from. +type healthIssueInput struct { + MQTT *mqttclient.Status // nil = no MQTT provider, no issue + Cache runtimecache.Status + Storage *storagehealth.Report // nil = no storage report + Telemetry *nodeagent.Telemetry // nil = no telemetry + Services []nodeagent.ServiceLiveness + Installed func(id string) bool // nil = every service installed + Window func(id string) time.Duration // nil = no grace + Uptime time.Duration +} + +// collectHealthIssues returns the issues of the node state, bad ones first, +// then the warnings in table order. It never returns nil. +func collectHealthIssues(in healthIssueInput) []healthIssue { + bad := []healthIssue{} + warn := []healthIssue{} + + if in.MQTT != nil && !in.MQTT.Connected { + bad = append(bad, healthIssue{Key: "mqtt_disconnected", Level: "bad"}) + } + if in.Cache.Degraded() { + warn = append(warn, healthIssue{Key: "cache_error", Level: "warn"}) + } + if storageWorn(in.Storage) { + warn = append(warn, healthIssue{Key: "storage_worn", Level: "warn"}) + } + if in.Telemetry != nil { + if in.Telemetry.UndervoltageNow { + warn = append(warn, healthIssue{Key: "undervoltage", Level: "warn"}) + } + if t := in.Telemetry.CPUTempC; t != nil && *t >= healthCPUHotC { + warn = append(warn, healthIssue{ + Key: "cpu_hot", + Level: "warn", + Params: map[string]any{"value": math.Round(*t*10) / 10}, + }) + } + if r := in.Telemetry.RAMUsedPct; r != nil && *r >= healthRAMFullPct { + warn = append(warn, healthIssue{ + Key: "ram_full", + Level: "warn", + Params: map[string]any{"value": int(math.Round(*r))}, + }) + } + } + for _, svc := range in.Services { + if svc.State == "active" { + continue + } + if in.Installed != nil && !in.Installed(svc.ID) { + continue + } + var window time.Duration + if in.Window != nil { + window = in.Window(svc.ID) + } + if in.Uptime < window { + continue + } + warn = append(warn, healthIssue{ + Key: "service_down", + Level: "warn", + Params: map[string]any{"service": svc.ID}, + }) + } + return append(bad, warn...) +} + +// storageWorn reports whether the medium itself says it is at the end of its +// life: pre-EOL warning or critical, or the endurance budget exceeded. +func storageWorn(r *storagehealth.Report) bool { + if r == nil || !r.Available { + return false + } + if r.PreEOL != nil && r.PreEOL.Code >= 2 { + return true + } + return r.LifeTimeA != nil && r.LifeTimeA.Code >= 11 +} + +// healthLevelOf returns the worst level of the issues: "bad", "warn" or "ok". +func healthLevelOf(issues []healthIssue) string { + level := "ok" + for _, i := range issues { + if i.Level == "bad" { + return "bad" + } + if i.Level == "warn" { + level = "warn" + } + } + return level +} diff --git a/dashboard/internal/httpapi/healthissues_test.go b/dashboard/internal/httpapi/healthissues_test.go new file mode 100644 index 000000000..cfca5b0d8 --- /dev/null +++ b/dashboard/internal/httpapi/healthissues_test.go @@ -0,0 +1,160 @@ +package httpapi + +import ( + "testing" + "time" + + "github.com/Developer-Simon/energy-node-dashboard/internal/mqttclient" + "github.com/Developer-Simon/energy-node-dashboard/internal/nodeagent" + "github.com/Developer-Simon/energy-node-dashboard/internal/runtimecache" + "github.com/Developer-Simon/energy-node-dashboard/internal/storagehealth" +) + +func f64(v float64) *float64 { return &v } + +func healthBase() healthIssueInput { + return healthIssueInput{ + MQTT: &mqttclient.Status{Connected: true}, + Telemetry: &nodeagent.Telemetry{CPUTempC: f64(50), RAMUsedPct: f64(40)}, + Services: []nodeagent.ServiceLiveness{{ID: "apsystems", State: "active"}}, + Uptime: time.Hour, + } +} + +func issueKeys(issues []healthIssue) []string { + keys := make([]string, 0, len(issues)) + for _, i := range issues { + keys = append(keys, i.Key) + } + return keys +} + +func TestHealthIssuesEmptyWhenAllFine(t *testing.T) { + issues := collectHealthIssues(healthBase()) + if issues == nil || len(issues) != 0 { + t.Fatalf("issues = %#v, want empty non-nil slice", issues) + } + if got := healthLevelOf(issues); got != "ok" { + t.Fatalf("level = %q, want ok", got) + } +} + +func TestHealthIssuesMQTTDisconnectedIsBad(t *testing.T) { + in := healthBase() + in.MQTT = &mqttclient.Status{Connected: false} + issues := collectHealthIssues(in) + if len(issues) != 1 || issues[0].Key != "mqtt_disconnected" || issues[0].Level != "bad" { + t.Fatalf("issues = %+v, want [mqtt_disconnected bad]", issues) + } + if got := healthLevelOf(issues); got != "bad" { + t.Fatalf("level = %q, want bad", got) + } +} + +func TestHealthIssuesOrderBadFirst(t *testing.T) { + in := healthBase() + in.MQTT = &mqttclient.Status{Connected: false} + in.Cache = runtimecache.Status{WriteError: "x"} + got := issueKeys(collectHealthIssues(in)) + want := []string{"mqtt_disconnected", "cache_error"} + if len(got) != len(want) || got[0] != want[0] || got[1] != want[1] { + t.Fatalf("keys = %v, want %v", got, want) + } +} + +func TestHealthIssuesThresholds(t *testing.T) { + in := healthBase() + in.Telemetry = &nodeagent.Telemetry{CPUTempC: f64(79.9), RAMUsedPct: f64(89.9)} + if issues := collectHealthIssues(in); len(issues) != 0 { + t.Fatalf("below threshold: issues = %+v, want none", issues) + } + + in.Telemetry = &nodeagent.Telemetry{CPUTempC: f64(80.0), RAMUsedPct: f64(90.0)} + issues := collectHealthIssues(in) + if len(issues) != 2 { + t.Fatalf("at threshold: issues = %+v, want 2", issues) + } + if issues[0].Key != "cpu_hot" || issues[0].Level != "warn" || issues[0].Params["value"] != 80.0 { + t.Fatalf("cpu issue = %+v, want cpu_hot warn value 80", issues[0]) + } + if issues[1].Key != "ram_full" || issues[1].Level != "warn" || issues[1].Params["value"] != 90 { + t.Fatalf("ram issue = %+v, want ram_full warn value 90", issues[1]) + } +} + +func TestHealthIssuesUndervoltage(t *testing.T) { + in := healthBase() + in.Telemetry = &nodeagent.Telemetry{CPUTempC: f64(50), RAMUsedPct: f64(40), UndervoltageNow: true} + issues := collectHealthIssues(in) + if len(issues) != 1 || issues[0].Key != "undervoltage" || issues[0].Level != "warn" { + t.Fatalf("issues = %+v, want [undervoltage warn]", issues) + } +} + +func TestHealthIssuesStorageWorn(t *testing.T) { + cases := []struct { + name string + report *storagehealth.Report + want bool + }{ + {"nil report", nil, false}, + {"pre-eol normal", &storagehealth.Report{Available: true, PreEOL: &storagehealth.PreEOL{Code: 1}}, false}, + {"pre-eol warning", &storagehealth.Report{Available: true, PreEOL: &storagehealth.PreEOL{Code: 2}}, true}, + {"pre-eol critical", &storagehealth.Report{Available: true, PreEOL: &storagehealth.PreEOL{Code: 3}}, true}, + {"life time 10", &storagehealth.Report{Available: true, LifeTimeA: &storagehealth.LifeTime{Code: 10}}, false}, + {"life time budget exceeded", &storagehealth.Report{Available: true, LifeTimeA: &storagehealth.LifeTime{Code: 11}}, true}, + {"unavailable", &storagehealth.Report{Available: false, PreEOL: &storagehealth.PreEOL{Code: 3}}, false}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + in := healthBase() + in.Storage = tc.report + issues := collectHealthIssues(in) + if !tc.want { + if len(issues) != 0 { + t.Fatalf("issues = %+v, want none", issues) + } + return + } + if len(issues) != 1 || issues[0].Key != "storage_worn" || issues[0].Level != "warn" { + t.Fatalf("issues = %+v, want [storage_worn warn]", issues) + } + }) + } +} + +func TestHealthIssuesSkipsUninstalledService(t *testing.T) { + in := healthBase() + in.Services = []nodeagent.ServiceLiveness{{ID: "tuya", State: "configured"}} + in.Installed = func(id string) bool { return false } + if issues := collectHealthIssues(in); len(issues) != 0 { + t.Fatalf("issues = %+v, want none", issues) + } +} + +func TestHealthIssuesServiceGrace(t *testing.T) { + in := healthBase() + in.Services = []nodeagent.ServiceLiveness{{ID: "tuya", State: "configured"}} + in.Installed = func(id string) bool { return true } + in.Window = func(id string) time.Duration { return 120 * time.Second } + + in.Uptime = 60 * time.Second + if issues := collectHealthIssues(in); len(issues) != 0 { + t.Fatalf("within grace: issues = %+v, want none", issues) + } + + in.Uptime = 200 * time.Second + issues := collectHealthIssues(in) + if len(issues) != 1 || issues[0].Key != "service_down" || issues[0].Params["service"] != "tuya" { + t.Fatalf("after grace: issues = %+v, want service_down tuya", issues) + } +} + +func TestHealthIssuesActiveServiceIsFine(t *testing.T) { + in := healthBase() + in.Services = []nodeagent.ServiceLiveness{{ID: "tuya", State: "active"}} + in.Window = func(id string) time.Duration { return 120 * time.Second } + if issues := collectHealthIssues(in); len(issues) != 0 { + t.Fatalf("issues = %+v, want none", issues) + } +} diff --git a/dashboard/internal/httpapi/httpapi.go b/dashboard/internal/httpapi/httpapi.go index ca6600cfb..c3c138f11 100644 --- a/dashboard/internal/httpapi/httpapi.go +++ b/dashboard/internal/httpapi/httpapi.go @@ -215,6 +215,10 @@ type RouterDependencies struct { // tuya. main.go fuellt sie ueber Config.ServiceInstalled; nil heisst // hier wie dort "alles an". InstalledServices map[string]bool + // ServiceInstalled ist dieselbe Auswahl als Funktion, fuer den Health- + // Befund service_down: nicht installierte Dienste melden nichts. main.go + // fuellt sie ueber Config.ServiceInstalled; nil heisst "alles installiert". + ServiceInstalled func(id string) bool // InstallerStateDir ist das Zustandsverzeichnis von Installer und Updater // (installed-manifest.json, selection.json, changelog.json), aus dem die // Versionsseite liest. Leer heisst versions.DefaultStateDir. @@ -353,7 +357,7 @@ func NewRouterWithDependencies(reg *registry.Registry, configs *config.Manager, if now == nil { now = func() time.Time { return time.Now().UTC() } } - g.HandleFunc("/api/v1/health", handleHealth(cache, storageProvider, dependencies.MQTT, dependencies.NodeAgent, dependencies.StartedAt, dependencies.Version, now)) + g.HandleFunc("/api/v1/health", handleHealth(cache, storageProvider, dependencies.MQTT, dependencies.NodeAgent, dependencies.ServiceInstalled, dependencies.StartedAt, dependencies.Version, now)) g.HandleFunc("/api/v1/runtime-cache", handleRuntimeCache(cache)) g.Handle("/static/", webui.Static()) g.Handle("/i18n/", webui.I18nScript()) @@ -1381,7 +1385,11 @@ func handleShellyPresets(store *shellypresets.Store) http.HandlerFunc { } type healthResponse struct { - Status string `json:"status"` + Status string `json:"status"` + // Level ist der schlimmste Befund: "ok", "warn" oder "bad". + Level string `json:"level"` + // Issues listet die Befunde, schlimme zuerst. Immer ein Array. + Issues []healthIssue `json:"issues"` RuntimeCache runtimecache.Status `json:"runtime_cache"` Version string `json:"version"` UptimeSeconds *int64 `json:"uptime_seconds,omitempty"` @@ -1405,29 +1413,25 @@ type nodeStatus struct { } // nodeAgent is threaded through for Task 6/7 (healthResponse.Node). -func handleHealth(cache runtimecache.StatusProvider, storageProvider storagehealth.Provider, mqttStatus mqttclient.StatusProvider, nodeAgent *nodeagent.Agent, startedAt time.Time, version string, now func() time.Time) http.HandlerFunc { +func handleHealth(cache runtimecache.StatusProvider, storageProvider storagehealth.Provider, mqttStatus mqttclient.StatusProvider, nodeAgent *nodeagent.Agent, installed func(string) bool, startedAt time.Time, version string, now func() time.Time) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodGet { methodNotAllowed(w) return } status := runtimecache.Status{} - result := "ok" if cache != nil { status = cache.Status() - if status.Degraded() { - result = "degraded" - } } currentTime := now() if version == "" { version = "dev" } response := healthResponse{ - Status: result, RuntimeCache: status, Version: version, } + issueInput := healthIssueInput{Cache: status, Installed: installed} if !startedAt.IsZero() { uptime := currentTime.Sub(startedAt) if uptime < 0 { @@ -1435,20 +1439,18 @@ func handleHealth(cache runtimecache.StatusProvider, storageProvider storageheal } uptimeSeconds := int64(uptime / time.Second) response.UptimeSeconds = &uptimeSeconds + issueInput.Uptime = uptime } if mqttStatus != nil { mqtt := mqttStatus.Status() response.MQTT = &mqtt - if !mqtt.Connected { - result = "degraded" - } + issueInput.MQTT = &mqtt } storage := map[string]any{"available": false, "reason": "Speichermedium-Diagnose ist nicht verfügbar"} if storageProvider != nil { report, err := storageProvider.Check(r.Context()) if err != nil { storage["reason"] = err.Error() - result = "degraded" } else { storage = map[string]any{ "available": report.Available, @@ -1459,10 +1461,16 @@ func handleHealth(cache runtimecache.StatusProvider, storageProvider storageheal } if report.Estimate != nil { storage["remaining_label"] = report.Estimate.RemainingLabel + storage["remaining_key"] = report.Estimate.RemainingKey + storage["remaining_params"] = report.Estimate.RemainingParams + } + if report.LifeTimeA != nil { + storage["life_time_key"] = report.LifeTimeA.LabelKey + storage["life_time_params"] = report.LifeTimeA.LabelParams } + issueInput.Storage = &report } } - response.Status = result response.Storage = storage response.Features = map[string]int{"history_exchange": exchangeProtocolVersion} if nodeAgent != nil { @@ -1471,6 +1479,15 @@ func handleHealth(cache runtimecache.StatusProvider, storageProvider storageheal ns.Telemetry = &tel } response.Node = ns + issueInput.Telemetry = ns.Telemetry + issueInput.Services = ns.Services + issueInput.Window = nodeAgent.ServiceWindow + } + response.Issues = collectHealthIssues(issueInput) + response.Level = healthLevelOf(response.Issues) + response.Status = "ok" + if len(response.Issues) > 0 { + response.Status = "degraded" } writeJSON(w, response) } diff --git a/dashboard/internal/httpapi/httpapi_test.go b/dashboard/internal/httpapi/httpapi_test.go index 97027942c..ecc7ae15b 100644 --- a/dashboard/internal/httpapi/httpapi_test.go +++ b/dashboard/internal/httpapi/httpapi_test.go @@ -547,7 +547,7 @@ func TestHealthVersionDefaultsToDev(t *testing.T) { func TestHealthReportsServiceLiveness(t *testing.T) { a := nodeagent.New(nodeagent.Options{NodeID: "energy_node"}) a.SetServiceCatalog([]string{"apsystems"}, map[string]appconfig.ServicePoll{"apsystems": {PollIntervalS: 60, DiagnosticPollMultiplier: 10}}) - h := handleHealth(nil, nil, nil, a, time.Now(), "test", time.Now) + h := handleHealth(nil, nil, nil, a, nil, time.Now(), "test", time.Now) rec := httptest.NewRecorder() h(rec, httptest.NewRequest(http.MethodGet, "/api/v1/health", nil)) var body map[string]any @@ -2792,3 +2792,48 @@ func TestEntityCommandObserverSkippedWhenPublishFails(t *testing.T) { t.Fatalf("observer calls after failed publish = %d, want 0", calls) } } + +func TestHealthCarriesIssuesAndLevel(t *testing.T) { + disconnected := fakeMQTTStatusProvider{status: mqttclient.Status{Connected: false}} + h := handleHealth(nil, nil, disconnected, nil, nil, time.Now(), "test", time.Now) + rec := httptest.NewRecorder() + h(rec, httptest.NewRequest(http.MethodGet, "/api/v1/health", nil)) + var body struct { + Status string `json:"status"` + Level string `json:"level"` + Issues []struct { + Key string `json:"key"` + } `json:"issues"` + } + if err := json.Unmarshal(rec.Body.Bytes(), &body); err != nil { + t.Fatalf("decode health body: %v", err) + } + if body.Level != "bad" || body.Status != "degraded" { + t.Fatalf("level=%q status=%q, want bad/degraded: %s", body.Level, body.Status, rec.Body) + } + if len(body.Issues) == 0 || body.Issues[0].Key != "mqtt_disconnected" { + t.Fatalf("issues = %+v, want mqtt_disconnected first", body.Issues) + } + + connected := fakeMQTTStatusProvider{status: mqttclient.Status{Connected: true}} + h = handleHealth(nil, nil, connected, nil, nil, time.Now(), "test", time.Now) + rec = httptest.NewRecorder() + h(rec, httptest.NewRequest(http.MethodGet, "/api/v1/health", nil)) + var raw map[string]json.RawMessage + if err := json.Unmarshal(rec.Body.Bytes(), &raw); err != nil { + t.Fatalf("decode health body: %v", err) + } + var ok struct { + Status string `json:"status"` + Level string `json:"level"` + } + if err := json.Unmarshal(rec.Body.Bytes(), &ok); err != nil { + t.Fatal(err) + } + if ok.Level != "ok" || ok.Status != "ok" { + t.Fatalf("level=%q status=%q, want ok/ok: %s", ok.Level, ok.Status, rec.Body) + } + if string(raw["issues"]) != "[]" { + t.Fatalf("issues = %s, want []", raw["issues"]) + } +} diff --git a/dashboard/internal/nodeagent/liveness.go b/dashboard/internal/nodeagent/liveness.go index 0b5f78bf4..fc6181fe8 100644 --- a/dashboard/internal/nodeagent/liveness.go +++ b/dashboard/internal/nodeagent/liveness.go @@ -127,17 +127,30 @@ func (a *Agent) ServiceLiveness(now time.Time) []ServiceLiveness { return out } -func (a *Agent) fresh(id string, st *serviceState, now time.Time) bool { - if st.lastUpdate == 0 { - return false - } +// ServiceWindow is how long a service's last settings/status stays fresh: +// its diagnostic poll interval plus a slack. Without poll settings the poll +// interval counts as 60 s. +func (a *Agent) ServiceWindow(id string) time.Duration { + a.live.mu.RLock() + defer a.live.mu.RUnlock() + return a.serviceWindow(id) +} + +func (a *Agent) serviceWindow(id string) time.Duration { p := a.live.poll[id] window := p.PollIntervalS * p.DiagnosticPollMultiplier if window <= 0 { window = 60 } window += livenessSlackSeconds - return now.Unix()-st.lastUpdate <= int64(window) + return time.Duration(window * float64(time.Second)) +} + +func (a *Agent) fresh(id string, st *serviceState, now time.Time) bool { + if st.lastUpdate == 0 { + return false + } + return now.Unix()-st.lastUpdate <= int64(a.serviceWindow(id)/time.Second) } // ServiceStatus returns the last settings/status a service published. diff --git a/dashboard/internal/nodeagent/liveness_test.go b/dashboard/internal/nodeagent/liveness_test.go index 83a6d1ce3..715354f2c 100644 --- a/dashboard/internal/nodeagent/liveness_test.go +++ b/dashboard/internal/nodeagent/liveness_test.go @@ -123,3 +123,13 @@ func TestObserveLivenessReadsPollRound(t *testing.T) { t.Fatalf("ServiceRoundS without field = %v, %v; want false", d, ok) } } + +func TestServiceWindowUsesPollSettings(t *testing.T) { + a := livenessAgent(t, time.Unix(10_000, 0)) + if got := a.ServiceWindow("apsystems"); got != 660*time.Second { + t.Fatalf("apsystems window = %v, want 660s", got) + } + if got := a.ServiceWindow("unknown"); got != 120*time.Second { + t.Fatalf("unknown window = %v, want 120s", got) + } +} diff --git a/dashboard/internal/onboarding/seed.go b/dashboard/internal/onboarding/seed.go index 680be9dd1..6abc0ddd8 100644 --- a/dashboard/internal/onboarding/seed.go +++ b/dashboard/internal/onboarding/seed.go @@ -37,7 +37,6 @@ type seedFile struct { Theme *string `json:"theme"` Title *string `json:"title"` Subtitle *string `json:"subtitle"` - StatusBarItems *[]string `json:"status_bar_items"` ShowRuntimeStatus *bool `json:"show_runtime_status"` WidePanels *[]string `json:"wide_panels"` UpdateCheck *bool `json:"update_check"` @@ -145,7 +144,7 @@ func templateRoles(template string) ([]string, error) { // applySeedSettings setzt die Einstellungen, die die Vorgaben nennen. Gespeichert // wird nur, wenn mindestens eine davon gesetzt ist. func applySeedSettings(seed seedFile, st *settings.Store) error { - if seed.Theme == nil && seed.Title == nil && seed.Subtitle == nil && seed.StatusBarItems == nil && + if seed.Theme == nil && seed.Title == nil && seed.Subtitle == nil && seed.ShowRuntimeStatus == nil && seed.WidePanels == nil && seed.UpdateCheck == nil { return nil } @@ -162,9 +161,6 @@ func applySeedSettings(seed seedFile, st *settings.Store) error { if seed.Subtitle != nil { set.DashboardSubtitle = *seed.Subtitle } - if seed.StatusBarItems != nil { - set.StatusBarItems = slices.Clone(*seed.StatusBarItems) - } if seed.ShowRuntimeStatus != nil { set.ShowRuntimeStatus = *seed.ShowRuntimeStatus } @@ -238,7 +234,7 @@ func seedSets(seed seedFile, id string) bool { case "title": return nonEmpty(seed.Title) || nonEmpty(seed.Subtitle) case "statusbar": - return seed.StatusBarItems != nil || seed.ShowRuntimeStatus != nil + return seed.ShowRuntimeStatus != nil case "tabwidth": return seed.WidePanels != nil case "updates": diff --git a/dashboard/internal/onboarding/seed_test.go b/dashboard/internal/onboarding/seed_test.go index e5159e3b9..9c6d1a88d 100644 --- a/dashboard/internal/onboarding/seed_test.go +++ b/dashboard/internal/onboarding/seed_test.go @@ -5,6 +5,7 @@ import ( "log/slog" "os" "path/filepath" + "reflect" "slices" "strings" "testing" @@ -212,6 +213,25 @@ func TestSeedMarksStepsInstaller(t *testing.T) { } } +func TestSeedIgnoresStatusBarItems(t *testing.T) { + f := newSeedFixture(t) + before, err := f.settings.LoadSettings() + if err != nil { + t.Fatal(err) + } + f.write(t, `{"version":1,"status_bar_items":["mqtt"]}`) + if err := f.apply(t); err != nil { + t.Fatalf("seed with retired status_bar_items: %v", err) + } + after, err := f.settings.LoadSettings() + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(before, after) { + t.Fatalf("retired status_bar_items changed settings: before %+v, after %+v", before, after) + } +} + func TestSeedLaterMarksStepLater(t *testing.T) { f := newSeedFixture(t) f.write(t, `{"version":1,"later":["theme","guest","nicht_da"]}`) diff --git a/dashboard/internal/onboarding/steps.go b/dashboard/internal/onboarding/steps.go index ab7191d68..09b62233c 100644 --- a/dashboard/internal/onboarding/steps.go +++ b/dashboard/internal/onboarding/steps.go @@ -87,8 +87,7 @@ func Detect(in DetectInput) map[string]StepState { mark("title", strings.TrimSpace(set.DashboardTitle) != "" || strings.TrimSpace(set.DashboardSubtitle) != "" || set.DashboardTitleHidden || set.DashboardSubtitleHidden) - mark("statusbar", !slices.Equal(set.StatusBarItems, defaults.StatusBarItems) || - set.ShowRuntimeStatus != defaults.ShowRuntimeStatus) + mark("statusbar", set.ShowRuntimeStatus != defaults.ShowRuntimeStatus) mark("tabwidth", !slices.Equal(set.WidePanels, defaults.WidePanels)) mark("updates", set.UpdateCheckDisabled) mark("roles", hasAssignedRole(in.Energy)) diff --git a/dashboard/internal/onboarding/steps_test.go b/dashboard/internal/onboarding/steps_test.go index ab95d58ac..c5f20cf65 100644 --- a/dashboard/internal/onboarding/steps_test.go +++ b/dashboard/internal/onboarding/steps_test.go @@ -187,6 +187,13 @@ func TestDetectRuntimeStatusOffIsDone(t *testing.T) { } } +func TestDetectRuntimeStatusDefaultIsOpen(t *testing.T) { + in := defaultInput() + if got := Detect(in); got["statusbar"] == StepDone { + t.Fatalf("statusbar = %q with the default (shown), want open", got["statusbar"]) + } +} + func TestDetectPartiallyConfiguredInstall(t *testing.T) { in := defaultInput() in.Settings.Theme = settings.ThemeSignalgelb diff --git a/dashboard/internal/settings/settings.go b/dashboard/internal/settings/settings.go index 489e18f0e..d74cb1791 100644 --- a/dashboard/internal/settings/settings.go +++ b/dashboard/internal/settings/settings.go @@ -70,7 +70,6 @@ type Settings struct { ShowDiagnosticEntitiesOnTile bool `json:"show_diagnostic_entities_on_tile"` LiveUpdateIntervalSeconds int `json:"live_update_interval_seconds"` WidePanels []string `json:"wide_panels"` - StatusBarItems []string `json:"status_bar_items"` // Verlaufs-Historie. Die Messwerte selbst liegen ausschliesslich in der // IndexedDB des Browsers - hier steht nur, wie aufgezeichnet und wie @@ -653,7 +652,6 @@ func Default() Settings { NumberFormat: numfmt.FormatAuto, NumberGrouping: numfmt.GroupingMatch, ShowConfigEntitiesOnTile: false, ShowDiagnosticEntitiesOnTile: false, LiveUpdateIntervalSeconds: 3, WidePanels: []string{"overview", "devices", "history", "layout", "settings"}, - StatusBarItems: []string{"mqtt", "storage", "uptime", "version"}, HistorySampleIntervalSeconds: 10, HistoryRetentionMode: HistoryRetentionModeTime, HistoryRetentionHours: 6, @@ -2115,9 +2113,6 @@ func normalizeSettings(value Settings) Settings { if value.WidePanels == nil { value.WidePanels = Default().WidePanels } - if value.StatusBarItems == nil { - value.StatusBarItems = Default().StatusBarItems - } if value.HistorySampleIntervalSeconds == 0 { value.HistorySampleIntervalSeconds = Default().HistorySampleIntervalSeconds } diff --git a/dashboard/internal/settings/settings.schema.json b/dashboard/internal/settings/settings.schema.json index 4d8632b72..f7dbcfa28 100644 --- a/dashboard/internal/settings/settings.schema.json +++ b/dashboard/internal/settings/settings.schema.json @@ -3,7 +3,7 @@ "description": "Operational settings for the Energy Node dashboard.", "type": "object", "additionalProperties": false, - "required": ["health_score_threshold", "sweep_interval_seconds", "show_runtime_status", "device_view_mode", "theme", "number_format", "number_grouping", "show_config_entities_on_tile", "show_diagnostic_entities_on_tile", "live_update_interval_seconds", "wide_panels", "status_bar_items", "history_sample_interval_seconds", "history_retention_mode", "history_retention_hours", "history_budget_mb", "history_raw_window_hours", "history_minute_window_days", "history_extra_entities", "history_exchange_disabled", "history_views", "energy_stats_recording", "changelog_history", "update_check_disabled", "language_switch_hidden", "dashboard_title", "dashboard_subtitle", "dashboard_title_hidden", "dashboard_subtitle_hidden", "performance_target_pct", "automation_patterns_disabled", "automation_habits_disabled", "automation_reliability_disabled", "automation_energy_disabled", "learning_season_year_disabled", "learning_excluded_devices", "learning_profile_days", "learning_acknowledged", "learning_level", "learning_minutes_mode", "learning_minutes_location", "learning_minutes_days", "learning_ha_reconcile_disabled", "automation_outdoor_entity"], + "required": ["health_score_threshold", "sweep_interval_seconds", "show_runtime_status", "device_view_mode", "theme", "number_format", "number_grouping", "show_config_entities_on_tile", "show_diagnostic_entities_on_tile", "live_update_interval_seconds", "wide_panels", "history_sample_interval_seconds", "history_retention_mode", "history_retention_hours", "history_budget_mb", "history_raw_window_hours", "history_minute_window_days", "history_extra_entities", "history_exchange_disabled", "history_views", "energy_stats_recording", "changelog_history", "update_check_disabled", "language_switch_hidden", "dashboard_title", "dashboard_subtitle", "dashboard_title_hidden", "dashboard_subtitle_hidden", "performance_target_pct", "automation_patterns_disabled", "automation_habits_disabled", "automation_reliability_disabled", "automation_energy_disabled", "learning_season_year_disabled", "learning_excluded_devices", "learning_profile_days", "learning_acknowledged", "learning_level", "learning_minutes_mode", "learning_minutes_location", "learning_minutes_days", "learning_ha_reconcile_disabled", "automation_outdoor_entity"], "properties": { "health_score_threshold": { "type": "integer", @@ -82,13 +82,6 @@ "title": "Tabs ohne Breitendeckelung", "description": "Tabs, die die volle Fensterbreite nutzen duerfen statt der 1180px-Lesebreite." }, - "status_bar_items": { - "type": "array", - "items": {"type": "string", "enum": ["mqtt", "cache", "storage", "uptime", "version", "cpu_temp", "cpu_load", "ram", "undervoltage"]}, - "default": ["mqtt", "storage", "uptime", "version"], - "title": "Angaben im Systemstatus", - "description": "Welche Angaben die Statuszeile unterhalb der Kopfzeile zeigt, wenn der globale Systemstatus aktiv ist." - }, "history_sample_interval_seconds": { "type": "integer", "minimum": 5, diff --git a/dashboard/internal/settings/settings_test.go b/dashboard/internal/settings/settings_test.go index 46e73be10..dc02af8c1 100644 --- a/dashboard/internal/settings/settings_test.go +++ b/dashboard/internal/settings/settings_test.go @@ -1167,73 +1167,41 @@ func TestSettingsRejectsUnknownWidePanel(t *testing.T) { } } -// TestSettingsStatusBarItemsDefault: die Vorgabe zeigt MQTT, Storage, -// Uptime und die Dashboard-Version, aber nicht den Cache-Status. -func TestSettingsStatusBarItemsDefault(t *testing.T) { - value, err := NewStore(t.TempDir()).LoadSettings() - if err != nil { - t.Fatal(err) - } - want := []string{"mqtt", "storage", "uptime", "version"} - if !reflect.DeepEqual(value.StatusBarItems, want) { - t.Fatalf("StatusBarItems = %v, want %v", value.StatusBarItems, want) - } -} - -func TestSettingsStatusBarItemsAcceptsEmptySelection(t *testing.T) { +// TestSettingsIgnoresRetiredStatusBarItems: die Einstellung status_bar_items +// ist entfallen. Alte settings.json mit dem Schluessel laden ohne Fehler und +// schreiben ihn beim naechsten Speichern nicht mehr. +func TestSettingsIgnoresRetiredStatusBarItems(t *testing.T) { dir := t.TempDir() - store := NewStore(dir) - value, err := store.LoadSettings() + raw, err := json.Marshal(Default()) if err != nil { t.Fatal(err) } - value.StatusBarItems = []string{} - if err := store.SaveSettings(value); err != nil { + var document map[string]any + if err := json.Unmarshal(raw, &document); err != nil { t.Fatal(err) } - reloaded, err := NewStore(dir).LoadSettings() + document["status_bar_items"] = []string{"mqtt"} + legacy, err := json.Marshal(document) if err != nil { t.Fatal(err) } - if len(reloaded.StatusBarItems) != 0 { - t.Fatalf("StatusBarItems = %v, want leer", reloaded.StatusBarItems) - } -} - -func TestSettingsRejectsUnknownStatusBarItem(t *testing.T) { - store := NewStore(t.TempDir()) - value, err := store.LoadSettings() - if err != nil { + if err := os.WriteFile(filepath.Join(dir, "settings.json"), legacy, 0600); err != nil { t.Fatal(err) } - value.StatusBarItems = []string{"gibt-es-nicht"} - if err := store.SaveSettings(value); err == nil { - t.Fatal("unbekannter Statuszeilen-Schluessel wurde angenommen") - } -} - -func TestSettingsAcceptsTelemetryStatusBarItems(t *testing.T) { - store := NewStore(t.TempDir()) + store := NewStore(dir) value, err := store.LoadSettings() if err != nil { - t.Fatal(err) + t.Fatalf("LoadSettings with retired status_bar_items: %v", err) } - value.StatusBarItems = []string{"cpu_temp", "ram", "undervoltage"} if err := store.SaveSettings(value); err != nil { - t.Fatalf("SaveSettings failed for telemetry status bar items: %v", err) + t.Fatal(err) } - reloaded, err := store.LoadSettings() + written, err := os.ReadFile(filepath.Join(dir, "settings.json")) if err != nil { t.Fatal(err) } - if len(reloaded.StatusBarItems) != 3 { - t.Fatalf("StatusBarItems = %v, want 3 items", reloaded.StatusBarItems) - } - expected := map[string]bool{"cpu_temp": true, "ram": true, "undervoltage": true} - for _, item := range reloaded.StatusBarItems { - if !expected[item] { - t.Fatalf("unexpected StatusBarItem %q", item) - } + if strings.Contains(string(written), "status_bar_items") { + t.Fatalf("saved settings still contain status_bar_items: %s", written) } } diff --git a/dashboard/internal/webui/cache-bust-history.csv b/dashboard/internal/webui/cache-bust-history.csv index d5e5287bc..380a5e596 100644 --- a/dashboard/internal/webui/cache-bust-history.csv +++ b/dashboard/internal/webui/cache-bust-history.csv @@ -1,4 +1,9 @@ version,date,asset,v,note +v0.12.1-pre.1,2026-12-03,css/base.css,56, +v0.12.1-pre.1,2026-12-03,css/onboarding.css,9, +v0.12.1-pre.1,2026-12-03,css/settings-controls.css,23, +v0.12.1-pre.1,2026-12-03,js/dashboard.js,57, +v0.12.1-pre.1,2026-12-03,js/settings.page.js,46, v0.12.0,2026-12-02,css/storage.css,2,"settings panel, system drive usage broken down into its parts (#252)" v0.12.0,2026-12-02,js/storage.page.js,2,"settings panel, system drive usage broken down into its parts (#252)" v0.11.23-pre.46,2026-12-02,css/settings-controls.css,22, diff --git a/dashboard/internal/webui/catalogs/de.json b/dashboard/internal/webui/catalogs/de.json index 00dc0facd..ddb769ae7 100644 --- a/dashboard/internal/webui/catalogs/de.json +++ b/dashboard/internal/webui/catalogs/de.json @@ -4279,7 +4279,7 @@ "onboarding.setup.roles.title": "Energierollen zuordnen", "onboarding.setup.services.sub": "Welche Dienste installiert sind", "onboarding.setup.services.title": "Dienste", - "onboarding.setup.statusbar.text": "Die Leiste oben zeigt gerade MQTT, Speicher, Laufzeit und Version. Wähle, ob und was du davon dauerhaft sehen möchtest.", + "onboarding.setup.statusbar.text": "Oben rechts zeigt ein Chip, ob das System läuft. Ein Klick öffnet alle Werte. Wähle, ob er sichtbar sein soll.", "onboarding.setup.statusbar.title": "Systemstatus", "onboarding.setup.tabwidth.text": "Auf großen Bildschirmen dürfen Tabs die volle Fensterbreite nutzen. Mit Alle gilt das für jeden Tab.", "onboarding.setup.tabwidth.title": "Tab-Breite", @@ -4787,10 +4787,7 @@ "settings.number_format.point": "1,234.5", "settings.read_only": "Du kannst die Einstellungen ansehen, aber nicht ändern.", "settings.revisions.label": "Revisionen der Einstellungen", - "settings.runtime_status.bar_items": "Angaben im Systemstatus", - "settings.runtime_status.bar_items_help": "Nur wirksam, wenn \"Globalen Systemstatus anzeigen\" oben aktiv ist.", - "settings.runtime_status.bar_items_help_button": "Erklärung zu Angaben im Systemstatus", - "settings.runtime_status.show": "Globalen Systemstatus anzeigen", + "settings.runtime_status.show": "Systemstatus in der Kopfzeile anzeigen", "settings.runtime_status.title": "Systemstatus", "settings.saved": "Einstellungen gespeichert.", "settings.saving": "Speichere ...", @@ -4800,15 +4797,6 @@ "settings.stale.label": "Veraltet nach", "settings.stale.note": "Kommt so lange kein neuer Wert über MQTT, gilt der letzte als veraltet. Der Health-Score des Geräts fällt dann auf null.", "settings.stale.title": "Veraltete Werte", - "settings.status_bar.item.cache": "Cache", - "settings.status_bar.item.cpu_load": "CPU-Auslastung", - "settings.status_bar.item.cpu_temp": "CPU-Temperatur", - "settings.status_bar.item.mqtt": "MQTT", - "settings.status_bar.item.ram": "RAM", - "settings.status_bar.item.storage": "Storage", - "settings.status_bar.item.undervoltage": "Unterspannung", - "settings.status_bar.item.uptime": "Uptime", - "settings.status_bar.item.version": "Dashboard-Version", "settings.sweep.decrease": "Seltener sichern", "settings.sweep.increase": "Öfter sichern", "settings.sweep.label": "Sichern alle", @@ -4958,30 +4946,55 @@ "status.cache.impaired": "beeinträchtigt", "status.cache.loaded": "geladen", "status.cache.not_loaded": "nicht geladen", - "status.degraded": "Beeinträchtigt", + "status.count.bad.one": "{n} Störung", + "status.count.bad.other": "{n} Störungen", + "status.count.warn.one": "{n} Hinweis", + "status.count.warn.other": "{n} Hinweise", + "status.issue.cache_error.chip": "Cache-Fehler", + "status.issue.cache_error.label": "Cache", + "status.issue.cache_error.value": "Fehler", + "status.issue.cpu_hot.chip": "CPU heiß", + "status.issue.cpu_hot.label": "CPU", + "status.issue.cpu_hot.value": "{value} °C", + "status.issue.mqtt_disconnected.chip": "MQTT getrennt", + "status.issue.mqtt_disconnected.label": "MQTT", + "status.issue.mqtt_disconnected.value": "getrennt", + "status.issue.ram_full.chip": "RAM knapp", + "status.issue.ram_full.label": "RAM", + "status.issue.ram_full.value": "{value} %", + "status.issue.service_down.chip": "{service} läuft nicht", + "status.issue.service_down.label": "Dienst {service}", + "status.issue.service_down.value": "läuft nicht", + "status.issue.storage_worn.chip": "Speicher verschlissen", + "status.issue.storage_worn.label": "Storage", + "status.issue.storage_worn.value": "Medium bald tauschen", + "status.issue.undervoltage.chip": "Unterspannung", + "status.issue.undervoltage.label": "Spannung", + "status.issue.undervoltage.value": "Unterspannung", "status.label.cache": "Cache", - "status.label.cpu_load": "CPU-Last", - "status.label.cpu_temp": "CPU", + "status.label.cpu": "CPU", + "status.label.mqtt": "MQTT", "status.label.ram": "RAM", "status.label.storage": "Storage", "status.label.uptime": "Uptime", "status.label.version": "Version", + "status.label.voltage": "Spannung", "status.loading": "Lade Status ...", "status.mqtt.connected": "verbunden", "status.mqtt.disconnected": "getrennt", "status.offline": "Offline", "status.ok": "Betriebsbereit", "status.online": "Online", - "status.storage.available": "verfügbar", - "status.storage.unavailable": "nicht verfügbar", + "status.open_diagnostics": "Diagnose öffnen", + "status.ready_short": "Bereit", "status.title": "Systemstatus", "status.unavailable": "Status nicht verfügbar", - "status.undervoltage.now": "⚠ Unterspannung", - "status.undervoltage.ok": "Spannung ok", "status.unknown": "Unbekannt", "status.uptime.days_hours": "{days} T {hours} h", "status.uptime.hours_minutes": "{hours} h {minutes} min", "status.uptime.minutes": "{minutes} min", + "status.voltage.low": "Unterspannung", + "status.voltage.ok": "ok", "storage.contents.disk": "Alle Partitionen auf diesem Stick werden gelöscht und durch eine einzige ersetzt.", "storage.contents.foreign": "Auf diesem Laufwerk liegt ein Dateisystem, das die Node nicht nutzt. Die Node kann nur ext4 nutzen, beim Formatieren gehen die Daten verloren.", "storage.contents.none": "Auf diesem Laufwerk gibt es kein Dateisystem. Die Node formatiert es vorher.", diff --git a/dashboard/internal/webui/catalogs/en.json b/dashboard/internal/webui/catalogs/en.json index 8c264f67f..2a38b7e12 100644 --- a/dashboard/internal/webui/catalogs/en.json +++ b/dashboard/internal/webui/catalogs/en.json @@ -4279,7 +4279,7 @@ "onboarding.setup.roles.title": "Assign energy roles", "onboarding.setup.services.sub": "Which services are installed", "onboarding.setup.services.title": "Services", - "onboarding.setup.statusbar.text": "The bar at the top currently shows MQTT, storage, uptime and version. Choose whether and what you want to see there permanently.", + "onboarding.setup.statusbar.text": "A chip at the top right shows whether the system is running. A click opens all values. Choose whether it is shown.", "onboarding.setup.statusbar.title": "System status", "onboarding.setup.tabwidth.text": "On large screens, tabs may use the full window width. With All, this applies to every tab.", "onboarding.setup.tabwidth.title": "Tab width", @@ -4787,10 +4787,7 @@ "settings.number_format.point": "1,234.5", "settings.read_only": "You can view the settings but not change them.", "settings.revisions.label": "Settings revisions", - "settings.runtime_status.bar_items": "Items in the system status", - "settings.runtime_status.bar_items_help": "Only takes effect when \"Show global system status\" above is on.", - "settings.runtime_status.bar_items_help_button": "About items in the system status", - "settings.runtime_status.show": "Show global system status", + "settings.runtime_status.show": "Show the system status in the header", "settings.runtime_status.title": "System status", "settings.saved": "Settings saved.", "settings.saving": "Saving ...", @@ -4800,15 +4797,6 @@ "settings.stale.label": "Stale after", "settings.stale.note": "If no new value arrives over MQTT for this long, the last one counts as stale. The health score of the device then drops to zero.", "settings.stale.title": "Stale values", - "settings.status_bar.item.cache": "Cache", - "settings.status_bar.item.cpu_load": "CPU load", - "settings.status_bar.item.cpu_temp": "CPU temperature", - "settings.status_bar.item.mqtt": "MQTT", - "settings.status_bar.item.ram": "RAM", - "settings.status_bar.item.storage": "Storage", - "settings.status_bar.item.undervoltage": "Undervoltage", - "settings.status_bar.item.uptime": "Uptime", - "settings.status_bar.item.version": "Dashboard version", "settings.sweep.decrease": "Save less often", "settings.sweep.increase": "Save more often", "settings.sweep.label": "Save every", @@ -4958,30 +4946,55 @@ "status.cache.impaired": "impaired", "status.cache.loaded": "loaded", "status.cache.not_loaded": "not loaded", - "status.degraded": "Degraded", + "status.count.bad.one": "{n} problem", + "status.count.bad.other": "{n} problems", + "status.count.warn.one": "{n} notice", + "status.count.warn.other": "{n} notices", + "status.issue.cache_error.chip": "Cache error", + "status.issue.cache_error.label": "Cache", + "status.issue.cache_error.value": "error", + "status.issue.cpu_hot.chip": "CPU hot", + "status.issue.cpu_hot.label": "CPU", + "status.issue.cpu_hot.value": "{value} °C", + "status.issue.mqtt_disconnected.chip": "MQTT disconnected", + "status.issue.mqtt_disconnected.label": "MQTT", + "status.issue.mqtt_disconnected.value": "disconnected", + "status.issue.ram_full.chip": "RAM almost full", + "status.issue.ram_full.label": "RAM", + "status.issue.ram_full.value": "{value} %", + "status.issue.service_down.chip": "{service} not running", + "status.issue.service_down.label": "Service {service}", + "status.issue.service_down.value": "not running", + "status.issue.storage_worn.chip": "Storage worn", + "status.issue.storage_worn.label": "Storage", + "status.issue.storage_worn.value": "Replace the medium soon", + "status.issue.undervoltage.chip": "Undervoltage", + "status.issue.undervoltage.label": "Voltage", + "status.issue.undervoltage.value": "undervoltage", "status.label.cache": "Cache", - "status.label.cpu_load": "CPU load", - "status.label.cpu_temp": "CPU", + "status.label.cpu": "CPU", + "status.label.mqtt": "MQTT", "status.label.ram": "RAM", "status.label.storage": "Storage", "status.label.uptime": "Uptime", "status.label.version": "Version", + "status.label.voltage": "Voltage", "status.loading": "Loading status ...", "status.mqtt.connected": "connected", "status.mqtt.disconnected": "disconnected", "status.offline": "Offline", "status.ok": "Operational", "status.online": "Online", - "status.storage.available": "available", - "status.storage.unavailable": "unavailable", + "status.open_diagnostics": "Open diagnostics", + "status.ready_short": "Ready", "status.title": "System status", "status.unavailable": "Status unavailable", - "status.undervoltage.now": "⚠ Undervoltage", - "status.undervoltage.ok": "Voltage ok", "status.unknown": "Unknown", "status.uptime.days_hours": "{days} d {hours} h", "status.uptime.hours_minutes": "{hours} h {minutes} min", "status.uptime.minutes": "{minutes} min", + "status.voltage.low": "Undervoltage", + "status.voltage.ok": "ok", "storage.contents.disk": "All partitions on this stick are deleted and replaced by a single one.", "storage.contents.foreign": "This drive holds a file system the node does not use. The node can only use ext4, and formatting deletes the data.", "storage.contents.none": "This drive has no file system. The node formats it first.", diff --git a/dashboard/internal/webui/localize_test.go b/dashboard/internal/webui/localize_test.go index 0e078ed07..4f88f394c 100644 --- a/dashboard/internal/webui/localize_test.go +++ b/dashboard/internal/webui/localize_test.go @@ -156,8 +156,8 @@ func TestMastheadAndStatusBarFollowTheLanguage(t *testing.T) { german := renderOverviewWithLang(t, "de") for _, want := range []string{ "Discovery-getriebene Live-Ansicht und lokaler Gerätemanager", - `Systemstatus`, - "$t('status.mqtt.connected')", + `
{{t "onboarding.guest_note.title"}} {{t "onboarding.guest_note.text"}}
@@ -239,14 +240,14 @@{{t "panel.efficiency_loading"}}
{{t "panel.monitoring_loading"}}
{{t "panel.diagnostics_loading"}}
{{t "panel.diagnostics_loading"}}
{{t "panel.config_loading"}}
{{t "panel.energy_loading"}}
{{t "panel.devicemap_loading"}}
{{t "panel.settings_loading"}}
{{t "panel.settings_loading"}}
{{t "panel.automations_loading"}}
{{t "panel.diagnostics_loading"}}
{{t "panel.diagnostics_loading"}}