mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-04-01 14:39:24 +02:00
Adiciona monitoramento de disco com alertas globais quando o uso ultrapassa thresholds configuráveis (85% warning, 95% critical). - Novo endpoint GET /api/system/disk-status - getDiskStatus() no SystemService com thresholds via KVStore - Hook useDiskAlert com polling de 45s e dismiss via localStorage - DiskAlertBanner no AppLayout visível em todas as páginas - Banner reaparece se o nível de alerta piorar Closes #485
24 lines
737 B
TypeScript
24 lines
737 B
TypeScript
import Alert from './Alert'
|
|
import { useDiskAlert } from '~/hooks/useDiskAlert'
|
|
|
|
export default function DiskAlertBanner() {
|
|
const { diskStatus, shouldShow, dismiss } = useDiskAlert()
|
|
|
|
if (!shouldShow || !diskStatus) return null
|
|
|
|
const isWarning = diskStatus.level === 'warning'
|
|
|
|
return (
|
|
<div className="px-4 pt-4">
|
|
<Alert
|
|
type={isWarning ? 'warning' : 'error'}
|
|
variant="bordered"
|
|
title={isWarning ? 'Disk Space Running Low' : 'Disk Space Critically Low'}
|
|
message={`Disk "${diskStatus.diskName}" is ${diskStatus.highestUsage.toFixed(1)}% full. Free up space to avoid issues with downloads and services.`}
|
|
dismissible={true}
|
|
onDismiss={dismiss}
|
|
/>
|
|
</div>
|
|
)
|
|
}
|