Update notification service

This commit is contained in:
MacRimi
2026-03-08 19:37:04 +01:00
parent be2bfa0087
commit d1d44afc9d
2 changed files with 22 additions and 3 deletions

View File

@@ -1046,11 +1046,11 @@ export function StorageOverview() {
<div className="grid grid-cols-2 gap-x-4 gap-y-2 pl-7 text-sm">
<div>
<span className="text-muted-foreground">Size</span>
<p className="font-medium">{disk.size || "N/A"}</p>
<p className="font-medium">{disk.size_formatted || disk.size || "N/A"}</p>
</div>
<div>
<span className="text-muted-foreground">SMART Status</span>
<p className="font-medium">{disk.smart_status || "N/A"}</p>
<p className="font-medium capitalize">{disk.smart_status || "N/A"}</p>
</div>
{disk.serial && disk.serial !== "Unknown" && (
<div className="col-span-2">
@@ -1314,7 +1314,7 @@ export function StorageOverview() {
</div>
{/* Observations Section */}
{(diskObservations.length > 0 || loadingObservations) && (
{(diskObservations.length > 0 || loadingObservations || (selectedDisk.observations_count ?? 0) > 0) && (
<div className="border-t pt-4">
<h4 className="font-semibold mb-2 flex items-center gap-2">
<Info className="h-4 w-4 text-blue-400" />

View File

@@ -804,6 +804,13 @@ class JournalWatcher:
raw_message=raw_msg,
severity='warning',
)
# Also update worst_health so the disk stays marked as warning
# even if current SMART readings show 0 pending sectors
warn_line_text = warn_line_m.group(1).strip() if warn_line_m else error_signature
health_persistence.update_disk_worst_health(
base_dev, serial, 'warning', warn_line_text
)
except Exception as e:
print(f"[DiskIOEventProcessor] Error recording smartd observation: {e}")
@@ -1795,6 +1802,18 @@ class PollingCollector:
except Exception:
pass
# Skip recovery notifications for SMART disk errors (pending/reallocated sectors).
# These indicate physical disk degradation that doesn't truly "recover" --
# the disk may show 0 pending sectors later but the damage history persists.
# The worst_health in disk_registry tracks this, so we don't send false "resolved".
if category == 'disks':
reason_lower = reason.lower() if reason else ''
if any(indicator in reason_lower for indicator in [
'pending', 'reallocated', 'sector', 'smart', 'unreadable'
]):
self._last_notified.pop(key, None)
continue
# Calculate duration
duration = ''
if first_seen: