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.

Unify platform overview table layout

rcourtman6ef06e48ef91
diff --git a/frontend-modern/src/features/docker/DockerHostsTable.tsx b/frontend-modern/src/features/docker/DockerHostsTable.tsx
index ba33235d74..ffb8673f38 100644
--- a/frontend-modern/src/features/docker/DockerHostsTable.tsx
+++ b/frontend-modern/src/features/docker/DockerHostsTable.tsx
@@ -1,9 +1,9 @@
import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { EmptyState } from '@/components/shared/EmptyState';
import { FilterButtonGroup, type FilterOption } from '@/components/shared/FilterButtonGroup';
import { SearchInput } from '@/components/shared/SearchInput';
import { StatusDot } from '@/components/shared/StatusDot';
+import { TableCard } from '@/components/shared/TableCard';
+import { TableCardHeader } from '@/components/shared/TableCardHeader';
import {
Table,
TableBody,
@@ -15,7 +15,13 @@ import {
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PLATFORM_TABLE_BODY_CLASS,
+ PLATFORM_TABLE_CARD_CLASS,
+ PLATFORM_TABLE_HEADER_ROW_CLASS,
+ PlatformTableEmptyState,
filterPlatformResources,
+ getPlatformTableCellClass,
+ getPlatformTableHeadClass,
type PlatformResourceStatusFilter,
} from '@/features/platformPage/sharedPlatformPage';
import type { Resource } from '@/types/resource';
@@ -37,7 +43,8 @@ const STATUS_FILTER_OPTIONS: FilterOption<PlatformResourceStatusFilter>[] = [
];
const formatPercent = (percent?: number): JSX.Element => {
- if (typeof percent !== 'number' || Number.isNaN(percent)) return <span class="text-muted">—</span>;
+ if (typeof percent !== 'number' || Number.isNaN(percent))
+ return <span class="text-muted">—</span>;
return <span class="tabular-nums">{percent.toFixed(1)}%</span>;
};
@@ -68,6 +75,8 @@ export const DockerHostsTable: Component<{
emptyIcon: JSX.Element;
emptyTitle: string;
emptyDescription: string;
+ title?: string;
+ showToolbar?: boolean;
}> = (props) => {
const [search, setSearch] = createSignal('');
const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');
@@ -80,76 +89,85 @@ export const DockerHostsTable: Component<{
<Show
when={props.resources.length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title={props.emptyTitle}
- description={props.emptyDescription}
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title={props.emptyTitle}
+ description={props.emptyDescription}
+ />
}
>
<div class="space-y-3">
- <div class="flex flex-wrap items-center gap-2">
- <div class="min-w-[200px] flex-1 sm:max-w-xs">
- <SearchInput
- value={search}
- onChange={setSearch}
- placeholder="Search Docker hosts"
+ <Show when={props.showToolbar !== false}>
+ <div class="flex flex-wrap items-center gap-2">
+ <div class="min-w-[200px] flex-1 sm:max-w-xs">
+ <SearchInput value={search} onChange={setSearch} placeholder="Search Docker hosts" />
+ </div>
+ <FilterButtonGroup
+ options={STATUS_FILTER_OPTIONS}
+ value={status()}
+ onChange={setStatus}
/>
+ <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
+ <Show when={visible() !== total()} fallback={<>{total()} hosts</>}>
+ {visible()} of {total()} hosts
+ </Show>
+ </span>
</div>
- <FilterButtonGroup
- options={STATUS_FILTER_OPTIONS}
- value={status()}
- onChange={setStatus}
- />
- <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
- <Show when={visible() !== total()} fallback={<>{total()} hosts</>}>
- {visible()} of {total()} hosts
- </Show>
- </span>
- </div>
+ </Show>
<Show
when={filtered().length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title="No hosts match current filters"
- description="Adjust the search or status filter to see more hosts."
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title="No hosts match current filters"
+ description="Adjust the search or status filter to see more hosts."
+ />
}
>
- <Card padding="none" tone="card" class="overflow-hidden">
- <Table class="w-full min-w-[940px] border-collapse text-xs">
- <TableHeader class="bg-surface-alt text-muted border-b border-border">
- <TableRow class="text-left text-[10px] uppercase tracking-wide">
- <TableHead class="px-3 py-2 font-medium">Host</TableHead>
- <TableHead class="px-3 py-2 font-medium">Runtime</TableHead>
- <TableHead class="px-3 py-2 font-medium">Version</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Containers</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">CPU</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Memory</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Uptime</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Temp</TableHead>
- <TableHead class="px-3 py-2 font-medium">Swarm role</TableHead>
+ <TableCard class={PLATFORM_TABLE_CARD_CLASS}>
+ <TableCardHeader title={props.title ?? 'Hosts'} />
+ <Table class="min-w-full table-fixed text-xs md:min-w-[1040px]">
+ <TableHeader>
+ <TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}>
+ <TableHead class={getPlatformTableHeadClass()}>Host</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Runtime
+ </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')} 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>
</TableRow>
</TableHeader>
- <TableBody class="divide-y divide-border-subtle">
+ <TableBody class={PLATFORM_TABLE_BODY_CLASS}>
<For each={filtered()}>
{(host) => {
- const docker = () => host.docker as
- | (NonNullable<Resource['docker']> & {
- runtime?: string;
- runtimeVersion?: string;
- containerCount?: number;
- uptimeSeconds?: number;
- temperature?: number;
- swarm?: { nodeRole?: string };
- })
- | undefined;
+ const docker = () =>
+ host.docker as
+ | (NonNullable<Resource['docker']> & {
+ runtime?: string;
+ runtimeVersion?: string;
+ containerCount?: number;
+ uptimeSeconds?: number;
+ temperature?: number;
+ swarm?: { nodeRole?: string };
+ })
+ | undefined;
const name = () => asTrimmedString(host.name) || host.id;
const runtime = () => runtimeLabel(docker()?.runtime);
const version = () => asTrimmedString(docker()?.runtimeVersion) || '—';
@@ -160,47 +178,72 @@ export const DockerHostsTable: Component<{
};
const indicator = () => getSimpleStatusIndicator(host.status);
return (
- <TableRow class="hover:bg-surface-hover">
- <TableCell class="px-3 py-2">
- <div class="flex items-center gap-2 min-w-0">
+ <TableRow class="text-[11px] sm:text-xs">
+ <TableCell class={getPlatformTableCellClass()}>
+ <div class="flex min-w-0 items-center gap-2">
<StatusDot
size="sm"
variant={indicator().variant}
title={host.status || 'unknown'}
ariaHidden
/>
- <span class="font-semibold text-base-content truncate" title={name()}>
+ <span class="truncate font-semibold text-base-content" title={name()}>
{name()}
</span>
</div>
</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{runtime()}</TableCell>
- <TableCell class="px-3 py-2 text-base-content font-mono text-[11px]">
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ {runtime()}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden font-mono text-[11px] text-base-content md:table-cell`}
+ >
{version()}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content tabular-nums">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content tabular-nums md:table-cell`}
+ >
{containerCount()}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
{formatPercent(host.cpu?.current)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
{formatPercent(host.memory?.current)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
+ {formatPercent(host.disk?.current)}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content md:table-cell`}
+ >
{formatUptime(host.uptime ?? docker()?.uptimeSeconds)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content md:table-cell`}
+ >
{formatTemperature(host.temperature ?? docker()?.temperature)}
</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{swarmRole()}</TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ {swarmRole()}
+ </TableCell>
</TableRow>
);
}}
</For>
</TableBody>
</Table>
- </Card>
+ </TableCard>
</Show>
</div>
</Show>
diff --git a/frontend-modern/src/features/docker/DockerPageSurface.tsx b/frontend-modern/src/features/docker/DockerPageSurface.tsx
index fa51320a8c..6de70687f3 100644
--- a/frontend-modern/src/features/docker/DockerPageSurface.tsx
+++ b/frontend-modern/src/features/docker/DockerPageSurface.tsx
@@ -10,11 +10,7 @@ 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, type DockerPageTabId } from './dockerPageModel';
const DOCKER_RESOURCE_QUERY = 'type=agent,docker-host,app-container,docker-service';
const DOCKER_PLATFORM_FILTER = 'docker';
@@ -74,12 +70,36 @@ export function DockerPageSurface() {
}
>
<Show when={activeTab() === 'overview'}>
- <DockerHostsTable
- resources={model().hosts}
- emptyIcon={dockerIcon()}
- emptyTitle="No Docker hosts"
- emptyDescription="Container hosts appear here once a Pulse agent registers them."
- />
+ <div class="space-y-4">
+ <DockerHostsTable
+ resources={model().hosts}
+ emptyIcon={dockerIcon()}
+ emptyTitle="No Docker hosts"
+ emptyDescription="Container hosts appear here once a Pulse agent registers them."
+ showToolbar={false}
+ />
+ <WorkloadsSurface
+ vms={[]}
+ containers={[]}
+ nodes={[]}
+ useWorkloads
+ embedded
+ tableOnly
+ showFilterToolbar
+ suppressPlatformFilter
+ forcedPlatform={DOCKER_PLATFORM_FILTER}
+ compactGroupHeaders
+ />
+ <Show when={model().services.length > 0}>
+ <DockerServicesTable
+ resources={model().services}
+ emptyIcon={dockerIcon()}
+ emptyTitle="No Swarm services"
+ emptyDescription="Docker Swarm services appear here when a Swarm manager reports them."
+ showToolbar={false}
+ />
+ </Show>
+ </div>
</Show>
<Show when={activeTab() === 'containers'}>
<WorkloadsSurface
diff --git a/frontend-modern/src/features/docker/DockerServicesTable.tsx b/frontend-modern/src/features/docker/DockerServicesTable.tsx
index ff65f7af9b..d64f8b2278 100644
--- a/frontend-modern/src/features/docker/DockerServicesTable.tsx
+++ b/frontend-modern/src/features/docker/DockerServicesTable.tsx
@@ -1,9 +1,9 @@
import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { EmptyState } from '@/components/shared/EmptyState';
import { FilterButtonGroup, type FilterOption } from '@/components/shared/FilterButtonGroup';
import { SearchInput } from '@/components/shared/SearchInput';
import { StatusDot } from '@/components/shared/StatusDot';
+import { TableCard } from '@/components/shared/TableCard';
+import { TableCardHeader } from '@/components/shared/TableCardHeader';
import {
Table,
TableBody,
@@ -15,7 +15,13 @@ import {
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PLATFORM_TABLE_BODY_CLASS,
+ PLATFORM_TABLE_CARD_CLASS,
+ PLATFORM_TABLE_HEADER_ROW_CLASS,
+ PlatformTableEmptyState,
filterPlatformResources,
+ getPlatformTableCellClass,
+ getPlatformTableHeadClass,
type PlatformResourceStatusFilter,
} from '@/features/platformPage/sharedPlatformPage';
import type { Resource } from '@/types/resource';
@@ -37,19 +43,26 @@ const STATUS_FILTER_OPTIONS: FilterOption<PlatformResourceStatusFilter>[] = [
];
const formatPorts = (ports: Resource['docker'] extends infer T ? T : never): string => {
- const entries = (ports as { endpointPorts?: Array<{ publishedPort?: number; targetPort?: number; protocol?: string }> })?.endpointPorts ?? [];
- if (entries.length === 0) return '—';
- return entries
- .map((entry) => {
- const protocol = entry?.protocol ? `/${entry.protocol.toLowerCase()}` : '';
- if (entry?.publishedPort && entry?.targetPort) {
- return `${entry.publishedPort}:${entry.targetPort}${protocol}`;
+ const entries =
+ (
+ ports as {
+ endpointPorts?: Array<{ publishedPort?: number; targetPort?: number; protocol?: string }>;
}
- const single = entry?.publishedPort ?? entry?.targetPort;
- return single ? `${single}${protocol}` : '';
- })
- .filter((part) => part.length > 0)
- .join(', ') || '—';
+ )?.endpointPorts ?? [];
+ if (entries.length === 0) return '—';
+ return (
+ entries
+ .map((entry) => {
+ const protocol = entry?.protocol ? `/${entry.protocol.toLowerCase()}` : '';
+ if (entry?.publishedPort && entry?.targetPort) {
+ return `${entry.publishedPort}:${entry.targetPort}${protocol}`;
+ }
+ const single = entry?.publishedPort ?? entry?.targetPort;
+ return single ? `${single}${protocol}` : '';
+ })
+ .filter((part) => part.length > 0)
+ .join(', ') || '—'
+ );
};
const replicaCount = (value: number | undefined): JSX.Element => (
@@ -61,6 +74,8 @@ export const DockerServicesTable: Component<{
emptyIcon: JSX.Element;
emptyTitle: string;
emptyDescription: string;
+ title?: string;
+ showToolbar?: boolean;
}> = (props) => {
const [search, setSearch] = createSignal('');
const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');
@@ -73,62 +88,69 @@ export const DockerServicesTable: Component<{
<Show
when={props.resources.length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title={props.emptyTitle}
- description={props.emptyDescription}
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title={props.emptyTitle}
+ description={props.emptyDescription}
+ />
}
>
<div class="space-y-3">
- <div class="flex flex-wrap items-center gap-2">
- <div class="min-w-[200px] flex-1 sm:max-w-xs">
- <SearchInput
- value={search}
- onChange={setSearch}
- placeholder="Search Swarm services"
+ <Show when={props.showToolbar !== false}>
+ <div class="flex flex-wrap items-center gap-2">
+ <div class="min-w-[200px] flex-1 sm:max-w-xs">
+ <SearchInput
+ value={search}
+ onChange={setSearch}
+ placeholder="Search Swarm services"
+ />
+ </div>
+ <FilterButtonGroup
+ options={STATUS_FILTER_OPTIONS}
+ value={status()}
+ onChange={setStatus}
/>
+ <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
+ <Show when={visible() !== total()} fallback={<>{total()} services</>}>
+ {visible()} of {total()} services
+ </Show>
+ </span>
</div>
- <FilterButtonGroup
- options={STATUS_FILTER_OPTIONS}
- value={status()}
- onChange={setStatus}
- />
- <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
- <Show when={visible() !== total()} fallback={<>{total()} services</>}>
- {visible()} of {total()} services
- </Show>
- </span>
- </div>
+ </Show>
<Show
when={filtered().length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title="No services match current filters"
- description="Adjust the search or status filter to see more services."
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title="No services match current filters"
+ description="Adjust the search or status filter to see more services."
+ />
}
>
- <Card padding="none" tone="card" class="overflow-hidden">
- <Table class="w-full min-w-[900px] border-collapse text-xs">
- <TableHeader class="bg-surface-alt text-muted border-b border-border">
- <TableRow class="text-left text-[10px] uppercase tracking-wide">
- <TableHead class="px-3 py-2 font-medium">Service</TableHead>
- <TableHead class="px-3 py-2 font-medium">Image</TableHead>
- <TableHead class="px-3 py-2 font-medium">Mode</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Desired</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Running</TableHead>
- <TableHead class="px-3 py-2 font-medium">Ports</TableHead>
- <TableHead class="px-3 py-2 font-medium">Host</TableHead>
+ <TableCard class={PLATFORM_TABLE_CARD_CLASS}>
+ <TableCardHeader title={props.title ?? 'Swarm Services'} />
+ <Table class="min-w-full table-fixed text-xs md:min-w-[900px]">
+ <TableHeader>
+ <TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}>
+ <TableHead class={getPlatformTableHeadClass()}>Service</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Image
+ </TableHead>
+ <TableHead class={getPlatformTableHeadClass()}>Mode</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
+ Desired
+ </TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>Running</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Ports
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Host
+ </TableHead>
</TableRow>
</TableHeader>
- <TableBody class="divide-y divide-border-subtle">
+ <TableBody class={PLATFORM_TABLE_BODY_CLASS}>
<For each={filtered()}>
{(service) => {
const name = () => asTrimmedString(service.name) || service.id;
@@ -137,48 +159,59 @@ export const DockerServicesTable: Component<{
const host = () => asTrimmedString(service.docker?.hostname) || '—';
const indicator = () => getSimpleStatusIndicator(service.status);
return (
- <TableRow class="hover:bg-surface-hover">
- <TableCell class="px-3 py-2">
- <div class="flex items-center gap-2 min-w-0">
+ <TableRow class="text-[11px] sm:text-xs">
+ <TableCell class={getPlatformTableCellClass()}>
+ <div class="flex min-w-0 items-center gap-2">
<StatusDot
size="sm"
variant={indicator().variant}
title={service.status || 'unknown'}
ariaHidden
/>
- <span
- class="font-semibold text-base-content truncate"
- title={name()}
- >
+ <span class="truncate font-semibold text-base-content" title={name()}>
{name()}
</span>
</div>
</TableCell>
- <TableCell class="px-3 py-2 text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
<span class="truncate inline-block max-w-[18rem]" title={image()}>
{image()}
</span>
</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{mode()}</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell class={`${getPlatformTableCellClass()} text-base-content`}>
+ {mode()}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content md:table-cell`}
+ >
{replicaCount(service.docker?.desiredTasks)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
{replicaCount(service.docker?.runningTasks)}
</TableCell>
- <TableCell class="px-3 py-2 text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
<span class="font-mono text-[11px]" title={formatPorts(service.docker)}>
{formatPorts(service.docker)}
</span>
</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{host()}</TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ {host()}
+ </TableCell>
</TableRow>
);
}}
</For>
</TableBody>
</Table>
- </Card>
+ </TableCard>
</Show>
</div>
</Show>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesClustersTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesClustersTable.tsx
index 8b72b817c9..a530c283c7 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesClustersTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesClustersTable.tsx
@@ -1,9 +1,9 @@
import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { EmptyState } from '@/components/shared/EmptyState';
import { FilterButtonGroup, type FilterOption } from '@/components/shared/FilterButtonGroup';
import { SearchInput } from '@/components/shared/SearchInput';
import { StatusDot } from '@/components/shared/StatusDot';
+import { TableCard } from '@/components/shared/TableCard';
+import { TableCardHeader } from '@/components/shared/TableCardHeader';
import {
Table,
TableBody,
@@ -15,7 +15,13 @@ import {
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PLATFORM_TABLE_BODY_CLASS,
+ PLATFORM_TABLE_CARD_CLASS,
+ PLATFORM_TABLE_HEADER_ROW_CLASS,
+ PlatformTableEmptyState,
filterPlatformResources,
+ getPlatformTableCellClass,
+ getPlatformTableHeadClass,
type PlatformResourceStatusFilter,
} from '@/features/platformPage/sharedPlatformPage';
import type { Resource } from '@/types/resource';
@@ -38,7 +44,8 @@ const STATUS_FILTER_OPTIONS: FilterOption<PlatformResourceStatusFilter>[] = [
];
const formatPercent = (percent?: number): JSX.Element => {
- if (typeof percent !== 'number' || Number.isNaN(percent)) return <span class="text-muted">—</span>;
+ if (typeof percent !== 'number' || Number.isNaN(percent))
+ return <span class="text-muted">—</span>;
return <span class="tabular-nums">{percent.toFixed(1)}%</span>;
};
@@ -51,6 +58,8 @@ export const KubernetesClustersTable: Component<{
emptyIcon: JSX.Element;
emptyTitle: string;
emptyDescription: string;
+ title?: string;
+ showToolbar?: boolean;
}> = (props) => {
const [search, setSearch] = createSignal('');
const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');
@@ -86,7 +95,8 @@ export const KubernetesClustersTable: Component<{
}
if (!bucket) continue;
if (resource.type === 'k8s-node') bucket.nodes += 1;
- else if (resource.type === 'agent' && resource.sources?.includes('kubernetes')) bucket.nodes += 1;
+ else if (resource.type === 'agent' && resource.sources?.includes('kubernetes'))
+ bucket.nodes += 1;
else if (resource.type === 'pod') bucket.pods += 1;
else if (resource.type === 'k8s-deployment') bucket.deployments += 1;
}
@@ -99,63 +109,66 @@ export const KubernetesClustersTable: Component<{
<Show
when={props.clusters.length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title={props.emptyTitle}
- description={props.emptyDescription}
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title={props.emptyTitle}
+ description={props.emptyDescription}
+ />
}
>
<div class="space-y-3">
- <div class="flex flex-wrap items-center gap-2">
- <div class="min-w-[200px] flex-1 sm:max-w-xs">
- <SearchInput
- value={search}
- onChange={setSearch}
- placeholder="Search clusters"
+ <Show when={props.showToolbar !== false}>
+ <div class="flex flex-wrap items-center gap-2">
+ <div class="min-w-[200px] flex-1 sm:max-w-xs">
+ <SearchInput value={search} onChange={setSearch} placeholder="Search clusters" />
+ </div>
+ <FilterButtonGroup
+ options={STATUS_FILTER_OPTIONS}
+ value={status()}
+ onChange={setStatus}
/>
+ <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
+ <Show when={visible() !== total()} fallback={<>{total()} clusters</>}>
+ {visible()} of {total()} clusters
+ </Show>
+ </span>
</div>
- <FilterButtonGroup
- options={STATUS_FILTER_OPTIONS}
- value={status()}
- onChange={setStatus}
- />
- <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
- <Show when={visible() !== total()} fallback={<>{total()} clusters</>}>
- {visible()} of {total()} clusters
- </Show>
- </span>
- </div>
+ </Show>
<Show
when={filtered().length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title="No clusters match current filters"
- description="Adjust the search or status filter to see more clusters."
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title="No clusters match current filters"
+ description="Adjust the search or status filter to see more clusters."
+ />
}
>
- <Card padding="none" tone="card" class="overflow-hidden">
- <Table class="w-full min-w-[860px] border-collapse text-xs">
- <TableHeader class="bg-surface-alt text-muted border-b border-border">
- <TableRow class="text-left text-[10px] uppercase tracking-wide">
- <TableHead class="px-3 py-2 font-medium">Cluster</TableHead>
- <TableHead class="px-3 py-2 font-medium">Context</TableHead>
- <TableHead class="px-3 py-2 font-medium">Version</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Nodes</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Pods</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Deployments</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">CPU</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Memory</TableHead>
+ <TableCard class={PLATFORM_TABLE_CARD_CLASS}>
+ <TableCardHeader title={props.title ?? 'Clusters'} />
+ <Table class="min-w-full table-fixed text-xs md:min-w-[860px]">
+ <TableHeader>
+ <TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}>
+ <TableHead class={getPlatformTableHeadClass()}>Cluster</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Context
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Version
+ </TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>Nodes</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
+ Pods
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
+ Deployments
+ </TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>CPU</TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>Memory</TableHead>
</TableRow>
</TableHeader>
- <TableBody class="divide-y divide-border-subtle">
+ <TableBody class={PLATFORM_TABLE_BODY_CLASS}>
<For each={filtered()}>
{(cluster) => {
const name = () =>
@@ -164,40 +177,61 @@ export const KubernetesClustersTable: Component<{
cluster.id;
const context = () => asTrimmedString(cluster.kubernetes?.context) || '—';
const version = () => asTrimmedString(cluster.kubernetes?.version) || '—';
- const counts = () => countsByCluster().get(cluster.id) ?? { nodes: 0, pods: 0, deployments: 0 };
+ const counts = () =>
+ countsByCluster().get(cluster.id) ?? {
+ nodes: 0,
+ pods: 0,
+ deployments: 0,
+ };
const indicator = () => getSimpleStatusIndicator(cluster.status);
return (
- <TableRow class="hover:bg-surface-hover">
- <TableCell class="px-3 py-2">
- <div class="flex items-center gap-2 min-w-0">
+ <TableRow class="text-[11px] sm:text-xs">
+ <TableCell class={getPlatformTableCellClass()}>
+ <div class="flex min-w-0 items-center gap-2">
<StatusDot
size="sm"
variant={indicator().variant}
title={cluster.status || 'unknown'}
ariaHidden
/>
- <span class="font-semibold text-base-content truncate" title={name()}>
+ <span class="truncate font-semibold text-base-content" title={name()}>
{name()}
</span>
</div>
</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{context()}</TableCell>
- <TableCell class="px-3 py-2 text-base-content font-mono text-[11px]">
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ {context()}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden font-mono text-[11px] text-base-content md:table-cell`}
+ >
{version()}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content tabular-nums">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content tabular-nums`}
+ >
{counts().nodes}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content tabular-nums">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content tabular-nums md:table-cell`}
+ >
{counts().pods}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content tabular-nums">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content tabular-nums md:table-cell`}
+ >
{counts().deployments}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
{formatPercent(cluster.cpu?.current)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
{formatPercent(cluster.memory?.current)}
</TableCell>
</TableRow>
@@ -206,7 +240,7 @@ export const KubernetesClustersTable: Component<{
</For>
</TableBody>
</Table>
- </Card>
+ </TableCard>
</Show>
</div>
</Show>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx
index aa83866faa..0e546b4f66 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx
@@ -1,9 +1,9 @@
import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { EmptyState } from '@/components/shared/EmptyState';
import { FilterButtonGroup, type FilterOption } from '@/components/shared/FilterButtonGroup';
import { SearchInput } from '@/components/shared/SearchInput';
import { StatusDot } from '@/components/shared/StatusDot';
+import { TableCard } from '@/components/shared/TableCard';
+import { TableCardHeader } from '@/components/shared/TableCardHeader';
import {
Table,
TableBody,
@@ -15,7 +15,13 @@ import {
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PLATFORM_TABLE_BODY_CLASS,
+ PLATFORM_TABLE_CARD_CLASS,
+ PLATFORM_TABLE_HEADER_ROW_CLASS,
+ PlatformTableEmptyState,
filterPlatformResources,
+ getPlatformTableCellClass,
+ getPlatformTableHeadClass,
type PlatformResourceStatusFilter,
} from '@/features/platformPage/sharedPlatformPage';
import type { Resource } from '@/types/resource';
@@ -44,6 +50,8 @@ export const KubernetesDeploymentsTable: Component<{
emptyIcon: JSX.Element;
emptyTitle: string;
emptyDescription: string;
+ title?: string;
+ showToolbar?: boolean;
}> = (props) => {
const [search, setSearch] = createSignal('');
const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');
@@ -56,62 +64,65 @@ export const KubernetesDeploymentsTable: Component<{
<Show
when={props.resources.length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title={props.emptyTitle}
- description={props.emptyDescription}
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title={props.emptyTitle}
+ description={props.emptyDescription}
+ />
}
>
<div class="space-y-3">
- <div class="flex flex-wrap items-center gap-2">
- <div class="min-w-[200px] flex-1 sm:max-w-xs">
- <SearchInput
- value={search}
- onChange={setSearch}
- placeholder="Search deployments"
+ <Show when={props.showToolbar !== false}>
+ <div class="flex flex-wrap items-center gap-2">
+ <div class="min-w-[200px] flex-1 sm:max-w-xs">
+ <SearchInput value={search} onChange={setSearch} placeholder="Search deployments" />
+ </div>
+ <FilterButtonGroup
+ options={STATUS_FILTER_OPTIONS}
+ value={status()}
+ onChange={setStatus}
/>
+ <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
+ <Show when={visible() !== total()} fallback={<>{total()} deployments</>}>
+ {visible()} of {total()} deployments
+ </Show>
+ </span>
</div>
- <FilterButtonGroup
- options={STATUS_FILTER_OPTIONS}
- value={status()}
- onChange={setStatus}
- />
- <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
- <Show when={visible() !== total()} fallback={<>{total()} deployments</>}>
- {visible()} of {total()} deployments
- </Show>
- </span>
- </div>
+ </Show>
<Show
when={filtered().length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title="No deployments match current filters"
- description="Adjust the search or status filter to see more deployments."
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title="No deployments match current filters"
+ description="Adjust the search or status filter to see more deployments."
+ />
}
>
- <Card padding="none" tone="card" class="overflow-hidden">
- <Table class="w-full min-w-[820px] border-collapse text-xs">
- <TableHeader class="bg-surface-alt text-muted border-b border-border">
- <TableRow class="text-left text-[10px] uppercase tracking-wide">
- <TableHead class="px-3 py-2 font-medium">Deployment</TableHead>
- <TableHead class="px-3 py-2 font-medium">Namespace</TableHead>
- <TableHead class="px-3 py-2 font-medium">Cluster</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Desired</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Updated</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Ready</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Available</TableHead>
+ <TableCard class={PLATFORM_TABLE_CARD_CLASS}>
+ <TableCardHeader title={props.title ?? 'Deployments'} />
+ <Table class="min-w-full table-fixed text-xs md:min-w-[820px]">
+ <TableHeader>
+ <TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}>
+ <TableHead class={getPlatformTableHeadClass()}>Deployment</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Namespace
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Cluster
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
+ Desired
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
+ Updated
+ </TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>Ready</TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>Available</TableHead>
</TableRow>
</TableHeader>
- <TableBody class="divide-y divide-border-subtle">
+ <TableBody class={PLATFORM_TABLE_BODY_CLASS}>
<For each={filtered()}>
{(deployment) => {
const name = () => asTrimmedString(deployment.name) || deployment.id;
@@ -122,35 +133,48 @@ export const KubernetesDeploymentsTable: Component<{
'—';
const indicator = () => getSimpleStatusIndicator(deployment.status);
return (
- <TableRow class="hover:bg-surface-hover">
- <TableCell class="px-3 py-2">
- <div class="flex items-center gap-2 min-w-0">
+ <TableRow class="text-[11px] sm:text-xs">
+ <TableCell class={getPlatformTableCellClass()}>
+ <div class="flex min-w-0 items-center gap-2">
<StatusDot
size="sm"
variant={indicator().variant}
title={deployment.status || 'unknown'}
ariaHidden
/>
- <span
- class="font-semibold text-base-content truncate"
- title={name()}
- >
+ <span class="truncate font-semibold text-base-content" title={name()}>
{name()}
</span>
</div>
</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{ns()}</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{cluster()}</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ {ns()}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ {cluster()}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content md:table-cell`}
+ >
{replicaCount(deployment.kubernetes?.desiredReplicas)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content md:table-cell`}
+ >
{replicaCount(deployment.kubernetes?.updatedReplicas)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
{replicaCount(deployment.kubernetes?.readyReplicas)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
{replicaCount(deployment.kubernetes?.availableReplicas)}
</TableCell>
</TableRow>
@@ -159,7 +183,7 @@ export const KubernetesDeploymentsTable: Component<{
</For>
</TableBody>
</Table>
- </Card>
+ </TableCard>
</Show>
</div>
</Show>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesNodesTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesNodesTable.tsx
index 2b46ceecf1..a44459b26c 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesNodesTable.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesNodesTable.tsx
@@ -1,9 +1,9 @@
import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { EmptyState } from '@/components/shared/EmptyState';
import { FilterButtonGroup, type FilterOption } from '@/components/shared/FilterButtonGroup';
import { SearchInput } from '@/components/shared/SearchInput';
import { StatusDot } from '@/components/shared/StatusDot';
+import { TableCard } from '@/components/shared/TableCard';
+import { TableCardHeader } from '@/components/shared/TableCardHeader';
import {
Table,
TableBody,
@@ -15,7 +15,13 @@ import {
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PLATFORM_TABLE_BODY_CLASS,
+ PLATFORM_TABLE_CARD_CLASS,
+ PLATFORM_TABLE_HEADER_ROW_CLASS,
+ PlatformTableEmptyState,
filterPlatformResources,
+ getPlatformTableCellClass,
+ getPlatformTableHeadClass,
type PlatformResourceStatusFilter,
} from '@/features/platformPage/sharedPlatformPage';
import type { Resource } from '@/types/resource';
@@ -38,7 +44,8 @@ const STATUS_FILTER_OPTIONS: FilterOption<PlatformResourceStatusFilter>[] = [
];
const formatPercent = (percent?: number): JSX.Element => {
- if (typeof percent !== 'number' || Number.isNaN(percent)) return <span class="text-muted">—</span>;
+ if (typeof percent !== 'number' || Number.isNaN(percent))
+ return <span class="text-muted">—</span>;
return <span class="tabular-nums">{percent.toFixed(1)}%</span>;
};
@@ -66,9 +73,7 @@ const formatBytes = (bytes: number | undefined): string => {
const formatRoles = (roles: string[] | undefined): string => {
if (!roles || roles.length === 0) return '—';
- return roles
- .map((role) => role.replace('node-role.kubernetes.io/', ''))
- .join(', ');
+ return roles.map((role) => role.replace('node-role.kubernetes.io/', '')).join(', ');
};
export const KubernetesNodesTable: Component<{
@@ -76,6 +81,8 @@ export const KubernetesNodesTable: Component<{
emptyIcon: JSX.Element;
emptyTitle: string;
emptyDescription: string;
+ title?: string;
+ showToolbar?: boolean;
}> = (props) => {
const [search, setSearch] = createSignal('');
const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');
@@ -88,64 +95,69 @@ export const KubernetesNodesTable: Component<{
<Show
when={props.resources.length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title={props.emptyTitle}
- description={props.emptyDescription}
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title={props.emptyTitle}
+ description={props.emptyDescription}
+ />
}
>
<div class="space-y-3">
- <div class="flex flex-wrap items-center gap-2">
- <div class="min-w-[200px] flex-1 sm:max-w-xs">
- <SearchInput
- value={search}
- onChange={setSearch}
- placeholder="Search nodes"
+ <Show when={props.showToolbar !== false}>
+ <div class="flex flex-wrap items-center gap-2">
+ <div class="min-w-[200px] flex-1 sm:max-w-xs">
+ <SearchInput value={search} onChange={setSearch} placeholder="Search nodes" />
+ </div>
+ <FilterButtonGroup
+ options={STATUS_FILTER_OPTIONS}
+ value={status()}
+ onChange={setStatus}
/>
+ <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
+ <Show when={visible() !== total()} fallback={<>{total()} nodes</>}>
+ {visible()} of {total()} nodes
+ </Show>
+ </span>
</div>
- <FilterButtonGroup
- options={STATUS_FILTER_OPTIONS}
- value={status()}
- onChange={setStatus}
- />
- <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
- <Show when={visible() !== total()} fallback={<>{total()} nodes</>}>
- {visible()} of {total()} nodes
- </Show>
- </span>
- </div>
+ </Show>
<Show
when={filtered().length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title="No nodes match current filters"
- description="Adjust the search or status filter to see more nodes."
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title="No nodes match current filters"
+ description="Adjust the search or status filter to see more nodes."
+ />
}
>
- <Card padding="none" tone="card" class="overflow-hidden">
- <Table class="w-full min-w-[1000px] border-collapse text-xs">
- <TableHeader class="bg-surface-alt text-muted border-b border-border">
- <TableRow class="text-left text-[10px] uppercase tracking-wide">
- <TableHead class="px-3 py-2 font-medium">Node</TableHead>
- <TableHead class="px-3 py-2 font-medium">Cluster</TableHead>
- <TableHead class="px-3 py-2 font-medium">Roles</TableHead>
- <TableHead class="px-3 py-2 font-medium">Kubelet</TableHead>
- <TableHead class="px-3 py-2 font-medium">Runtime</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">CPU</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Memory</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Capacity</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Uptime</TableHead>
+ <TableCard class={PLATFORM_TABLE_CARD_CLASS}>
+ <TableCardHeader title={props.title ?? 'Nodes'} />
+ <Table class="min-w-full table-fixed text-xs md:min-w-[1000px]">
+ <TableHeader>
+ <TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}>
+ <TableHead class={getPlatformTableHeadClass()}>Node</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Cluster
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Roles
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Kubelet
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Runtime
+ </TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>CPU</TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>Memory</TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>Capacity</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
+ Uptime
+ </TableHead>
</TableRow>
</TableHeader>
- <TableBody class="divide-y divide-border-subtle">
+ <TableBody class={PLATFORM_TABLE_BODY_CLASS}>
<For each={filtered()}>
{(node) => {
const meta = () => node.kubernetes;
@@ -164,42 +176,68 @@ export const KubernetesNodesTable: Component<{
if (typeof mem === 'number' && mem > 0) parts.push(formatBytes(mem));
return parts.join(' / ') || '—';
};
+ const compactCapacityLabel = () => {
+ const cores = meta()?.capacityCpuCores;
+ if (typeof cores === 'number' && cores > 0) return `${cores} cores`;
+ return capacityLabel();
+ };
const indicator = () => getSimpleStatusIndicator(node.status);
return (
- <TableRow class="hover:bg-surface-hover">
- <TableCell class="px-3 py-2">
- <div class="flex items-center gap-2 min-w-0">
+ <TableRow class="text-[11px] sm:text-xs">
+ <TableCell class={getPlatformTableCellClass()}>
+ <div class="flex min-w-0 items-center gap-2">
<StatusDot
size="sm"
variant={indicator().variant}
title={node.status || 'unknown'}
ariaHidden
/>
- <span class="font-semibold text-base-content truncate" title={name()}>
+ <span class="truncate font-semibold text-base-content" title={name()}>
{name()}
</span>
</div>
</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{cluster()}</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{formatRoles(meta()?.roles)}</TableCell>
- <TableCell class="px-3 py-2 text-base-content font-mono text-[11px]">
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ {cluster()}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ {formatRoles(meta()?.roles)}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden font-mono text-[11px] text-base-content md:table-cell`}
+ >
{kubelet()}
</TableCell>
- <TableCell class="px-3 py-2 text-base-content font-mono text-[11px]">
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden font-mono text-[11px] text-base-content md:table-cell`}
+ >
<span class="truncate inline-block max-w-[10rem]" title={runtime()}>
{runtime()}
</span>
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
{formatPercent(node.cpu?.current)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
{formatPercent(node.memory?.current)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content tabular-nums">
- {capacityLabel()}
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content tabular-nums`}
+ >
+ <span class="md:hidden">{compactCapacityLabel()}</span>
+ <span class="hidden md:inline">{capacityLabel()}</span>
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content md:table-cell`}
+ >
{formatUptime(node.uptime)}
</TableCell>
</TableRow>
@@ -208,7 +246,7 @@ export const KubernetesNodesTable: Component<{
</For>
</TableBody>
</Table>
- </Card>
+ </TableCard>
</Show>
</div>
</Show>
diff --git a/frontend-modern/src/features/kubernetes/KubernetesPageSurface.tsx b/frontend-modern/src/features/kubernetes/KubernetesPageSurface.tsx
index d472763d8b..da75a9cef2 100644
--- a/frontend-modern/src/features/kubernetes/KubernetesPageSurface.tsx
+++ b/frontend-modern/src/features/kubernetes/KubernetesPageSurface.tsx
@@ -20,8 +20,7 @@ import {
// Include `agent` rows so K8s nodes that the backend registry merged onto
// the linked agent host (sources=['agent','kubernetes']) still appear in the
// Nodes tab; the page model filters them down to those tagged kubernetes.
-const KUBERNETES_RESOURCE_QUERY =
- 'type=k8s-cluster,k8s-node,pod,k8s-deployment,agent';
+const KUBERNETES_RESOURCE_QUERY = 'type=k8s-cluster,k8s-node,pod,k8s-deployment,agent';
const KUBERNETES_PLATFORM_FILTER = 'kubernetes';
const VALID_TABS = new Set<KubernetesPageTabId>(KUBERNETES_TAB_SPECS.map((tab) => tab.id));
@@ -81,13 +80,44 @@ export function KubernetesPageSurface() {
}
>
<Show when={activeTab() === 'overview'}>
- <KubernetesClustersTable
- clusters={model().clusters}
- scope={model().resources}
- emptyIcon={k8sIcon()}
- emptyTitle="No clusters reported"
- emptyDescription="Kubernetes clusters appear here once at least one agent reports cluster context."
- />
+ <div class="space-y-4">
+ <KubernetesClustersTable
+ clusters={model().clusters}
+ scope={model().resources}
+ emptyIcon={k8sIcon()}
+ emptyTitle="No clusters reported"
+ emptyDescription="Kubernetes clusters appear here once at least one agent reports cluster context."
+ showToolbar={false}
+ />
+ <KubernetesNodesTable
+ resources={model().nodes}
+ emptyIcon={k8sIcon()}
+ emptyTitle="No nodes reported"
+ emptyDescription="Kubernetes nodes appear here as soon as the agent enumerates them."
+ showToolbar={false}
+ />
+ <WorkloadsSurface
+ vms={[]}
+ containers={[]}
+ nodes={[]}
+ useWorkloads
+ embedded
+ tableOnly
+ showFilterToolbar
+ suppressPlatformFilter
+ forcedPlatform={KUBERNETES_PLATFORM_FILTER}
+ compactGroupHeaders
+ />
+ <Show when={model().deployments.length > 0}>
+ <KubernetesDeploymentsTable
+ resources={model().deployments}
+ emptyIcon={k8sIcon()}
+ emptyTitle="No deployments reported"
+ emptyDescription="Deployments appear here once the cluster reports them."
+ showToolbar={false}
+ />
+ </Show>
+ </div>
</Show>
<Show when={activeTab() === 'nodes'}>
<KubernetesNodesTable
diff --git a/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts b/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts
new file mode 100644
index 0000000000..265a8471f0
--- /dev/null
+++ b/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts
@@ -0,0 +1,116 @@
+import { describe, expect, it } from 'vitest';
+import dockerHostsTableSource from '@/features/docker/DockerHostsTable.tsx?raw';
+import dockerPageSurfaceSource from '@/features/docker/DockerPageSurface.tsx?raw';
+import dockerServicesTableSource from '@/features/docker/DockerServicesTable.tsx?raw';
+import kubernetesClustersTableSource from '@/features/kubernetes/KubernetesClustersTable.tsx?raw';
+import kubernetesDeploymentsTableSource from '@/features/kubernetes/KubernetesDeploymentsTable.tsx?raw';
+import kubernetesNodesTableSource from '@/features/kubernetes/KubernetesNodesTable.tsx?raw';
+import kubernetesPageSurfaceSource from '@/features/kubernetes/KubernetesPageSurface.tsx?raw';
+import proxmoxNodesTableSource from '@/features/proxmox/ProxmoxNodesTable.tsx?raw';
+import sharedPlatformPageSource from '@/features/platformPage/sharedPlatformPage.tsx?raw';
+import truenasDisksTableSource from '@/features/truenas/TrueNASDisksTable.tsx?raw';
+import truenasPageSurfaceSource from '@/features/truenas/TrueNASPageSurface.tsx?raw';
+import truenasSystemsTableSource from '@/features/truenas/TrueNASSystemsTable.tsx?raw';
+import vmwarePageSurfaceSource from '@/features/vmware/VmwarePageSurface.tsx?raw';
+import vsphereDatastoresTableSource from '@/features/vmware/VsphereDatastoresTable.tsx?raw';
+import vsphereHostsTableSource from '@/features/vmware/VsphereHostsTable.tsx?raw';
+
+const platformTableSources = [
+ proxmoxNodesTableSource,
+ dockerHostsTableSource,
+ dockerServicesTableSource,
+ kubernetesClustersTableSource,
+ kubernetesNodesTableSource,
+ kubernetesDeploymentsTableSource,
+ truenasSystemsTableSource,
+ truenasDisksTableSource,
+ vsphereHostsTableSource,
+ vsphereDatastoresTableSource,
+];
+
+const overviewSurfaceSources = [
+ dockerPageSurfaceSource,
+ kubernetesPageSurfaceSource,
+ truenasPageSurfaceSource,
+ vmwarePageSurfaceSource,
+];
+
+describe('platform overview layout guardrails', () => {
+ it('keeps platform inventory tables on the shared dense table styling contract', () => {
+ expect(sharedPlatformPageSource).toContain('PLATFORM_TABLE_CARD_CLASS');
+ expect(sharedPlatformPageSource).toContain('PLATFORM_TABLE_HEADER_ROW_CLASS');
+ expect(sharedPlatformPageSource).toContain('PLATFORM_TABLE_BODY_CLASS');
+ expect(sharedPlatformPageSource).toContain('getPlatformTableHeadClass');
+ expect(sharedPlatformPageSource).toContain('getPlatformTableCellClass');
+
+ for (const source of platformTableSources) {
+ expect(source).toContain('TableCard');
+ expect(source).toContain('TableCardHeader');
+ expect(source).toContain('PLATFORM_TABLE_CARD_CLASS');
+ expect(source).toContain('PLATFORM_TABLE_HEADER_ROW_CLASS');
+ expect(source).toContain('PLATFORM_TABLE_BODY_CLASS');
+ expect(source).toContain('getPlatformTableHeadClass');
+ expect(source).toContain('getPlatformTableCellClass');
+ }
+ });
+
+ it('keeps provider overview pages in the parent-table plus child-inventory stack', () => {
+ for (const source of overviewSurfaceSources) {
+ expect(source).toContain('<div class="space-y-4">');
+ expect(source).toContain('showToolbar={false}');
+ }
+
+ expect(dockerPageSurfaceSource).toContain('<DockerHostsTable');
+ expect(dockerPageSurfaceSource).toContain('<WorkloadsSurface');
+ expect(dockerPageSurfaceSource).toContain('<DockerServicesTable');
+ expect(kubernetesPageSurfaceSource).toContain('<KubernetesClustersTable');
+ expect(kubernetesPageSurfaceSource).toContain('<KubernetesNodesTable');
+ expect(kubernetesPageSurfaceSource).toContain('<KubernetesDeploymentsTable');
+ expect(truenasPageSurfaceSource).toContain('<TrueNASSystemsTable');
+ expect(truenasPageSurfaceSource).toContain('<StorageSurface');
+ expect(truenasPageSurfaceSource).toContain('<TrueNASDisksTable');
+ expect(vmwarePageSurfaceSource).toContain('<VsphereHostsTable');
+ expect(vmwarePageSurfaceSource).toContain('<WorkloadsSurface');
+ expect(vmwarePageSurfaceSource).toContain('<VsphereDatastoresTable');
+ });
+
+ it('keeps mobile host tables focused on useful operational columns', () => {
+ expect(dockerHostsTableSource).toContain('<TableHead class={getPlatformTableHeadClass()}>Host');
+ expect(dockerHostsTableSource).toContain(
+ "<TableHead class={getPlatformTableHeadClass('right')}>CPU",
+ );
+ expect(dockerHostsTableSource).toContain(
+ "<TableHead class={getPlatformTableHeadClass('right')}>Memory",
+ );
+ expect(dockerHostsTableSource).toContain(
+ "<TableHead class={getPlatformTableHeadClass('right')}>Disk",
+ );
+
+ expect(kubernetesClustersTableSource).toContain(
+ '<TableHead class={getPlatformTableHeadClass()}>Cluster',
+ );
+ expect(kubernetesClustersTableSource).toContain(
+ "<TableHead class={getPlatformTableHeadClass('right')}>Nodes",
+ );
+ expect(kubernetesNodesTableSource).toContain(
+ '<TableHead class={getPlatformTableHeadClass()}>Node',
+ );
+ expect(kubernetesNodesTableSource).toContain(
+ '<span class="md:hidden">{compactCapacityLabel()}</span>',
+ );
+
+ expect(truenasSystemsTableSource).toContain(
+ '<TableHead class={getPlatformTableHeadClass()}>System',
+ );
+ expect(truenasSystemsTableSource).toContain(
+ '<span class="md:hidden">{formatPercent(storagePercent())}</span>',
+ );
+ expect(vsphereHostsTableSource).toContain(
+ '<TableHead class={getPlatformTableHeadClass()}>Host',
+ );
+ expect(vsphereHostsTableSource).toContain(
+ "<TableHead class={getPlatformTableHeadClass('right')}>VMs",
+ );
+ expect(vsphereHostsTableSource).toContain('hidden md:table-cell');
+ });
+});
diff --git a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
index 3a8c42876d..460b400b7f 100644
--- a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
+++ b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
@@ -20,7 +20,10 @@ export function PlatformSectionTabs<TabId extends string>(props: {
ariaLabel: string;
}) {
return (
- <nav class="flex flex-wrap items-center gap-1 border-b border-border" aria-label={props.ariaLabel}>
+ <nav
+ class="flex flex-wrap items-center gap-1 border-b border-border"
+ aria-label={props.ariaLabel}
+ >
<For each={props.tabs}>
{(tab) => (
<A
@@ -54,6 +57,24 @@ export function PlatformTableEmptyState(props: {
);
}
+export type PlatformTableCellAlign = 'left' | 'right' | 'center';
+
+export const PLATFORM_TABLE_CARD_CLASS = 'rounded-md';
+export const PLATFORM_TABLE_HEADER_ROW_CLASS = 'bg-surface-alt text-muted border-b border-border';
+export const PLATFORM_TABLE_BODY_CLASS = 'divide-y divide-border';
+
+const getPlatformTableAlignClass = (align: PlatformTableCellAlign = 'left'): string => {
+ if (align === 'right') return 'text-right';
+ if (align === 'center') return 'text-center';
+ return '';
+};
+
+export const getPlatformTableHeadClass = (align?: PlatformTableCellAlign): string =>
+ `px-1.5 sm:px-2 py-0.5 font-medium ${getPlatformTableAlignClass(align)}`.trim();
+
+export const getPlatformTableCellClass = (align?: PlatformTableCellAlign): string =>
+ `px-1.5 sm:px-2 py-1 ${getPlatformTableAlignClass(align)}`.trim();
+
export function PlatformErrorState(props: {
title: string;
description: string;
diff --git a/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx
index 87a922911d..4890133fed 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx
@@ -23,6 +23,13 @@ import { normalizeDiskArray } from '@/utils/format';
import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';
import { useWorkloadTableMetricHistory } from '@/components/Workloads/useWorkloadTableMetricHistory';
import { getWorkloadTableLayoutMode } from '@/components/Workloads/guestRowModel';
+import {
+ PLATFORM_TABLE_BODY_CLASS,
+ PLATFORM_TABLE_CARD_CLASS,
+ PLATFORM_TABLE_HEADER_ROW_CLASS,
+ getPlatformTableCellClass,
+ getPlatformTableHeadClass,
+} from '@/features/platformPage/sharedPlatformPage';
import { type WorkloadsMetricDisplayMode } from '@/components/Workloads/workloadsFilterModel';
import { type WorkloadTableMetricHistoryRange } from '@/components/Workloads/workloadMetricHistoryModel';
import type { Disk, Node as LegacyNode } from '@/types/api';
@@ -112,18 +119,6 @@ const formatPercentLabel = (value: number | null | undefined): string => {
return `${Math.round(Math.max(0, normalized))}%`;
};
-const getHostHeaderCellClass = (column: ProxmoxHostTableColumn): string => {
- const align =
- column.align === 'right' ? 'text-right' : column.align === 'center' ? 'text-center' : '';
- return `px-1.5 sm:px-2 py-0.5 font-medium ${align}`.trim();
-};
-
-const getHostBodyCellClass = (column: ProxmoxHostTableColumn): string => {
- const align =
- column.align === 'right' ? 'text-right' : column.align === 'center' ? 'text-center' : '';
- return `px-1.5 sm:px-2 py-1 ${align}`.trim();
-};
-
export const ProxmoxNodesTable: Component<{
nodes: Resource[];
guests: Resource[];
@@ -163,7 +158,7 @@ export const ProxmoxNodesTable: Component<{
</TableCard>
}
>
- <TableCard class="rounded-md">
+ <TableCard class={PLATFORM_TABLE_CARD_CLASS}>
<TableCardHeader title="Hosts" />
<Table class={`${getProxmoxHostTableMinWidthClass(layoutMode())} table-fixed text-xs`}>
<colgroup>
@@ -180,15 +175,17 @@ export const ProxmoxNodesTable: Component<{
</For>
</colgroup>
<TableHeader>
- <TableRow class="bg-surface-alt text-muted border-b border-border">
+ <TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}>
<For each={visibleColumns()}>
{(column) => (
- <TableHead class={getHostHeaderCellClass(column)}>{column.label}</TableHead>
+ <TableHead class={getPlatformTableHeadClass(column.align)}>
+ {column.label}
+ </TableHead>
)}
</For>
</TableRow>
</TableHeader>
- <TableBody class="divide-y divide-border">
+ <TableBody class={PLATFORM_TABLE_BODY_CLASS}>
<For each={props.nodes}>
{(node) => {
const name = () => asTrimmedString(node.name) || node.id;
@@ -232,7 +229,7 @@ export const ProxmoxNodesTable: Component<{
switch (column.id) {
case 'node':
return (
- <TableCell class={getHostBodyCellClass(column)}>
+ <TableCell class={getPlatformTableCellClass(column.align)}>
<div class="flex min-w-0 items-center gap-2">
<StatusDot
size="sm"
@@ -248,7 +245,7 @@ export const ProxmoxNodesTable: Component<{
);
case 'version':
return (
- <TableCell class={getHostBodyCellClass(column)}>
+ <TableCell class={getPlatformTableCellClass(column.align)}>
<Show when={version()} fallback={<span class="text-muted">—</span>}>
<span class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 font-mono text-[10px] text-base-content">
{version()}
@@ -259,7 +256,7 @@ export const ProxmoxNodesTable: Component<{
case 'uptime':
return (
<TableCell
- class={`${getHostBodyCellClass(column)} tabular-nums ${
+ class={`${getPlatformTableCellClass(column.align)} tabular-nums ${
uptime().warn
? 'text-orange-600 dark:text-orange-400'
: 'text-base-content'
@@ -270,7 +267,7 @@ export const ProxmoxNodesTable: Component<{
);
case 'cpu':
return (
- <TableCell class={getHostBodyCellClass(column)}>
+ <TableCell class={getPlatformTableCellClass(column.align)}>
<Show
when={isSparklineMode()}
fallback={
@@ -294,7 +291,7 @@ export const ProxmoxNodesTable: Component<{
);
case 'memory':
return (
- <TableCell class={getHostBodyCellClass(column)}>
+ <TableCell class={getPlatformTableCellClass(column.align)}>
<Show
when={isSparklineMode()}
fallback={
@@ -328,7 +325,7 @@ export const ProxmoxNodesTable: Component<{
);
case 'disk':
return (
- <TableCell class={getHostBodyCellClass(column)}>
+ <TableCell class={getPlatformTableCellClass(column.align)}>
<Show
when={isSparklineMode()}
fallback={
@@ -359,7 +356,7 @@ export const ProxmoxNodesTable: Component<{
);
case 'temp':
return (
- <TableCell class={getHostBodyCellClass(column)}>
+ <TableCell class={getPlatformTableCellClass(column.align)}>
<Show
when={
typeof temperature() === 'number' && (temperature() as number) > 0
@@ -372,7 +369,7 @@ export const ProxmoxNodesTable: Component<{
);
case 'vms':
return (
- <TableCell class={getHostBodyCellClass(column)}>
+ <TableCell class={getPlatformTableCellClass(column.align)}>
<span class={counts().vms > 0 ? VMS_BADGE : ZERO_BADGE}>
{counts().vms}
</span>
@@ -380,7 +377,7 @@ export const ProxmoxNodesTable: Component<{
);
case 'cts':
return (
- <TableCell class={getHostBodyCellClass(column)}>
+ <TableCell class={getPlatformTableCellClass(column.align)}>
<span class={counts().containers > 0 ? CTS_BADGE : ZERO_BADGE}>
{counts().containers}
</span>
@@ -388,7 +385,7 @@ export const ProxmoxNodesTable: Component<{
);
case 'cluster':
return (
- <TableCell class={getHostBodyCellClass(column)}>
+ <TableCell class={getPlatformTableCellClass(column.align)}>
<span class="inline-flex items-center rounded-md bg-surface-alt px-2 py-0.5 text-[11px] font-medium text-base-content">
{cluster()}
</span>
diff --git a/frontend-modern/src/features/truenas/TrueNASDisksTable.tsx b/frontend-modern/src/features/truenas/TrueNASDisksTable.tsx
index 6d666e48c1..eb405a346b 100644
--- a/frontend-modern/src/features/truenas/TrueNASDisksTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASDisksTable.tsx
@@ -1,9 +1,9 @@
import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { EmptyState } from '@/components/shared/EmptyState';
import { FilterButtonGroup, type FilterOption } from '@/components/shared/FilterButtonGroup';
import { SearchInput } from '@/components/shared/SearchInput';
import { StatusDot } from '@/components/shared/StatusDot';
+import { TableCard } from '@/components/shared/TableCard';
+import { TableCardHeader } from '@/components/shared/TableCardHeader';
import {
Table,
TableBody,
@@ -14,7 +14,13 @@ import {
} from '@/components/shared/Table';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PLATFORM_TABLE_BODY_CLASS,
+ PLATFORM_TABLE_CARD_CLASS,
+ PLATFORM_TABLE_HEADER_ROW_CLASS,
+ PlatformTableEmptyState,
filterPlatformResources,
+ getPlatformTableCellClass,
+ getPlatformTableHeadClass,
type PlatformResourceStatusFilter,
} from '@/features/platformPage/sharedPlatformPage';
import type { Resource } from '@/types/resource';
@@ -55,13 +61,13 @@ const formatWearout = (wearout: number | undefined): JSX.Element => {
return <span class="tabular-nums">{wearout.toFixed(0)}%</span>;
};
-const healthVariant = (
- health: string | undefined,
-): 'success' | 'warning' | 'danger' | 'muted' => {
+const healthVariant = (health: string | undefined): 'success' | 'warning' | 'danger' | 'muted' => {
const normalized = (health || '').trim().toLowerCase();
- if (normalized === 'healthy' || normalized === 'passed' || normalized === 'pass') return 'success';
+ if (normalized === 'healthy' || normalized === 'passed' || normalized === 'pass')
+ return 'success';
if (normalized === 'warning' || normalized === 'degraded') return 'warning';
- if (normalized === 'failed' || normalized === 'fail' || normalized === 'critical') return 'danger';
+ if (normalized === 'failed' || normalized === 'fail' || normalized === 'critical')
+ return 'danger';
return 'muted';
};
@@ -70,6 +76,8 @@ export const TrueNASDisksTable: Component<{
emptyIcon: JSX.Element;
emptyTitle: string;
emptyDescription: string;
+ title?: string;
+ showToolbar?: boolean;
}> = (props) => {
const [search, setSearch] = createSignal('');
const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');
@@ -82,63 +90,66 @@ export const TrueNASDisksTable: Component<{
<Show
when={props.resources.length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title={props.emptyTitle}
- description={props.emptyDescription}
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title={props.emptyTitle}
+ description={props.emptyDescription}
+ />
}
>
<div class="space-y-3">
- <div class="flex flex-wrap items-center gap-2">
- <div class="min-w-[200px] flex-1 sm:max-w-xs">
- <SearchInput
- value={search}
- onChange={setSearch}
- placeholder="Search disks"
+ <Show when={props.showToolbar !== false}>
+ <div class="flex flex-wrap items-center gap-2">
+ <div class="min-w-[200px] flex-1 sm:max-w-xs">
+ <SearchInput value={search} onChange={setSearch} placeholder="Search disks" />
+ </div>
+ <FilterButtonGroup
+ options={STATUS_FILTER_OPTIONS}
+ value={status()}
+ onChange={setStatus}
/>
+ <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
+ <Show when={visible() !== total()} fallback={<>{total()} disks</>}>
+ {visible()} of {total()} disks
+ </Show>
+ </span>
</div>
- <FilterButtonGroup
- options={STATUS_FILTER_OPTIONS}
- value={status()}
- onChange={setStatus}
- />
- <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
- <Show when={visible() !== total()} fallback={<>{total()} disks</>}>
- {visible()} of {total()} disks
- </Show>
- </span>
- </div>
+ </Show>
<Show
when={filtered().length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title="No disks match current filters"
- description="Adjust the search or status filter to see more disks."
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title="No disks match current filters"
+ description="Adjust the search or status filter to see more disks."
+ />
}
>
- <Card padding="none" tone="card" class="overflow-hidden">
- <Table class="w-full min-w-[880px] border-collapse text-xs">
- <TableHeader class="bg-surface-alt text-muted border-b border-border">
- <TableRow class="text-left text-[10px] uppercase tracking-wide">
- <TableHead class="px-3 py-2 font-medium">Disk</TableHead>
- <TableHead class="px-3 py-2 font-medium">Model</TableHead>
- <TableHead class="px-3 py-2 font-medium">Type</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Size</TableHead>
- <TableHead class="px-3 py-2 font-medium">Health</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Temp</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Wearout</TableHead>
- <TableHead class="px-3 py-2 font-medium">Serial</TableHead>
+ <TableCard class={PLATFORM_TABLE_CARD_CLASS}>
+ <TableCardHeader title={props.title ?? 'Disks'} />
+ <Table class="min-w-full table-fixed text-xs md:min-w-[880px]">
+ <TableHeader>
+ <TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}>
+ <TableHead class={getPlatformTableHeadClass()}>Disk</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Model
+ </TableHead>
+ <TableHead class={getPlatformTableHeadClass()}>Type</TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>Size</TableHead>
+ <TableHead class={getPlatformTableHeadClass()}>Health</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
+ Temp
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
+ Wearout
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Serial
+ </TableHead>
</TableRow>
</TableHeader>
- <TableBody class="divide-y divide-border-subtle">
+ <TableBody class={PLATFORM_TABLE_BODY_CLASS}>
<For each={filtered()}>
{(disk) => {
const meta = () => disk.physicalDisk;
@@ -148,22 +159,28 @@ export const TrueNASDisksTable: Component<{
const health = () => asTrimmedString(meta()?.health) || '—';
const serial = () => asTrimmedString(meta()?.serial) || '—';
return (
- <TableRow class="hover:bg-surface-hover">
- <TableCell class="px-3 py-2">
- <span class="font-semibold text-base-content truncate" title={name()}>
+ <TableRow class="text-[11px] sm:text-xs">
+ <TableCell class={getPlatformTableCellClass()}>
+ <span class="truncate font-semibold text-base-content" title={name()}>
{name()}
</span>
</TableCell>
- <TableCell class="px-3 py-2 text-base-content">
- <span class="truncate inline-block max-w-[14rem]" title={model()}>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ <span class="inline-block max-w-[14rem] truncate" title={model()}>
{model()}
</span>
</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{type()}</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell class={`${getPlatformTableCellClass()} text-base-content`}>
+ {type()}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
{formatBytes(meta()?.sizeBytes)}
</TableCell>
- <TableCell class="px-3 py-2">
+ <TableCell class={getPlatformTableCellClass()}>
<div class="flex items-center gap-2">
<StatusDot
size="sm"
@@ -174,14 +191,20 @@ export const TrueNASDisksTable: Component<{
<span class="text-base-content">{health()}</span>
</div>
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content md:table-cell`}
+ >
{formatTemperature(meta()?.temperature)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content md:table-cell`}
+ >
{formatWearout(meta()?.wearout)}
</TableCell>
- <TableCell class="px-3 py-2 text-base-content font-mono text-[11px]">
- <span class="truncate inline-block max-w-[10rem]" title={serial()}>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden font-mono text-[11px] text-base-content md:table-cell`}
+ >
+ <span class="inline-block max-w-[10rem] truncate" title={serial()}>
{serial()}
</span>
</TableCell>
@@ -191,7 +214,7 @@ export const TrueNASDisksTable: Component<{
</For>
</TableBody>
</Table>
- </Card>
+ </TableCard>
</Show>
</div>
</Show>
diff --git a/frontend-modern/src/features/truenas/TrueNASPageSurface.tsx b/frontend-modern/src/features/truenas/TrueNASPageSurface.tsx
index a6689c329a..f7b8ac06bf 100644
--- a/frontend-modern/src/features/truenas/TrueNASPageSurface.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASPageSurface.tsx
@@ -22,8 +22,7 @@ import {
// first-class type tokens and including them triggers a 400 from
// `/api/resources`. The page model still buckets by topology
// client-side.
-const TRUENAS_RESOURCE_QUERY =
- 'type=agent,app-container,storage,physical_disk';
+const TRUENAS_RESOURCE_QUERY = 'type=agent,app-container,storage,physical_disk';
const TRUENAS_PLATFORM_FILTER = 'truenas';
const VALID_TABS = new Set<TrueNASPageTabId>(TRUENAS_TAB_SPECS.map((tab) => tab.id));
@@ -81,13 +80,45 @@ export function TrueNASPageSurface() {
}
>
<Show when={activeTab() === 'overview'}>
- <TrueNASSystemsTable
- systems={model().systems}
- scope={model().resources}
- emptyIcon={truenasIcon()}
- emptyTitle="No TrueNAS systems"
- emptyDescription="TrueNAS systems appear here once a TrueNAS connection reports its top-level appliance."
- />
+ <div class="space-y-4">
+ <TrueNASSystemsTable
+ systems={model().systems}
+ scope={model().resources}
+ emptyIcon={truenasIcon()}
+ emptyTitle="No TrueNAS systems"
+ emptyDescription="TrueNAS systems appear here once a TrueNAS connection reports its top-level appliance."
+ showToolbar={false}
+ />
+ <StorageSurface
+ embedded
+ tableOnly
+ showFilterToolbar
+ forcedSourceFilter={TRUENAS_PLATFORM_FILTER}
+ />
+ <Show when={model().disks.length > 0}>
+ <TrueNASDisksTable
+ resources={model().disks}
+ emptyIcon={truenasIcon()}
+ emptyTitle="No TrueNAS disks reported"
+ emptyDescription="Physical disks appear here once a TrueNAS connection enumerates them."
+ showToolbar={false}
+ />
+ </Show>
+ <Show when={model().apps.length > 0}>
+ <WorkloadsSurface
+ vms={[]}
+ containers={[]}
+ nodes={[]}
+ useWorkloads
+ embedded
+ tableOnly
+ showFilterToolbar
+ suppressPlatformFilter
+ forcedPlatform={TRUENAS_PLATFORM_FILTER}
+ compactGroupHeaders
+ />
+ </Show>
+ </div>
</Show>
<Show when={activeTab() === 'storage'}>
<StorageSurface
diff --git a/frontend-modern/src/features/truenas/TrueNASSystemsTable.tsx b/frontend-modern/src/features/truenas/TrueNASSystemsTable.tsx
index 6c00c6c39c..de8a134974 100644
--- a/frontend-modern/src/features/truenas/TrueNASSystemsTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASSystemsTable.tsx
@@ -1,9 +1,9 @@
import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { EmptyState } from '@/components/shared/EmptyState';
import { FilterButtonGroup, type FilterOption } from '@/components/shared/FilterButtonGroup';
import { SearchInput } from '@/components/shared/SearchInput';
import { StatusDot } from '@/components/shared/StatusDot';
+import { TableCard } from '@/components/shared/TableCard';
+import { TableCardHeader } from '@/components/shared/TableCardHeader';
import {
Table,
TableBody,
@@ -15,7 +15,13 @@ import {
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PLATFORM_TABLE_BODY_CLASS,
+ PLATFORM_TABLE_CARD_CLASS,
+ PLATFORM_TABLE_HEADER_ROW_CLASS,
+ PlatformTableEmptyState,
filterPlatformResources,
+ getPlatformTableCellClass,
+ getPlatformTableHeadClass,
type PlatformResourceStatusFilter,
} from '@/features/platformPage/sharedPlatformPage';
import type { Resource } from '@/types/resource';
@@ -60,7 +66,8 @@ const formatBytes = (bytes: number | undefined): string => {
};
const formatPercent = (percent?: number): JSX.Element => {
- if (typeof percent !== 'number' || Number.isNaN(percent)) return <span class="text-muted">—</span>;
+ if (typeof percent !== 'number' || Number.isNaN(percent))
+ return <span class="text-muted">—</span>;
return <span class="tabular-nums">{percent.toFixed(1)}%</span>;
};
@@ -77,6 +84,8 @@ export const TrueNASSystemsTable: Component<{
emptyIcon: JSX.Element;
emptyTitle: string;
emptyDescription: string;
+ title?: string;
+ showToolbar?: boolean;
}> = (props) => {
const [search, setSearch] = createSignal('');
const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');
@@ -105,117 +114,165 @@ export const TrueNASSystemsTable: Component<{
<Show
when={props.systems.length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title={props.emptyTitle}
- description={props.emptyDescription}
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title={props.emptyTitle}
+ description={props.emptyDescription}
+ />
}
>
<div class="space-y-3">
- <div class="flex flex-wrap items-center gap-2">
- <div class="min-w-[200px] flex-1 sm:max-w-xs">
- <SearchInput
- value={search}
- onChange={setSearch}
- placeholder="Search TrueNAS systems"
+ <Show when={props.showToolbar !== false}>
+ <div class="flex flex-wrap items-center gap-2">
+ <div class="min-w-[200px] flex-1 sm:max-w-xs">
+ <SearchInput
+ value={search}
+ onChange={setSearch}
+ placeholder="Search TrueNAS systems"
+ />
+ </div>
+ <FilterButtonGroup
+ options={STATUS_FILTER_OPTIONS}
+ value={status()}
+ onChange={setStatus}
/>
+ <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
+ <Show when={visible() !== total()} fallback={<>{total()} systems</>}>
+ {visible()} of {total()} systems
+ </Show>
+ </span>
</div>
- <FilterButtonGroup
- options={STATUS_FILTER_OPTIONS}
- value={status()}
- onChange={setStatus}
- />
- <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
- <Show when={visible() !== total()} fallback={<>{total()} systems</>}>
- {visible()} of {total()} systems
- </Show>
- </span>
- </div>
+ </Show>
<Show
when={filtered().length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title="No systems match current filters"
- description="Adjust the search or status filter to see more systems."
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title="No systems match current filters"
+ description="Adjust the search or status filter to see more systems."
+ />
}
>
- <Card padding="none" tone="card" class="overflow-hidden">
- <Table class="w-full min-w-[960px] border-collapse text-xs">
- <TableHeader class="bg-surface-alt text-muted border-b border-border">
- <TableRow class="text-left text-[10px] uppercase tracking-wide">
- <TableHead class="px-3 py-2 font-medium">System</TableHead>
- <TableHead class="px-3 py-2 font-medium">Version</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Uptime</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">CPU</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Memory</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Storage</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Temp</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Pools</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Datasets</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Disks</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Apps</TableHead>
+ <TableCard class={PLATFORM_TABLE_CARD_CLASS}>
+ <TableCardHeader title={props.title ?? 'Systems'} />
+ <Table class="min-w-full table-fixed text-xs md:min-w-[1040px]">
+ <TableHeader>
+ <TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}>
+ <TableHead class={getPlatformTableHeadClass()}>System</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Version
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
+ Uptime
+ </TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>CPU</TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>Memory</TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>Storage</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
+ Temp
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
+ Pools
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
+ Datasets
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
+ Disks
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
+ Apps
+ </TableHead>
</TableRow>
</TableHeader>
- <TableBody class="divide-y divide-border-subtle">
+ <TableBody class={PLATFORM_TABLE_BODY_CLASS}>
<For each={filtered()}>
{(system) => {
const name = () => asTrimmedString(system.name) || system.id;
const version = () => asTrimmedString(system.agent?.osVersion) || '—';
const indicator = () => getSimpleStatusIndicator(system.status);
+ const storagePercent = () => {
+ if (typeof system.disk?.current === 'number') return system.disk.current;
+ if (
+ typeof system.disk?.used === 'number' &&
+ typeof system.disk?.total === 'number' &&
+ system.disk.total > 0
+ ) {
+ return (system.disk.used / system.disk.total) * 100;
+ }
+ return undefined;
+ };
+ const storageFullLabel = () =>
+ typeof system.disk?.used === 'number' &&
+ typeof system.disk?.total === 'number'
+ ? `${formatBytes(system.disk.used)} / ${formatBytes(system.disk.total)}`
+ : formatPercent(storagePercent());
const c = counts();
return (
- <TableRow class="hover:bg-surface-hover">
- <TableCell class="px-3 py-2">
- <div class="flex items-center gap-2 min-w-0">
+ <TableRow class="text-[11px] sm:text-xs">
+ <TableCell class={getPlatformTableCellClass()}>
+ <div class="flex min-w-0 items-center gap-2">
<StatusDot
size="sm"
variant={indicator().variant}
title={system.status || 'unknown'}
ariaHidden
/>
- <span class="font-semibold text-base-content truncate" title={name()}>
+ <span class="truncate font-semibold text-base-content" title={name()}>
{name()}
</span>
</div>
</TableCell>
- <TableCell class="px-3 py-2 text-base-content font-mono text-[11px]">
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden font-mono text-[11px] text-base-content md:table-cell`}
+ >
{version()}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content md:table-cell`}
+ >
{formatUptime(system.uptime)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
{formatPercent(system.cpu?.current)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
{formatPercent(system.memory?.current)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
- {typeof system.disk?.used === 'number' && typeof system.disk?.total === 'number'
- ? `${formatBytes(system.disk.used)} / ${formatBytes(system.disk.total)}`
- : formatPercent(system.disk?.current)}
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
+ <span class="md:hidden">{formatPercent(storagePercent())}</span>
+ <span class="hidden md:inline">{storageFullLabel()}</span>
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content md:table-cell`}
+ >
{formatTemperature(system.temperature)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content tabular-nums">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content tabular-nums md:table-cell`}
+ >
{c.pools}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content tabular-nums">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content tabular-nums md:table-cell`}
+ >
{c.datasets}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content tabular-nums">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content tabular-nums md:table-cell`}
+ >
{c.disks}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content tabular-nums">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content tabular-nums md:table-cell`}
+ >
{c.apps}
</TableCell>
</TableRow>
@@ -224,7 +281,7 @@ export const TrueNASSystemsTable: Component<{
</For>
</TableBody>
</Table>
- </Card>
+ </TableCard>
</Show>
</div>
</Show>
diff --git a/frontend-modern/src/features/vmware/VmwarePageSurface.tsx b/frontend-modern/src/features/vmware/VmwarePageSurface.tsx
index 231973443a..89ef903d51 100644
--- a/frontend-modern/src/features/vmware/VmwarePageSurface.tsx
+++ b/frontend-modern/src/features/vmware/VmwarePageSurface.tsx
@@ -10,11 +10,7 @@ import {
PlatformTableEmptyState,
} from '@/features/platformPage/sharedPlatformPage';
import { VsphereHostsTable } from './VsphereHostsTable';
-import {
- VMWARE_TAB_SPECS,
- buildVmwarePageModel,
- type VmwarePageTabId,
-} from './vmwarePageModel';
+import { VMWARE_TAB_SPECS, buildVmwarePageModel, type VmwarePageTabId } from './vmwarePageModel';
// `datastore` is not a first-class type token at the API boundary; vSphere
// datastores are emitted as canonical `storage` rows. Including it
@@ -77,13 +73,37 @@ export function VmwarePageSurface() {
}
>
<Show when={activeTab() === 'overview'}>
- <VsphereHostsTable
- hosts={model().hosts}
- scope={model().resources}
- emptyIcon={vmwareIcon()}
- emptyTitle="No vSphere hosts"
- emptyDescription="Hosts appear here once the vCenter connection enumerates them."
- />
+ <div class="space-y-4">
+ <VsphereHostsTable
+ hosts={model().hosts}
+ scope={model().resources}
+ emptyIcon={vmwareIcon()}
+ emptyTitle="No vSphere hosts"
+ emptyDescription="Hosts appear here once the vCenter connection enumerates them."
+ showToolbar={false}
+ />
+ <WorkloadsSurface
+ vms={[]}
+ containers={[]}
+ nodes={[]}
+ useWorkloads
+ embedded
+ tableOnly
+ showFilterToolbar
+ suppressPlatformFilter
+ forcedPlatform={VMWARE_PLATFORM_FILTER}
+ compactGroupHeaders
+ />
+ <Show when={model().datastores.length > 0}>
+ <VsphereDatastoresTable
+ resources={model().datastores}
+ emptyIcon={vmwareIcon()}
+ emptyTitle="No vSphere datastores"
+ emptyDescription="Datastores appear here once a vCenter connection enumerates them."
+ showToolbar={false}
+ />
+ </Show>
+ </div>
</Show>
<Show when={activeTab() === 'vms'}>
<WorkloadsSurface
diff --git a/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx b/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx
index 522efd479e..5a3385e184 100644
--- a/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx
+++ b/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx
@@ -1,16 +1,9 @@
-import {
- For,
- Show,
- createMemo,
- createSignal,
- type Component,
- type JSX,
-} from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { EmptyState } from '@/components/shared/EmptyState';
+import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';
import { FilterButtonGroup, type FilterOption } from '@/components/shared/FilterButtonGroup';
import { SearchInput } from '@/components/shared/SearchInput';
import { StatusDot } from '@/components/shared/StatusDot';
+import { TableCard } from '@/components/shared/TableCard';
+import { TableCardHeader } from '@/components/shared/TableCardHeader';
import type { StatusIndicatorVariant } from '@/utils/status';
import {
Table,
@@ -22,6 +15,14 @@ import {
} from '@/components/shared/Table';
import { formatBytes } from '@/utils/format';
import { asTrimmedString } from '@/utils/stringUtils';
+import {
+ PLATFORM_TABLE_BODY_CLASS,
+ PLATFORM_TABLE_CARD_CLASS,
+ PLATFORM_TABLE_HEADER_ROW_CLASS,
+ PlatformTableEmptyState,
+ getPlatformTableCellClass,
+ getPlatformTableHeadClass,
+} from '@/features/platformPage/sharedPlatformPage';
import type { Resource } from '@/types/resource';
// vSphere storage is just datastores — there are no "physical disks"
@@ -138,6 +139,8 @@ export const VsphereDatastoresTable: Component<{
emptyIcon: JSX.Element;
emptyTitle: string;
emptyDescription: string;
+ title?: string;
+ showToolbar?: boolean;
}> = (props) => {
const [search, setSearch] = createSignal('');
const [status, setStatus] = createSignal<DatastoreStatusFilter>('all');
@@ -171,88 +174,123 @@ export const VsphereDatastoresTable: Component<{
<Show
when={total() > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title={props.emptyTitle}
- description={props.emptyDescription}
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title={props.emptyTitle}
+ description={props.emptyDescription}
+ />
}
>
<div class="space-y-3">
- <div class="flex flex-wrap items-center gap-2">
- <div class="min-w-[200px] flex-1 sm:max-w-xs">
- <SearchInput
- value={search}
- onChange={setSearch}
- placeholder="Search datastores, datacenters, hosts"
+ <Show when={props.showToolbar !== false}>
+ <div class="flex flex-wrap items-center gap-2">
+ <div class="min-w-[200px] flex-1 sm:max-w-xs">
+ <SearchInput
+ value={search}
+ onChange={setSearch}
+ placeholder="Search datastores, datacenters, hosts"
+ />
+ </div>
+ <FilterButtonGroup
+ options={STATUS_FILTER_OPTIONS}
+ value={status()}
+ onChange={setStatus}
/>
+ <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
+ <Show when={visible() !== total()} fallback={<>{total()} datastores</>}>
+ {visible()} of {total()} datastores
+ </Show>
+ </span>
</div>
- <FilterButtonGroup options={STATUS_FILTER_OPTIONS} value={status()} onChange={setStatus} />
- <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
- <Show when={visible() !== total()} fallback={<>{total()} datastores</>}>
- {visible()} of {total()} datastores
- </Show>
- </span>
- </div>
+ </Show>
<Show
when={filtered().length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title="No datastores match current filters"
- description="Adjust the search or status filter to see more datastores."
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title="No datastores match current filters"
+ description="Adjust the search or status filter to see more datastores."
+ />
}
>
- <Card padding="none" tone="card" class="overflow-hidden">
- <Table class="w-full min-w-[1050px] border-collapse text-xs">
- <TableHeader class="bg-surface-alt text-muted border-b border-border">
- <TableRow class="text-left text-[10px] uppercase tracking-wide">
- <TableHead class="px-3 py-2 font-medium">Datastore</TableHead>
- <TableHead class="px-3 py-2 font-medium">Type</TableHead>
- <TableHead class="px-3 py-2 font-medium">Datacenter</TableHead>
- <TableHead class="px-3 py-2 font-medium">Capacity</TableHead>
- <TableHead class="px-3 py-2 font-medium">Hosts</TableHead>
- <TableHead class="px-3 py-2 font-medium">Access</TableHead>
- <TableHead class="px-3 py-2 font-medium">Maintenance</TableHead>
- <TableHead class="px-3 py-2 font-medium">vCenter</TableHead>
+ <TableCard class={PLATFORM_TABLE_CARD_CLASS}>
+ <TableCardHeader title={props.title ?? 'Datastores'} />
+ <Table class="min-w-full table-fixed text-xs md:min-w-[1050px]">
+ <TableHeader>
+ <TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}>
+ <TableHead class={getPlatformTableHeadClass()}>Datastore</TableHead>
+ <TableHead class={getPlatformTableHeadClass()}>Type</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Datacenter
+ </TableHead>
+ <TableHead class={getPlatformTableHeadClass()}>Capacity</TableHead>
+ <TableHead class={getPlatformTableHeadClass()}>Hosts</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Access
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Maintenance
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ vCenter
+ </TableHead>
</TableRow>
</TableHeader>
- <TableBody class="divide-y divide-border-subtle">
+ <TableBody class={PLATFORM_TABLE_BODY_CLASS}>
<For each={filtered()}>
{(row) => {
const ind = indicatorFor(row);
const name = asTrimmedString(row.name) || row.id;
- const datacenter =
- asTrimmedString(row.vmware?.datacenterName) || '—';
+ const datacenter = asTrimmedString(row.vmware?.datacenterName) || '—';
const vcenter =
asTrimmedString(row.vmware?.connectionName) ||
asTrimmedString(row.vmware?.vcenterHost) ||
'—';
return (
- <TableRow class="hover:bg-surface-hover">
- <TableCell class="px-3 py-2">
- <div class="flex items-center gap-2 min-w-0">
- <StatusDot size="sm" variant={ind.variant} title={ind.label} ariaHidden />
- <span class="font-semibold text-base-content truncate" title={name}>
+ <TableRow class="text-[11px] sm:text-xs">
+ <TableCell class={getPlatformTableCellClass()}>
+ <div class="flex min-w-0 items-center gap-2">
+ <StatusDot
+ size="sm"
+ variant={ind.variant}
+ title={ind.label}
+ ariaHidden
+ />
+ <span class="truncate font-semibold text-base-content" title={name}>
{name}
</span>
</div>
</TableCell>
- <TableCell class="px-3 py-2 text-base-content uppercase text-[10px] font-medium">
+ <TableCell
+ class={`${getPlatformTableCellClass()} text-[10px] font-medium uppercase text-base-content`}
+ >
{datastoreTypeLabel(row)}
</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{datacenter}</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{capacityCell(row)}</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{hostsCell(row)}</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{accessLabel(row)}</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{maintenanceLabel(row)}</TableCell>
- <TableCell class="px-3 py-2 text-base-content font-mono text-[11px]">
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ {datacenter}
+ </TableCell>
+ <TableCell class={`${getPlatformTableCellClass()} text-base-content`}>
+ {capacityCell(row)}
+ </TableCell>
+ <TableCell class={`${getPlatformTableCellClass()} text-base-content`}>
+ {hostsCell(row)}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ {accessLabel(row)}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ {maintenanceLabel(row)}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden font-mono text-[11px] text-base-content md:table-cell`}
+ >
<span class="inline-block max-w-[12rem] truncate" title={vcenter}>
{vcenter}
</span>
@@ -263,7 +301,7 @@ export const VsphereDatastoresTable: Component<{
</For>
</TableBody>
</Table>
- </Card>
+ </TableCard>
</Show>
</div>
</Show>
diff --git a/frontend-modern/src/features/vmware/VsphereHostsTable.tsx b/frontend-modern/src/features/vmware/VsphereHostsTable.tsx
index 178448fc9d..dd355faf27 100644
--- a/frontend-modern/src/features/vmware/VsphereHostsTable.tsx
+++ b/frontend-modern/src/features/vmware/VsphereHostsTable.tsx
@@ -1,9 +1,9 @@
import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';
-import { Card } from '@/components/shared/Card';
-import { EmptyState } from '@/components/shared/EmptyState';
import { FilterButtonGroup, type FilterOption } from '@/components/shared/FilterButtonGroup';
import { SearchInput } from '@/components/shared/SearchInput';
import { StatusDot } from '@/components/shared/StatusDot';
+import { TableCard } from '@/components/shared/TableCard';
+import { TableCardHeader } from '@/components/shared/TableCardHeader';
import {
Table,
TableBody,
@@ -15,7 +15,13 @@ import {
import { getSimpleStatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
+ PLATFORM_TABLE_BODY_CLASS,
+ PLATFORM_TABLE_CARD_CLASS,
+ PLATFORM_TABLE_HEADER_ROW_CLASS,
+ PlatformTableEmptyState,
filterPlatformResources,
+ getPlatformTableCellClass,
+ getPlatformTableHeadClass,
type PlatformResourceStatusFilter,
} from '@/features/platformPage/sharedPlatformPage';
import type { Resource } from '@/types/resource';
@@ -38,7 +44,8 @@ const STATUS_FILTER_OPTIONS: FilterOption<PlatformResourceStatusFilter>[] = [
];
const formatPercent = (percent?: number): JSX.Element => {
- if (typeof percent !== 'number' || Number.isNaN(percent)) return <span class="text-muted">—</span>;
+ if (typeof percent !== 'number' || Number.isNaN(percent))
+ return <span class="text-muted">—</span>;
return <span class="tabular-nums">{percent.toFixed(1)}%</span>;
};
@@ -69,6 +76,8 @@ export const VsphereHostsTable: Component<{
emptyIcon: JSX.Element;
emptyTitle: string;
emptyDescription: string;
+ title?: string;
+ showToolbar?: boolean;
}> = (props) => {
const [search, setSearch] = createSignal('');
const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');
@@ -92,64 +101,69 @@ export const VsphereHostsTable: Component<{
<Show
when={props.hosts.length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title={props.emptyTitle}
- description={props.emptyDescription}
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title={props.emptyTitle}
+ description={props.emptyDescription}
+ />
}
>
<div class="space-y-3">
- <div class="flex flex-wrap items-center gap-2">
- <div class="min-w-[200px] flex-1 sm:max-w-xs">
- <SearchInput
- value={search}
- onChange={setSearch}
- placeholder="Search ESXi hosts"
+ <Show when={props.showToolbar !== false}>
+ <div class="flex flex-wrap items-center gap-2">
+ <div class="min-w-[200px] flex-1 sm:max-w-xs">
+ <SearchInput value={search} onChange={setSearch} placeholder="Search ESXi hosts" />
+ </div>
+ <FilterButtonGroup
+ options={STATUS_FILTER_OPTIONS}
+ value={status()}
+ onChange={setStatus}
/>
+ <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
+ <Show when={visible() !== total()} fallback={<>{total()} hosts</>}>
+ {visible()} of {total()} hosts
+ </Show>
+ </span>
</div>
- <FilterButtonGroup
- options={STATUS_FILTER_OPTIONS}
- value={status()}
- onChange={setStatus}
- />
- <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
- <Show when={visible() !== total()} fallback={<>{total()} hosts</>}>
- {visible()} of {total()} hosts
- </Show>
- </span>
- </div>
+ </Show>
<Show
when={filtered().length > 0}
fallback={
- <Card padding="lg">
- <EmptyState
- icon={props.emptyIcon}
- title="No hosts match current filters"
- description="Adjust the search or status filter to see more hosts."
- />
- </Card>
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title="No hosts match current filters"
+ description="Adjust the search or status filter to see more hosts."
+ />
}
>
- <Card padding="none" tone="card" class="overflow-hidden">
- <Table class="w-full min-w-[960px] border-collapse text-xs">
- <TableHeader class="bg-surface-alt text-muted border-b border-border">
- <TableRow class="text-left text-[10px] uppercase tracking-wide">
- <TableHead class="px-3 py-2 font-medium">Host</TableHead>
- <TableHead class="px-3 py-2 font-medium">Datacenter</TableHead>
- <TableHead class="px-3 py-2 font-medium">Cluster</TableHead>
- <TableHead class="px-3 py-2 font-medium">Power</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">CPU</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Memory</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">Datastores</TableHead>
- <TableHead class="px-3 py-2 font-medium text-right">VMs</TableHead>
- <TableHead class="px-3 py-2 font-medium">vCenter</TableHead>
+ <TableCard class={PLATFORM_TABLE_CARD_CLASS}>
+ <TableCardHeader title={props.title ?? 'Hosts'} />
+ <Table class="min-w-full table-fixed text-xs md:min-w-[960px]">
+ <TableHeader>
+ <TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}>
+ <TableHead class={getPlatformTableHeadClass()}>Host</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Datacenter
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Cluster
+ </TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ Power
+ </TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>CPU</TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>Memory</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
+ Datastores
+ </TableHead>
+ <TableHead class={getPlatformTableHeadClass('right')}>VMs</TableHead>
+ <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
+ vCenter
+ </TableHead>
</TableRow>
</TableHeader>
- <TableBody class="divide-y divide-border-subtle">
+ <TableBody class={PLATFORM_TABLE_BODY_CLASS}>
<For each={filtered()}>
{(host) => {
const meta = () => host.vmware;
@@ -157,28 +171,37 @@ export const VsphereHostsTable: Component<{
const datacenter = () => asTrimmedString(meta()?.datacenterName) || '—';
const cluster = () => asTrimmedString(meta()?.clusterName) || '—';
const vcenter = () => asTrimmedString(meta()?.vcenterHost) || '—';
- const datastoreCount = () => meta()?.datastoreIds?.length ?? meta()?.datastoreNames?.length ?? 0;
+ const datastoreCount = () =>
+ meta()?.datastoreIds?.length ?? meta()?.datastoreNames?.length ?? 0;
const vmCount = () =>
vmCountByHost().get(asTrimmedString(meta()?.managedObjectId) || '') ?? 0;
const indicator = () => getSimpleStatusIndicator(host.status);
return (
- <TableRow class="hover:bg-surface-hover">
- <TableCell class="px-3 py-2">
- <div class="flex items-center gap-2 min-w-0">
+ <TableRow class="text-[11px] sm:text-xs">
+ <TableCell class={getPlatformTableCellClass()}>
+ <div class="flex min-w-0 items-center gap-2">
<StatusDot
size="sm"
variant={indicator().variant}
title={host.status || 'unknown'}
ariaHidden
/>
- <span class="font-semibold text-base-content truncate" title={name()}>
+ <span class="truncate font-semibold text-base-content" title={name()}>
{name()}
</span>
</div>
</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{datacenter()}</TableCell>
- <TableCell class="px-3 py-2 text-base-content">{cluster()}</TableCell>
- <TableCell class="px-3 py-2">
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ {datacenter()}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
+ >
+ {cluster()}
+ </TableCell>
+ <TableCell class={`${getPlatformTableCellClass()} hidden md:table-cell`}>
<div class="flex items-center gap-2">
<StatusDot
size="sm"
@@ -186,23 +209,35 @@ export const VsphereHostsTable: Component<{
title={meta()?.powerState || 'unknown'}
ariaHidden
/>
- <span class="text-base-content">{formatPowerState(meta()?.powerState)}</span>
+ <span class="text-base-content">
+ {formatPowerState(meta()?.powerState)}
+ </span>
</div>
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
{formatPercent(host.cpu?.current)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content`}
+ >
{formatPercent(host.memory?.current)}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content tabular-nums">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} hidden text-base-content tabular-nums md:table-cell`}
+ >
{datastoreCount()}
</TableCell>
- <TableCell class="px-3 py-2 text-right text-base-content tabular-nums">
+ <TableCell
+ class={`${getPlatformTableCellClass('right')} text-base-content tabular-nums`}
+ >
{vmCount()}
</TableCell>
- <TableCell class="px-3 py-2 text-base-content font-mono text-[11px]">
- <span class="truncate inline-block max-w-[12rem]" title={vcenter()}>
+ <TableCell
+ class={`${getPlatformTableCellClass()} hidden font-mono text-[11px] text-base-content md:table-cell`}
+ >
+ <span class="inline-block max-w-[12rem] truncate" title={vcenter()}>
{vcenter()}
</span>
</TableCell>
@@ -212,7 +247,7 @@ export const VsphereHostsTable: Component<{
</For>
</TableBody>
</Table>
- </Card>
+ </TableCard>
</Show>
</div>
</Show>