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.

Make image check failures readable without hovering

pulse-triage[bot]38205b5fb55e
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx
index 9ad3607691..9b286f84a8 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx
@@ -347,6 +347,18 @@ const dockerImageSection = (
const rows = compactDetailRows([
makeDetailRow('Update check', operational.updateLabel, {
title: operational.updateDetail,
+ // The table's failure badge opens this ordinary drawer. Keep the reason
+ // in the visible, selectable value too: a title alone is not available
+ // to keyboard or touch users. Render it as text, never registry HTML.
+ valueContent: (
+ <span class="!block min-w-0 whitespace-normal text-left wrap-anywhere">
+ <span class="block">{operational.updateLabel}</span>
+ <span class="mt-1 block select-text whitespace-pre-wrap font-normal">
+ {operational.updateDetail}
+ </span>
+ </span>
+ ),
+ wrap: true,
tone:
operational.updateTone === 'danger'
? 'danger'
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.platform-content.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.platform-content.test.tsx
index 5094a72971..65a69b3f54 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.platform-content.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.platform-content.test.tsx
@@ -137,6 +137,67 @@ describe('ResourceDetailDrawer platform content', () => {
expect(facts(unused.getByTestId)).toContain('Unused');
});
+ it.each(['image', 'consumer'])('shows the %s check failure as ordinary wrapping text', (source) => {
+ const error = 'authentication required\n<em>registry.example.invalid</em>';
+ const updateStatus = { updateAvailable: false, error };
+ const image = baseResource({
+ id: 'image-failed',
+ type: 'docker-image',
+ name: 'registry.example.invalid/team/web:latest',
+ docker: {
+ hostname: 'edge-01',
+ image: 'registry.example.invalid/team/web:latest',
+ ...(source === 'image' ? { updateStatus } : {}),
+ },
+ });
+ if (source === 'consumer') {
+ estate.push(
+ baseResource({
+ id: 'consumer-failed',
+ type: 'app-container',
+ name: 'web',
+ docker: { image: image.docker!.image, updateStatus },
+ }),
+ );
+ }
+ const { getByTestId } = render(() => <ResourceDetailDrawer resource={image} />);
+ const lifted = getByTestId('resource-drawer-exceptions');
+ const reason = within(lifted).getByText(error, { exact: true, normalizer: (value) => value });
+ expect(within(lifted).getByText('Check failed')).toBeInTheDocument();
+ expect(reason).toHaveClass('select-text', 'whitespace-pre-wrap');
+ expect(reason.parentElement).toHaveClass('wrap-anywhere');
+ expect(reason.closest('details')).toBeNull();
+ expect(reason.querySelector('em')).toBeNull();
+ expect(reason.textContent).toBe(error);
+ });
+
+ it.each([
+ ['Current', { updateAvailable: false }, 'No newer digest was reported by the last image check.'],
+ ['Not checked', undefined, 'No update comparison has been reported for this image.'],
+ [
+ 'Pinned',
+ { updateAvailable: false, error: 'digest-pinned image' },
+ 'The image is pinned to a specific digest, so there is no tag to check against.',
+ ],
+ [
+ 'Local',
+ { updateAvailable: false, error: 'local image' },
+ 'The image was built or loaded on this host, so no registry has a newer version to check.',
+ ],
+ ] as const)('keeps %s distinct and gives its explanation in Details', (label, updateStatus, reason) => {
+ const image = baseResource({
+ id: 'image-state',
+ type: 'docker-image',
+ name: 'service:latest',
+ docker: { image: 'service:latest', updateStatus },
+ });
+ const { getByTestId, queryByTestId } = render(() => <ResourceDetailDrawer resource={image} />);
+ const section = within(getByTestId('resource-docker-image-section'));
+ expect(section.getByText(label)).toBeInTheDocument();
+ expect(section.getByText(reason)).toBeInTheDocument();
+ expect(queryByTestId('resource-drawer-exceptions')).toBeNull();
+ });
+
it('describes a Docker volume with its mountpoint in full', () => {
const volume = baseResource({
id: 'volume-data',
diff --git a/frontend-modern/src/features/docker/DockerImagesTable.tsx b/frontend-modern/src/features/docker/DockerImagesTable.tsx
index 172ff8b99f..21d6f13511 100644
--- a/frontend-modern/src/features/docker/DockerImagesTable.tsx
+++ b/frontend-modern/src/features/docker/DockerImagesTable.tsx
@@ -247,12 +247,32 @@ export const DockerImagesTable: Component<
{dockerByteValue(resource.docker?.sizeBytes)}
</TableCell>
<TableCell class={getPlatformTableCellClassForKind('badge')}>
- <span
- class={`inline-flex rounded-full px-2 py-0.5 text-[10px] font-medium ${updateToneClass[operational().updateTone]}`}
- title={operational().updateDetail}
+ <Show
+ when={operational().updateTone === 'danger'}
+ fallback={
+ <span
+ class={`inline-flex rounded-full px-2 py-0.5 text-[10px] font-medium ${updateToneClass[operational().updateTone]}`}
+ title={operational().updateDetail}
+ >
+ {operational().updateLabel}
+ </span>
+ }
>
- {operational().updateLabel}
- </span>
+ <button
+ type="button"
+ class={`inline-flex min-h-9 max-w-full items-center rounded-full px-2 py-0.5 text-[10px] font-medium underline decoration-dotted underline-offset-2 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sky-400/70 sm:min-h-0 ${updateToneClass[operational().updateTone]}`}
+ aria-label={`Check failed for ${dockerResourceName(resource)}; details`}
+ aria-expanded={isExpanded()}
+ aria-controls={detailRowId()}
+ title={operational().updateDetail}
+ onClick={(event) => {
+ event.stopPropagation();
+ drawer.toggle(resource);
+ }}
+ >
+ {operational().updateLabel}
+ </button>
+ </Show>
</TableCell>
</TableRow>
<PlatformResourceDetailTableRow
diff --git a/frontend-modern/src/features/docker/__tests__/DockerNativeTables.test.tsx b/frontend-modern/src/features/docker/__tests__/DockerNativeTables.test.tsx
index 4a49b9603c..dcfd1ad6e8 100644
--- a/frontend-modern/src/features/docker/__tests__/DockerNativeTables.test.tsx
+++ b/frontend-modern/src/features/docker/__tests__/DockerNativeTables.test.tsx
@@ -1499,6 +1499,88 @@ describe('Docker native tables', () => {
expect(screen.getByText('edge-01')).toBeInTheDocument();
});
+ it('opens a failed image check from a named native button without toggling its row twice', () => {
+ const error = 'authentication required (synthetic registry)';
+ const { container } = render(() => (
+ <DockerImagesTable
+ resources={[
+ makeResource({
+ id: 'image-failed',
+ type: 'docker-image',
+ name: 'registry.example.invalid/team/web:latest',
+ docker: {
+ hostname: 'edge-01',
+ image: 'registry.example.invalid/team/web:latest',
+ updateStatus: { updateAvailable: false, error },
+ },
+ }),
+ ]}
+ emptyIcon={<span />}
+ emptyTitle="No images"
+ emptyDescription="No images"
+ showToolbar={false}
+ />
+ ));
+
+ const button = screen.getByRole('button', {
+ name: 'Check failed for registry.example.invalid/team/web:latest; details',
+ });
+ expect(button).toHaveAttribute('type', 'button');
+ expect(button.tabIndex).toBe(0);
+ expect(button).toHaveAttribute('aria-expanded', 'false');
+ expect(screen.queryByText(error)).not.toBeInTheDocument();
+ button.focus();
+ fireEvent.click(button);
+ expect(button).toHaveFocus();
+ expect(button).toHaveAttribute('aria-expanded', 'true');
+ const detail = document.getElementById(button.getAttribute('aria-controls')!);
+ expect(detail).toBeInTheDocument();
+ expect(within(detail!).getByText(error)).toBeInTheDocument();
+ expect(detail).toHaveTextContent('Host edge-01');
+ expect(container.querySelectorAll('[data-inline-platform-resource-detail-for]')).toHaveLength(
+ 1,
+ );
+ fireEvent.click(button);
+ expect(button).toHaveAttribute('aria-expanded', 'false');
+ expect(screen.queryByText(error)).not.toBeInTheDocument();
+ expect(button).toHaveFocus();
+ expect(ResourceActionsAPI.planAction).not.toHaveBeenCalled();
+ expect(ResourceActionsAPI.executeAction).not.toHaveBeenCalled();
+ });
+
+ it('keeps two failed image explanations attached to their own expanded row', () => {
+ render(() => (
+ <DockerImagesTable
+ resources={['one', 'two'].map((name) =>
+ makeResource({
+ id: `image-${name}`,
+ type: 'docker-image',
+ name: `service-${name}:latest`,
+ docker: {
+ hostname: `edge-${name}`,
+ updateStatus: { updateAvailable: false, error: `registry failure ${name}` },
+ },
+ }),
+ )}
+ emptyIcon={<span />}
+ emptyTitle="No images"
+ emptyDescription="No images"
+ showToolbar={false}
+ />
+ ));
+
+ const one = screen.getByRole('button', { name: /Check failed for service-one/ });
+ const two = screen.getByRole('button', { name: /Check failed for service-two/ });
+ fireEvent.click(one);
+ expect(screen.getByText('registry failure one')).toBeInTheDocument();
+ expect(screen.queryByText('registry failure two')).not.toBeInTheDocument();
+ fireEvent.click(two);
+ expect(one).toHaveAttribute('aria-expanded', 'false');
+ expect(two).toHaveAttribute('aria-expanded', 'true');
+ expect(screen.queryByText('registry failure one')).not.toBeInTheDocument();
+ expect(screen.getByText('registry failure two')).toBeInTheDocument();
+ });
+
it('renders Docker volume API fields', () => {
render(() => (
<DockerVolumesTable