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.

Retire aggregate route-state path builders

rcourtman3c0bd12fc64a
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 9f8934f2ee..7f763a9c33 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -1092,9 +1092,9 @@ not a replacement status card, CTA band, or page-local nested card.
families stay hidden rather than rendering as disabled placeholders.
The `MOBILE_NAV_PLATFORM_PRIORITY` ordering in
`frontend-modern/src/components/shared/mobileNavBarModel.ts` mirrors
- that platform-first set plus the aggregate Workloads / Storage / Recovery
- workspace tabs, so mobile and desktop navigation stay aligned while the
- legacy Infrastructure entry remains absent from that priority list.
+ that platform-first set only, so mobile and desktop navigation stay aligned
+ without reintroducing aggregate Workloads / Storage / Recovery workspace
+ tabs or the legacy Infrastructure entry.
The support-manifest `agent` platform may be presented as `Agents` in the
same shell. Its primary tab, mobile priority, command-palette destination,
and keyboard shortcut must all route through `buildAgentsPath()` and the
@@ -1590,6 +1590,10 @@ and `getActiveTabForPath` matcher must not recognize aggregate workspace URLs
as owned shell destinations. New palette commands and shortcut chords must
flow through the same shell owners; do not reintroduce hidden platform
families or retired top-level aggregate routes by reanimating legacy paths.
+The shared route-state helpers follow the same boundary: workload, storage,
+and recovery helpers in `frontend-modern/src/routing/resourceLinks.ts` may
+build query strings for an already-owned platform/runtime route, but must not
+export pathname builders for `/workloads`, `/storage`, or `/recovery`.
The shared table chrome now allows `TableCardHeader` to expose a right-aligned
action slot, currently used by the Workloads/Proxmox metric display control.
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 e01cc5d278..0af2bbb781 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -310,6 +310,14 @@ regression protection.
14. Extend workload deep-link selection and hovered-row continuity semantics through `frontend-modern/src/components/Workloads/workloadSelectionModel.ts`, and extend table scroll preservation plus reactive selection state through `frontend-modern/src/components/Workloads/useWorkloadSelectionState.ts`, rather than rebuilding resource-query parsing, selected-row scroll pinning, or hovered-row invalidation inside `frontend-modern/src/components/Workloads/useWorkloadsState.ts`; canonical typed workload IDs such as `app-container:<host>:<provider-id>` must remain exact route/selection keys and must not be reinterpreted into synthetic node scopes
15. Extend workload route ownership, route-driven option catalogs, and toolbar filter config through `frontend-modern/src/components/Workloads/useWorkloadRouteState.ts`, `frontend-modern/src/components/Workloads/useWorkloadFilterOptions.ts`, `frontend-modern/src/components/Workloads/workloadRouteModel.ts`, `frontend-modern/src/components/Workloads/workloadFilterConfigModel.ts`, and `frontend-modern/src/components/Workloads/workloadRouteStateModel.ts`, and extend query-param synchronization plus managed workload URL semantics through `frontend-modern/src/components/Workloads/useWorkloadUrlSync.ts` and `frontend-modern/src/components/Workloads/workloadUrlSyncModel.ts`, rather than rebuilding route sync, alias parsing, option derivation, toolbar callback/config wiring, reset policy, node-selection compatibility rules, param precedence, or managed workload URLs inside `frontend-modern/src/components/Workloads/useWorkloadsState.ts`
Workloads route host scopes must resolve through `frontend-modern/src/components/Workloads/workloadTopology.ts`: app-container scopes use the canonical Docker/runtime host id before host labels or node fallbacks, while VM and system-container scopes keep the instance-node key. Route `agent` filters and option catalogs must consume that shared scope so Infrastructure related-workload links cannot drift from Workloads filtering.
+ Workloads route-state writes must preserve the owning platform/runtime
+ pathname instead of rebuilding the retired aggregate `/workloads` route.
+ `useWorkloadRouteState.ts` supplies the route-enabled boundary, while
+ `useWorkloadUrlSync.ts` and `workloadUrlSyncModel.ts` may serialize
+ canonical workload query params only after the embedding surface has opted
+ into route state. Embedded surfaces that are table-only or drawer-local
+ must stay route-state inert so the hot path does not schedule app-shell
+ navigations or revive aggregate-path redirects.
The user-facing Workloads Type filter must expose the stable operator
buckets `All`, `VMs`, `Containers`, and `Pods`. The internal
`system-container` / `app-container` distinction may continue to parse for
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index f56f03c5c1..8ab12930ce 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -1208,6 +1208,12 @@ the platform-page sub-tabs rather than offering external surface jumps.
Future cross-surface storage or recovery affordances must compose against
the embedded `StorageSurface` / `RecoverySurface` consumers rather than
reintroducing top-level URL builders.
+The remaining storage and recovery route builders in
+`frontend-modern/src/routing/resourceLinks.ts` are query-state serializers, not
+destination builders: callers must append `buildStorageRouteSearch()` or
+`buildRecoveryRouteSearch()` to the current platform-owned pathname such as
+`/proxmox/storage`, `/proxmox/backups`, or `/truenas/protection`. They must not
+emit `/storage` or `/recovery` as hidden compatibility paths.
Storage and Recovery can now be embedded by a platform page in table-only mode
with a forced platform source/filter. Proxmox uses that embedding for
@@ -2067,12 +2073,13 @@ multi-tenant fetch state, so Dashboard, StorageSummary, and other storage
adjacent consumers do not each keep a local `getOrgID() || 'default'`
fallback.
-The frontend storage and recovery surfaces are also first-class runtime entry
-points. `frontend-modern/src/pages/Storage.tsx` is the storage route shell,
+The frontend storage and recovery surfaces are also first-class embedded
+runtime entry points. Platform page route shells own the path, while
`frontend-modern/src/components/Storage/Storage.tsx` is the operator-facing
storage surface owner, and `frontend-modern/src/components/Storage/` plus
`frontend-modern/src/features/storageBackups/` define the storage health model
-and presentation, while
+and presentation. The retired standalone storage page shell must not be
+recreated, while
the storage page's readiness now stays route-owned as well:
`frontend-modern/src/components/Storage/useStoragePageModel.ts` and
`frontend-modern/src/features/storageBackups/storagePageStatus.ts` must derive
@@ -2197,7 +2204,7 @@ implementation detail: `frontend-modern/src/hooks/useRecoveryPoints.ts`,
`frontend-modern/src/hooks/useRecoveryPointsSeries.ts`, and
`frontend-modern/src/hooks/useRecoveryRollups.ts` must stay on the explicit
`recovery-product-surface` proof path instead of inheriting release-control
-coverage only through `frontend-modern/src/pages/Recovery.tsx`.
+coverage only through a retired standalone Recovery page shell.
Those same hooks now also own recovery transport normalization at the frontend
boundary: raw compatibility fields such as `provider` / `providers` may be
accepted from older `/api/recovery/*` payloads, but the runtime values they
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index acd0242c81..1bacfb8f46 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -1003,9 +1003,11 @@ in the same pass. The K8s Namespaces and Deployments drawer "Open Pods" /
(`frontend-modern/src/components/Kubernetes/K8sNamespacesDrawer.tsx`,
`frontend-modern/src/components/Kubernetes/K8sDeploymentsDrawer.tsx`) now
route to `/kubernetes/workloads` rather than building
-`/workloads?type=pod&context=...&namespace=...` URLs; the legacy
-context/namespace query filter does not carry forward because the new
-Kubernetes Workloads tab does not consume those parameters. New drawer or
+retired aggregate workload URLs; the legacy context/namespace query filter
+does not carry forward because the new Kubernetes Workloads tab does not
+consume those parameters. Workloads, storage, and recovery route-state helpers
+in `frontend-modern/src/routing/resourceLinks.ts` now serialize query state
+only; the owning platform/runtime route supplies the pathname. New drawer or
correlation surfaces must anchor on platform routes (or stay-in-place drawer
expansion) instead of resurrecting the retired top-level paths.
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts
index 4d9b1a1e0e..164d78a232 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerOperationalModel.test.ts
@@ -191,7 +191,7 @@ describe('resourceDetailDrawerOperationalModel', () => {
hasWebInterface: true,
links: [
{
- href: '/workloads?type=app-container&platform=docker&agent=agent-1',
+ href: '/docker/workloads?type=app-container&platform=docker&agent=agent-1',
label: 'Open in Workloads',
compactLabel: 'Workloads',
ariaLabel: 'Open related workloads for Host 1',
diff --git a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
index 1426047f0b..3f1c2ca7f7 100644
--- a/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
+++ b/frontend-modern/src/components/Recovery/__tests__/Recovery.test.tsx
@@ -26,7 +26,7 @@ import {
} from '@/utils/recoveryPlatformModel';
let mockLocationSearch = '';
-let mockLocationPath = '/recovery';
+let mockLocationPath = '/proxmox/backups';
const navigateSpy = vi.hoisted(() => vi.fn());
const mockLocationVersion = vi.hoisted(() => ({
read: undefined as undefined | (() => number),
@@ -295,14 +295,14 @@ describe('Recovery', () => {
localStorage.clear();
navigateSpy.mockReset();
navigateSpy.mockImplementation((path: string) => {
- const next = new URL(String(path || '/recovery'), 'http://localhost');
+ const next = new URL(String(path || '/proxmox/backups'), 'http://localhost');
mockLocationPath = next.pathname;
mockLocationSearch = next.search;
mockLocationVersion.bump?.();
});
apiFetchMock.mockClear();
mockLocationSearch = '';
- mockLocationPath = '/recovery';
+ mockLocationPath = '/proxmox/backups';
wsState.resources = [
{
id: 'pbs-resource-1',
@@ -596,7 +596,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?view=inventory',
+ '/proxmox/backups?view=inventory',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -609,7 +609,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?view=inventory',
+ '/proxmox/backups?view=inventory',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -626,7 +626,7 @@ describe('Recovery', () => {
fireEvent.click(screen.getByRole('button', { name: 'Back to recovery events' }));
await waitFor(() => {
- expect(navigateSpy).toHaveBeenCalledWith('/recovery', ROUTE_STATE_REPLACE_OPTIONS);
+ expect(navigateSpy).toHaveBeenCalledWith('/proxmox/backups', ROUTE_STATE_REPLACE_OPTIONS);
});
mockLocationSearch = '';
mockLocationVersion.bump?.();
@@ -698,7 +698,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?rollupId=res%3Avm-404',
+ '/proxmox/backups?rollupId=res%3Avm-404',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -971,7 +971,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?rollupId=res%3Avm-123',
+ '/proxmox/backups?rollupId=res%3Avm-123',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -1169,7 +1169,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?view=inventory&platform=truenas',
+ '/proxmox/backups?view=inventory&platform=truenas',
ROUTE_STATE_REPLACE_OPTIONS,
);
expect(screen.queryByText('VM 123')).not.toBeInTheDocument();
@@ -1312,7 +1312,7 @@ describe('Recovery', () => {
fireEvent.click(within(controls).getByRole('button', { name: 'Clear all' }));
await waitFor(() => {
- expect(navigateSpy).toHaveBeenCalledWith('/recovery', ROUTE_STATE_REPLACE_OPTIONS);
+ expect(navigateSpy).toHaveBeenCalledWith('/proxmox/backups', ROUTE_STATE_REPLACE_OPTIONS);
expect(screen.getByTestId('recovery-history-item-filter-trigger')).toHaveTextContent(
'Any item',
);
@@ -1337,7 +1337,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?day=2026-02-14',
+ '/proxmox/backups?day=2026-02-14',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -1351,7 +1351,7 @@ describe('Recovery', () => {
}),
).not.toBeInTheDocument();
expect(within(bars).queryByRole('button', { pressed: true })).not.toBeInTheDocument();
- expect(navigateSpy).toHaveBeenCalledWith('/recovery', ROUTE_STATE_REPLACE_OPTIONS);
+ expect(navigateSpy).toHaveBeenCalledWith('/proxmox/backups', ROUTE_STATE_REPLACE_OPTIONS);
});
});
@@ -1388,7 +1388,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?rollupId=ext%3Atruenas-1',
+ '/proxmox/backups?rollupId=ext%3Atruenas-1',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -1401,7 +1401,7 @@ describe('Recovery', () => {
fireEvent.click(await screen.findByTestId('recovery-history-item-filter-clear'));
await waitFor(() => {
- expect(navigateSpy).toHaveBeenCalledWith('/recovery', ROUTE_STATE_REPLACE_OPTIONS);
+ expect(navigateSpy).toHaveBeenCalledWith('/proxmox/backups', ROUTE_STATE_REPLACE_OPTIONS);
expect(screen.getByTestId('recovery-history-item-filter-trigger')).toHaveTextContent(
'Any item',
);
@@ -1432,7 +1432,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?itemType=dataset',
+ '/proxmox/backups?itemType=dataset',
ROUTE_STATE_REPLACE_OPTIONS,
);
expect(screen.queryByText('VM 123')).not.toBeInTheDocument();
@@ -1466,7 +1466,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?view=inventory&q=tank',
+ '/proxmox/backups?view=inventory&q=tank',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -1541,7 +1541,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?view=inventory&state=never-succeeded',
+ '/proxmox/backups?view=inventory&state=never-succeeded',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -1622,7 +1622,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?view=inventory&state=stale',
+ '/proxmox/backups?view=inventory&state=stale',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -1641,7 +1641,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?range=90&status=failed',
+ '/proxmox/backups?range=90&status=failed',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -1650,7 +1650,7 @@ describe('Recovery', () => {
fireEvent.click(within(controls).getByRole('button', { name: 'Clear all' }));
await waitFor(() => {
- expect(navigateSpy).toHaveBeenCalledWith('/recovery', ROUTE_STATE_REPLACE_OPTIONS);
+ expect(navigateSpy).toHaveBeenCalledWith('/proxmox/backups', ROUTE_STATE_REPLACE_OPTIONS);
});
});
@@ -1660,7 +1660,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?platform=proxmox-pve',
+ '/proxmox/backups?platform=proxmox-pve',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -1672,7 +1672,7 @@ describe('Recovery', () => {
render(() => <Recovery />);
await waitFor(() => {
- expect(navigateSpy).toHaveBeenCalledWith('/recovery', ROUTE_STATE_REPLACE_OPTIONS);
+ expect(navigateSpy).toHaveBeenCalledWith('/proxmox/backups', ROUTE_STATE_REPLACE_OPTIONS);
});
await waitFor(() => {
@@ -1702,7 +1702,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?cluster=dev-cluster',
+ '/proxmox/backups?cluster=dev-cluster',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -1732,7 +1732,7 @@ describe('Recovery', () => {
render(() => <Recovery />);
await waitFor(() => {
- expect(navigateSpy).toHaveBeenCalledWith('/recovery', ROUTE_STATE_REPLACE_OPTIONS);
+ expect(navigateSpy).toHaveBeenCalledWith('/proxmox/backups', ROUTE_STATE_REPLACE_OPTIONS);
});
await waitFor(() => {
@@ -1781,7 +1781,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?namespace=tenant-a&node=node-agent-1',
+ '/proxmox/backups?namespace=tenant-a&node=node-agent-1',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -2000,7 +2000,7 @@ describe('Recovery', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/recovery?range=7&day=2026-02-13',
+ '/proxmox/backups?range=7&day=2026-02-13',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -2012,7 +2012,7 @@ describe('Recovery', () => {
fireEvent.click(await screen.findByRole('button', { name: '7d' }));
await waitFor(() => {
- expect(navigateSpy).toHaveBeenCalledWith('/recovery?range=7', ROUTE_STATE_REPLACE_OPTIONS);
+ expect(navigateSpy).toHaveBeenCalledWith('/proxmox/backups?range=7', ROUTE_STATE_REPLACE_OPTIONS);
});
});
@@ -2075,7 +2075,7 @@ describe('Recovery', () => {
fireEvent.keyDown(document, { key: 'Escape' });
await waitFor(() => {
- expect(navigateSpy).toHaveBeenCalledWith('/recovery', ROUTE_STATE_REPLACE_OPTIONS);
+ expect(navigateSpy).toHaveBeenCalledWith('/proxmox/backups', ROUTE_STATE_REPLACE_OPTIONS);
});
});
});
diff --git a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
index 414a50472e..d320ea1f52 100644
--- a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
+++ b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
@@ -58,7 +58,7 @@ if (typeof HTMLCanvasElement.prototype.getContext === 'function') {
}
let mockLocationSearch = '';
-let mockLocationPath = '/storage';
+let mockLocationPath = '/proxmox/storage';
const navigateSpy = vi.fn();
let wsConnected = true;
@@ -392,7 +392,7 @@ describe('Storage', () => {
beforeEach(() => {
vi.stubGlobal('fetch', fetchMock);
fetchMock.mockClear();
- mockLocationPath = '/storage';
+ mockLocationPath = '/proxmox/storage';
mockLocationSearch = '';
navigateSpy.mockReset();
@@ -887,7 +887,7 @@ describe('Storage', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/storage?source=proxmox-pve',
+ '/proxmox/storage?source=proxmox-pve',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -902,7 +902,7 @@ describe('Storage', () => {
render(() => <Storage />);
await waitFor(() => {
- expect(navigateSpy).toHaveBeenCalledWith('/storage', ROUTE_STATE_REPLACE_OPTIONS);
+ expect(navigateSpy).toHaveBeenCalledWith('/proxmox/storage', ROUTE_STATE_REPLACE_OPTIONS);
});
// Default Node selection ("all") collapses to no chip on the FilterBar.
@@ -941,7 +941,7 @@ describe('Storage', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/storage?group=node&summaryGroup=storage%3Anode%3Apve1',
+ '/proxmox/storage?group=node&summaryGroup=storage%3Anode%3Apve1',
ROUTE_STATE_REPLACE_OPTIONS,
);
});
@@ -973,7 +973,7 @@ describe('Storage', () => {
fireEvent.click(clearButton);
await waitFor(() => {
- expect(navigateSpy).toHaveBeenCalledWith('/storage?group=node', ROUTE_STATE_REPLACE_OPTIONS);
+ expect(navigateSpy).toHaveBeenCalledWith('/proxmox/storage?group=node', ROUTE_STATE_REPLACE_OPTIONS);
});
});
@@ -1021,7 +1021,7 @@ describe('Storage', () => {
await waitFor(() => {
expect(navigateSpy).toHaveBeenCalledWith(
- '/storage?group=node&summaryGroup=storage%3Anode%3Apve1',
+ '/proxmox/storage?group=node&summaryGroup=storage%3Anode%3Apve1',
ROUTE_STATE_REPLACE_OPTIONS,
);
expect(
@@ -2030,11 +2030,11 @@ describe('Storage', () => {
expect(screen.getByText('Loading storage resources...')).toBeInTheDocument();
});
- it('GA contract: Storage served at /storage is the only canonical path', async () => {
+ it('GA contract: storage route state stays on the owning platform storage path', async () => {
hookResources = [
buildStorageResource('storage-ga', 'GA-Store', 'pve1', { status: 'degraded' }),
];
- mockLocationPath = '/storage';
+ mockLocationPath = '/proxmox/storage';
mockLocationSearch = '?source=proxmox-pve&status=warning';
render(() => <Storage />);
@@ -2047,8 +2047,8 @@ describe('Storage', () => {
navigateSpy.mock.calls.length > 0
? (navigateSpy.mock.calls.at(-1) as [string])[0]
: `${mockLocationPath}${mockLocationSearch}`;
- expect(path.startsWith('/storage')).toBe(true);
- expect(path).not.toContain('/storage-v2');
+ expect(path.startsWith('/proxmox/storage')).toBe(true);
+ expect(path).not.toContain('/proxmox/storage-v2');
const params = new URLSearchParams(path.split('?')[1] || '');
expect(params.get('source')).toBe('proxmox-pve');
expect(params.get('status')).toBe('warning');
diff --git a/frontend-modern/src/components/Storage/__tests__/useStoragePageFilters.test.ts b/frontend-modern/src/components/Storage/__tests__/useStoragePageFilters.test.ts
index 166a2204bb..9e15d939c1 100644
--- a/frontend-modern/src/components/Storage/__tests__/useStoragePageFilters.test.ts
+++ b/frontend-modern/src/components/Storage/__tests__/useStoragePageFilters.test.ts
@@ -12,7 +12,7 @@ describe('useStoragePageFilters', () => {
});
const setup = (initialSearch = '') => {
- const [pathname] = createSignal('/storage');
+ const [pathname] = createSignal('/proxmox/storage');
const [searchValue, setSearchValue] = createSignal(initialSearch);
const navigate = vi.fn((nextPath: string) => {
const nextSearch = nextPath.includes('?') ? nextPath.slice(nextPath.indexOf('?')) : '';
@@ -61,7 +61,7 @@ describe('useStoragePageFilters', () => {
vi.runAllTimers();
expect(ctx.filters.sourceFilter()).toBe('proxmox-pve');
- expect(ctx.navigate).toHaveBeenCalledWith('/storage?source=proxmox-pve', {
+ expect(ctx.navigate).toHaveBeenCalledWith('/proxmox/storage?source=proxmox-pve', {
replace: true,
scroll: false,
});
@@ -75,7 +75,7 @@ describe('useStoragePageFilters', () => {
vi.runAllTimers();
expect(ctx.filters.selectedNodeId()).toBe('all');
- expect(ctx.navigate).toHaveBeenCalledWith('/storage', {
+ expect(ctx.navigate).toHaveBeenCalledWith('/proxmox/storage', {
replace: true,
scroll: false,
});
@@ -95,7 +95,7 @@ describe('useStoragePageFilters', () => {
vi.runAllTimers();
expect(ctx.navigate).toHaveBeenCalledTimes(1);
- expect(ctx.navigate).toHaveBeenCalledWith('/storage?tab=disks&source=agent&q=tank', {
+ expect(ctx.navigate).toHaveBeenCalledWith('/proxmox/storage?tab=disks&source=agent&q=tank', {
replace: true,
scroll: false,
});
diff --git a/frontend-modern/src/components/Storage/__tests__/useStorageResourceHighlight.test.ts b/frontend-modern/src/components/Storage/__tests__/useStorageResourceHighlight.test.ts
index 86f78ce908..7b73bf85b7 100644
--- a/frontend-modern/src/components/Storage/__tests__/useStorageResourceHighlight.test.ts
+++ b/frontend-modern/src/components/Storage/__tests__/useStorageResourceHighlight.test.ts
@@ -26,7 +26,7 @@ const makeRecord = (overrides: Partial<StorageRecord> = {}): StorageRecord =>
describe('useStorageResourceHighlight', () => {
it('highlights matching deep-linked resources and expands ceph pools', () => {
- const [locationPathname] = createSignal('/storage');
+ const [locationPathname] = createSignal('/proxmox/storage');
const [locationSearch] = createSignal('?resource=storage-ceph');
const [records] = createSignal<StorageRecord[]>([makeRecord()]);
const navigate = vi.fn();
@@ -55,7 +55,7 @@ describe('useStorageResourceHighlight', () => {
});
it('does nothing when no resource match exists', () => {
- const [locationPathname] = createSignal('/storage');
+ const [locationPathname] = createSignal('/proxmox/storage');
const [locationSearch] = createSignal('?resource=missing');
const [records] = createSignal<StorageRecord[]>([makeRecord()]);
const navigate = vi.fn();
@@ -84,7 +84,7 @@ describe('useStorageResourceHighlight', () => {
});
it('rewrites whitespace-padded resource deep-links to the canonical storage URL', () => {
- const [locationPathname] = createSignal('/storage');
+ const [locationPathname] = createSignal('/proxmox/storage');
const [locationSearch] = createSignal('?resource=%20storage-ceph%20&from=overview');
const [records] = createSignal<StorageRecord[]>([makeRecord()]);
const navigate = vi.fn();
@@ -107,7 +107,7 @@ describe('useStorageResourceHighlight', () => {
}),
);
- expect(navigate).toHaveBeenCalledWith('/storage?resource=storage-ceph&from=overview', {
+ expect(navigate).toHaveBeenCalledWith('/proxmox/storage?resource=storage-ceph&from=overview', {
replace: true,
});
expect(result()).toBe('storage-ceph');
diff --git a/frontend-modern/src/components/Storage/__tests__/useStorageRouteState.test.ts b/frontend-modern/src/components/Storage/__tests__/useStorageRouteState.test.ts
index 8e8921e2ba..5d074ad0af 100644
--- a/frontend-modern/src/components/Storage/__tests__/useStorageRouteState.test.ts
+++ b/frontend-modern/src/components/Storage/__tests__/useStorageRouteState.test.ts
@@ -1,6 +1,6 @@
import { batch, createRoot, createSignal } from 'solid-js';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
-import { buildStoragePath } from '@/routing/resourceLinks';
+import { buildStorageRouteSearch } from '@/routing/resourceLinks';
import { useStorageRouteState } from '@/components/Storage/useStorageRouteState';
import { ROUTE_STATE_REPLACE_OPTIONS } from '@/utils/routeStateNavigation';
@@ -14,7 +14,7 @@ describe('useStorageRouteState', () => {
});
const setup = (initialSearch = '') => {
- const [pathname] = createSignal('/storage');
+ const [pathname] = createSignal('/proxmox/storage');
const [search, setSearch] = createSignal(initialSearch);
const [tab, setTab] = createSignal('pools');
const [source, setSource] = createSignal('all');
@@ -42,7 +42,7 @@ describe('useStorageRouteState', () => {
},
},
navigate,
- buildPath: buildStoragePath,
+ buildPath: (options) => `${pathname()}${buildStorageRouteSearch(options)}`,
useCurrentPathForNavigation: true,
fields: {
tab: {
@@ -148,7 +148,7 @@ describe('useStorageRouteState', () => {
expect(ctx.navigate).toHaveBeenCalledTimes(1);
expect(ctx.navigate).toHaveBeenCalledWith(
- '/storage?tab=disks&source=proxmox-pbs',
+ '/proxmox/storage?tab=disks&source=proxmox-pbs',
ROUTE_STATE_REPLACE_OPTIONS,
);
diff --git a/frontend-modern/src/components/Storage/useStoragePageFilters.ts b/frontend-modern/src/components/Storage/useStoragePageFilters.ts
index 63237638bf..8f8aa79090 100644
--- a/frontend-modern/src/components/Storage/useStoragePageFilters.ts
+++ b/frontend-modern/src/components/Storage/useStoragePageFilters.ts
@@ -1,5 +1,5 @@
import { createSignal } from 'solid-js';
-import { buildStoragePath } from '@/routing/resourceLinks';
+import { buildStorageRouteSearch } from '@/routing/resourceLinks';
import type { StorageHealthFilter } from '@/features/storageBackups/models';
import { useStorageRouteState } from './useStorageRouteState';
import {
@@ -38,12 +38,15 @@ export const useStoragePageFilters = (options: UseStoragePageFiltersOptions) =>
);
const [groupBy, setGroupBy] = createSignal<StorageGroupKey>(DEFAULT_STORAGE_GROUP_KEY);
- const isActiveStorageRoute = () => options.location.pathname === '/storage';
+ const isActiveStorageRoute = () => true;
useStorageRouteState({
location: options.location,
navigate: options.navigate,
- buildPath: buildStoragePath,
+ buildPath: (routeOptions) => {
+ const search = buildStorageRouteSearch(routeOptions);
+ return `${options.location.pathname}${search}`;
+ },
isReadEnabled: isActiveStorageRoute,
isWriteEnabled: isActiveStorageRoute,
useCurrentPathForNavigation: true,
diff --git a/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx
index 48e01ccf17..d3c6182a01 100644
--- a/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsFilter.test.tsx
@@ -24,7 +24,7 @@ vi.mock('@/hooks/useBreakpoint', () => ({
// useLocation outside a Router context. The tests don't exercise navigation.
vi.mock('@solidjs/router', () => ({
useNavigate: () => () => undefined,
- useLocation: () => ({ pathname: '/workloads', search: '', hash: '', state: null, query: {} }),
+ useLocation: () => ({ pathname: '/proxmox/overview', search: '', hash: '', state: null, query: {} }),
}));
vi.mock('@/components/shared/SearchInput', () => ({
diff --git a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.k8s.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.k8s.test.tsx
index 792118910c..a7612aa3a0 100644
--- a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.k8s.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.k8s.test.tsx
@@ -57,7 +57,7 @@ vi.mock('@solidjs/router', async () => {
return {
...actual,
useLocation: () => ({
- pathname: '/workloads',
+ pathname: '/kubernetes/workloads',
search: mockLocationSearch,
}),
useNavigate: () => navigateSpy,
@@ -705,7 +705,7 @@ describe('Workloads pod workloads integration', () => {
});
const [path, options] = navigateSpy.mock.calls.at(-1) as [string, { replace?: boolean }];
- expect(path).toBe('/workloads');
+ expect(path).toBe('/kubernetes/workloads');
expect(options?.replace).toBe(true);
});
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 80f2f1a01a..738f565126 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
@@ -110,7 +110,7 @@ vi.mock('@solidjs/router', async () => {
const actual = await vi.importActual<typeof import('@solidjs/router')>('@solidjs/router');
return {
...actual,
- useLocation: () => ({ pathname: '/workloads', search: mockLocationSearch }),
+ useLocation: () => ({ pathname: '/proxmox/overview', search: mockLocationSearch }),
useNavigate: () => navigateSpy,
};
});
@@ -410,9 +410,11 @@ describe('Workloads platform-page embed contract', () => {
expect(proxmoxSource).toContain('STORAGE_KEYS.WORKLOADS_METRIC_DISPLAY_MODE');
expect(proxmoxSource).toContain('STORAGE_KEYS.WORKLOADS_METRIC_HISTORY_RANGE');
expect(proxmoxSource).toContain('metricDisplayMode={metricDisplayMode}');
- expect(proxmoxSource).toContain('onMetricDisplayModeChange={setMetricDisplayMode}');
+ expect(proxmoxSource).toContain('setMetricDisplayMode={workloadsState.setWorkloadMetricDisplayMode}');
+ expect(proxmoxSource).toContain('onMetricDisplayModeChange: props.setMetricDisplayMode,');
expect(proxmoxSource).toContain('metricHistoryRange={metricHistoryRange}');
- expect(proxmoxSource).toContain('onMetricHistoryRangeChange={setMetricHistoryRange}');
+ expect(proxmoxSource).toContain('setMetricHistoryRange={workloadsState.setWorkloadMetricHistoryRange}');
+ expect(proxmoxSource).toContain('onMetricHistoryRangeChange: props.setMetricHistoryRange,');
const nodesTableSource = (await import('../../../features/proxmox/ProxmoxNodesTable.tsx?raw'))
.default;
@@ -625,7 +627,7 @@ describe('Workloads performance contract', () => {
});
it('searches policy-redacted resources by their raw display name in operator-local UI', () => {
- // /workloads search; redaction is a transmission-boundary policy
+ // owning route search; redaction is a transmission-boundary policy
// (docs/PRIVACY.md), so the haystack must use the raw infra name.
const resources = [makeResource()];
@@ -968,7 +970,7 @@ describe('Workloads performance contract', () => {
'resolveWorkloadsManagedWorkloadsNavigateTarget({',
);
expect(workloadUrlSyncModelSource).toContain('parseWorkloadsLinkSearch(search)');
- expect(workloadUrlSyncModelSource).toContain('buildWorkloadsPath({');
+ expect(workloadUrlSyncModelSource).toContain('buildWorkloadsRouteSearch({');
expect(workloadUrlSyncModelSource).toContain(
'resolveWorkloadsManagedWorkloadsNavigateTarget',
);
diff --git a/frontend-modern/src/components/Workloads/__tests__/useWorkloadSelectionState.test.ts b/frontend-modern/src/components/Workloads/__tests__/useWorkloadSelectionState.test.ts
index fc53d87af7..2494c40ab4 100644
--- a/frontend-modern/src/components/Workloads/__tests__/useWorkloadSelectionState.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/useWorkloadSelectionState.test.ts
@@ -14,7 +14,7 @@ const emptySummaryGroupScopes = () => new Map<string, SummarySeriesGroupScope>()
vi.mock('@solidjs/router', () => ({
useLocation: () => ({
- pathname: '/workloads',
+ pathname: '/proxmox/overview',
get search() {
return locationSearch;
},
diff --git a/frontend-modern/src/components/Workloads/__tests__/workloadUrlSyncModel.test.ts b/frontend-modern/src/components/Workloads/__tests__/workloadUrlSyncModel.test.ts
index 025833d4e9..3b35b8c0fe 100644
--- a/frontend-modern/src/components/Workloads/__tests__/workloadUrlSyncModel.test.ts
+++ b/frontend-modern/src/components/Workloads/__tests__/workloadUrlSyncModel.test.ts
@@ -87,6 +87,7 @@ describe('workloadUrlSyncModel', () => {
it('builds managed workload navigate targets without dropping unrelated resource params', () => {
expect(
resolveWorkloadsManagedWorkloadsNavigateTarget({
+ currentPathname: '/proxmox/overview',
currentSearch: '?resource=guest-1&type=vm&agent=node-a',
viewMode: 'pod',
containerRuntime: 'docker',
@@ -97,11 +98,12 @@ describe('workloadUrlSyncModel', () => {
selectedHostHint: null,
}),
).toBe(
- '/workloads?resource=guest-1&type=pod&platform=kubernetes&context=prod&namespace=default',
+ '/proxmox/overview?resource=guest-1&type=pod&platform=kubernetes&context=prod&namespace=default',
);
expect(
resolveWorkloadsManagedWorkloadsNavigateTarget({
+ currentPathname: '/kubernetes/workloads',
currentSearch: '?type=pod&context=prod&namespace=default',
viewMode: 'pod',
containerRuntime: '',
diff --git a/frontend-modern/src/components/Workloads/useWorkloadRouteState.ts b/frontend-modern/src/components/Workloads/useWorkloadRouteState.ts
index b499b2de59..16119180d5 100644
--- a/frontend-modern/src/components/Workloads/useWorkloadRouteState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadRouteState.ts
@@ -13,6 +13,7 @@ import { useWorkloadUrlSync } from './useWorkloadUrlSync';
export interface WorkloadRouteStateOptions {
allGuests: Accessor<WorkloadGuest[]>;
allowEmbeddedScopeFilters?: boolean;
+ embedded?: boolean;
forcedPlatform?: string;
forcedViewMode?: ViewMode;
showFilters: Accessor<boolean>;
@@ -74,6 +75,7 @@ export function useWorkloadRouteState(options: WorkloadRouteStateOptions) {
const { isWorkloadsRoute } = useWorkloadUrlSync({
containerRuntime,
containerRuntimeOptions: () => filterOptions.containerRuntimeOptions(),
+ routeStateEnabled: () => options.allowEmbeddedScopeFilters === true || options.embedded !== true,
kubernetesNamespaceOptions: () => filterOptions.kubernetesNamespaceOptions(),
selectedHostHint,
selectedKubernetesContext,
diff --git a/frontend-modern/src/components/Workloads/useWorkloadUrlSync.ts b/frontend-modern/src/components/Workloads/useWorkloadUrlSync.ts
index c8fd54b082..8d28eec7a6 100644
--- a/frontend-modern/src/components/Workloads/useWorkloadUrlSync.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadUrlSync.ts
@@ -9,7 +9,6 @@ import {
} from 'solid-js';
import { useLocation, useNavigate } from '@solidjs/router';
import type { ViewMode } from '@/types/workloads';
-import { WORKLOADS_PATH } from '@/routing/resourceLinks';
import { createRouteStateNavigateScheduler } from '@/utils/routeStateNavigation';
import { isContainerWorkloadViewMode } from '@/utils/workloads';
import type { WorkloadNodeOption } from './workloadRouteModel';
@@ -23,6 +22,7 @@ import {
export interface WorkloadsWorkloadUrlSyncOptions {
containerRuntime: Accessor<string>;
containerRuntimeOptions: Accessor<string[]>;
+ routeStateEnabled: Accessor<boolean>;
kubernetesNamespaceOptions: Accessor<string[]>;
selectedHostHint: Accessor<string | null>;
selectedPlatform: Accessor<string | null>;
@@ -45,7 +45,7 @@ export interface WorkloadsWorkloadUrlSyncOptions {
export function useWorkloadUrlSync(options: WorkloadsWorkloadUrlSyncOptions) {
const navigate = useNavigate();
const location = useLocation();
- const isWorkloadsRoute = () => location.pathname === WORKLOADS_PATH;
+ const isWorkloadsRoute = () => options.routeStateEnabled();
const workloadUrlParams = createMemo(() => parseWorkloadsWorkloadUrlParams(location.search));
const routeStateNavigate = createRouteStateNavigateScheduler(
navigate,
@@ -137,6 +137,7 @@ export function useWorkloadUrlSync(options: WorkloadsWorkloadUrlSyncOptions) {
});
createEffect(() => {
+ if (!isWorkloadsRoute()) return;
const parsed = workloadUrlParams();
const normalizedType = parsed.type;
if (normalizedType === handledTypeParam()) return;
@@ -157,6 +158,7 @@ export function useWorkloadUrlSync(options: WorkloadsWorkloadUrlSyncOptions) {
});
createEffect(() => {
+ if (!isWorkloadsRoute()) return;
const normalized = workloadUrlParams().platform;
if (normalized === handledPlatformParam()) return;
const currentSelected = untrack(() => options.selectedPlatform());
@@ -183,6 +185,7 @@ export function useWorkloadUrlSync(options: WorkloadsWorkloadUrlSyncOptions) {
});
createEffect(() => {
+ if (!isWorkloadsRoute()) return;
const normalized = workloadUrlParams().context;
if (normalized === handledContextParam()) return;
@@ -203,6 +206,7 @@ export function useWorkloadUrlSync(options: WorkloadsWorkloadUrlSyncOptions) {
});
createEffect(() => {
+ if (!isWorkloadsRoute()) return;
const normalized = workloadUrlParams().namespace;
if (normalized === handledNamespaceParam()) return;
@@ -223,6 +227,7 @@ export function useWorkloadUrlSync(options: WorkloadsWorkloadUrlSyncOptions) {
});
createEffect(() => {
+ if (!isWorkloadsRoute()) return;
const normalized = workloadUrlParams().agent;
if (normalized === handledAgentParam()) return;
@@ -243,6 +248,7 @@ export function useWorkloadUrlSync(options: WorkloadsWorkloadUrlSyncOptions) {
});
createEffect(() => {
+ if (!isWorkloadsRoute()) return;
const parsed = workloadUrlParams();
const urlRuntime = parsed.runtime;
if (urlRuntime === handledRuntimeParam()) return;
@@ -284,6 +290,7 @@ export function useWorkloadUrlSync(options: WorkloadsWorkloadUrlSyncOptions) {
if (urlResource) return;
const nextPath = resolveWorkloadsManagedWorkloadsNavigateTarget({
+ currentPathname: location.pathname,
currentSearch: location.search,
viewMode: options.viewMode(),
containerRuntime: options.containerRuntime(),
diff --git a/frontend-modern/src/components/Workloads/useWorkloadsState.ts b/frontend-modern/src/components/Workloads/useWorkloadsState.ts
index dd20fbb403..48a46d7ab0 100644
--- a/frontend-modern/src/components/Workloads/useWorkloadsState.ts
+++ b/frontend-modern/src/components/Workloads/useWorkloadsState.ts
@@ -194,6 +194,7 @@ export function useWorkloadsState(props: WorkloadsSurfaceProps) {
} = useWorkloadRouteState({
allGuests,
allowEmbeddedScopeFilters: props.allowEmbeddedScopeFilters,
+ embedded: props.embedded,
forcedPlatform: props.forcedPlatform,
forcedViewMode: props.forcedViewMode,
showFilters,
diff --git a/frontend-modern/src/components/Workloads/workloadUrlSyncModel.ts b/frontend-modern/src/components/Workloads/workloadUrlSyncModel.ts
index efa1fb295b..a2ac93f394 100644
--- a/frontend-modern/src/components/Workloads/workloadUrlSyncModel.ts
+++ b/frontend-modern/src/components/Workloads/workloadUrlSyncModel.ts
@@ -1,8 +1,7 @@
import type { ViewMode } from '@/types/workloads';
import {
- buildWorkloadsPath,
+ buildWorkloadsRouteSearch,
parseWorkloadsLinkSearch,
- WORKLOADS_PATH,
WORKLOADS_QUERY_PARAMS,
} from '@/routing/resourceLinks';
import { areSearchParamsEquivalent } from '@/utils/searchParams';
@@ -26,6 +25,7 @@ export interface WorkloadsWorkloadRuntimeParamResolution {
interface WorkloadsManagedWorkloadsNavigateTargetOptions {
containerRuntime: string;
+ currentPathname: string;
currentSearch: string;
selectedHostHint: string | null;
selectedPlatform: string | null;
@@ -83,6 +83,7 @@ export const resolveWorkloadsWorkloadRuntimeParam = (
export const resolveWorkloadsManagedWorkloadsNavigateTarget = ({
containerRuntime,
+ currentPathname,
currentSearch,
selectedHostHint,
selectedPlatform,
@@ -100,7 +101,7 @@ export const resolveWorkloadsManagedWorkloadsNavigateTarget = ({
const nextNamespace = viewMode === 'pod' ? (selectedKubernetesNamespace ?? '') : '';
const nextAgent = viewMode === 'pod' ? '' : (selectedNode ?? selectedHostHint ?? '');
- const managedPath = buildWorkloadsPath({
+ const managedSearch = buildWorkloadsRouteSearch({
type: nextType || null,
platform: nextPlatform || null,
runtime: nextRuntime || null,
@@ -108,14 +109,13 @@ export const resolveWorkloadsManagedWorkloadsNavigateTarget = ({
namespace: nextNamespace || null,
agent: nextAgent || null,
});
- const managedUrl = new URL(managedPath, 'http://pulse.local');
nextParams.delete(WORKLOADS_QUERY_PARAMS.type);
nextParams.delete(WORKLOADS_QUERY_PARAMS.platform);
nextParams.delete(WORKLOADS_QUERY_PARAMS.runtime);
nextParams.delete(WORKLOADS_QUERY_PARAMS.context);
nextParams.delete(WORKLOADS_QUERY_PARAMS.namespace);
nextParams.delete(WORKLOADS_QUERY_PARAMS.agent);
- managedUrl.searchParams.forEach((value, key) => {
+ new URLSearchParams(managedSearch).forEach((value, key) => {
nextParams.set(key, value);
});
@@ -124,5 +124,5 @@ export const resolveWorkloadsManagedWorkloadsNavigateTarget = ({
}
const nextSearch = nextParams.toString();
- return nextSearch ? `${WORKLOADS_PATH}?${nextSearch}` : WORKLOADS_PATH;
+ return nextSearch ? `${currentPathname}?${nextSearch}` : currentPathname;
};
diff --git a/frontend-modern/src/features/recovery/useRecoverySurfaceState.ts b/frontend-modern/src/features/recovery/useRecoverySurfaceState.ts
index 906ef820a6..211c1c5b1e 100644
--- a/frontend-modern/src/features/recovery/useRecoverySurfaceState.ts
+++ b/frontend-modern/src/features/recovery/useRecoverySurfaceState.ts
@@ -6,7 +6,7 @@ import { useRecoveryRollups, type RecoveryRollupsQuery } from '@/hooks/useRecove
import { useRecoveryPoints } from '@/hooks/useRecoveryPoints';
import { useRecoveryPointsFacets } from '@/hooks/useRecoveryPointsFacets';
import { useRecoveryPointsSeries } from '@/hooks/useRecoveryPointsSeries';
-import { RECOVERY_PATH, buildRecoveryPath, parseRecoveryLinkSearch } from '@/routing/resourceLinks';
+import { buildRecoveryRouteSearch, parseRecoveryLinkSearch } from '@/routing/resourceLinks';
import type { ProtectionRollup, RecoveryOutcome } from '@/types/recovery';
import type { Resource } from '@/types/resource';
import { createRouteStateNavigateScheduler } from '@/utils/routeStateNavigation';
@@ -417,12 +417,10 @@ export function useRecoverySurfaceState(options: RecoverySurfaceStateOptions = {
protectedStateFilter();
chartRangeDays();
selectedDateKey();
- if (location.pathname !== RECOVERY_PATH) return;
if (untrack(currentPage) !== 1) setCurrentPage(1);
});
createEffect(() => {
- if (location.pathname !== RECOVERY_PATH) return;
const rid = rollupId().trim();
const defaultView: RecoveryWorkspaceView = 'events';
const status = historyOutcomeFilter() !== 'all' ? historyOutcomeFilter() : null;
@@ -430,7 +428,7 @@ export function useRecoverySurfaceState(options: RecoverySurfaceStateOptions = {
const currentPath = `${location.pathname}${location.search || ''}`;
if (hydratedLocationKey() !== currentPath) return;
- const nextPath = buildRecoveryPath({
+ const nextSearch = buildRecoveryRouteSearch({
rollupId: rid || null,
view: workspaceView() !== defaultView ? workspaceView() : null,
query: queryFilter().trim() || null,
@@ -451,6 +449,7 @@ export function useRecoverySurfaceState(options: RecoverySurfaceStateOptions = {
node: nodeFilter() !== 'all' ? nodeFilter() : null,
namespace: namespaceFilter() !== 'all' ? namespaceFilter() : null,
});
+ const nextPath = `${location.pathname}${nextSearch}`;
if (nextPath !== currentPath) {
routeStateNavigate.schedule(nextPath);
diff --git a/frontend-modern/src/routing/__tests__/resourceLinks.test.ts b/frontend-modern/src/routing/__tests__/resourceLinks.test.ts
index 50a01431cb..138084b8f7 100644
--- a/frontend-modern/src/routing/__tests__/resourceLinks.test.ts
+++ b/frontend-modern/src/routing/__tests__/resourceLinks.test.ts
@@ -14,17 +14,16 @@ import {
buildAgentsPath,
buildDockerPath,
buildKubernetesPath,
- buildRecoveryPath,
+ buildRecoveryRouteSearch,
buildProxmoxPath,
- buildStoragePath,
+ buildStorageRouteSearch,
buildTrueNASPath,
buildVmwarePath,
- buildWorkloadsPath,
+ buildWorkloadsRouteSearch,
parseRecoveryLinkSearch,
parseStorageLinkSearch,
parseWorkloadsLinkSearch,
STORAGE_QUERY_PARAMS,
- STORAGE_PATH,
WORKLOADS_QUERY_PARAMS,
} from '@/routing/resourceLinks';
@@ -76,18 +75,18 @@ describe('resource link routing contract', () => {
});
it('builds and parses workloads query params', () => {
- const href = buildWorkloadsPath({
+ const search = buildWorkloadsRouteSearch({
type: 'k8s',
platform: 'kubernetes',
context: 'cluster-a',
agent: 'worker-1',
resource: 'cluster-a:worker-1:101',
});
- expect(href).toBe(
- '/workloads?type=pod&platform=kubernetes&context=cluster-a&agent=worker-1&resource=cluster-a%3Aworker-1%3A101',
+ expect(search).toBe(
+ '?type=pod&platform=kubernetes&context=cluster-a&agent=worker-1&resource=cluster-a%3Aworker-1%3A101',
);
- const parsed = parseWorkloadsLinkSearch(href.slice('/workloads'.length));
+ const parsed = parseWorkloadsLinkSearch(search);
expect(parsed).toEqual({
type: 'pod',
platform: 'kubernetes',
@@ -109,18 +108,32 @@ describe('resource link routing contract', () => {
expect(WORKLOADS_QUERY_PARAMS.summaryGroup).toBe('summaryGroup');
});
- it('canonicalizes legacy workloads type aliases when building links', () => {
- expect(buildWorkloadsPath({ type: 'docker', platform: 'docker', agent: 'runtime-1' })).toBe(
- '/workloads?type=app-container&platform=docker&agent=runtime-1',
- );
+ it('canonicalizes legacy workloads type aliases when building route search', () => {
+ expect(
+ buildWorkloadsRouteSearch({ type: 'docker', platform: 'docker', agent: 'runtime-1' }),
+ ).toBe('?type=app-container&platform=docker&agent=runtime-1');
expect(
- buildWorkloadsPath({ type: 'kubernetes', platform: 'kubernetes', context: 'cluster-a' }),
- ).toBe('/workloads?type=pod&platform=kubernetes&context=cluster-a');
+ buildWorkloadsRouteSearch({
+ type: 'kubernetes',
+ platform: 'kubernetes',
+ context: 'cluster-a',
+ }),
+ ).toBe('?type=pod&platform=kubernetes&context=cluster-a');
+ });
+
+ it('does not expose retired aggregate route builders', () => {
+ const linkExports = {
+ buildWorkloadsRouteSearch,
+ buildStorageRouteSearch,
+ buildRecoveryRouteSearch,
+ };
+ expect(linkExports).not.toHaveProperty('buildWorkloadsPath');
+ expect(linkExports).not.toHaveProperty('buildStoragePath');
+ expect(linkExports).not.toHaveProperty('buildRecoveryPath');
});
it('builds and parses storage query params', () => {
- expect(STORAGE_PATH).toBe('/storage');
- const href = buildStoragePath({
+ const search = buildStorageRouteSearch({
tab: 'disks',
group: 'storage',
source: 'pbs',
@@ -133,11 +146,11 @@ describe('resource link routing contract', () => {
sort: 'usage',
order: 'desc',
});
- expect(href).toBe(
- '/storage?tab=disks&group=storage&source=proxmox-pbs&status=available&diskRole=nvme-disk&diskGroup=data&node=cluster-main-pve1&q=local-lvm&resource=storage-1&sort=usage&order=desc',
+ expect(search).toBe(
+ '?tab=disks&group=storage&source=proxmox-pbs&status=available&diskRole=nvme-disk&diskGroup=data&node=cluster-main-pve1&q=local-lvm&resource=storage-1&sort=usage&order=desc',
);
- const parsed = parseStorageLinkSearch(href.slice('/storage'.length));
+ const parsed = parseStorageLinkSearch(search);
expect(parsed).toEqual({
tab: 'disks',
group: 'storage',
@@ -170,7 +183,7 @@ describe('resource link routing contract', () => {
});
it('builds and parses recovery query params', () => {
- const href = buildRecoveryPath({
+ const search = buildRecoveryRouteSearch({
view: 'events',
platform: 'proxmox-pbs',
state: 'stale',
@@ -187,8 +200,8 @@ describe('resource link routing contract', () => {
node: 'cluster-main-pve1',
query: 'node:pve1',
});
- const url = new URL(href, 'http://localhost');
- expect(url.pathname).toBe('/recovery');
+ const url = new URL(search, 'http://localhost/truenas/protection');
+ expect(url.pathname).toBe('/truenas/protection');
expect(url.searchParams.get('view')).toBe('events');
expect(url.searchParams.get('platform')).toBe('proxmox-pbs');
expect(url.searchParams.get('state')).toBe('stale');
@@ -205,7 +218,7 @@ describe('resource link routing contract', () => {
expect(url.searchParams.get('node')).toBe('cluster-main-pve1');
expect(url.searchParams.get('q')).toBe('node:pve1');
- const parsed = parseRecoveryLinkSearch(href.slice('/recovery'.length));
+ const parsed = parseRecoveryLinkSearch(search);
expect(parsed).toEqual({
rollupId: '',
view: 'events',
@@ -243,31 +256,31 @@ describe('resource link routing contract', () => {
});
it('canonicalizes recovery platform aliases when building and parsing links', () => {
- expect(buildRecoveryPath({ platform: 'pbs', mode: 'remote' })).toBe(
- '/recovery?platform=proxmox-pbs&mode=remote',
+ expect(buildRecoveryRouteSearch({ platform: 'pbs', mode: 'remote' })).toBe(
+ '?platform=proxmox-pbs&mode=remote',
);
const parsed = parseRecoveryLinkSearch('?provider=proxmox&mode=local');
expect(parsed).toMatchObject({
platform: 'proxmox-pve',
mode: 'local',
});
- expect(buildRecoveryPath(parsed)).toBe('/recovery?platform=proxmox-pve&mode=local');
+ expect(buildRecoveryRouteSearch(parsed)).toBe('?platform=proxmox-pve&mode=local');
expect(parseRecoveryLinkSearch('?itemType=proxmox-vm')).toMatchObject({
itemType: 'vm',
});
});
it('canonicalizes stale-only recovery route flags to the owned query shape', () => {
- expect(buildRecoveryPath({ stale: 'true', platform: 'proxmox-pve' })).toBe(
- '/recovery?platform=proxmox-pve&stale=1',
+ expect(buildRecoveryRouteSearch({ stale: 'true', platform: 'proxmox-pve' })).toBe(
+ '?platform=proxmox-pve&stale=1',
);
expect(parseRecoveryLinkSearch('?stale=%201%20')).toMatchObject({ stale: '1' });
});
it('preserves explicit recovery chart range values in route state', () => {
- const href = buildRecoveryPath({ range: '30', platform: 'proxmox-pve' });
- const url = new URL(href, 'http://localhost');
- expect(url.pathname).toBe('/recovery');
+ const search = buildRecoveryRouteSearch({ range: '30', platform: 'proxmox-pve' });
+ const url = new URL(search, 'http://localhost/proxmox/backups');
+ expect(url.pathname).toBe('/proxmox/backups');
expect(url.searchParams.get('platform')).toBe('proxmox-pve');
expect(url.searchParams.get('range')).toBe('30');
expect(parseRecoveryLinkSearch('?range=90')).toMatchObject({ range: '90' });
diff --git a/frontend-modern/src/routing/resourceLinks.ts b/frontend-modern/src/routing/resourceLinks.ts
index 824232028b..f45f29b29b 100644
--- a/frontend-modern/src/routing/resourceLinks.ts
+++ b/frontend-modern/src/routing/resourceLinks.ts
@@ -15,7 +15,6 @@ export const WORKLOADS_QUERY_PARAMS = {
summaryGroup: 'summaryGroup',
} as const;
-export const WORKLOADS_PATH = '/workloads';
export const AGENTS_PATH = '/agents';
export const AGENTS_DEFAULT_TAB = 'overview';
export const PROXMOX_PATH = '/proxmox';
@@ -31,9 +30,6 @@ export const VMWARE_DEFAULT_TAB = 'overview';
export const PMG_THRESHOLDS_PATH = '/alerts/thresholds/mail-gateway';
export const ALERTS_OVERVIEW_PATH = '/alerts/overview';
export const PATROL_PATH = '/patrol';
-export const STORAGE_PATH = '/storage';
-// Canonical "Recovery" surface (was historically called Backups).
-export const RECOVERY_PATH = '/recovery';
export const STORAGE_QUERY_PARAMS = {
tab: 'tab',
@@ -150,7 +146,12 @@ export const parseWorkloadsLinkSearch = (search: string) => {
};
};
-export const buildWorkloadsPath = (options: WorkloadsLinkOptions = {}): string => {
+const serializedRouteSearch = (params: URLSearchParams): string => {
+ const query = params.toString();
+ return query ? `?${query}` : '';
+};
+
+export const buildWorkloadsRouteSearch = (options: WorkloadsLinkOptions = {}): string => {
const params = new URLSearchParams();
const type = normalizeWorkloadsType(options.type);
const platform = normalizeSourcePlatformQueryValue(options.platform);
@@ -168,8 +169,7 @@ export const buildWorkloadsPath = (options: WorkloadsLinkOptions = {}): string =
if (agent) params.set(WORKLOADS_QUERY_PARAMS.agent, agent);
if (resource) params.set(WORKLOADS_QUERY_PARAMS.resource, resource);
if (summaryGroup) params.set(WORKLOADS_QUERY_PARAMS.summaryGroup, summaryGroup);
- const query = params.toString();
- return query ? `${WORKLOADS_PATH}?${query}` : WORKLOADS_PATH;
+ return serializedRouteSearch(params);
};
export const buildProxmoxPath = (tab: string = PROXMOX_DEFAULT_TAB): string => {
@@ -220,7 +220,7 @@ export const parseStorageLinkSearch = (search: string) => {
};
};
-export const buildStoragePath = (options: StorageLinkOptions = {}): string => {
+export const buildStorageRouteSearch = (options: StorageLinkOptions = {}): string => {
const params = new URLSearchParams();
const tab = normalizeQueryValue(options.tab);
const group = normalizeQueryValue(options.group);
@@ -248,8 +248,7 @@ export const buildStoragePath = (options: StorageLinkOptions = {}): string => {
if (order) params.set(STORAGE_QUERY_PARAMS.order, order);
if (summaryGroup) params.set(STORAGE_QUERY_PARAMS.summaryGroup, summaryGroup);
- const serialized = params.toString();
- return serialized ? `${STORAGE_PATH}?${serialized}` : STORAGE_PATH;
+ return serializedRouteSearch(params);
};
export const parseRecoveryLinkSearch = (search: string) => {
@@ -280,7 +279,7 @@ export const parseRecoveryLinkSearch = (search: string) => {
};
};
-export const buildRecoveryPath = (options: RecoveryLinkOptions = {}): string => {
+export const buildRecoveryRouteSearch = (options: RecoveryLinkOptions = {}): string => {
const params = new URLSearchParams();
const rollupId = normalizeQueryValue(options.rollupId);
const view = normalizeQueryValue(options.view);
@@ -316,6 +315,5 @@ export const buildRecoveryPath = (options: RecoveryLinkOptions = {}): string =>
if (node) params.set(RECOVERY_QUERY_PARAMS.node, node);
if (query) params.set(RECOVERY_QUERY_PARAMS.query, query);
- const serialized = params.toString();
- return serialized ? `${RECOVERY_PATH}?${serialized}` : RECOVERY_PATH;
+ return serializedRouteSearch(params);
};
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index f0cff9222c..0f237ac701 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -741,7 +741,7 @@ describe('frontend resource type boundaries', () => {
'resolveWorkloadsManagedWorkloadsNavigateTarget({',
);
expect(workloadUrlSyncModelSource).toContain('parseWorkloadsLinkSearch(search)');
- expect(workloadUrlSyncModelSource).toContain('buildWorkloadsPath({');
+ expect(workloadUrlSyncModelSource).toContain('buildWorkloadsRouteSearch({');
expect(workloadUrlSyncModelSource).toContain('resolveWorkloadsManagedWorkloadsNavigateTarget');
expect(workloadUrlSyncModelSource).toContain('resolveWorkloadsWorkloadRuntimeParam');
expect(workloadUrlSyncModelSource).toContain('normalizeWorkloadViewModeParam(params.type)');
@@ -1094,12 +1094,12 @@ describe('frontend resource type boundaries', () => {
'export function useRecoveryHistorySectionState',
);
expect(recoverySource).not.toContain('parseRecoveryLinkSearch');
- expect(recoverySource).not.toContain('buildRecoveryPath');
+ expect(recoverySource).not.toContain('buildRecoveryRouteSearch');
expect(recoverySource).not.toContain('useRecoveryRollups');
expect(recoverySource).not.toContain('useRecoveryPointsFacets');
expect(recoverySurfaceStateSource).toContain('export function useRecoverySurfaceState');
expect(recoverySurfaceStateSource).toContain('parseRecoveryLinkSearch');
- expect(recoverySurfaceStateSource).toContain('buildRecoveryPath');
+ expect(recoverySurfaceStateSource).toContain('buildRecoveryRouteSearch');
expect(recoverySurfaceStateSource).toContain('useRecoveryRollups');
expect(recoverySurfaceStateSource).toContain('useRecoveryPoints');
expect(recoverySurfaceStateSource).toContain('useRecoveryPointsFacets');
diff --git a/frontend-modern/src/utils/__tests__/routeStateNavigation.test.ts b/frontend-modern/src/utils/__tests__/routeStateNavigation.test.ts
index 49b08c2357..30dc17e355 100644
--- a/frontend-modern/src/utils/__tests__/routeStateNavigation.test.ts
+++ b/frontend-modern/src/utils/__tests__/routeStateNavigation.test.ts
@@ -51,14 +51,14 @@ describe('routeStateNavigation', () => {
it('preserves scroll when replacing query state on the same pathname', () => {
const navigate = vi.fn();
- let currentPath = '/workloads?type=app-container';
+ let currentPath = '/proxmox/overview?type=app-container';
const scheduler = createRouteStateNavigateScheduler(navigate, () => currentPath);
- scheduler.schedule('/workloads?type=app-container&resource=agent-123');
+ scheduler.schedule('/proxmox/overview?type=app-container&resource=agent-123');
vi.runAllTimers();
expect(navigate).toHaveBeenCalledWith(
- '/workloads?type=app-container&resource=agent-123',
+ '/proxmox/overview?type=app-container&resource=agent-123',
ROUTE_STATE_REPLACE_OPTIONS,
);
expect(scrollToSpy).toHaveBeenCalledWith(24, 320);
@@ -67,14 +67,14 @@ describe('routeStateNavigation', () => {
it('cancels deferred same-path scroll restoration when cleaned up', () => {
const navigate = vi.fn();
- let currentPath = '/workloads?type=app-container';
+ let currentPath = '/proxmox/overview?type=app-container';
const scheduler = createRouteStateNavigateScheduler(navigate, () => currentPath);
- scheduler.schedule('/workloads?type=app-container&resource=agent-123');
+ scheduler.schedule('/proxmox/overview?type=app-container&resource=agent-123');
vi.advanceTimersByTime(0);
expect(navigate).toHaveBeenCalledWith(
- '/workloads?type=app-container&resource=agent-123',
+ '/proxmox/overview?type=app-container&resource=agent-123',
ROUTE_STATE_REPLACE_OPTIONS,
);
expect(scrollToSpy).toHaveBeenCalledTimes(1);
@@ -87,18 +87,18 @@ describe('routeStateNavigation', () => {
it('captures the app scroll shell before same-path route state navigation', () => {
const navigate = vi.fn();
- let currentPath = '/workloads?type=app-container';
+ let currentPath = '/proxmox/overview?type=app-container';
const scheduler = createRouteStateNavigateScheduler(navigate, () => currentPath);
const shell = document.createElement('div');
shell.className = 'app-scroll-shell';
shell.scrollTop = 55;
document.body.appendChild(shell);
- scheduler.schedule('/workloads?type=app-container&resource=agent-123');
+ scheduler.schedule('/proxmox/overview?type=app-container&resource=agent-123');
vi.runAllTimers();
expect(navigate).toHaveBeenCalledWith(
- '/workloads?type=app-container&resource=agent-123',
+ '/proxmox/overview?type=app-container&resource=agent-123',
ROUTE_STATE_REPLACE_OPTIONS,
);
expect(readPendingAppShellRestoreTop()).toBe(55);
@@ -106,9 +106,9 @@ describe('routeStateNavigation', () => {
it('skips redundant navigations to the current path', () => {
const navigate = vi.fn();
- const scheduler = createRouteStateNavigateScheduler(navigate, () => '/recovery?rollupId=abc');
+ const scheduler = createRouteStateNavigateScheduler(navigate, () => '/proxmox/backups?rollupId=abc');
- scheduler.schedule('/recovery?rollupId=abc');
+ scheduler.schedule('/proxmox/backups?rollupId=abc');
vi.runAllTimers();
expect(navigate).not.toHaveBeenCalled();
@@ -118,10 +118,10 @@ describe('routeStateNavigation', () => {
it('stops replaying preserved scroll after a later deliberate scroll change', () => {
const navigate = vi.fn();
- let currentPath = '/workloads?type=app-container';
+ let currentPath = '/proxmox/overview?type=app-container';
const scheduler = createRouteStateNavigateScheduler(navigate, () => currentPath);
- scheduler.schedule('/workloads?type=app-container&resource=agent-123');
+ scheduler.schedule('/proxmox/overview?type=app-container&resource=agent-123');
vi.advanceTimersByTime(0);
expect(scrollToSpy).toHaveBeenCalledTimes(1);
@@ -134,15 +134,15 @@ describe('routeStateNavigation', () => {
it('suppresses preserved scroll replays while a deliberate scroll handoff is active', () => {
const navigate = vi.fn();
- let currentPath = '/workloads?type=app-container';
+ let currentPath = '/proxmox/overview?type=app-container';
const scheduler = createRouteStateNavigateScheduler(navigate, () => currentPath);
markRouteStateDeliberateScroll();
- scheduler.schedule('/workloads?type=app-container&resource=guest-1');
+ scheduler.schedule('/proxmox/overview?type=app-container&resource=guest-1');
vi.runAllTimers();
expect(navigate).toHaveBeenCalledWith(
- '/workloads?type=app-container&resource=guest-1',
+ '/proxmox/overview?type=app-container&resource=guest-1',
ROUTE_STATE_REPLACE_OPTIONS,
);
expect(scrollToSpy).not.toHaveBeenCalled();