From 35afcc4a371ff8a2322d8a8be25806cbed978d02 Mon Sep 17 00:00:00 2001 From: Bobban Rydh Date: Wed, 16 Sep 2026 00:01:17 +0200 Subject: [PATCH] Add a host filter to the Docker page Dockhand aggregates containers across every Docker host it manages into one list, with no way to narrow it down to a single host. Add a host dropdown next to Refresh (only shown when more than one host is present) that filters the table client-side over the already-fetched container list. Resets whenever the selected Dockhand integration changes, so a stale host name from a previous integration can't linger. Co-Authored-By: Claude Sonnet 5 --- web/src/pages/Docker.tsx | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/web/src/pages/Docker.tsx b/web/src/pages/Docker.tsx index 1c10353..fe94aeb 100644 --- a/web/src/pages/Docker.tsx +++ b/web/src/pages/Docker.tsx @@ -34,6 +34,7 @@ export default function Docker({ user }: { user: CurrentUser }) { const [data, setData] = useState(null); const [loading, setLoading] = useState(false); const [actingOnContainer, setActingOnContainer] = useState(null); + const [hostFilter, setHostFilter] = useState(""); useEffect(() => { api.integrations @@ -60,6 +61,7 @@ export default function Docker({ user }: { user: CurrentUser }) { } useEffect(() => { + setHostFilter(""); if (selected?.enabled) { loadContainers(selected.id); } else { @@ -68,6 +70,9 @@ export default function Docker({ user }: { user: CurrentUser }) { // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectedId]); + const hosts = [...new Set((data?.containers ?? []).map((c) => c.environmentName))].sort(); + const filteredContainers = (data?.containers ?? []).filter((c) => !hostFilter || c.environmentName === hostFilter); + async function containerAction(c: DockhandContainer, action: "start" | "stop" | "restart") { if (!selectedId) return; if (action === "stop" && !confirm(`Stop container "${c.name}"?`)) return; @@ -132,7 +137,22 @@ export default function Docker({ user }: { user: CurrentUser }) { )} -
+
+ {hosts.length > 1 && ( + + )}