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.

Stabilize mobile infrastructure tables

rcourtman3d8214099760
diff --git a/frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx b/frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx
index c907c52003..0a3f78d5ad 100644
--- a/frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx
+++ b/frontend-modern/src/components/Dashboard/DashboardWorkloadTable.tsx
@@ -74,7 +74,7 @@ export function DashboardWorkloadTable(props: DashboardWorkloadTableProps) {
/>
<Table
wrapperRef={props.setTableWrapperRef}
- class={`workload-table min-w-full ${props.isMobile() ? 'workload-table--mobile' : 'workload-table--desktop table-fixed'}`}
+ class={`workload-table min-w-full table-fixed ${props.isMobile() ? 'workload-table--mobile' : 'workload-table--desktop'}`}
>
<colgroup>
<For each={props.mobileVisibleColumns()}>
diff --git a/frontend-modern/src/components/Dashboard/GuestRow.tsx b/frontend-modern/src/components/Dashboard/GuestRow.tsx
index 2d14afb947..0c20dd9283 100644
--- a/frontend-modern/src/components/Dashboard/GuestRow.tsx
+++ b/frontend-modern/src/components/Dashboard/GuestRow.tsx
@@ -433,7 +433,7 @@ export function GuestRow(props: GuestRowProps) {
<Show when={ociImage()} fallback={<span class="text-xs text-slate-400">—</span>}>
{/* For OCI containers without guest agent, show image name in OS column */}
<span
- class="text-xs text-purple-600 dark:text-purple-400 truncate max-w-[100px]"
+ class="text-xs text-cyan-600 dark:text-cyan-400 truncate max-w-[100px]"
title={`OCI Image: ${ociImage()}`}
>
{ociImage()}
diff --git a/frontend-modern/src/components/Dashboard/guestRowModel.tsx b/frontend-modern/src/components/Dashboard/guestRowModel.tsx
index aa9b78a65c..9538d7ba5d 100644
--- a/frontend-modern/src/components/Dashboard/guestRowModel.tsx
+++ b/frontend-modern/src/components/Dashboard/guestRowModel.tsx
@@ -293,11 +293,18 @@ type GuestColumnWidthOverride = {
maxWidth?: string | null;
};
+// Mobile widths use percentages so the visible column set fills the viewport
+// without triggering horizontal scroll. The workload table's mobile-essential
+// columns (name + cpu + memory + disk + link) must sum to 100% at mobile:
+// 44 + 17 + 17 + 17 + 5 = 100. See useDashboardControlsState
+// `mobileEssentialColumns` for the visible set, and DashboardWorkloadTable for
+// the `table-fixed` class that makes these percentages authoritative.
const GUEST_COLUMN_MOBILE_OVERRIDES: Record<string, GuestColumnWidthOverride> = {
- name: { width: null, minWidth: '120px', maxWidth: null },
- cpu: { width: '70px', minWidth: '60px', maxWidth: '70px' },
- memory: { width: '70px', minWidth: '60px', maxWidth: '70px' },
- disk: { width: '70px', minWidth: '60px', maxWidth: '70px' },
+ name: { width: '44%', minWidth: null, maxWidth: '44%' },
+ cpu: { width: '17%', minWidth: null, maxWidth: '17%' },
+ memory: { width: '17%', minWidth: null, maxWidth: '17%' },
+ disk: { width: '17%', minWidth: null, maxWidth: '17%' },
+ link: { width: '5%', minWidth: null, maxWidth: '5%' },
netIo: { width: '170px', minWidth: '170px', maxWidth: '170px' },
diskIo: { width: '170px', minWidth: '170px', maxWidth: '170px' },
};
diff --git a/frontend-modern/src/components/Dashboard/stackedMemoryBarModel.ts b/frontend-modern/src/components/Dashboard/stackedMemoryBarModel.ts
index 027e299c8e..d49e1099af 100644
--- a/frontend-modern/src/components/Dashboard/stackedMemoryBarModel.ts
+++ b/frontend-modern/src/components/Dashboard/stackedMemoryBarModel.ts
@@ -164,7 +164,7 @@ function getTooltipRows(
rows.push({
borderTop: true,
label: 'Swap',
- labelClass: 'text-purple-400',
+ labelClass: 'text-amber-400',
value: `${formatBytes(props.swapUsed || 0)} / ${formatBytes(props.swapTotal || 0)}`,
});
}
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
index 43de79001c..67cee7191d 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
@@ -88,7 +88,7 @@ export const UnifiedResourceHostTableCard: Component<UnifiedResourceHostTableCar
width={table.metricColumn().width}
onClick={() => table.handleSort('memory')}
>
- Memory {table.renderSortIndicator('memory')}
+ {table.isMobile() ? 'Mem' : 'Memory'} {table.renderSortIndicator('memory')}
</TableHead>
<TableHead
class={table.metricColumn().className}
@@ -331,7 +331,10 @@ export const UnifiedResourceHostTableCard: Component<UnifiedResourceHostTableCar
onClick={() => table.toggleExpand(resource.id)}
{...resourceRowInteraction}
>
- <TableCell class="pr-1.5 sm:pr-2 py-0.5 align-middle overflow-hidden pl-2 sm:pl-3">
+ <TableCell
+ class={`pr-1.5 sm:pr-2 py-0.5 align-middle overflow-hidden pl-2 sm:pl-3 ${table.resourceColumn().className}`}
+ width={table.resourceColumn().width}
+ >
<div class="flex items-center gap-1.5 min-w-0">
<SummaryRowActionButton
kind="disclosure"
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
index 14e0cb208d..d9660faf1d 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
@@ -59,14 +59,14 @@ export const UnifiedResourcePBSTableSection: Component<UnifiedResourcePBSTableSe
Resource
</TableHead>
<TableHead
- classList={{ hidden: !table.isVisible('primary') && !table.isMobile() }}
+ classList={{ hidden: table.isMobile() || !table.isVisible('primary') }}
class={table.serviceCountColumn().className}
width={table.serviceCountColumn().width}
>
Datastores
</TableHead>
<TableHead
- classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}
+ classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}
class={table.serviceCountColumn().className}
width={table.serviceCountColumn().width}
>
@@ -79,14 +79,14 @@ export const UnifiedResourcePBSTableSection: Component<UnifiedResourcePBSTableSe
Health
</TableHead>
<TableHead
- classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}
+ classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}
class={table.sourceColumn().className}
width={table.sourceColumn().width}
>
Source
</TableHead>
<TableHead
- classList={{ hidden: !table.isVisible('supplementary') && !table.isMobile() }}
+ classList={{ hidden: table.isMobile() || !table.isVisible('supplementary') }}
class={table.uptimeColumn().className}
width={table.uptimeColumn().width}
>
@@ -206,7 +206,7 @@ export const UnifiedResourcePBSTableSection: Component<UnifiedResourcePBSTableSe
</div>
</TableCell>
- <TableCell classList={{ hidden: !table.isVisible('primary') && !table.isMobile() }}>
+ <TableCell classList={{ hidden: table.isMobile() || !table.isVisible('primary') }}>
<div class="flex justify-center">
<Show
when={pbsRow()?.datastores != null}
@@ -217,7 +217,7 @@ export const UnifiedResourcePBSTableSection: Component<UnifiedResourcePBSTableSe
</div>
</TableCell>
- <TableCell classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}>
+ <TableCell classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}>
<div class="flex justify-center">
<Show
when={pbsRow()?.activity}
@@ -253,7 +253,7 @@ export const UnifiedResourcePBSTableSection: Component<UnifiedResourcePBSTableSe
</div>
</TableCell>
- <TableCell classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}>
+ <TableCell classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}>
<div class="flex items-center justify-center gap-1">
<Show
when={hasUnifiedSources()}
@@ -287,7 +287,7 @@ export const UnifiedResourcePBSTableSection: Component<UnifiedResourcePBSTableSe
</div>
</TableCell>
- <TableCell classList={{ hidden: !table.isVisible('supplementary') && !table.isMobile() }}>
+ <TableCell classList={{ hidden: table.isMobile() || !table.isVisible('supplementary') }}>
<div class="flex justify-center">
<Show
when={resource.uptime}
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx
index af660e4d49..55d363c333 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourcePMGTableSection.tsx
@@ -59,28 +59,28 @@ export const UnifiedResourcePMGTableSection: Component<UnifiedResourcePMGTableSe
Resource
</TableHead>
<TableHead
- classList={{ hidden: !table.isVisible('primary') && !table.isMobile() }}
+ classList={{ hidden: table.isMobile() || !table.isVisible('primary') }}
class={table.serviceQueueColumn().className}
width={table.serviceQueueColumn().width}
>
Queue
</TableHead>
<TableHead
- classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}
+ classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}
class={table.serviceQueueColumn().className}
width={table.serviceQueueColumn().width}
>
Deferred
</TableHead>
<TableHead
- classList={{ hidden: !table.isVisible('supplementary') && !table.isMobile() }}
+ classList={{ hidden: table.isMobile() || !table.isVisible('supplementary') }}
class={table.serviceQueueColumn().className}
width={table.serviceQueueColumn().width}
>
Hold
</TableHead>
<TableHead
- classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}
+ classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}
class={table.serviceCountColumn().className}
width={table.serviceCountColumn().width}
>
@@ -93,14 +93,14 @@ export const UnifiedResourcePMGTableSection: Component<UnifiedResourcePMGTableSe
Health
</TableHead>
<TableHead
- classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}
+ classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}
class={table.sourceColumn().className}
width={table.sourceColumn().width}
>
Source
</TableHead>
<TableHead
- classList={{ hidden: !table.isVisible('supplementary') && !table.isMobile() }}
+ classList={{ hidden: table.isMobile() || !table.isVisible('supplementary') }}
class={table.uptimeColumn().className}
width={table.uptimeColumn().width}
>
@@ -220,7 +220,7 @@ export const UnifiedResourcePMGTableSection: Component<UnifiedResourcePMGTableSe
</div>
</TableCell>
- <TableCell classList={{ hidden: !table.isVisible('primary') && !table.isMobile() }}>
+ <TableCell classList={{ hidden: table.isMobile() || !table.isVisible('primary') }}>
<div class="flex justify-center">
<Show
when={pmgRow()?.queue != null}
@@ -231,7 +231,7 @@ export const UnifiedResourcePMGTableSection: Component<UnifiedResourcePMGTableSe
</div>
</TableCell>
- <TableCell classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}>
+ <TableCell classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}>
<div class="flex justify-center">
<Show
when={pmgRow()?.deferred != null}
@@ -242,7 +242,7 @@ export const UnifiedResourcePMGTableSection: Component<UnifiedResourcePMGTableSe
</div>
</TableCell>
- <TableCell classList={{ hidden: !table.isVisible('supplementary') && !table.isMobile() }}>
+ <TableCell classList={{ hidden: table.isMobile() || !table.isVisible('supplementary') }}>
<div class="flex justify-center">
<Show
when={pmgRow()?.hold != null}
@@ -253,7 +253,7 @@ export const UnifiedResourcePMGTableSection: Component<UnifiedResourcePMGTableSe
</div>
</TableCell>
- <TableCell classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}>
+ <TableCell classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}>
<div class="flex justify-center">
<Show
when={pmgRow()?.nodes != null}
@@ -277,7 +277,7 @@ export const UnifiedResourcePMGTableSection: Component<UnifiedResourcePMGTableSe
</div>
</TableCell>
- <TableCell classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}>
+ <TableCell classList={{ hidden: table.isMobile() || !table.isVisible('secondary') }}>
<div class="flex items-center justify-center gap-1">
<Show
when={hasUnifiedSources()}
@@ -311,7 +311,7 @@ export const UnifiedResourcePMGTableSection: Component<UnifiedResourcePMGTableSe
</div>
</TableCell>
- <TableCell classList={{ hidden: !table.isVisible('supplementary') && !table.isMobile() }}>
+ <TableCell classList={{ hidden: table.isMobile() || !table.isVisible('supplementary') }}>
<div class="flex justify-center">
<Show
when={resource.uptime}
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/unifiedResourceTableStateModel.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/unifiedResourceTableStateModel.test.ts
index 7f2b2cd25c..f5eaee997d 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/unifiedResourceTableStateModel.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/unifiedResourceTableStateModel.test.ts
@@ -109,9 +109,17 @@ describe('unifiedResourceTableStateModel', () => {
const desktopColumns = getUnifiedResourceTableColumnPresentations(false);
expect(getUnifiedResourceTableShellClass(true)).toContain('table-fixed');
+ expect(getUnifiedResourceTableShellClass(true)).toContain('min-w-full');
expect(getUnifiedResourceTableShellClass(false)).toContain('min-w-[max-content]');
- expect(mobileColumns.resourceColumn.width).toBe('100%');
- expect(mobileColumns.metricColumn.width).toBe(70);
+ // Mobile uses percentage widths so the visible-column set fills the
+ // viewport without horizontal overflow. Host rows render
+ // Resource + CPU + Memory + Disk = 40 + 3×20 = 100%; service (PBS/PMG)
+ // rows render Resource + Health + Action = 40 + 36 + 24 = 100%. Columns
+ // hidden at mobile keep placeholder percentages that never paint.
+ expect(mobileColumns.resourceColumn.width).toBe('40%');
+ expect(mobileColumns.metricColumn.width).toBe('20%');
+ expect(mobileColumns.serviceHealthColumn.width).toBe('36%');
+ expect(mobileColumns.serviceActionColumn.width).toBe('24%');
expect(desktopColumns.resourceColumn.className).toContain('min-w-[220px]');
expect(desktopColumns.resourceColumn.className).toContain('max-w-[220px]');
expect(desktopColumns.resourceColumn.width).toBe(220);
diff --git a/frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts b/frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts
index 698ca9ef46..5f14ed3cab 100644
--- a/frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts
+++ b/frontend-modern/src/components/Infrastructure/unifiedResourceTableStateModel.ts
@@ -192,34 +192,40 @@ export const getUnifiedResourceTableShellClass = (isMobile: boolean): string =>
export const getUnifiedResourceTableColumnPresentations = (
isMobile: boolean,
): UnifiedResourceTableColumnPresentations => ({
+ // Mobile widths are percentages so visible columns fill the viewport without
+ // triggering horizontal scroll. Hidden columns retain placeholder widths that
+ // never render. Host rows show Resource + CPU + Memory + Disk (40/20/20/20 =
+ // 100%). Service (PBS/PMG) rows show Resource + Health + Action (40/36/24 =
+ // 100%). See UnifiedResourceHostTableCard / UnifiedResourcePBSTableSection /
+ // UnifiedResourcePMGTableSection for the matching visibility predicates.
resourceColumn: isMobile
- ? buildUnifiedResourceTableColumnPresentation('w-full min-w-[120px]', '100%')
+ ? buildUnifiedResourceTableColumnPresentation('', '40%')
: buildUnifiedResourceTableColumnPresentation('min-w-[220px] max-w-[220px]', 220),
metricColumn: isMobile
- ? buildUnifiedResourceTableColumnPresentation('min-w-[65px]', 70)
+ ? buildUnifiedResourceTableColumnPresentation('', '20%')
: buildUnifiedResourceTableColumnPresentation('min-w-[144px] max-w-[144px]', 144),
ioColumn: isMobile
- ? buildUnifiedResourceTableColumnPresentation('min-w-[180px]', 180)
+ ? buildUnifiedResourceTableColumnPresentation('', '20%')
: buildUnifiedResourceTableColumnPresentation('min-w-[192px] max-w-[192px]', 192),
sourceColumn: isMobile
- ? buildUnifiedResourceTableColumnPresentation('min-w-[140px]', 140)
+ ? buildUnifiedResourceTableColumnPresentation('', '20%')
: buildUnifiedResourceTableColumnPresentation('min-w-[144px] max-w-[144px]', 144),
uptimeColumn: isMobile
- ? buildUnifiedResourceTableColumnPresentation('min-w-[70px] max-w-[80px]', 70)
+ ? buildUnifiedResourceTableColumnPresentation('', '15%')
: buildUnifiedResourceTableColumnPresentation('min-w-[80px] max-w-[80px]', 80),
tempColumn: isMobile
- ? buildUnifiedResourceTableColumnPresentation('min-w-[50px] max-w-[60px]', 50)
+ ? buildUnifiedResourceTableColumnPresentation('', '15%')
: buildUnifiedResourceTableColumnPresentation('min-w-[60px] max-w-[70px]', 60),
serviceCountColumn: isMobile
- ? buildUnifiedResourceTableColumnPresentation('min-w-[80px] max-w-[90px]', 80)
+ ? buildUnifiedResourceTableColumnPresentation('', '20%')
: buildUnifiedResourceTableColumnPresentation('min-w-[110px] max-w-[130px]', 110),
serviceQueueColumn: isMobile
- ? buildUnifiedResourceTableColumnPresentation('min-w-[88px] max-w-[104px]', 88)
+ ? buildUnifiedResourceTableColumnPresentation('', '20%')
: buildUnifiedResourceTableColumnPresentation('min-w-[120px] max-w-[140px]', 120),
serviceHealthColumn: isMobile
- ? buildUnifiedResourceTableColumnPresentation('min-w-[100px] max-w-[120px]', 100)
+ ? buildUnifiedResourceTableColumnPresentation('', '36%')
: buildUnifiedResourceTableColumnPresentation('min-w-[140px] max-w-[170px]', 140),
serviceActionColumn: isMobile
- ? buildUnifiedResourceTableColumnPresentation('min-w-[82px] max-w-[96px]', 82)
+ ? buildUnifiedResourceTableColumnPresentation('', '24%')
: buildUnifiedResourceTableColumnPresentation('min-w-[120px] max-w-[140px]', 120),
});
diff --git a/frontend-modern/src/components/shared/InfrastructureSummaryTableRow.tsx b/frontend-modern/src/components/shared/InfrastructureSummaryTableRow.tsx
index ca652df7a3..84f6287b8d 100644
--- a/frontend-modern/src/components/shared/InfrastructureSummaryTableRow.tsx
+++ b/frontend-modern/src/components/shared/InfrastructureSummaryTableRow.tsx
@@ -198,7 +198,7 @@ export const InfrastructureSummaryTableRow: Component<InfrastructureSummaryTable
</Show>
<Show when={isPVEItem && node()!.linkedAgentId}>
<span
- class="text-[9px] px-1 py-0 rounded font-medium whitespace-nowrap bg-purple-100 text-purple-700 dark:bg-purple-900 dark:text-purple-400"
+ class="text-[9px] px-1 py-0 rounded font-medium whitespace-nowrap bg-emerald-100 text-emerald-700 dark:bg-emerald-900 dark:text-emerald-400"
title="Pulse agent installed for enhanced metrics"
>
+Agent
@@ -224,7 +224,7 @@ export const InfrastructureSummaryTableRow: Component<InfrastructureSummaryTable
</span>
</Show>
<Show when={isPBSItem}>
- <span class="text-[9px] px-1 py-0 rounded font-medium bg-purple-100 text-purple-700 dark:bg-purple-900 dark:text-purple-400">
+ <span class="text-[9px] px-1 py-0 rounded font-medium bg-teal-100 text-teal-700 dark:bg-teal-900 dark:text-teal-400">
PBS
</span>
</Show>
diff --git a/frontend-modern/src/pages/Ceph.tsx b/frontend-modern/src/pages/Ceph.tsx
index f473873dfd..73cf5e1554 100644
--- a/frontend-modern/src/pages/Ceph.tsx
+++ b/frontend-modern/src/pages/Ceph.tsx
@@ -430,7 +430,7 @@ const Ceph: Component = () => {
<div class="flex items-center justify-between mb-2">
<span class="text-xs font-medium text-muted uppercase tracking-wide">Clusters</span>
<svg
- class="w-4 h-4 text-purple-500"
+ class="w-4 h-4 text-indigo-500"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
@@ -560,7 +560,7 @@ const Ceph: Component = () => {
</span>
</TableCell>
<TableCell class="px-2 py-2.5">
- <span class="inline-flex items-center gap-1 text-xs text-purple-600 dark:text-purple-400">
+ <span class="inline-flex items-center gap-1 text-xs text-indigo-600 dark:text-indigo-400">
<CephServiceIcon type="mgr" class="w-3.5 h-3.5" />
<span class="font-semibold">{cluster.numMgrs || 0}</span>
</span>
diff --git a/frontend-modern/src/pages/Dashboard.tsx b/frontend-modern/src/pages/Dashboard.tsx
index 08462c6f21..4dee42db33 100644
--- a/frontend-modern/src/pages/Dashboard.tsx
+++ b/frontend-modern/src/pages/Dashboard.tsx
@@ -208,7 +208,7 @@ export default function Dashboard() {
{(() => {
const colors = [
'border-l-blue-500/40',
- 'border-l-violet-500/40',
+ 'border-l-rose-500/40',
'border-l-cyan-500/40',
'border-l-amber-500/40',
];