From ae36cf55d86980b7eb9a9a3cfc77c53b40e1c917 Mon Sep 17 00:00:00 2001 From: claude Date: Mon, 23 Nov 2026 09:26:32 +0100 Subject: [PATCH] Statut "mise a jour en cours" (bleu, icone animee) sur la ligne du stack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - front : pendant un apply, la ligne du stack concerne passe en bleu avec une pastille "Mise à jour en cours" et une icone qui tourne, jusqu'a la fin du up -d ; l'indicateur en haut a droite ne sert plus qu'a l'analyse. - back : le repertoire en cours est connu des le lancement de l'apply (et plus seulement apres l'attente du semaphore). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LNfwm4oqRVX4CcBfiA3HL3 --- frontend/src/FleetView.tsx | 25 +++++++++++++++---------- frontend/src/styles.css | 11 +++++++++++ internal/fleet/manager.go | 7 ++++++- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/frontend/src/FleetView.tsx b/frontend/src/FleetView.tsx index 874c9d1..441dc0f 100644 --- a/frontend/src/FleetView.tsx +++ b/frontend/src/FleetView.tsx @@ -224,6 +224,8 @@ function TargetBlock({ server, target, scan, me, keep, filtering, onCheck, onApp const [open, setOpen] = useState>({}); const stacks = (scan?.stacks ?? []).filter(keep); const hidden = (scan?.stacks.length ?? 0) - stacks.length; + // Stack en cours de mise à jour (pull, down, up -d) sur cette connexion. + const applyingDir = scan?.running && scan.task === "apply" ? scan.current : undefined; return (
@@ -233,9 +235,9 @@ function TargetBlock({ server, target, scan, me, keep, filtering, onCheck, onApp {target.roots.join(" · ")}{target.depth > 1 ? ` (profondeur ${target.depth})` : ""} - {scan?.running && ( + {scan?.running && scan.task !== "apply" && ( - {scan.task === "apply" ? "Mise à jour" : "Analyse"} + Analyse {scan.current ? ` : ${scan.current.split("/").pop()}` : "…"} )} @@ -275,26 +277,29 @@ function TargetBlock({ server, target, scan, me, keep, filtering, onCheck, onApp {stacks.map((st) => { const isOpen = !!open[st.dir]; const [late, total] = [st.services?.filter((s) => s.state === "update").length ?? 0, st.services?.length ?? 0]; + const applying = !!applyingDir && applyingDir === st.dir; + const status = applying ? "applying" : st.status; return ( -
  • +
  • setOpen({ ...open, [st.dir]: !isOpen })}> - - {st.status === "uptodate" && } - {st.status === "updates" && } - {st.status === "error" && } - {statusLabel[st.status]} + + {applying && } + {!applying && st.status === "uptodate" && } + {!applying && st.status === "updates" && } + {!applying && st.status === "error" && } + {applying ? "Mise à jour en cours" : statusLabel[st.status]} {st.name} {st.dir} - {st.status === "error" ? {st.error} : total > 0 ? (late > 0 ? `${late}/${plural(total, "image")} à mettre à jour` : plural(total, "image")) : ""} + {applying ? "pull, down puis up -d…" : st.status === "error" ? {st.error} : total > 0 ? (late > 0 ? `${late}/${plural(total, "image")} à mettre à jour` : plural(total, "image")) : ""} - {me.admin && st.status === "updates" && ( + {me.admin && st.status === "updates" && !applying && (