R-516 items 7-10: one banner per drive, local times, te-form, health banners in the household's language
- item 7: the storage page shows the disconnect time in local time (fmtTimeStr), not the raw RFC3339 UTC. - item 8: a disconnected drive no longer has two banners - the health check's warning for it is dropped when the dedicated alert.storage.disconnected banner was built (it stays on the wire). - item 9: alert.deadapp.group says "nezd meg" (te-form); formal ceiling 14 -> 13. - item 10: the disk/memory/CPU/temperature health banners show the dashboard's own sentence (health.* keys, hu + en) via HealthReport.WarningMsgs/IssueMsgs; the wire text is unchanged. checkResources split out of RunHealthCheck as the test seam. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -235,11 +235,16 @@ func (am *AlertManager) Refresh(report *monitor.HealthReport, cfg *config.Config
|
||||
}
|
||||
|
||||
// From health check issues (critical)
|
||||
for _, issue := range report.Issues {
|
||||
for i, issue := range report.Issues {
|
||||
// R-516 item 10: the banner shows the dashboard's own sentence (household language) when the
|
||||
// check named one; the wire text is the fallback and stays untouched on the wire.
|
||||
msg := report.IssueMsgAt(i)
|
||||
alerts = append(alerts, Alert{
|
||||
ID: "health-" + simpleHash(issue),
|
||||
Level: "error",
|
||||
Message: issue, // ON THE WIRE (report health.issues) -- not ours to translate; slice 3
|
||||
Message: issue, // ON THE WIRE (report health.issues) -- the fallback when MessageKey is empty
|
||||
MessageKey: msg.Key,
|
||||
MessageArgs: msg.Args,
|
||||
Link: "/monitoring",
|
||||
LinkTextKey: "alert.link.monitoring",
|
||||
})
|
||||
@@ -247,10 +252,21 @@ func (am *AlertManager) Refresh(report *monitor.HealthReport, cfg *config.Config
|
||||
|
||||
// From health check warnings
|
||||
for i, w := range report.Warnings {
|
||||
// R-516 item 8: a disconnected drive already has its own banner above (alert.storage.disconnected,
|
||||
// in the household's language). The health check's „Meghajtó leválasztva" warning for the same
|
||||
// drive was a SECOND banner on every page — dropped here whenever the dedicated banners were built
|
||||
// from the storage list. The warning itself stays on the wire (report health.warnings).
|
||||
// Pinned by TestR516_DisconnectedDriveHasOneBanner.
|
||||
if len(storagePaths) > 0 && report.WarningKindAt(i) == monitor.WarnKindStorageDisconnected {
|
||||
continue
|
||||
}
|
||||
msg := report.WarningMsgAt(i) // R-516 item 10, as for the issues above
|
||||
alert := Alert{
|
||||
ID: "health-" + simpleHash(w),
|
||||
Level: "warning",
|
||||
Message: w, // ON THE WIRE (report health.warnings) -- not ours to translate; slice 3
|
||||
Message: w, // ON THE WIRE (report health.warnings) -- the fallback when MessageKey is empty
|
||||
MessageKey: msg.Key,
|
||||
MessageArgs: msg.Args,
|
||||
Link: "/monitoring",
|
||||
LinkTextKey: "alert.link.monitoring",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user