Dashboard: per-host disk usage (0.21.0)

The per-host resource bar gained a Disk stat (used / total). The agent now
reports disk_total/disk_used via shutil.disk_usage on its stacks dir (a host
bind-mount), alongside the existing cpu/mem/containers fields; the local host
uses the existing system info disk data.

- agent_app.py: _disk_info() + disk_total/disk_used in _system_info().
- Frontend: ResourceBar gained diskUsed/diskTotal (5-column grid); AgentSystem
  type gained disk_total/disk_used.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
menzelj
2026-06-08 13:31:18 +00:00
co-authored by Claude Opus 4.8
parent eb9ffd0b0d
commit d1c63a329b
6 changed files with 41 additions and 8 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "stackpilot-frontend",
"private": true,
"version": "0.20.0",
"version": "0.21.0",
"type": "module",
"scripts": {
"dev": "vite",
+2
View File
@@ -11,6 +11,8 @@ export interface AgentSystem {
cpu_cores: number;
mem_total: number;
mem_used: number;
disk_total: number;
disk_used: number;
containers_running: number;
containers_total: number;
}
+16 -2
View File
@@ -11,6 +11,7 @@ import {
Play,
Square,
RotateCw,
Server,
} from "lucide-react";
import { toast } from "sonner";
import { Card, Spinner, StatusDot, Badge } from "@/components/ui";
@@ -62,6 +63,8 @@ export function Dashboard() {
cpuCores={info.data?.cpu_cores ?? 0}
memUsed={info.data?.ram.used ?? 0}
memTotal={info.data?.ram.total ?? 0}
diskUsed={info.data?.disk.used ?? 0}
diskTotal={info.data?.disk.total ?? 0}
containersRunning={info.data?.containers_running ?? 0}
containersTotal={info.data?.containers_total ?? 0}
dockerVersion={info.data?.docker_version ?? ""}
@@ -168,6 +171,8 @@ function AgentDashboardSection({ agent, isAdmin }: { agent: Agent; isAdmin: bool
cpuCores={sys.data?.cpu_cores ?? 0}
memUsed={sys.data?.mem_used ?? 0}
memTotal={sys.data?.mem_total ?? 0}
diskUsed={sys.data?.disk_used ?? 0}
diskTotal={sys.data?.disk_total ?? 0}
containersRunning={sys.data?.containers_running ?? 0}
containersTotal={sys.data?.containers_total ?? 0}
dockerVersion={sys.data?.docker_version ?? ""}
@@ -420,6 +425,8 @@ function ResourceBar({
cpuCores,
memUsed,
memTotal,
diskUsed,
diskTotal,
containersRunning,
containersTotal,
dockerVersion,
@@ -427,24 +434,31 @@ function ResourceBar({
cpuCores: number;
memUsed: number;
memTotal: number;
diskUsed: number;
diskTotal: number;
containersRunning: number;
containersTotal: number;
dockerVersion: string;
}) {
return (
<div className="mb-4 grid grid-cols-2 gap-4 md:grid-cols-4">
<div className="mb-4 grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-5">
<Stat icon={<Cpu className="h-5 w-5" />} label="CPU cores" value={cpuCores || "—"} />
<Stat
icon={<MemoryStick className="h-5 w-5" />}
label="Memory"
value={memTotal ? `${formatBytes(memUsed)} / ${formatBytes(memTotal)}` : "—"}
/>
<Stat
icon={<HardDrive className="h-5 w-5" />}
label="Disk"
value={diskTotal ? `${formatBytes(diskUsed)} / ${formatBytes(diskTotal)}` : "—"}
/>
<Stat
icon={<Container className="h-5 w-5" />}
label="Containers"
value={`${containersRunning} / ${containersTotal}`}
/>
<Stat icon={<HardDrive className="h-5 w-5" />} label="Docker" value={dockerVersion || "—"} />
<Stat icon={<Server className="h-5 w-5" />} label="Docker" value={dockerVersion || "—"} />
</div>
);
}