homelab: Rueckweg auch als Kurzform (snapshot/sicherung/keiner) fuer die Update-Liste
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
37179b8864
commit
d2f699ac69
@@ -84,6 +84,13 @@ def _rueckweg(gast: dict) -> str:
|
||||
return grund
|
||||
|
||||
|
||||
def _rueckweg_art(gast: dict) -> str:
|
||||
"""Dasselbe in einem Wort — die Oberfläche fasst den Rückweg in der Update-Liste kurz."""
|
||||
if gast.get("snapshot_moeglich"):
|
||||
return "snapshot"
|
||||
return "sicherung" if gast.get("sicherung_moeglich") else "keiner"
|
||||
|
||||
|
||||
def _rueckweg_frage(gast: dict) -> str:
|
||||
"""Der Satz zum Rückweg in der Rückfrage vor „Jetzt updaten“."""
|
||||
if gast.get("snapshot_moeglich"):
|
||||
@@ -203,7 +210,7 @@ def _gast_ziel(gast: dict, jetzt: float) -> ZielStand:
|
||||
laeuft = gast.get("status") == "running"
|
||||
ziel = ZielStand(id=zid, name=app.name if app else str(gast.get("name") or zid), art=art, instanz="homelab",
|
||||
erreichbar=(erreichbar(url) if laeuft else False) if url else (laeuft or None),
|
||||
rueckweg=_rueckweg(gast))
|
||||
rueckweg=_rueckweg(gast), rueckweg_art=_rueckweg_art(gast))
|
||||
if not laeuft:
|
||||
ziel.bausteine.append(BausteinStand(id="status", name="Status", zustand="unbekannt",
|
||||
grund=f"Der Gast ist {gast.get('status') or 'unbekannt'}."))
|
||||
@@ -226,7 +233,8 @@ def _gast_ziel(gast: dict, jetzt: float) -> ZielStand:
|
||||
|
||||
def _host_ziel(host: dict) -> ZielStand:
|
||||
ziel = ZielStand(id="pve", name="Proxmox-Host", art="proxmox-host", instanz="homelab", erreichbar=True,
|
||||
rueckweg="Kein Snapshot möglich; der Host bleibt beim Update in Betrieb, neu gestartet wird getrennt.")
|
||||
rueckweg="Kein Snapshot möglich; der Host bleibt beim Update in Betrieb, neu gestartet wird getrennt.",
|
||||
rueckweg_art="keiner")
|
||||
updates = host.get("updates")
|
||||
pakete = BausteinStand(id="pakete", name="Proxmox VE und Debian", zustand="aktuell",
|
||||
installiert=host.get("version"))
|
||||
|
||||
Reference in New Issue
Block a user