Update notification service

This commit is contained in:
MacRimi
2026-03-05 21:28:48 +01:00
parent d927b462b6
commit 925fe1cce0
3 changed files with 18 additions and 34 deletions

View File

@@ -428,7 +428,7 @@ export function HealthStatusModal({ open, onOpenChange, getApiUrl }: HealthStatu
className="flex items-center justify-between gap-1.5 sm:gap-2 text-[10px] sm:text-xs py-1.5 px-2 sm:px-3 rounded-md hover:bg-muted/40 transition-colors" className="flex items-center justify-between gap-1.5 sm:gap-2 text-[10px] sm:text-xs py-1.5 px-2 sm:px-3 rounded-md hover:bg-muted/40 transition-colors"
> >
<div className="flex items-start gap-1.5 sm:gap-2 min-w-0 flex-1"> <div className="flex items-start gap-1.5 sm:gap-2 min-w-0 flex-1">
<span className="mt-0.5 shrink-0">{getStatusIcon(checkData.status, "sm")}</span> <span className="mt-0.5 shrink-0">{getStatusIcon(checkData.dismissed ? "INFO" : checkData.status, "sm")}</span>
<span className="font-medium shrink-0">{formatCheckLabel(checkKey)}</span> <span className="font-medium shrink-0">{formatCheckLabel(checkKey)}</span>
<span className="text-muted-foreground break-words whitespace-pre-wrap min-w-0">{checkData.detail}</span> <span className="text-muted-foreground break-words whitespace-pre-wrap min-w-0">{checkData.detail}</span>
{checkData.dismissed && ( {checkData.dismissed && (

View File

@@ -266,7 +266,8 @@ export function StorageOverview() {
setDetailsOpen(true) setDetailsOpen(true)
setDiskObservations([]) setDiskObservations([])
if (disk.observations_count && disk.observations_count > 0) { // Always attempt to fetch observations -- the count enrichment may lag
// behind the actual observation recording (especially for USB disks).
setLoadingObservations(true) setLoadingObservations(true)
try { try {
const params = new URLSearchParams() const params = new URLSearchParams()
@@ -280,7 +281,6 @@ export function StorageOverview() {
setLoadingObservations(false) setLoadingObservations(false)
} }
} }
}
const formatObsDate = (iso: string) => { const formatObsDate = (iso: string) => {
if (!iso) return 'N/A' if (!iso) return 'N/A'

View File

@@ -1095,27 +1095,11 @@ class HealthMonitor:
if not has_io: if not has_io:
checks['io_errors'] = {'status': 'OK', 'detail': 'No I/O errors in dmesg'} checks['io_errors'] = {'status': 'OK', 'detail': 'No I/O errors in dmesg'}
if self.capabilities.get('has_smart') and 'smart_health' not in checks: if self.capabilities.get('has_smart') and 'smart_health' not in checks:
if smart_warnings_found: if not smart_warnings_found:
# Collect the actual warning details for the sub-check
smart_details_parts = []
smart_error_keys = []
for disk_path, issue in disk_health_issues.items():
for sl in (issue.get('smart_lines') or [])[:3]:
smart_details_parts.append(sl)
if issue.get('error_key'):
smart_error_keys.append(issue['error_key'])
detail_text = '; '.join(smart_details_parts[:3]) if smart_details_parts else 'SMART warning in journal'
# Use the same error_key as the per-disk check so a single dismiss
# covers both the /Dev/Sda sub-check AND the SMART Health sub-check
shared_key = smart_error_keys[0] if smart_error_keys else 'smart_health_journal'
checks['smart_health'] = {
'status': 'WARNING',
'detail': detail_text,
'dismissable': True,
'error_key': shared_key,
}
else:
checks['smart_health'] = {'status': 'OK', 'detail': 'No SMART warnings in journal'} checks['smart_health'] = {'status': 'OK', 'detail': 'No SMART warnings in journal'}
# When smart_warnings_found is True, the per-disk sub-checks
# (/Dev/Sda etc.) already carry all the detail and dismiss logic.
# Adding a separate smart_health WARNING would just duplicate them.
if self.capabilities.get('has_zfs') and 'zfs_pools' not in checks: if self.capabilities.get('has_zfs') and 'zfs_pools' not in checks:
checks['zfs_pools'] = {'status': 'OK', 'detail': 'ZFS pools healthy'} checks['zfs_pools'] = {'status': 'OK', 'detail': 'ZFS pools healthy'}
if self.capabilities.get('has_lvm') and 'lvm_volumes' not in checks and 'lvm_check' not in checks: if self.capabilities.get('has_lvm') and 'lvm_volumes' not in checks and 'lvm_check' not in checks: