Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Refine Docker platform runtime presentation

rcourtman29b8d5161d51
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 4bbf218a9a..c7b3ddb880 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -117,6 +117,11 @@ cross-source deduplication.
## Shared Boundaries
+Docker platform navigation is a unified-resource consumer boundary: Docker
+subtabs may be shown only from canonical resource evidence (`app-container` for
+containers, `docker-service` for Swarm services), and inactive standalone
+Swarm metadata must not be interpreted as host-role or service-surface proof.
+
1. `frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts` shared with `performance-and-scalability`: the infrastructure selector pipeline is both a canonical unified-resource consumer surface and a fleet-scale performance hot-path boundary.
2. `frontend-modern/src/components/Infrastructure/InfrastructureSummary.tsx` shared with `performance-and-scalability`: the infrastructure summary surface is both a canonical unified-resource consumer and a fleet-scale summary chart hot-path boundary.
3. `frontend-modern/src/components/Infrastructure/infrastructureSummaryModel.ts` shared with `performance-and-scalability`: infrastructure summary chart matching, focused-summary view derivation, and metric-series shaping are both a canonical unified-resource consumer surface and a fleet-scale summary chart hot-path boundary.
@@ -1764,6 +1769,17 @@ Unsupported secondary tabs now also use the same terse availability notices
(`PMG resources only.`, `Kubernetes clusters only.`, `Docker runtimes with
Swarm only.`) instead of explanatory sentences, so mismatch fallback state
stays readable without turning support surfaces into inline documentation.
+Docker platform subtabs now follow canonical resource evidence as well:
+`Containers` is visible only when Docker/Podman app-container resources exist,
+and `Swarm services` is visible only when canonical `docker-service` resources
+exist. Inactive standalone Docker Swarm metadata is not a tab, host role, or
+service-surface signal.
+The frontend Docker facet contract covers both host runtime telemetry and
+Swarm service projection. Host resources may expose runtime/version, OS,
+temperature, uptime, container counts, update state, command metadata, and
+Swarm local-state/control evidence through `ResourceDockerMeta`; Docker
+platform pages must consume those canonical fields rather than keeping
+page-local host-runtime shape aliases.
The same facet bundle now also returns grouped recent-change counts by
canonical change kind, so the detail drawer can surface the distribution of
state transitions, restarts, config updates, and anomalies without
diff --git a/frontend-modern/src/features/docker/DockerHostsTable.tsx b/frontend-modern/src/features/docker/DockerHostsTable.tsx
index 8433e5e4a8..371effa65c 100644
--- a/frontend-modern/src/features/docker/DockerHostsTable.tsx
+++ b/frontend-modern/src/features/docker/DockerHostsTable.tsx
@@ -1,4 +1,4 @@
-import { For, Show, type Component, type JSX } from 'solid-js';
+import { For, Show, createMemo, type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { ResponsiveMetricCell } from '@/components/shared/responsive';
import { TableCard } from '@/components/shared/TableCard';
@@ -17,6 +17,10 @@ import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import { normalizeDiskArray } from '@/utils/format';
import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';
+import {
+ getInfrastructureSystemIdentityBadges,
+ type ResourceBadge,
+} from '@/utils/resourceBadgePresentation';
import {
PLATFORM_TABLE_BODY_CLASS,
PLATFORM_TABLE_CARD_CLASS,
@@ -32,6 +36,7 @@ import {
} from '@/features/platformPage/sharedPlatformPage';
import type { Disk } from '@/types/api';
import type { Resource } from '@/types/resource';
+import { hasDockerSwarmEvidence } from './dockerPageModel';
// Docker / Podman hosts are container hosts, not generic Pulse Agents.
// The operator columns that matter are runtime version, container count,
@@ -93,6 +98,13 @@ const aggregateDiskFor = (host: Resource): Disk | undefined => {
return { total, used, free, usage };
};
+const RUNTIME_ONLY_SYSTEM_LABELS = new Set(['docker', 'docker / podman', 'podman']);
+
+const hostSystemBadgeFor = (host: Resource): ResourceBadge | undefined =>
+ getInfrastructureSystemIdentityBadges(host).find(
+ (badge) => !RUNTIME_ONLY_SYSTEM_LABELS.has(badge.label.trim().toLowerCase()),
+ );
+
export const DockerHostsTable: Component<{
resources: Resource[];
emptyIcon: JSX.Element;
@@ -106,6 +118,7 @@ export const DockerHostsTable: Component<{
initialStatus: 'all' as PlatformResourceStatusFilter,
filter: filterPlatformResources,
});
+ const showSwarmColumn = createMemo(() => props.resources.some(hasDockerSwarmEvidence));
return (
<Show
@@ -145,28 +158,42 @@ export const DockerHostsTable: Component<{
>
<TableCard class={PLATFORM_TABLE_CARD_CLASS}>
<TableCardHeader title={props.title ?? 'Hosts'} />
- <Table class="min-w-full table-fixed text-xs md:min-w-[960px]">
+ <Table class="min-w-full table-fixed text-xs md:min-w-[1080px]">
<TableHeader>
<TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}>
- <TableHead class={getPlatformTableHeadClass()}>Host</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} w-[40%] md:w-auto`}>
+ Host
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ System
+ </TableHead>
<TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
Version
</TableHead>
<TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
Containers
</TableHead>
- <TableHead class={getPlatformTableHeadClass('right')}>CPU</TableHead>
- <TableHead class={getPlatformTableHeadClass('right')}>Memory</TableHead>
- <TableHead class={getPlatformTableHeadClass('right')}>Disk</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} w-[20%] md:w-auto`}>
+ CPU
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} w-[20%] md:w-auto`}>
+ <span class="md:hidden">Mem</span>
+ <span class="hidden md:inline">Memory</span>
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} w-[20%] md:w-auto`}>
+ Disk
+ </TableHead>
<TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
Uptime
</TableHead>
<TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
Temp
</TableHead>
- <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
- Swarm role
- </TableHead>
+ <Show when={showSwarmColumn()}>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Swarm role
+ </TableHead>
+ </Show>
</TableRow>
</TableHeader>
<TableBody class={PLATFORM_TABLE_BODY_CLASS}>
@@ -184,9 +211,11 @@ export const DockerHostsTable: Component<{
})
| undefined;
const name = () => asTrimmedString(host.name) || host.id;
+ const systemBadge = () => hostSystemBadgeFor(host);
const version = () => asTrimmedString(docker()?.runtimeVersion) || '—';
const containerCount = () => docker()?.containerCount ?? 0;
const swarmRole = () => {
+ if (!hasDockerSwarmEvidence(host)) return '—';
const role = asTrimmedString(docker()?.swarm?.nodeRole);
return role ? role.charAt(0).toUpperCase() + role.slice(1) : '—';
};
@@ -205,7 +234,7 @@ export const DockerHostsTable: Component<{
aggregateDisk() !== undefined || (disks()?.length ?? 0) > 0;
return (
<TableRow class="text-[11px] sm:text-xs">
- <TableCell class={getPlatformTableCellClass()}>
+ <TableCell class={`${getPlatformTableCellClass()} w-[40%] md:w-auto`}>
<div class="flex min-w-0 items-center gap-2">
<StatusDot
size="sm"
@@ -217,6 +246,33 @@ export const DockerHostsTable: Component<{
{name()}
</span>
</div>
+ <Show when={systemBadge()}>
+ {(badge) => (
+ <span
+ class="mt-0.5 block truncate pl-5 text-[9px] text-muted sm:text-[10px] md:hidden"
+ title={badge().title ?? badge().label}
+ >
+ {badge().label}
+ </span>
+ )}
+ </Show>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ <Show
+ when={systemBadge()}
+ fallback={<span class="text-muted">—</span>}
+ >
+ {(badge) => (
+ <span
+ class={badge().classes}
+ title={badge().title ?? badge().label}
+ >
+ {badge().label}
+ </span>
+ )}
+ </Show>
</TableCell>
<TableCell
class={`${getPlatformTableCellClass()} hidden font-mono text-[11px] text-base-content md:table-cell`}
@@ -228,7 +284,9 @@ export const DockerHostsTable: Component<{
>
{containerCount()}
</TableCell>
- <TableCell class={getPlatformTableCellClass('right')}>
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} w-[20%] md:w-auto`}
+ >
<ResponsiveMetricCell
class="w-full"
value={cpuPercent() ?? 0}
@@ -238,7 +296,9 @@ export const DockerHostsTable: Component<{
showMobile={false}
/>
</TableCell>
- <TableCell class={getPlatformTableCellClass('right')}>
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} w-[20%] md:w-auto`}
+ >
<Show
when={canRenderMetrics() && hasMemoryMetric()}
fallback={metricFallback()}
@@ -250,7 +310,9 @@ export const DockerHostsTable: Component<{
/>
</Show>
</TableCell>
- <TableCell class={getPlatformTableCellClass('right')}>
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} w-[20%] md:w-auto`}
+ >
<Show
when={canRenderMetrics() && hasDiskMetric()}
fallback={metricFallback()}
@@ -272,11 +334,13 @@ export const DockerHostsTable: Component<{
>
{formatTemperature(host.temperature ?? docker()?.temperature)}
</TableCell>
- <TableCell
- class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
- >
- {swarmRole()}
- </TableCell>
+ <Show when={showSwarmColumn()}>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ {swarmRole()}
+ </TableCell>
+ </Show>
</TableRow>
);
}}
diff --git a/frontend-modern/src/features/docker/DockerPageSurface.tsx b/frontend-modern/src/features/docker/DockerPageSurface.tsx
index 6de70687f3..7c0b64564d 100644
--- a/frontend-modern/src/features/docker/DockerPageSurface.tsx
+++ b/frontend-modern/src/features/docker/DockerPageSurface.tsx
@@ -10,7 +10,12 @@ import {
} from '@/features/platformPage/sharedPlatformPage';
import { DockerHostsTable } from './DockerHostsTable';
import { DockerServicesTable } from './DockerServicesTable';
-import { DOCKER_TAB_SPECS, buildDockerPageModel, type DockerPageTabId } from './dockerPageModel';
+import {
+ DOCKER_TAB_SPECS,
+ buildDockerPageModel,
+ buildVisibleDockerTabSpecs,
+ type DockerPageTabId,
+} from './dockerPageModel';
const DOCKER_RESOURCE_QUERY = 'type=agent,docker-host,app-container,docker-service';
const DOCKER_PLATFORM_FILTER = 'docker';
@@ -25,16 +30,21 @@ export function DockerPageSurface() {
cacheKey: 'docker-workspace',
initialHydration: 'prefer-ws-then-rest',
});
+ const model = createMemo(() => buildDockerPageModel(resources()));
+ const visibleTabs = createMemo(() => buildVisibleDockerTabSpecs(model()));
+ const visibleTabIds = createMemo(
+ () => new Set<DockerPageTabId>(visibleTabs().map((tab) => tab.id)),
+ );
const activeTab = createMemo<DockerPageTabId>(() => {
const segment = location.pathname.split('/').filter(Boolean)[1] as DockerPageTabId | undefined;
- return segment && VALID_TABS.has(segment) ? segment : 'overview';
+ if (!segment || !VALID_TABS.has(segment)) return 'overview';
+ return visibleTabIds().has(segment) ? segment : 'overview';
});
- const model = createMemo(() => buildDockerPageModel(resources()));
return (
<div data-testid="docker-page" class="space-y-3">
<PlatformSectionTabs
- tabs={DOCKER_TAB_SPECS}
+ tabs={visibleTabs()}
active={activeTab()}
ariaLabel="Docker sections"
/>
diff --git a/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx b/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx
index 39214eb006..7b11ae3223 100644
--- a/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx
+++ b/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx
@@ -87,6 +87,8 @@ describe('DockerHostsTable', () => {
));
expect(screen.getByRole('columnheader', { name: 'Version' })).toBeInTheDocument();
+ expect(screen.getByRole('columnheader', { name: 'System' })).toBeInTheDocument();
+ expect(screen.queryByRole('columnheader', { name: 'Swarm role' })).not.toBeInTheDocument();
expect(screen.queryByRole('columnheader', { name: 'Runtime' })).not.toBeInTheDocument();
expect(screen.getByText('27.5.1')).toBeInTheDocument();
expect(screen.queryByText('Docker')).not.toBeInTheDocument();
@@ -97,6 +99,100 @@ describe('DockerHostsTable', () => {
expect(screen.getByTestId('stacked-disk-bar')).toHaveAttribute('data-disks', '2');
});
+ it('identifies the host system separately from the container runtime', () => {
+ render(() => (
+ <DockerHostsTable
+ resources={[
+ makeDockerHost({
+ name: 'tower',
+ agent: {
+ hostProfile: 'unraid',
+ osName: 'Unraid OS',
+ osVersion: '6.12.10',
+ },
+ }),
+ makeDockerHost({
+ id: 'agent:qnap-01',
+ name: 'qnap-01',
+ agent: {
+ platform: 'linux',
+ osName: 'QuTS hero',
+ osVersion: '5.2',
+ },
+ }),
+ ]}
+ emptyIcon={<span />}
+ emptyTitle="No Docker hosts"
+ emptyDescription="No hosts"
+ showToolbar={false}
+ />
+ ));
+
+ expect(screen.getAllByText('Unraid 6.12.10').length).toBeGreaterThan(0);
+ expect(screen.getAllByText('QNAP 5.2').length).toBeGreaterThan(0);
+ expect(screen.queryByText('Docker / Podman')).not.toBeInTheDocument();
+ });
+
+ it('shows Swarm role only for hosts with active Swarm evidence', () => {
+ render(() => (
+ <DockerHostsTable
+ resources={[
+ makeDockerHost({
+ docker: {
+ runtimeVersion: '27.5.1',
+ containerCount: 12,
+ swarm: {
+ nodeId: 'node-1',
+ nodeRole: 'manager',
+ localState: 'active',
+ },
+ } as NonNullable<Resource['docker']> & {
+ runtimeVersion?: string;
+ containerCount?: number;
+ },
+ }),
+ ]}
+ emptyIcon={<span />}
+ emptyTitle="No Docker hosts"
+ emptyDescription="No hosts"
+ showToolbar={false}
+ />
+ ));
+
+ expect(screen.getByRole('columnheader', { name: 'Swarm role' })).toBeInTheDocument();
+ expect(screen.getByText('Manager')).toBeInTheDocument();
+ });
+
+ it('does not show inactive standalone Swarm metadata as a host role', () => {
+ render(() => (
+ <DockerHostsTable
+ resources={[
+ makeDockerHost({
+ docker: {
+ runtimeVersion: '27.5.1',
+ containerCount: 12,
+ swarm: {
+ nodeRole: 'worker',
+ localState: 'inactive',
+ scope: 'node',
+ },
+ } as NonNullable<Resource['docker']> & {
+ runtimeVersion?: string;
+ containerCount?: number;
+ },
+ }),
+ ]}
+ emptyIcon={<span />}
+ emptyTitle="No Docker hosts"
+ emptyDescription="No hosts"
+ showToolbar={false}
+ />
+ ));
+
+ expect(screen.queryByRole('columnheader', { name: 'Swarm role' })).not.toBeInTheDocument();
+ expect(screen.queryByText('Worker')).not.toBeInTheDocument();
+ });
+
it('uses percent-only memory and aggregate disk bars when capacity details are missing', () => {
render(() => (
<DockerHostsTable
diff --git a/frontend-modern/src/features/docker/__tests__/dockerPageModel.test.ts b/frontend-modern/src/features/docker/__tests__/dockerPageModel.test.ts
index 86e407a3e9..b14afa680d 100644
--- a/frontend-modern/src/features/docker/__tests__/dockerPageModel.test.ts
+++ b/frontend-modern/src/features/docker/__tests__/dockerPageModel.test.ts
@@ -1,6 +1,11 @@
import { describe, expect, it } from 'vitest';
import type { Resource } from '@/types/resource';
-import { DOCKER_TAB_SPECS, buildDockerPageModel } from '../dockerPageModel';
+import {
+ DOCKER_TAB_SPECS,
+ buildDockerPageModel,
+ buildVisibleDockerTabSpecs,
+ hasDockerSwarmEvidence,
+} from '../dockerPageModel';
const makeResource = (resource: Partial<Resource> & Pick<Resource, 'id' | 'type'>): Resource => ({
name: resource.id,
@@ -57,4 +62,64 @@ describe('dockerPageModel', () => {
expect(model.hosts).toEqual([]);
expect(model.resources).toEqual([]);
});
+
+ it('shows Docker subtabs only when canonical resource evidence exists', () => {
+ expect(
+ buildVisibleDockerTabSpecs(
+ buildDockerPageModel([makeResource({ id: 'docker-host-1', type: 'agent' })]),
+ ).map((tab) => tab.id),
+ ).toEqual(['overview']);
+
+ expect(
+ buildVisibleDockerTabSpecs(
+ buildDockerPageModel([
+ makeResource({ id: 'docker-host-1', type: 'agent' }),
+ makeResource({ id: 'ctr-1', type: 'app-container' }),
+ ]),
+ ).map((tab) => tab.id),
+ ).toEqual(['overview', 'containers']);
+
+ expect(
+ buildVisibleDockerTabSpecs(
+ buildDockerPageModel([
+ makeResource({ id: 'docker-host-1', type: 'agent' }),
+ makeResource({ id: 'svc-1', type: 'docker-service' }),
+ ]),
+ ).map((tab) => tab.id),
+ ).toEqual(['overview', 'services']);
+ });
+
+ it('does not treat standalone inactive Docker Swarm metadata as Swarm evidence', () => {
+ expect(
+ hasDockerSwarmEvidence(
+ makeResource({
+ id: 'docker-host-1',
+ type: 'agent',
+ docker: {
+ swarm: {
+ nodeRole: 'worker',
+ localState: 'inactive',
+ scope: 'node',
+ },
+ },
+ }),
+ ),
+ ).toBe(false);
+
+ expect(
+ hasDockerSwarmEvidence(
+ makeResource({
+ id: 'docker-host-1',
+ type: 'agent',
+ docker: {
+ swarm: {
+ nodeId: 'node-1',
+ nodeRole: 'manager',
+ localState: 'active',
+ },
+ },
+ }),
+ ),
+ ).toBe(true);
+ });
});
diff --git a/frontend-modern/src/features/docker/dockerPageModel.ts b/frontend-modern/src/features/docker/dockerPageModel.ts
index d0a0d0231c..14cdeea128 100644
--- a/frontend-modern/src/features/docker/dockerPageModel.ts
+++ b/frontend-modern/src/features/docker/dockerPageModel.ts
@@ -19,9 +19,36 @@ const DOCKER_HOST_TYPES = new Set<ResourceType>(['agent', 'docker-host']);
const DOCKER_CONTAINER_TYPES = new Set<ResourceType>(['app-container']);
const DOCKER_SERVICE_TYPES = new Set<ResourceType>(['docker-service']);
+const asTrimmedString = (value: unknown): string =>
+ typeof value === 'string' ? value.trim() : '';
+
const isDockerPlatform = (resource: Resource): boolean =>
resolveResourcePlatformType(resource) === 'docker';
+export function hasDockerSwarmEvidence(resource: Resource): boolean {
+ const swarm = resource.docker?.swarm;
+ if (!swarm) return false;
+
+ const localState = asTrimmedString(swarm.localState).toLowerCase();
+ if (localState === 'inactive') {
+ return (
+ swarm.controlAvailable === true ||
+ asTrimmedString(swarm.clusterId) !== '' ||
+ asTrimmedString(swarm.clusterName) !== '' ||
+ asTrimmedString(swarm.error) !== ''
+ );
+ }
+
+ return (
+ asTrimmedString(swarm.nodeId) !== '' ||
+ localState !== '' ||
+ swarm.controlAvailable === true ||
+ asTrimmedString(swarm.clusterId) !== '' ||
+ asTrimmedString(swarm.clusterName) !== '' ||
+ asTrimmedString(swarm.error) !== ''
+ );
+}
+
export type DockerPageModel = {
resources: Resource[];
hosts: Resource[];
@@ -54,3 +81,16 @@ export function buildDockerPageModel(resources: Resource[]): DockerPageModel {
services,
};
}
+
+export function buildVisibleDockerTabSpecs(model: DockerPageModel): DockerTabSpec[] {
+ const visible = new Set<DockerPageTabId>(['overview']);
+
+ if (model.containers.length > 0) {
+ visible.add('containers');
+ }
+ if (model.services.length > 0) {
+ visible.add('services');
+ }
+
+ return DOCKER_TAB_SPECS.filter((tab) => visible.has(tab.id));
+}
diff --git a/frontend-modern/src/types/__tests__/resource.test.ts b/frontend-modern/src/types/__tests__/resource.test.ts
index b58dfaa408..fc010059c9 100644
--- a/frontend-modern/src/types/__tests__/resource.test.ts
+++ b/frontend-modern/src/types/__tests__/resource.test.ts
@@ -12,6 +12,7 @@ import {
getDiskPercent,
type ResourceChangeKind,
type ResourceAgentUnraidDisk,
+ type ResourceDockerMeta,
type ResourcePhysicalDiskMeta,
type ResourceProxmoxMeta,
type ResourceVMwareMeta,
@@ -127,6 +128,40 @@ describe('Resource Type Guards', () => {
});
describe('Resource Helper Functions', () => {
+ describe('ResourceDockerMeta', () => {
+ it('accepts Docker host runtime and Swarm evidence in the canonical resource contract', () => {
+ const docker: ResourceDockerMeta = {
+ hostname: 'tower',
+ runtime: 'docker',
+ runtimeVersion: '27.5.1',
+ dockerVersion: '27.5.1',
+ os: 'Unraid OS',
+ kernelVersion: 'Linux 6.1.106-Unraid',
+ architecture: 'x86_64',
+ agentVersion: '6.0.0',
+ uptimeSeconds: 13_046_400,
+ temperature: 51.9,
+ containerCount: 12,
+ updatesAvailableCount: 2,
+ updatesLastCheckedAt: '2026-05-17T18:00:00Z',
+ command: { restartContainer: true },
+ swarm: {
+ clusterId: 'swarm-1',
+ clusterName: 'homelab',
+ nodeId: 'node-1',
+ nodeRole: 'manager',
+ localState: 'active',
+ controlAvailable: true,
+ },
+ };
+
+ expect(docker.runtimeVersion).toBe('27.5.1');
+ expect(docker.containerCount).toBe(12);
+ expect(docker.swarm?.localState).toBe('active');
+ expect(docker.swarm?.controlAvailable).toBe(true);
+ });
+ });
+
describe('ResourceAgentUnraidDisk', () => {
it('accepts native Unraid disk metadata in the resource contract', () => {
const disk: ResourceAgentUnraidDisk = {
diff --git a/frontend-modern/src/types/resource.ts b/frontend-modern/src/types/resource.ts
index 803e6e3f88..305579f543 100644
--- a/frontend-modern/src/types/resource.ts
+++ b/frontend-modern/src/types/resource.ts
@@ -526,16 +526,27 @@ export interface ResourceProxmoxMeta {
kernelVersion?: string;
}
-// Docker Swarm service projection emitted by the canonical adapter for
-// `docker-service` resources. Surfaced on the Docker platform-page Swarm
-// services table where the generic infrastructure table's CPU / Memory /
-// Disk / Disk I/O / Uptime / Temperature columns are conceptually N/A
-// (services are cluster-scoped declarations, not running processes);
-// image, mode, replica counts, and ports are the operator columns.
+// Docker runtime and Swarm service projection emitted by the canonical
+// adapter. Host resources use the runtime fields on the Docker platform
+// hosts table; `docker-service` resources use the service fields on the
+// Swarm services table.
export interface ResourceDockerMeta {
serviceId?: string;
hostSourceId?: string;
hostname?: string;
+ temperature?: number;
+ runtime?: string;
+ runtimeVersion?: string;
+ dockerVersion?: string;
+ os?: string;
+ kernelVersion?: string;
+ architecture?: string;
+ agentVersion?: string;
+ uptimeSeconds?: number;
+ containerCount?: number;
+ updatesAvailableCount?: number;
+ updatesLastCheckedAt?: string;
+ command?: Record<string, unknown>;
image?: string;
mode?: string;
desiredTasks?: number;
@@ -552,7 +563,10 @@ export interface ResourceDockerMeta {
clusterName?: string;
nodeId?: string;
nodeRole?: string;
+ localState?: string;
+ controlAvailable?: boolean;
scope?: string;
+ error?: string;
};
}