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.

Converge resource drawer detail layout

rcourtmance555ee09d7c
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index d8e11e6920..42b00795b8 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,53 +1,30 @@
{
"version": 1,
- "base_sha": "553592d2bd59d7983bb988700576ba2d2a3a945c",
- "verified_at": "2026-08-27T16:12:00Z",
+ "base_sha": "d48e70da152525471c1d1ee3364c92c76b4d06af",
+ "verified_at": "2026-08-27T17:00:26Z",
"result": "passed",
"changed_paths": [
- "frontend-modern/src/api/alerts.ts",
- "frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx",
- "frontend-modern/src/features/alerts/AlertSnoozeAction.tsx",
- "frontend-modern/src/features/alerts/types.ts",
- "frontend-modern/src/features/alerts/useAlertOverviewState.ts",
- "frontend-modern/src/features/alerts/useAlertSnoozeState.ts",
- "frontend-modern/src/i18n/messages.de.ts",
- "frontend-modern/src/i18n/messages.es.ts",
- "frontend-modern/src/i18n/messages.ts",
- "frontend-modern/src/types/resource.ts",
- "frontend-modern/src/utils/alertOverviewPresentation.ts",
- "frontend-modern/src/utils/resourceChangePresentation.ts"
+ "frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx",
+ "frontend-modern/src/components/shared/DetailSectionTable.tsx",
+ "frontend-modern/src/components/shared/detailSectionModel.ts"
],
"content_sha256": {
- "frontend-modern/src/api/alerts.ts": "bfd0ee6c8076e0f75308578d11c33c519340b17a23c604037fe8536d3d54f2be",
- "frontend-modern/src/features/alerts/AlertOverviewAlertCard.tsx": "662d6f7b47418e1c80cf916f5ac818159a545d3f7716e908491a55e042be2873",
- "frontend-modern/src/features/alerts/AlertSnoozeAction.tsx": "339db07fb2b236f970dd3f79bd81517b82281a2871149fec7f4d5df0c8a17842",
- "frontend-modern/src/features/alerts/types.ts": "e57351b3e8c56a3d15c7c486b8b8049f3bb7181fc30479fa398ede489aea6816",
- "frontend-modern/src/features/alerts/useAlertOverviewState.ts": "02b5eae728ede490710d5ba334537193c89bfe9e25a8df26aa574f03b80936ad",
- "frontend-modern/src/features/alerts/useAlertSnoozeState.ts": "5857a30196c2bd8156dfbace5d0d006f348f5d7eb1ef4720108eb1f43f2118e2",
- "frontend-modern/src/i18n/messages.de.ts": "652fefe6547386203ea749febd518d12d0a9538d112485bd87f8bfee5218d95c",
- "frontend-modern/src/i18n/messages.es.ts": "21adb4aff365b5f588fa48b9390dc4524a4954decc63ad366d492212f13c2dbc",
- "frontend-modern/src/i18n/messages.ts": "2979a81f676e50499302a89e7adb4a2b6c618258debf1d4ea09a67f9c153a7e8",
- "frontend-modern/src/types/resource.ts": "81d378c5923075dbdbf983083a896b28db11da894814904725456c508854cd10",
- "frontend-modern/src/utils/alertOverviewPresentation.ts": "82cf34fd090e39b51545c8cc90abf7fb1edfb5fbec3d23cbbe79e2d7fd02752f",
- "frontend-modern/src/utils/resourceChangePresentation.ts": "b7ddcd8401da17c264ad5804d93187b733faa2668f81df1fb81098f773235d17"
+ "frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx": "438dd4e834e576911bcf06d8849f832bb59e9349ff6476a3b437b356ecdf3d1a",
+ "frontend-modern/src/components/shared/DetailSectionTable.tsx": "5b2592463049e3b1740fa8c63cabb09529a83bd1cd64509c57b473d3b05dc35a",
+ "frontend-modern/src/components/shared/detailSectionModel.ts": "da27583092cad09d50ea03c4308f7841bd2475e8c6539527142da06a78d9722f"
},
- "routes": ["/alerts/overview"],
+ "routes": ["/proxmox/overview"],
"viewports": [
- { "width": 1280, "height": 800 },
+ { "width": 1920, "height": 800 },
{ "width": 390, "height": 844 }
],
"states": [
- "active unacknowledged incident with Snooze action",
- "preset snooze dialog with one-hour, two-hour, eight-hour, tomorrow-morning, and seven-day holds",
- "snoozed incident with exact local expiry, Resume action, and suppressed delivery diagnosis",
- "resumed incident with normal actions restored",
- "expanded incident timeline containing Snoozed and Resumed lifecycle events"
+ "expanded backup-vault backup-server resource drawer with Overview selected",
+ "runtime context and identity sections with rich alias values"
],
"interactions": [
- "opened Alerts Overview and confirmed every eligible active incident exposes Snooze beside acknowledgement and Timeline",
- "opened the preset dialog and confirmed its monitoring-continues contract and bounded duration choices",
- "snoozed a live local incident and confirmed the exact expiry, Resume action, toast, and durable timeline event",
- "resumed the incident and confirmed the open timeline refreshed immediately with Alert notifications resumed",
- "verified the dialog and alert workflow at 390x844 with readable copy and no horizontal control overflow"
+ "expanded the first backup-vault row and confirmed two aligned equal-height desktop cards with a local 7rem label column",
+ "confirmed the same sections retain compact native table rows at 390x844 with zero document horizontal overflow",
+ "reloaded the final implementation and confirmed no new browser console errors"
]
}
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx
index 80468f3e33..8291e514a0 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx
@@ -1,12 +1,19 @@
-import { For, Show } from 'solid-js';
-import type { Component } from 'solid-js';
+import { For, Show, type Component, type JSX } from 'solid-js';
import type { Resource } from '@/types/resource';
import { isContainerUpdatePinned } from '@/components/shared/containerUpdateBadgeModel';
+import { DetailSectionTable } from '@/components/shared/DetailSectionTable';
+import {
+ compactDetailRows,
+ compactDetailSections,
+ makeDetailRow,
+ type DetailRow,
+ type DetailSection,
+} from '@/components/shared/detailSectionModel';
import { TagBadges } from '@/components/shared/TagBadges';
import { formatBytes, formatRelativeTime, formatUptime } from '@/utils/format';
+import { getDockerImageRegistryLink } from '@/features/docker/dockerImageReference';
import { formatInteger } from './resourceDetailMappers';
import type { UseResourceDetailDrawerStateResult } from './useResourceDetailDrawerState';
-import { getDockerImageRegistryLink } from '@/features/docker/dockerImageReference';
interface ResourceSummaryPresentationProps {
resource: Resource;
@@ -16,10 +23,6 @@ interface ResourceSummaryPresentationProps {
dataTestId?: string;
}
-// Docker / Podman containers carry runtime facts (image, restart count,
-// created-at, compose membership, labels) that no generic summary row
-// surfaces. v5 rendered all of these in the container drawer; the unified
-// payload still ships them on resource.docker.
const dockerContainerMeta = (resource: Resource): NonNullable<Resource['docker']> | null => {
if (resource.type !== 'app-container') return null;
const docker = resource.docker;
@@ -61,450 +64,241 @@ const dockerTimestampMillis = (value: string | undefined): number | null => {
const dockerByteTotal = (value: number | undefined): number | null =>
typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : null;
-const DockerContainerSummarySection: Component<{ docker: NonNullable<Resource['docker']> }> = (
- props,
-) => {
- const labels = () => props.docker.labels ?? {};
- const labelEntries = () => Object.entries(labels());
- const createdAt = () => dockerTimestampMillis(props.docker.createdAt);
- const startedAt = () => dockerTimestampMillis(props.docker.startedAt);
- const finishedAt = () => dockerTimestampMillis(props.docker.finishedAt);
- const podman = () => props.docker.podman;
- const podmanPodName = () => trimmedDockerValue(podman()?.podName);
- const podmanPodId = () => trimmedDockerValue(podman()?.podId);
- const composeProject = () =>
- trimmedDockerValue(podman()?.composeProject) || composeLabelValue(labels(), 'project');
- const composeService = () =>
- trimmedDockerValue(podman()?.composeService) || composeLabelValue(labels(), 'service');
- const autoUpdatePolicy = () => trimmedDockerValue(podman()?.autoUpdatePolicy);
- const userNamespace = () => trimmedDockerValue(podman()?.userNamespace);
- const blockReadBytes = () => dockerByteTotal(props.docker.blockIo?.readBytes);
- const blockWriteBytes = () => dockerByteTotal(props.docker.blockIo?.writeBytes);
- const restartCount = () => props.docker.restartCount;
- const updateStatus = () => props.docker.updateStatus;
- const imageRegistryLink = () =>
- updateStatus()?.updateAvailable ? getDockerImageRegistryLink(props.docker.image) : null;
- const updateState = () => {
- const update = updateStatus();
- if (!update) return '';
- if (isContainerUpdatePinned(update)) return 'Pinned digest';
- if (trimmedDockerValue(update.error)) return 'Check failed';
- return update.updateAvailable ? 'Available' : 'Current';
- };
+const richRow = (
+ label: string,
+ value: string,
+ valueContent: JSX.Element,
+ options: Pick<DetailRow, 'title' | 'tone' | 'wrap' | 'valueClass'> = {},
+): DetailRow => ({ label, value, valueContent, ...options });
- return (
- <tbody
- data-testid="resource-docker-container-section"
- class="divide-y divide-border border-t border-border"
- >
- <tr class="bg-surface-alt">
- <th
- colspan="2"
- class="px-2 py-1 text-left text-[10px] font-semibold uppercase tracking-wide text-muted"
- >
- Container
- </th>
- </tr>
- <Show when={(props.docker.image || '').trim()}>
- <tr>
- <td class="w-[38%] px-2 py-1 text-muted">Image</td>
- <td class="px-2 py-1 text-right font-medium text-base-content" title={props.docker.image}>
- <span class="block truncate">{props.docker.image}</span>
- </td>
- </tr>
- </Show>
- <Show when={updateState()}>
- <tr>
- <td class="px-2 py-1 text-muted">Image update</td>
- <td
- class={`px-2 py-1 text-right font-medium ${
- updateStatus()?.updateAvailable
- ? 'text-sky-700 dark:text-sky-300'
- : updateStatus()?.error
- ? 'text-red-600 dark:text-red-400'
- : 'text-base-content'
- }`}
- title={updateStatus()?.error}
- >
- {updateState()}
- </td>
- </tr>
- </Show>
- <Show when={trimmedDockerValue(updateStatus()?.currentDigest)}>
- {(digest) => (
- <tr>
- <td class="px-2 py-1 text-muted">Current digest</td>
- <td
- class="break-all px-2 py-1 text-right font-mono text-[10px] font-medium text-base-content"
- title={digest()}
- >
- {digest()}
- </td>
- </tr>
- )}
- </Show>
- <Show when={trimmedDockerValue(updateStatus()?.latestDigest)}>
- {(digest) => (
- <tr>
- <td class="px-2 py-1 text-muted">Target digest</td>
- <td
- class="break-all px-2 py-1 text-right font-mono text-[10px] font-medium text-base-content"
- title={digest()}
- >
- {digest()}
- </td>
- </tr>
- )}
- </Show>
- <Show when={imageRegistryLink()}>
- {(link) => (
- <tr>
- <td class="px-2 py-1 text-muted">Release information</td>
- <td class="px-2 py-1 text-right font-medium">
- <a
- href={link().href}
- target="_blank"
- rel="noopener noreferrer"
- class="text-sky-700 hover:underline dark:text-sky-300"
- >
- {link().label}
- </a>
- </td>
- </tr>
- )}
- </Show>
- <Show when={typeof restartCount() === 'number'}>
- <tr>
- <td class="px-2 py-1 text-muted">Restarts</td>
- <td
- class={`px-2 py-1 text-right font-medium ${
- (restartCount() ?? 0) > 5 ? 'text-red-600 dark:text-red-400' : 'text-base-content'
- }`}
+const dockerSection = (docker: NonNullable<Resource['docker']>): DetailSection => {
+ const labels = docker.labels ?? {};
+ const labelEntries = Object.entries(labels);
+ const createdAt = dockerTimestampMillis(docker.createdAt);
+ const startedAt = dockerTimestampMillis(docker.startedAt);
+ const finishedAt = dockerTimestampMillis(docker.finishedAt);
+ const podmanPodName = trimmedDockerValue(docker.podman?.podName);
+ const podmanPodId = trimmedDockerValue(docker.podman?.podId);
+ const composeProject =
+ trimmedDockerValue(docker.podman?.composeProject) || composeLabelValue(labels, 'project');
+ const composeService =
+ trimmedDockerValue(docker.podman?.composeService) || composeLabelValue(labels, 'service');
+ const autoUpdatePolicy = trimmedDockerValue(docker.podman?.autoUpdatePolicy);
+ const userNamespace = trimmedDockerValue(docker.podman?.userNamespace);
+ const blockReadBytes = dockerByteTotal(docker.blockIo?.readBytes);
+ const blockWriteBytes = dockerByteTotal(docker.blockIo?.writeBytes);
+ const update = docker.updateStatus;
+ const updateState = update
+ ? isContainerUpdatePinned(update)
+ ? 'Pinned digest'
+ : trimmedDockerValue(update.error)
+ ? 'Check failed'
+ : update.updateAvailable
+ ? 'Available'
+ : 'Current'
+ : '';
+ const image = trimmedDockerValue(docker.image);
+ const imageRegistryLink = update?.updateAvailable
+ ? getDockerImageRegistryLink(docker.image)
+ : null;
+
+ const rows = compactDetailRows([
+ makeDetailRow('Image', image, { title: image }),
+ makeDetailRow('Image update', updateState, {
+ title: update?.error,
+ tone: update?.updateAvailable ? 'accent' : update?.error ? 'danger' : 'default',
+ }),
+ makeDetailRow('Current digest', trimmedDockerValue(update?.currentDigest), {
+ valueClass: 'break-all font-mono text-[10px]',
+ wrap: true,
+ }),
+ makeDetailRow('Target digest', trimmedDockerValue(update?.latestDigest), {
+ valueClass: 'break-all font-mono text-[10px]',
+ wrap: true,
+ }),
+ imageRegistryLink
+ ? richRow(
+ 'Release information',
+ imageRegistryLink.label,
+ <a
+ href={imageRegistryLink.href}
+ target="_blank"
+ rel="noopener noreferrer"
+ class="text-sky-700 hover:underline dark:text-sky-300"
>
- {formatInteger(restartCount())}
- </td>
- </tr>
- </Show>
- <Show when={createdAt()}>
- {(created) => (
- <tr>
- <td class="px-2 py-1 text-muted">Created</td>
- <td
- class="px-2 py-1 text-right font-medium text-base-content"
- title={new Date(created()).toLocaleString()}
- >
- {formatRelativeTime(created())}
- </td>
- </tr>
- )}
- </Show>
- <Show when={startedAt()}>
- {(started) => (
- <tr>
- <td class="px-2 py-1 text-muted">Started</td>
- <td
- class="px-2 py-1 text-right font-medium text-base-content"
- title={new Date(started()).toLocaleString()}
- >
- {formatRelativeTime(started())}
- </td>
- </tr>
- )}
- </Show>
- <Show when={finishedAt()}>
- {(finished) => (
- <tr>
- <td class="px-2 py-1 text-muted">Finished</td>
- <td
- class="px-2 py-1 text-right font-medium text-base-content"
- title={new Date(finished()).toLocaleString()}
- >
- {formatRelativeTime(finished())}
- </td>
- </tr>
- )}
- </Show>
- <Show when={podmanPodName()}>
- <tr>
- <td class="px-2 py-1 text-muted">Podman pod</td>
- <td class="px-2 py-1 text-right font-medium text-base-content" title={podmanPodName()}>
- <span class="block truncate">{podmanPodName()}</span>
- </td>
- </tr>
- </Show>
- <Show when={podmanPodId()}>
- <tr>
- <td class="px-2 py-1 text-muted">Podman pod ID</td>
- <td class="px-2 py-1 text-right font-medium text-base-content" title={podmanPodId()}>
- <span class="block truncate">{podmanPodId()}</span>
- </td>
- </tr>
- </Show>
- <Show when={typeof podman()?.infra === 'boolean'}>
- <tr>
- <td class="px-2 py-1 text-muted">Podman infra</td>
- <td class="px-2 py-1 text-right font-medium text-base-content">
- {podman()?.infra ? 'Yes' : 'No'}
- </td>
- </tr>
- </Show>
- <Show when={composeProject()}>
- <tr>
- <td class="px-2 py-1 text-muted">Compose project</td>
- <td class="px-2 py-1 text-right font-medium text-base-content">{composeProject()}</td>
- </tr>
- </Show>
- <Show when={composeService()}>
- <tr>
- <td class="px-2 py-1 text-muted">Compose service</td>
- <td class="px-2 py-1 text-right font-medium text-base-content">{composeService()}</td>
- </tr>
- </Show>
- <Show when={autoUpdatePolicy()}>
- <tr>
- <td class="px-2 py-1 text-muted">Auto-update</td>
- <td class="px-2 py-1 text-right font-medium text-base-content">{autoUpdatePolicy()}</td>
- </tr>
- </Show>
- <Show when={userNamespace()}>
- <tr>
- <td class="px-2 py-1 text-muted">User namespace</td>
- <td class="px-2 py-1 text-right font-medium text-base-content" title={userNamespace()}>
- <span class="block truncate">{userNamespace()}</span>
- </td>
- </tr>
- </Show>
- <Show when={blockReadBytes()}>
- {(readBytes) => (
- <tr>
- <td class="px-2 py-1 text-muted">Block I/O read</td>
- <td class="px-2 py-1 text-right font-medium text-base-content">
- {formatBytes(readBytes())}
- </td>
- </tr>
- )}
- </Show>
- <Show when={blockWriteBytes()}>
- {(writeBytes) => (
- <tr>
- <td class="px-2 py-1 text-muted">Block I/O write</td>
- <td class="px-2 py-1 text-right font-medium text-base-content">
- {formatBytes(writeBytes())}
- </td>
- </tr>
- )}
- </Show>
- <Show when={labelEntries().length > 0}>
- <tr>
- <td class="px-2 py-1 align-top text-muted">Labels</td>
- <td class="px-2 py-1">
- <div class="flex flex-wrap justify-end gap-1">
- <For each={labelEntries()}>
- {([key, value]) => (
+ {imageRegistryLink.label}
+ </a>,
+ )
+ : null,
+ typeof docker.restartCount === 'number'
+ ? makeDetailRow('Restarts', formatInteger(docker.restartCount), {
+ tone: docker.restartCount > 5 ? 'danger' : 'default',
+ })
+ : null,
+ createdAt
+ ? makeDetailRow('Created', formatRelativeTime(createdAt), {
+ title: new Date(createdAt).toLocaleString(),
+ })
+ : null,
+ startedAt
+ ? makeDetailRow('Started', formatRelativeTime(startedAt), {
+ title: new Date(startedAt).toLocaleString(),
+ })
+ : null,
+ finishedAt
+ ? makeDetailRow('Finished', formatRelativeTime(finishedAt), {
+ title: new Date(finishedAt).toLocaleString(),
+ })
+ : null,
+ makeDetailRow('Podman pod', podmanPodName),
+ makeDetailRow('Podman pod ID', podmanPodId),
+ typeof docker.podman?.infra === 'boolean'
+ ? makeDetailRow('Podman infra', docker.podman.infra ? 'Yes' : 'No')
+ : null,
+ makeDetailRow('Compose project', composeProject),
+ makeDetailRow('Compose service', composeService),
+ makeDetailRow('Auto-update', autoUpdatePolicy),
+ makeDetailRow('User namespace', userNamespace),
+ blockReadBytes !== null ? makeDetailRow('Block I/O read', formatBytes(blockReadBytes)) : null,
+ blockWriteBytes !== null
+ ? makeDetailRow('Block I/O write', formatBytes(blockWriteBytes))
+ : null,
+ labelEntries.length > 0
+ ? richRow(
+ 'Labels',
+ labelEntries.map(([key, value]) => (value ? `${key}: ${value}` : key)).join(', '),
+ <div class="flex flex-wrap gap-1">
+ <For each={labelEntries}>
+ {([key, value]) => (
+ <span
+ class="inline-flex max-w-full items-center truncate rounded bg-surface-alt px-1.5 py-0.5 text-[10px]"
+ title={value ? `${key}: ${value}` : key}
+ >
+ {key}
+ <Show when={value}>: {value}</Show>
+ </span>
+ )}
+ </For>
+ </div>,
+ { wrap: true },
+ )
+ : null,
+ ]);
+
+ return { label: 'Container', rows, testId: 'resource-docker-container-section' };
+};
+
+export const InlineResourceSummaryTables: Component<ResourceSummaryPresentationProps> = (props) => {
+ const sections = (): DetailSection[] => {
+ const docker = dockerContainerMeta(props.resource);
+ const identityRows = compactDetailRows([
+ ...props.drawer.primaryIdentityRows().map((row) => makeDetailRow(row.label, row.value)),
+ props.showPlatformId ? makeDetailRow('Platform ID', props.resource.platformId) : null,
+ props.drawer.identityIpValues().length > 0
+ ? richRow(
+ 'IP Addresses',
+ props.drawer.identityIpValues().join(', '),
+ <div class="flex flex-wrap gap-1">
+ <For each={props.drawer.identityIpValues()}>
+ {(ip) => (
<span
- class="inline-flex max-w-full items-center truncate rounded bg-surface-alt px-1.5 py-0.5 text-[10px]"
- title={value ? `${key}: ${value}` : key}
+ class="inline-flex items-center rounded bg-blue-100 px-1.5 py-0.5 text-[10px] text-blue-700 dark:bg-blue-900 dark:text-blue-200"
+ title={ip}
>
- {key}
- <Show when={value}>: {value}</Show>
+ {ip}
</span>
)}
</For>
- </div>
- </td>
- </tr>
- </Show>
- </tbody>
+ </div>,
+ )
+ : null,
+ props.resource.tags?.length
+ ? richRow(
+ 'Tags',
+ props.resource.tags.join(', '),
+ <TagBadges tags={props.resource.tags} maxVisible={6} />,
+ )
+ : null,
+ props.drawer.identityAliasValues().length > 0
+ ? richRow(
+ 'Aliases',
+ props.drawer.identityAliasValues().join(', '),
+ <div class="flex flex-wrap gap-1">
+ <For each={props.drawer.aliasPreviewValues()}>
+ {(value) => (
+ <span
+ class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px]"
+ title={value}
+ >
+ {value}
+ </span>
+ )}
+ </For>
+ <Show when={props.drawer.hasAliasOverflow()}>
+ <span class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px] text-muted">
+ +
+ {props.drawer.identityAliasValues().length -
+ props.drawer.aliasPreviewValues().length}
+ </span>
+ </Show>
+ </div>,
+ )
+ : null,
+ !props.drawer.identityCardHasRichData()
+ ? makeDetailRow('Metadata', 'No identity metadata yet.', { tone: 'muted' })
+ : null,
+ ]);
+
+ return compactDetailSections([
+ props.content !== 'technical'
+ ? {
+ label: 'Operator context',
+ testId: 'resource-current-state-section',
+ rows: compactDetailRows([
+ props.drawer.sourceSummary()
+ ? makeDetailRow('Pulse coverage', props.drawer.sourceSummary()?.label, {
+ title: props.drawer.sourceSummary()?.title,
+ valueClass: props.drawer.sourceSummary()?.className,
+ })
+ : null,
+ makeDetailRow('Primary IP', props.drawer.identityIpValues()[0]),
+ ]),
+ }
+ : null,
+ props.content !== 'overview'
+ ? {
+ label: 'Runtime context',
+ testId: 'resource-runtime-context-section',
+ rows: compactDetailRows([
+ makeDetailRow('Observed state', props.resource.status || 'unknown', {
+ valueClass: 'capitalize',
+ }),
+ props.resource.uptime
+ ? makeDetailRow('Uptime', formatUptime(props.resource.uptime))
+ : null,
+ props.resource.lastSeen
+ ? makeDetailRow('Last seen', props.drawer.lastSeen() || '—', {
+ title: props.drawer.lastSeenAbsolute(),
+ })
+ : null,
+ ]),
+ }
+ : null,
+ props.content !== 'overview' && docker ? dockerSection(docker) : null,
+ props.content !== 'overview'
+ ? {
+ label: 'Identity',
+ testId: 'resource-identity-section',
+ rows: identityRows,
+ }
+ : null,
+ ]);
+ };
+
+ return (
+ <DetailSectionTable
+ sections={sections()}
+ dataTestId={props.dataTestId ?? 'resource-summary-section'}
+ />
);
};
-
-export const InlineResourceSummaryTables: Component<ResourceSummaryPresentationProps> = (props) => (
- <div
- data-testid={props.dataTestId ?? 'resource-summary-section'}
- class="overflow-hidden rounded border border-border bg-surface"
- >
- <table class="w-full table-fixed text-[11px]">
- <Show
- when={
- props.content !== 'technical' &&
- Boolean(props.drawer.sourceSummary() || props.drawer.identityIpValues()[0])
- }
- >
- <tbody data-testid="resource-current-state-section" class="divide-y divide-border">
- <tr class="bg-surface-alt">
- <th
- colspan="2"
- class="px-2 py-1 text-left text-[10px] font-semibold uppercase tracking-wide text-muted"
- >
- Operator context
- </th>
- </tr>
- <Show when={props.drawer.sourceSummary()}>
- {(source) => (
- <tr>
- <td class="w-[38%] px-2 py-1 text-muted">Pulse coverage</td>
- <td
- class={`px-2 py-1 text-right font-medium ${source().className}`}
- title={source().title}
- >
- {source().label}
- </td>
- </tr>
- )}
- </Show>
- <Show when={props.drawer.identityIpValues()[0]}>
- {(ip) => (
- <tr>
- <td class="w-[38%] px-2 py-1 text-muted">Primary IP</td>
- <td class="px-2 py-1 text-right font-medium text-base-content" title={ip()}>
- <span class="block truncate">{ip()}</span>
- </td>
- </tr>
- )}
- </Show>
- </tbody>
- </Show>
- <Show when={props.content !== 'overview'}>
- <tbody
- data-testid="resource-runtime-context-section"
- class="divide-y divide-border border-t border-border"
- >
- <tr class="bg-surface-alt">
- <th
- colspan="2"
- class="px-2 py-1 text-left text-[10px] font-semibold uppercase tracking-wide text-muted"
- >
- Runtime context
- </th>
- </tr>
- <tr>
- <td class="w-[38%] px-2 py-1 text-muted">Observed state</td>
- <td class="px-2 py-1 text-right font-medium capitalize text-base-content">
- {props.resource.status || 'unknown'}
- </td>
- </tr>
- <Show when={props.resource.uptime}>
- <tr>
- <td class="px-2 py-1 text-muted">Uptime</td>
- <td class="px-2 py-1 text-right font-medium text-base-content">
- {formatUptime(props.resource.uptime ?? 0)}
- </td>
- </tr>
- </Show>
- <Show when={props.resource.lastSeen}>
- <tr>
- <td class="px-2 py-1 text-muted">Last seen</td>
- <td
- class="px-2 py-1 text-right font-medium text-base-content"
- title={props.drawer.lastSeenAbsolute()}
- >
- {props.drawer.lastSeen() || '—'}
- </td>
- </tr>
- </Show>
- </tbody>
- </Show>
- <Show when={props.content !== 'overview' && dockerContainerMeta(props.resource)}>
- {(docker) => <DockerContainerSummarySection docker={docker()} />}
- </Show>
- <Show when={props.content !== 'overview'}>
- <tbody
- data-testid="resource-identity-section"
- class="divide-y divide-border border-t border-border"
- >
- <tr class="bg-surface-alt">
- <th
- colspan="2"
- class="px-2 py-1 text-left text-[10px] font-semibold uppercase tracking-wide text-muted"
- >
- Identity
- </th>
- </tr>
- <For each={props.drawer.primaryIdentityRows()}>
- {(row) => (
- <tr>
- <td class="w-[38%] px-2 py-1 text-muted">{row.label}</td>
- <td class="px-2 py-1 text-right font-medium text-base-content" title={row.value}>
- <span class="block truncate">{row.value}</span>
- </td>
- </tr>
- )}
- </For>
- <Show when={props.showPlatformId}>
- <tr>
- <td class="w-[38%] px-2 py-1 text-muted">Platform ID</td>
- <td
- class="px-2 py-1 text-right font-medium text-base-content"
- title={props.resource.platformId}
- >
- <span class="block truncate">{props.resource.platformId}</span>
- </td>
- </tr>
- </Show>
- <Show when={props.drawer.identityIpValues().length > 0}>
- <tr>
- <td class="px-2 py-1 align-top text-muted">IP Addresses</td>
- <td class="px-2 py-1">
- <div class="flex flex-wrap justify-end gap-1">
- <For each={props.drawer.identityIpValues()}>
- {(ip) => (
- <span
- class="inline-flex items-center rounded bg-blue-100 px-1.5 py-0.5 text-[10px] text-blue-700 dark:bg-blue-900 dark:text-blue-200"
- title={ip}
- >
- {ip}
- </span>
- )}
- </For>
- </div>
- </td>
- </tr>
- </Show>
- <Show when={props.resource.tags && props.resource.tags.length > 0}>
- <tr>
- <td class="px-2 py-1 align-top text-muted">Tags</td>
- <td class="px-2 py-1">
- <div class="flex justify-end">
- <TagBadges tags={props.resource.tags} maxVisible={6} />
- </div>
- </td>
- </tr>
- </Show>
- <Show when={props.drawer.identityAliasValues().length > 0}>
- <tr>
- <td class="px-2 py-1 align-top text-muted">Aliases</td>
- <td class="px-2 py-1">
- <div class="flex flex-wrap justify-end gap-1">
- <For each={props.drawer.aliasPreviewValues()}>
- {(value) => (
- <span
- class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px]"
- title={value}
- >
- {value}
- </span>
- )}
- </For>
- <Show when={props.drawer.hasAliasOverflow()}>
- <span class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px] text-muted">
- +
- {props.drawer.identityAliasValues().length -
- props.drawer.aliasPreviewValues().length}
- </span>
- </Show>
- </div>
- </td>
- </tr>
- </Show>
- <Show when={!props.drawer.identityCardHasRichData()}>
- <tr>
- <td colspan="2" class="px-2 py-1 text-muted">
- No identity metadata yet.
- </td>
- </tr>
- </Show>
- </tbody>
- </Show>
- </table>
- </div>
-);
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
index 8c02264168..93d32e26bf 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
@@ -182,6 +182,8 @@ describe('ResourceDetailDrawer change history section', () => {
"from './ResourceInvestigationContextTables'",
);
expect(resourceDetailSummarySource).toContain("from '@/components/shared/TagBadges'");
+ expect(resourceDetailSummarySource).toContain("from '@/components/shared/DetailSectionTable'");
+ expect(resourceDetailSummarySource).not.toContain('<table');
expect(resourceInvestigationContextSource).toContain('<table');
expect(resourceInvestigationContextSource).toContain('RESOURCE_SAFE_SUMMARY_LABEL');
expect(resourceDetailDrawerOverviewSource).toContain('getAllFilterOptionLabel');
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.truenas-details.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.truenas-details.test.tsx
index 0629c704c9..9638d06d11 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.truenas-details.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.truenas-details.test.tsx
@@ -250,7 +250,7 @@ describe('ResourceDetailDrawer TrueNAS details', () => {
expect(getByTestId('resource-technical-summary-section').querySelector('table')).toBeTruthy();
expect(() => getByTestId('resource-current-state-section')).toThrow();
expect(getByTestId('resource-identity-section').tagName).toBe('TBODY');
- expect(summary.querySelector('[class*="shadow-sm"]')).toBeNull();
+ expect(summary.querySelector('[class*="shadow-sm"]')).not.toBeNull();
expect(getByRole('button', { name: 'Hide TrueNAS' })).toBeInTheDocument();
const trueNASSection = getByTestId('resource-truenas-details-section');
expect(
diff --git a/frontend-modern/src/components/shared/DetailSectionTable.tsx b/frontend-modern/src/components/shared/DetailSectionTable.tsx
index c10aa63950..3384d0fefe 100644
--- a/frontend-modern/src/components/shared/DetailSectionTable.tsx
+++ b/frontend-modern/src/components/shared/DetailSectionTable.tsx
@@ -34,8 +34,10 @@ const detailSectionDesktopBasisClass = (sectionCount: number): string =>
export const DetailSectionTable: Component<{
sections: DetailSection[];
class?: string;
+ dataTestId?: string;
}> = (props) => (
<div
+ data-testid={props.dataTestId}
class={`${props.class ?? 'overflow-hidden rounded border border-border bg-surface'} lg:overflow-visible lg:border-0 lg:bg-transparent`}
>
<Table
@@ -45,6 +47,7 @@ export const DetailSectionTable: Component<{
<For each={props.sections}>
{(section) => (
<TableBody
+ data-testid={section.testId}
class={`divide-y divide-border lg:flex lg:min-w-[16rem] lg:flex-1 lg:flex-col lg:overflow-hidden lg:rounded lg:border lg:border-border lg:bg-surface lg:p-3 lg:shadow-sm lg:divide-y-0 ${detailSectionDesktopBasisClass(props.sections.length)}`}
>
<TableRow class="bg-surface-alt lg:mb-1 lg:block lg:bg-transparent lg:hover:bg-transparent">
@@ -64,19 +67,21 @@ export const DetailSectionTable: Component<{
<TableCell
class={`px-2 py-1 text-right align-top font-medium lg:min-w-0 lg:px-0 lg:py-0 lg:text-left ${detailValueToneClass(
row.tone,
- )}`}
+ )} ${row.valueClass ?? ''}`}
title={row.title ?? row.value}
>
- <span
- title={row.title ?? row.value}
- class={
- row.wrap
- ? 'block whitespace-normal break-words text-left leading-snug'
- : 'block truncate'
- }
- >
- {row.value}
- </span>
+ {row.valueContent ?? (
+ <span
+ title={row.title ?? row.value}
+ class={
+ row.wrap
+ ? 'block whitespace-normal break-words text-left leading-snug'
+ : 'block truncate'
+ }
+ >
+ {row.value}
+ </span>
+ )}
{row.progress ? (
<ProgressBar
value={row.progress.value}
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 2450732e8f..f7766f7e72 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -7931,6 +7931,8 @@ describe('shared primitive guardrails', () => {
expect(detailSectionTableSource).toContain('lg:grid-cols-[7rem_minmax(0,1fr)]');
expect(detailSectionTableSource).toContain('lg:text-left');
expect(detailSectionTableSource).toContain('lg:divide-y-0');
+ expect(resourceDetailSummarySource).toContain("from '@/components/shared/DetailSectionTable'");
+ expect(resourceDetailSummarySource).not.toContain('<table');
for (const source of [
resourceDetailDrawerKubernetesModelSource,
diff --git a/frontend-modern/src/components/shared/__tests__/DetailSectionTable.test.tsx b/frontend-modern/src/components/shared/__tests__/DetailSectionTable.test.tsx
index 6eb651f17a..fa7f02fdd6 100644
--- a/frontend-modern/src/components/shared/__tests__/DetailSectionTable.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/DetailSectionTable.test.tsx
@@ -101,6 +101,38 @@ describe('DetailSectionTable', () => {
expect(screen.getByText('Warning').closest('td')).toHaveClass('lg:text-left');
});
+ it('preserves section test hooks and rich value content inside the shared layout', () => {
+ render(() => (
+ <DetailSectionTable
+ dataTestId="resource-summary"
+ sections={[
+ {
+ label: 'Container',
+ testId: 'resource-container-section',
+ rows: [
+ {
+ label: 'Release information',
+ value: 'View release',
+ valueClass: 'font-mono',
+ valueContent: <a href="https://example.test/release">View release</a>,
+ },
+ ],
+ },
+ ]}
+ />
+ ));
+
+ expect(screen.getByTestId('resource-summary')).toBeInTheDocument();
+ expect(screen.getByTestId('resource-container-section').tagName).toBe('TBODY');
+ expect(screen.getByRole('link', { name: 'View release' })).toHaveAttribute(
+ 'href',
+ 'https://example.test/release',
+ );
+ expect(screen.getByRole('link', { name: 'View release' }).closest('td')).toHaveClass(
+ 'font-mono',
+ );
+ });
+
it('renders optional row progress without replacing its compact text value', () => {
const { container } = render(() => (
<DetailSectionTable
diff --git a/frontend-modern/src/components/shared/detailSectionModel.ts b/frontend-modern/src/components/shared/detailSectionModel.ts
index 09282014ca..cd45016f5c 100644
--- a/frontend-modern/src/components/shared/detailSectionModel.ts
+++ b/frontend-modern/src/components/shared/detailSectionModel.ts
@@ -1,3 +1,4 @@
+import type { JSX } from 'solid-js';
import { formatBytes } from '@/utils/format';
export type DetailValueTone = 'default' | 'accent' | 'success' | 'warning' | 'danger' | 'muted';
@@ -11,6 +12,8 @@ export type DetailRowProgress = {
export type DetailRow = {
label: string;
value: string;
+ valueContent?: JSX.Element;
+ valueClass?: string;
title?: string;
tone?: DetailValueTone;
wrap?: boolean;
@@ -20,12 +23,16 @@ export type DetailRow = {
export type DetailSection = {
label: string;
rows: DetailRow[];
+ testId?: string;
};
export const makeDetailRow = (
label: string,
value?: string | null,
- options: Pick<DetailRow, 'title' | 'tone' | 'wrap' | 'progress'> = {},
+ options: Pick<
+ DetailRow,
+ 'title' | 'tone' | 'wrap' | 'progress' | 'valueContent' | 'valueClass'
+ > = {},
): DetailRow | null => {
const trimmed = value?.trim();
if (!trimmed || trimmed === '-') return null;