feat: Word the workload and update panels for Windows servers

This commit is contained in:
2026-08-13 12:16:10 +00:00
parent ea6d0b969c
commit 36848a519a
4 changed files with 28 additions and 9 deletions
+3 -1
View File
@@ -301,7 +301,9 @@ export default function ServerDetailPage() {
<div ref={panelsRef} className="p-4 sm:p-6 lg:p-8">
<div role="tabpanel" id={`server-panel-${activeTab}`} aria-labelledby={`server-tab-${activeTab}`}>
{activeTab === "overview" && <OverviewTab server={server} attention={attention} onGoTo={selectTab} />}
{activeTab === "workloads" && <WorkloadList serverId={server.server_id} canControl={isAdmin} />}
{activeTab === "workloads" && (
<WorkloadList serverId={server.server_id} canControl={isAdmin} isWindows={!!server.os_info?.toLowerCase().includes("windows")} />
)}
{activeTab === "security" && <ServerVulnerabilities serverId={server.server_id} />}
{activeTab === "access" && <AccessTab server={server} onGenerateKey={() => setShowGenerateModal(true)} />}
{activeTab === "maintenance" && (
+11 -4
View File
@@ -47,11 +47,18 @@ export function MaintenanceTab({
<Card padding={false}>
<div className="flex flex-wrap items-center justify-between gap-3 border-b border-border px-6 py-4">
<h2 className="text-lg font-semibold text-text-primary">OS updates</h2>
{updates.length > 0 ? <Badge variant="warning">{updates.length} pending</Badge> : <Badge variant="success">up to date</Badge>}
<div className="flex flex-wrap items-center gap-2">
{updates.length > 0 ? <Badge variant="warning">{updates.length} pending</Badge> : <Badge variant="success">up to date</Badge>}
{/* Sits with the updates panel because that is what
caused it. The agent never reboots a host itself. */}
{server.inventory?.reboot_required && <Badge variant="warning">reboot required</Badge>}
</div>
</div>
{updates.length === 0 ? (
<p className="px-6 py-10 text-center text-sm text-text-secondary">No pending package updates. The agent checks hourly.</p>
<p className="px-6 py-10 text-center text-sm text-text-secondary">
{isWindows ? "No pending Windows updates. The agent checks hourly." : "No pending package updates. The agent checks hourly."}
</p>
) : (
<>
{/* Capped so a host with 400 pending packages does not make the
@@ -60,9 +67,9 @@ export function MaintenanceTab({
<Table>
<Thead>
<Tr>
<Th>Package</Th>
<Th>{isWindows ? "Update" : "Package"}</Th>
<Th>Current</Th>
<Th>Available</Th>
<Th>{isWindows ? "KB" : "Available"}</Th>
</Tr>
</Thead>
<Tbody>
+13 -4
View File
@@ -45,7 +45,7 @@ const ACTION_PAST: Record<WorkloadAction, string> = {
restart: "Restarted",
};
export function WorkloadList({ serverId, canControl }: { serverId: string; canControl: boolean }) {
export function WorkloadList({ serverId, canControl, isWindows }: { serverId: string; canControl: boolean; isWindows: boolean }) {
const qc = useQueryClient();
const toast = useToast();
const [logTarget, setLogTarget] = useState<Workload | null>(null);
@@ -115,7 +115,7 @@ export function WorkloadList({ serverId, canControl }: { serverId: string; canCo
{snapshot.isLoading ? (
<p className="text-sm text-text-secondary">Loading</p>
) : !data ? (
<p className="text-sm text-text-secondary">Nothing reported yet. Agents report every 60 seconds, on Linux only.</p>
<p className="text-sm text-text-secondary">Nothing reported yet. Agents report every 60 seconds.</p>
) : (
<div className="space-y-2 text-sm">
{/* Docker absent is the common case on a fleet built
@@ -128,9 +128,18 @@ export function WorkloadList({ serverId, canControl }: { serverId: string; canCo
<p className="text-text-secondary">Docker is not in use on this server.</p>
) : null}
{/* One wire field, two honest words for it: the agent
reports Windows services under the same `unit` kind
systemd units use, and only the UI knows which host
this is. On Windows there is no "not in use" case —
every Windows host has a service controller — so a
failure is the only thing worth saying. */}
{data.systemd_error ? (
<p className="text-warning">systemd could not be read: {data.systemd_error}</p>
) : !data.systemd_ok ? (
<p className="text-warning">
{isWindows ? "Windows services could not be read: " : "systemd could not be read: "}
{data.systemd_error}
</p>
) : !data.systemd_ok && !isWindows ? (
<p className="text-text-secondary">systemd is not in use on this server.</p>
) : null}
</div>
+1
View File
@@ -14,6 +14,7 @@ export interface Inventory {
swap_used_bytes: number;
partitions?: { device: string; mountpoint: string; fstype?: string; total_bytes: number; used_bytes: number }[];
kernel?: string;
reboot_required?: boolean;
metrics_at?: string;
static_at?: string;
}