feat: Word the workload and update panels for Windows servers
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user