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.

Move workload links into name cells

rcourtmanf2077c61fe2d
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
index 3c55db9fbd..68bb98b5a9 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -351,7 +351,12 @@ regression protection.
responsive workload column priority and width model. `WorkloadsTable`,
`WorkloadTableHeader`, and `WorkloadPanel` must consume one shared
layout-visible column set so headers, colgroups, and rows stay aligned during
- live resize. View-mode-specific column sets in
+ live resize. Workload rows keep navigation inside owned identity cells
+ rather than trailing action columns: guest custom web-interface URLs render
+ on the workload name, and
+ grouped node web-interface navigation stays on the shared node header name,
+ so responsive colgroups and rows do not carry an otherwise empty link
+ column. View-mode-specific column sets in
`frontend-modern/src/components/Workloads/guestRowModel.tsx` must retain
core monitoring metrics when narrowing scope: app-container mode keeps CPU,
memory, disk, and the responsive Net I/O and Disk I/O columns available,
diff --git a/frontend-modern/src/components/Workloads/GuestRow.tsx b/frontend-modern/src/components/Workloads/GuestRow.tsx
index 61406c8921..6ec969ce2d 100644
--- a/frontend-modern/src/components/Workloads/GuestRow.tsx
+++ b/frontend-modern/src/components/Workloads/GuestRow.tsx
@@ -187,12 +187,30 @@ export function GuestRow(props: GuestRowProps) {
size="xs"
/>
<div class="flex items-center gap-1.5 min-w-0 group/name">
- <span
- class="text-[11px] font-medium text-base-content select-none truncate"
- title={props.guest.name}
+ <Show
+ when={customUrl()}
+ fallback={
+ <span
+ class="text-[11px] font-medium text-base-content select-none truncate"
+ title={props.guest.name}
+ >
+ {props.guest.name}
+ </span>
+ }
>
- {props.guest.name}
- </span>
+ {(href) => (
+ <a
+ href={href()}
+ target="_blank"
+ rel="noopener noreferrer"
+ class="text-[11px] font-medium text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 hover:underline select-none truncate"
+ title={`Open ${href()}`}
+ onClick={(event) => event.stopPropagation()}
+ >
+ {props.guest.name}
+ </a>
+ )}
+ </Show>
{/* Show backup indicator in name cell only if backup column is hidden */}
<Show when={!isColVisible('backup') && supportsBackup()}>
<BackupIndicator
@@ -422,7 +440,7 @@ export function GuestRow(props: GuestRowProps) {
<button
type="button"
class="text-xs text-blue-600 dark:text-blue-400 hover:underline truncate max-w-[80px]"
- title={`${props.guest.node} (Open related infrastructure)`}
+ title={`Open infrastructure node ${props.guest.node}`}
onClick={(event) => {
event.stopPropagation();
navigate(infrastructureHref());
@@ -707,59 +725,6 @@ export function GuestRow(props: GuestRowProps) {
</div>
</td>
</Show>
-
- {/* Link Column - at the end like InfrastructureSummaryTable */}
- <Show when={isColVisible('link')}>
- <td class="px-0 py-0.5 align-middle text-center">
- <Show
- when={customUrl() && customUrl() !== ''}
- fallback={
- <button
- type="button"
- class="inline-flex justify-center items-center text-muted hover:text-base-content transition-colors"
- title="Open related infrastructure"
- onClick={(event) => {
- event.stopPropagation();
- navigate(infrastructureHref());
- }}
- >
- <svg
- class="w-3.5 h-3.5"
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="2"
- >
- <rect x="2" y="2" width="20" height="8" rx="2" ry="2" />
- <rect x="2" y="14" width="20" height="8" rx="2" ry="2" />
- <line x1="6" y1="6" x2="6.01" y2="6" />
- <line x1="6" y1="18" x2="6.01" y2="18" />
- </svg>
- </button>
- }
- >
- <a
- href={customUrl()}
- target="_blank"
- rel="noopener noreferrer"
- class="inline-flex justify-center items-center text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 transition-colors"
- title={`Open ${customUrl()}`}
- onClick={(event) => event.stopPropagation()}
- >
- <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="2"
- d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
- />
- </svg>
- </a>
- </Show>
- </td>
- </Show>
</tr>
</>
);
diff --git a/frontend-modern/src/components/Workloads/WorkloadPanel.tsx b/frontend-modern/src/components/Workloads/WorkloadPanel.tsx
index b275186e29..75edb1ab29 100644
--- a/frontend-modern/src/components/Workloads/WorkloadPanel.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadPanel.tsx
@@ -76,9 +76,8 @@ const GROUP_NODE_NAME_CELL_CLASS = getGroupedTableRowCellClass(
'!py-1 !pl-2 sm:!pl-3 !pr-1.5 sm:!pr-2',
);
-const getGroupNodeColumnCellClass = (columnId: string, isNameColumn: boolean): string => {
+const getGroupNodeColumnCellClass = (_columnId: string, isNameColumn: boolean): string => {
if (isNameColumn) return GROUP_NODE_NAME_CELL_CLASS;
- if (columnId === 'link') return 'px-0 py-0.5 align-middle text-center';
return GROUP_NODE_METRIC_CELL_CLASS;
};
@@ -324,30 +323,6 @@ export function WorkloadPanel(props: WorkloadPanelProps) {
'font-mono text-amber-500',
node.diskWrite,
);
- case 'link': {
- const href = node.guestURL || node.host || `https://${node.name}:8006`;
- return (
- <Show when={href}>
- <a
- href={href}
- target="_blank"
- rel="noopener noreferrer"
- class="inline-flex justify-center items-center text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 transition-colors"
- title={`Open ${node.name} web interface`}
- onClick={(event) => event.stopPropagation()}
- >
- <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="2"
- d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
- />
- </svg>
- </a>
- </Show>
- );
- }
default:
return renderGroupNodeEmptyCell();
}
diff --git a/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx b/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx
index cb4e35ac71..bf637c715a 100644
--- a/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/GuestRow.test.tsx
@@ -690,8 +690,8 @@ describe('GuestRow', () => {
});
});
- describe('custom URL in link column', () => {
- it('renders external link when customUrl is set', () => {
+ describe('custom URL on the name cell', () => {
+ it('renders the workload name as the external link when customUrl is set', () => {
const { container } = renderGuestRow({
guest: makeGuest(),
customUrl: 'https://example.com',
@@ -700,16 +700,17 @@ describe('GuestRow', () => {
const link = container.querySelector('a[href="https://example.com"]');
expect(link).toBeTruthy();
expect(link?.getAttribute('target')).toBe('_blank');
+ expect(link?.textContent).toBe('test-vm');
+ expect(container.querySelector('td[data-workload-col="link"]')).toBeNull();
});
- it('renders infrastructure link button when no customUrl', () => {
+ it('does not render a trailing infrastructure fallback link when no customUrl is set', () => {
const { container } = renderGuestRow({
guest: makeGuest(),
visibleColumnIds: ['name', 'link'],
});
- // Should have a button instead of an anchor
- const buttons = container.querySelectorAll('td:last-child button');
- expect(buttons.length).toBeGreaterThan(0);
+ expect(container.querySelector('a[href="/infrastructure/node1"]')).toBeNull();
+ expect(container.querySelector('td[data-workload-col="link"]')).toBeNull();
});
});
@@ -805,16 +806,17 @@ describe('GuestRow', () => {
describe('GUEST_COLUMNS', () => {
it('has the expected number of columns', () => {
// name, type, info, vmid, cpu, memory, disk, ip, uptime, node,
- // image, namespace, context, backup, tags, update, os, netIo, diskIo, link
- expect(GUEST_COLUMNS.length).toBe(20);
+ // image, namespace, context, backup, tags, update, os, netIo, diskIo
+ expect(GUEST_COLUMNS.length).toBe(19);
});
it('has name as the first column', () => {
expect(GUEST_COLUMNS[0].id).toBe('name');
});
- it('has link as the last column', () => {
- expect(GUEST_COLUMNS[GUEST_COLUMNS.length - 1].id).toBe('link');
+ it('does not expose a trailing link column', () => {
+ expect(GUEST_COLUMNS.map((column) => column.id)).not.toContain('link');
+ expect(GUEST_COLUMNS[GUEST_COLUMNS.length - 1].id).toBe('diskIo');
});
it('marks toggleable columns correctly', () => {
@@ -848,12 +850,15 @@ describe('GUEST_COLUMNS', () => {
});
it('derives mobile overrides from the canonical guest column model', () => {
- expect(getGuestColumnStyle('name', true)).toEqual({ width: '44%', 'max-width': '44%' });
+ expect(getGuestColumnStyle('name', true)).toEqual({
+ width: '46.3158%',
+ 'max-width': '46.3158%',
+ });
expect(getGuestColumnStyle('cpu', true)).toEqual({
- width: '17%',
- 'max-width': '17%',
+ width: '17.8947%',
+ 'max-width': '17.8947%',
});
- expect(getGuestColumnWidthStyle('name', true)).toEqual({ width: '44%' });
+ expect(getGuestColumnWidthStyle('name', true)).toEqual({ width: '46.3158%' });
expect(getGuestColumnWidthStyle('diskIo', true)).toEqual({ width: '170px' });
});
@@ -869,7 +874,6 @@ describe('GUEST_COLUMNS', () => {
'cpu',
'memory',
'disk',
- 'link',
]);
expect(compactColumns.map((column) => column.id)).toEqual([
'name',
@@ -880,7 +884,6 @@ describe('GUEST_COLUMNS', () => {
'disk',
'uptime',
'backup',
- 'link',
]);
expect(
@@ -890,7 +893,7 @@ describe('GUEST_COLUMNS', () => {
'tablet',
tabletColumns.map((column) => column.id),
),
- ).toEqual({ width: '30%' });
+ ).toEqual({ width: '30.9278%' });
expect(
getGuestColumnWidthStyle(
'name',
@@ -898,7 +901,7 @@ describe('GUEST_COLUMNS', () => {
'compact',
compactColumns.map((column) => column.id),
),
- ).toEqual({ width: '26%' });
+ ).toEqual({ width: '27.6596%' });
});
it('normalizes compact widths for workload view modes with different column sets', () => {
@@ -906,20 +909,9 @@ describe('GUEST_COLUMNS', () => {
const compactPodColumns = getWorkloadVisibleColumnsForLayout(podColumns, 'compact');
const compactPodColumnIds = compactPodColumns.map((column) => column.id);
- expect(compactPodColumnIds).toEqual([
- 'name',
- 'cpu',
- 'memory',
- 'image',
- 'namespace',
- 'context',
- 'link',
- ]);
+ expect(compactPodColumnIds).toEqual(['name', 'cpu', 'memory', 'image', 'namespace', 'context']);
expect(getGuestColumnWidthStyle('name', false, 'compact', compactPodColumnIds)).toEqual({
- width: '25.7426%',
- });
- expect(getGuestColumnWidthStyle('link', false, 'compact', compactPodColumnIds)).toEqual({
- width: '5.9406%',
+ width: '27.3684%',
});
});
@@ -1180,15 +1172,16 @@ describe('event propagation', () => {
expect(rowClick).not.toHaveBeenCalled();
});
- it('link button click does not trigger row onClick', () => {
+ it('name custom URL click does not trigger row onClick', () => {
const rowClick = vi.fn();
const { container } = renderGuestRow({
guest: makeGuest(),
+ customUrl: 'https://example.com',
onClick: rowClick,
- visibleColumnIds: ['name', 'link'],
+ visibleColumnIds: ['name'],
});
- const linkButton = container.querySelector('td:last-child button')!;
- fireEvent.click(linkButton);
+ const link = container.querySelector('a[href="https://example.com"]')!;
+ fireEvent.click(link);
expect(rowClick).not.toHaveBeenCalled();
});
});
diff --git a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
index 1394148209..65ced153ba 100644
--- a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
@@ -1029,6 +1029,10 @@ describe('Workloads performance contract', () => {
expect(guestRowSource).toContain('style={getGuestColumnStyle(');
expect(guestRowSource).toContain('props.workloadTableLayoutMode');
expect(guestRowSource).toContain('props.visibleColumnIds');
+ expect(guestRowSource).toContain('when={customUrl()}');
+ expect(guestRowSource).toContain('target="_blank"');
+ expect(guestRowSource).not.toContain('data-workload-col="link"');
+ expect(guestRowSource).not.toContain('Open related infrastructure');
expect(guestRowSource).not.toContain('export const GUEST_COLUMNS');
expect(guestRowSource).not.toContain('const guestId = createMemo(');
expect(guestRowSource).not.toContain('function NetworkInfoCell(');
@@ -1046,6 +1050,8 @@ describe('Workloads performance contract', () => {
expect(guestRowStateSource).toContain("from '@/routing/resourceLinks'");
expect(guestRowStateSource).toContain("from './workloadTopology'");
expect(guestRowStateSource).not.toContain('./infrastructureLink');
+ expect(guestRowModelSource).not.toContain("id: 'link'");
+ expect(guestRowModelSource).not.toContain("'link'");
expect(guestRowStateSource).not.toContain('rowStyle');
expect(guestRowStateSource).not.toContain('box-shadow');
expect(guestRowStateSource).toContain('getWorkloadTypeBadge');
diff --git a/frontend-modern/src/components/Workloads/guestRowModel.tsx b/frontend-modern/src/components/Workloads/guestRowModel.tsx
index 8e7a404c1a..7cfb12ba24 100644
--- a/frontend-modern/src/components/Workloads/guestRowModel.tsx
+++ b/frontend-modern/src/components/Workloads/guestRowModel.tsx
@@ -27,7 +27,6 @@ const WORKLOAD_COLUMN_MIN_LAYOUT: Record<string, WorkloadTableLayoutMode> = {
cpu: 'mobile',
memory: 'mobile',
disk: 'mobile',
- link: 'mobile',
type: 'tablet',
info: 'tablet',
vmid: 'tablet',
@@ -324,7 +323,6 @@ export const GUEST_COLUMNS: ColumnDef[] = [
toggleable: true,
sortKey: 'diskIo',
},
- { id: 'link', label: '', width: '28px' },
];
const GUEST_COLUMN_BY_ID = new Map(GUEST_COLUMNS.map((column) => [column.id, column] as const));
@@ -354,7 +352,6 @@ const GUEST_COLUMN_RESPONSIVE_WEIGHTS: Record<
cpu: 17,
memory: 17,
disk: 17,
- link: 5,
},
tablet: {
name: 30,
@@ -364,7 +361,6 @@ const GUEST_COLUMN_RESPONSIVE_WEIGHTS: Record<
cpu: 17,
memory: 17,
disk: 17,
- link: 3,
},
compact: {
name: 26,
@@ -380,7 +376,6 @@ const GUEST_COLUMN_RESPONSIVE_WEIGHTS: Record<
namespace: 11,
context: 13,
update: 6,
- link: 6,
},
};
@@ -490,7 +485,6 @@ export const VIEW_MODE_COLUMNS: Record<ViewMode, Set<string> | null> = {
'os',
'diskIo',
'netIo',
- 'link',
]),
vm: new Set([
'name',
@@ -506,7 +500,6 @@ export const VIEW_MODE_COLUMNS: Record<ViewMode, Set<string> | null> = {
'os',
'diskIo',
'netIo',
- 'link',
]),
'system-container': new Set([
'name',
@@ -522,7 +515,6 @@ export const VIEW_MODE_COLUMNS: Record<ViewMode, Set<string> | null> = {
'os',
'diskIo',
'netIo',
- 'link',
]),
container: new Set([
'name',
@@ -542,7 +534,6 @@ export const VIEW_MODE_COLUMNS: Record<ViewMode, Set<string> | null> = {
'update',
'diskIo',
'netIo',
- 'link',
]),
'app-container': new Set([
'name',
@@ -556,7 +547,6 @@ export const VIEW_MODE_COLUMNS: Record<ViewMode, Set<string> | null> = {
'update',
'diskIo',
'netIo',
- 'link',
]),
- pod: new Set(['name', 'cpu', 'memory', 'image', 'namespace', 'context', 'link']),
+ pod: new Set(['name', 'cpu', 'memory', 'image', 'namespace', 'context']),
};