homelab: Wächter und Geräteliste sehen volle Gastplatten (AdGuard stand bei 100 %)

Der Ausfuehrer schickt die Belegung der rootfs laufender Container mit; ab 85 % gelb, ab 95 % rot, in der
Geraeteliste als eigene Spalte und auf der Lampe des Geraets. Anlass: AdGuard (2 GB) war voll, das
Abfrageprotokoll schrieb nicht mehr und die Paketsuche scheiterte, ohne dass es eine Anzeige sagte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hitonabi
2026-09-24 21:00:44 +02:00
co-authored by Claude Opus 5.5
parent eed36e9764
commit c08a144006
30 changed files with 146 additions and 32 deletions
+14
View File
@@ -81,10 +81,24 @@ export function neuText(b: BausteinStand): string {
return b.kurz || b.verfuegbar || "neu"
}
/** Anteil der belegten Platte (0…1) oder null, wo unbekannt. Ab 85 % gelb, ab 95 % rot — wie der Wächter. */
export function plattenAnteil(ziel: ZielStand): number | null {
const p = ziel.platte
return p && p.gesamt > 0 ? p.belegt / p.gesamt : null
}
export const PLATTE_GELB = 0.85
export const PLATTE_ROT = 0.95
export function lampeFuer(ziel: ZielStand, laeuft: boolean): Lampe {
const label = kurzname(ziel)
const platte = plattenAnteil(ziel)
if (ziel.erreichbar === false) return { id: ziel.id, label, zustand: "fehler", wert: "antwortet nicht" }
if (platte !== null && platte >= PLATTE_ROT) return { id: ziel.id, label, zustand: "fehler", wert: "Platte voll" }
if (laeuft) return { id: ziel.id, label, zustand: "info", wert: "Update läuft" }
if (platte !== null && platte >= PLATTE_GELB) {
return { id: ziel.id, label, zustand: "warn", wert: `Platte ${Math.round(platte * 100)} %` }
}
const neu = ziel.bausteine.filter((b) => b.zustand === "neu")
if (neu.length > 0) {
const b = neu.find((x) => APP.has(x.id)) ?? neu[0]