Wartung: UI/UX-Politur fuer MC2.0 (Sidebar-Gruppierung, Kachel-Livedaten, Memory-Splitscreen und Mobile-Touch)
This commit is contained in:
@@ -75,6 +75,20 @@ export function CockpitView({ onNavigate }: { onNavigate: (v: string) => void })
|
||||
const connectOk = connect?.gateway.ok && connect?.memory.ok
|
||||
const openAuftraege = auftraege?.available ? auftraege.open_count : 0
|
||||
|
||||
// Zusätzliche reaktive Livedaten für die Kacheln
|
||||
const activeBrain = models?.models?.find((m: any) => m.role === "hermes")
|
||||
const brainName = activeBrain?.name ? activeBrain.name.split("/").pop()?.replace(/\.gguf$/i, "") : ""
|
||||
const autoNotes = memory ? memory.filter((m: any) => ["auto", "agent", "hermes"].includes(m.source)).length : 0
|
||||
const failedSvc = svc?.services.filter((s: any) => !s.ok).map((s: any) => s.name).join(", ")
|
||||
|
||||
const upParts = updates ? [
|
||||
updates.os > 0 && "OS",
|
||||
updates.engine > 0 && "Engine",
|
||||
updates.swap > 0 && "Swap",
|
||||
updates.models > 0 && "Modelle"
|
||||
].filter(Boolean) : []
|
||||
const updateSummary = upParts.length > 0 ? upParts.join(" + ") : ""
|
||||
|
||||
return (
|
||||
<div className="space-y-7">
|
||||
{/* Kopf */}
|
||||
@@ -109,38 +123,44 @@ export function CockpitView({ onNavigate }: { onNavigate: (v: string) => void })
|
||||
icon={Inbox} title="Auftragsbuch" value={auftraege?.available ? openAuftraege : "—"}
|
||||
unit={openAuftraege === 1 ? "Vorschlag" : "Vorschläge"}
|
||||
tone={!auftraege ? "loading" : openAuftraege > 0 ? "warn" : "ok"}
|
||||
hint="Annehmen oder ablehnen"
|
||||
hint={openAuftraege > 0 ? `${openAuftraege} offene Patches prüfen` : "Keine ausstehenden Vorschläge"}
|
||||
onClick={() => onNavigate("auftraege")}
|
||||
/>
|
||||
<CockpitTile
|
||||
icon={Boxes} title="Modelle" value={running} unit="warm"
|
||||
tone={running > 0 ? "ok" : "muted"} hint="Speicher, laden & Rollen"
|
||||
tone={running > 0 ? "ok" : "muted"}
|
||||
hint={brainName ? `Hirn: ${brainName}` : "Kein Hermes-Modell geladen"}
|
||||
onClick={() => onNavigate("models")}
|
||||
/>
|
||||
<CockpitTile
|
||||
icon={Brain} title="Gedächtnis" value={memory ? notes : "…"} unit="Notizen"
|
||||
tone={memory ? "ok" : "loading"} hint="Lucys geteiltes Wissen"
|
||||
tone={memory ? "ok" : "loading"}
|
||||
hint={memory ? `${notes} Fakten (${autoNotes} auto gelernt)` : "Gedächtnis-Pool laden..."}
|
||||
onClick={() => onNavigate("memory")}
|
||||
/>
|
||||
<CockpitTile
|
||||
icon={Server} title="Dienste" value={svc ? `${svcOk}/${svcTotal}` : "…"} unit="laufen"
|
||||
tone={!svc ? "loading" : svcErrors > 0 ? "warn" : "ok"} hint="Status & Neustart"
|
||||
tone={!svc ? "loading" : svcErrors > 0 ? "warn" : "ok"}
|
||||
hint={failedSvc ? `Ausfall: ${failedSvc}` : "Alle Dienste online"}
|
||||
onClick={() => openDrawer("maintenance")}
|
||||
/>
|
||||
<CockpitTile
|
||||
icon={ShieldAlert} title="Updates" value={updates ? (pendingCount > 0 ? pendingCount : "0") : "…"}
|
||||
unit={pendingCount > 0 ? "bereit" : "aktuell"}
|
||||
tone={!updates ? "loading" : pendingCount > 0 ? "warn" : "ok"} hint="Prüfen & einspielen"
|
||||
tone={!updates ? "loading" : pendingCount > 0 ? "warn" : "ok"}
|
||||
hint={pendingCount > 0 ? `Verfügbar: ${updateSummary}` : "Alles auf dem neuesten Stand"}
|
||||
onClick={() => openDrawer("maintenance")}
|
||||
/>
|
||||
<CockpitTile
|
||||
icon={Plug} title="Verbinden" value="Zed" unit={connectOk ? "· bereit" : ""}
|
||||
tone={!connect ? "loading" : connectOk ? "ok" : "warn"} hint="IDE- & Agent-Configs"
|
||||
tone={!connect ? "loading" : connectOk ? "ok" : "warn"}
|
||||
hint={agent?.pc_executor_reachable ? "IDE & PC online (:7777)" : "IDE-Kopplung (PC offline)"}
|
||||
onClick={() => onNavigate("connect")}
|
||||
/>
|
||||
<CockpitTile
|
||||
icon={ScrollText} title="Logs" value={svc ? svcErrors : "…"} unit={svcErrors === 1 ? "Fehler" : "Fehler"}
|
||||
tone={!svc ? "loading" : svcErrors > 0 ? "alert" : "ok"} hint="Verlauf & Diagnose"
|
||||
tone={!svc ? "loading" : svcErrors > 0 ? "alert" : "ok"}
|
||||
hint={svcErrors > 0 ? `${svcErrors} Dienst-Fehler gefunden` : "Keine Log-Warnungen"}
|
||||
onClick={() => openDrawer("logs")}
|
||||
/>
|
||||
</div>
|
||||
@@ -288,12 +308,12 @@ function NeedsYou({
|
||||
) : (
|
||||
<div className="space-y-2">
|
||||
{problems.map((c) => (
|
||||
<div key={c.id} className="flex items-center justify-between gap-3 rounded-2xl border border-red-500/25 bg-red-500/5 p-4">
|
||||
<div className="flex min-w-0 items-center gap-3">
|
||||
<div key={c.id} className="flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-2xl border border-red-500/25 bg-red-500/5 p-4">
|
||||
<div className="flex min-w-0 items-center gap-3 w-full">
|
||||
<span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-red-500/30 bg-background/30 text-red-300">
|
||||
<c.icon className="h-4.5 w-4.5" />
|
||||
</span>
|
||||
<div className="min-w-0">
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="text-sm font-bold text-foreground">{c.label}</p>
|
||||
<p className="truncate text-xs text-muted-foreground">{c.detail}</p>
|
||||
</div>
|
||||
@@ -302,7 +322,7 @@ function NeedsYou({
|
||||
<button
|
||||
onClick={() => c.repair && onRepair(c.id, c.repair)}
|
||||
disabled={!!busy[c.id]}
|
||||
className="flex h-9 shrink-0 items-center gap-1.5 rounded-lg border border-red-500/40 bg-red-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300 transition-all hover:bg-red-500/20 cursor-pointer disabled:opacity-60"
|
||||
className="flex h-9 shrink-0 items-center gap-1.5 rounded-lg border border-red-500/40 bg-red-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300 transition-all hover:bg-red-500/20 cursor-pointer disabled:opacity-60 w-full sm:w-auto justify-center"
|
||||
>
|
||||
{busy[c.id] ? <Loader2 className="h-3.5 w-3.5 animate-spin" /> : <Wrench className="h-3.5 w-3.5" />}
|
||||
{c.repair.label}
|
||||
|
||||
Reference in New Issue
Block a user