Werkstatt: ServicesCard-Neustart-Bug fixieren
Das Frontend schickte den Anzeigenamen (z.B. 'Engine (llama-swap)') an die Restart-API, die aber systemd-Unit-Namen (z.B. 'llama-swap') erwartet. Backend gibt jetzt ein 'unit'-Feld mit; Frontend nutzt es für restart(), disabled und key.
This commit is contained in:
@@ -43,7 +43,7 @@ export function ServicesCard() {
|
||||
<div className="flex flex-1 flex-col">
|
||||
<div className="space-y-1.5">
|
||||
{svc.services.map((x) => (
|
||||
<div key={x.name} className="group flex items-center justify-between gap-2 rounded-xl border border-border/30 bg-background/20 p-2.5">
|
||||
<div key={x.unit} className="group flex items-center justify-between gap-2 rounded-xl border border-border/30 bg-background/20 p-2.5">
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<span className={cn("h-2.5 w-2.5 shrink-0 rounded-full ring-2 ring-black/40", x.ok ? "bg-emerald-500" : "bg-amber-500")} />
|
||||
<div className="min-w-0">
|
||||
@@ -52,11 +52,11 @@ export function ServicesCard() {
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
onClick={() => restart(x.name)} disabled={restarting[x.name]}
|
||||
onClick={() => restart(x.unit)} disabled={restarting[x.unit]}
|
||||
className="flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-border/40 text-muted-foreground opacity-0 transition-all hover:bg-primary/5 hover:text-primary group-hover:opacity-100"
|
||||
title="Dienst neu starten"
|
||||
>
|
||||
<RefreshCw className={cn("h-3.5 w-3.5", restarting[x.name] && "animate-spin")} />
|
||||
<RefreshCw className={cn("h-3.5 w-3.5", restarting[x.unit] && "animate-spin")} />
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user