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.

Link locked history ranges to Plans & Billing

rcourtmand7d8de0a0296
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 900ecee2e6..9f11c181c5 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -5308,13 +5308,19 @@ production table, router and styles; it does not qualify full-app scrolling.
page takeover between tabs.
39. Keep self-hosted paid-service prompts opt-in at the shared shell layer.
`settingsNavCatalog.ts`, `settingsNavVisibility.ts`, shared upgrade link
- primitives, trial banners, monitored-system warning banners, history-lock
- overlays, and Patrol lock helpers must honor `presentationPolicy.hideUpgrade`
+ primitives, trial banners, monitored-system warning banners, and Patrol
+ lock helpers must honor `presentationPolicy.hideUpgrade`
by hiding paid prompts by default on ordinary self-hosted installs. Direct
activation/recovery routes may render their owned content, but sidebar
discovery, trial CTAs, plan upsells, monitored-system limit pressure,
feature upgrade links, and plan-lock Patrol banners must require hosted
- mode, explicit handoff, or active entitlement. Cloud interest links from
+ mode, explicit handoff, or active entitlement. A lock the operator opens
+ is not a proactive prompt: plan-locked lines in Settings and the locked
+ long-range history states (`HistoryChartOverlay` and the guest drawer
+ history lock, both through
+ `frontend-modern/src/components/shared/HistoryLockPlanLink.tsx`) link to
+ Plans & Billing whenever `presentationPolicy.hideCommercial` is false,
+ and stay text only under demo and white-label runtimes. Cloud interest links from
self-hosted plan surfaces must hand
off to Pulse Account/public Cloud ownership rather than route to an
in-product Cloud trial/signup page.
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 41ccee1175..884af07f4b 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -23,6 +23,14 @@ the `currentMetrics` and `deferredMetrics` the drawer already derives, issues
no request, adds no poll or timer, and holds one item per configured series.
The history query, its 30-second poll and its retry are unchanged.
+### Plan-locked history link adds no history work (3 November 2026)
+
+The plan-locked range in `GuestDrawerHistory` ends with a Plans & Billing link
+from `HistoryLockPlanLink`. It resolves a static in-product route, reads the
+session presentation policy the shell already holds, and issues no request:
+no commercial-posture fetch, poll or timer. A locked range still starts no
+history read.
+
### Missing backup completion remains a presentation-only uncertainty
Workloads keeps its existing scalar and legacy absence classification, but
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index ca6385b19c..10bb46f952 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -6366,6 +6366,7 @@
"frontend-modern/src/components/shared/__tests__/Dialog.test.tsx",
"frontend-modern/src/components/shared/__tests__/HelpIcon.test.tsx",
"frontend-modern/src/components/shared/__tests__/HistoryChart.test.tsx",
+ "frontend-modern/src/components/shared/__tests__/HistoryLockPlanLink.test.tsx",
"frontend-modern/src/components/shared/__tests__/InlineDetailTableRow.test.tsx",
"frontend-modern/src/components/shared/__tests__/MobileNavBar.test.tsx",
"frontend-modern/src/components/shared/__tests__/PulseDataGrid.test.tsx",
diff --git a/frontend-modern/browser-verification/3afae0cfabf332e1.json b/frontend-modern/browser-verification/3afae0cfabf332e1.json
new file mode 100644
index 0000000000..b839efe75f
--- /dev/null
+++ b/frontend-modern/browser-verification/3afae0cfabf332e1.json
@@ -0,0 +1,45 @@
+{
+ "version": 1,
+ "base_sha": "94a368de87f1454a50ad598a2ba4a18e25fc4456",
+ "verified_at": "2026-11-03T14:09:00Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/components/Workloads/GuestDrawerHistory.tsx",
+ "frontend-modern/src/components/shared/HistoryChartOverlay.tsx",
+ "frontend-modern/src/components/shared/HistoryLockPlanLink.tsx"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/components/Workloads/GuestDrawerHistory.tsx": "2b104a2aafa9a09eed23c212d951eebfa734e8111485245464aa7eba82c1e5b6",
+ "frontend-modern/src/components/shared/HistoryChartOverlay.tsx": "9502b2546fd282097042dd6ce436d66885d5ee4e1524e8a42195d4467b3d3fa6",
+ "frontend-modern/src/components/shared/HistoryLockPlanLink.tsx": "17f721459cd9d8c52faff52702683eca2d3cbd9ed5cf52dc3f7a53bc6d41ac80"
+ },
+ "routes": [
+ "/proxmox/overview",
+ "/settings/pulse-intelligence/billing/plan"
+ ],
+ "viewports": [
+ {
+ "width": 1280,
+ "height": 860
+ },
+ {
+ "width": 375,
+ "height": 812
+ }
+ ],
+ "states": [
+ "Free self-hosted install, mock mode, served presentationPolicy hideCommercial=false hideUpgrade=true, max_history_days=7",
+ "Guest drawer (edge-proxy-01 LXC) at 30 days: lock reads \"30 days history requires a higher license plan. This instance's plan retains 7 days.\" followed by a Plans & Billing link to /settings/pulse-intelligence/billing/plan",
+ "Proxmox node drawer (London Edge Standalone) at 90 days: same lock and link; Latest readings strip still shown below",
+ "Plan page reached from the lock shows Current plan: Community and the Pulse Pro card with View plans and 90-day metric history",
+ "375px phone width: link wraps inside the lock text, document width 375 (no horizontal scroll)",
+ "No commercial-posture request and no 30-day history read observed after opening the lock",
+ "HistoryChartOverlay lock not reachable live: HistoryChart is not rendered by any app route on this base; covered by HistoryLockPlanLink.test.tsx"
+ ],
+ "interactions": [
+ "Opened guest drawer from the Proxmox guests table and chose 30 days in History range",
+ "Followed the Plans & Billing link from the guest drawer lock (in-app navigation to the plan page)",
+ "Opened the node drawer and chose 90 days in History range",
+ "Resized to 375x812 and scrolled the lock into view"
+ ]
+}
diff --git a/frontend-modern/src/components/Workloads/GuestDrawerHistory.tsx b/frontend-modern/src/components/Workloads/GuestDrawerHistory.tsx
index 2d59cf66ed..d57a18cc7c 100644
--- a/frontend-modern/src/components/Workloads/GuestDrawerHistory.tsx
+++ b/frontend-modern/src/components/Workloads/GuestDrawerHistory.tsx
@@ -15,6 +15,7 @@ import { type AggregatedMetricPoint, type HistoryTimeRange } from '@/api/charts'
import { FormSelect } from '@/components/shared/FormSelect';
import { filterSelectClass } from '@/components/shared/FilterToolbar';
import { Button } from '@/components/shared/Button';
+import { HistoryLockPlanLink } from '@/components/shared/HistoryLockPlanLink';
import { InlineNotice } from '@/components/shared/InlineNotice';
import { LoadingSpinner } from '@/components/shared/LoadingSpinner';
import { PhoneChartsToggle } from '@/components/shared/PhoneChartsToggle';
@@ -1219,7 +1220,7 @@ export const GuestDrawerHistory: Component<GuestDrawerHistoryProps> = (props) =>
<>
<div class="rounded-xs border border-border bg-surface p-5 text-sm text-muted">
{formatHistoryRangeOptionLabel(props.range)} history requires a higher license plan.
- This instance's plan retains {maxHistoryDays()} days.
+ This instance's plan retains {maxHistoryDays()} days. <HistoryLockPlanLink />
</div>
{liveReadings()}
</>
diff --git a/frontend-modern/src/components/Workloads/__tests__/GuestDrawerHistory.refresh.test.tsx b/frontend-modern/src/components/Workloads/__tests__/GuestDrawerHistory.refresh.test.tsx
index 106c446826..7bc19c4743 100644
--- a/frontend-modern/src/components/Workloads/__tests__/GuestDrawerHistory.refresh.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/GuestDrawerHistory.refresh.test.tsx
@@ -1,8 +1,10 @@
-import { cleanup, fireEvent, render, screen, waitFor } from '@solidjs/testing-library';
-import { createSignal } from 'solid-js';
+import { cleanup, fireEvent, render, screen, waitFor, within } from '@solidjs/testing-library';
+import { Route, Router } from '@solidjs/router';
+import { createSignal, type JSX } from 'solid-js';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { ChartsAPI, type AllMetricsHistoryResponse, type HistoryTimeRange } from '@/api/charts';
import { resetCreateNonSuspendingQueryCacheForTest } from '@/hooks/createNonSuspendingQuery';
+import { syncSessionPresentationPolicy } from '@/stores/sessionPresentationPolicy';
import { GuestDrawerHistory } from '../GuestDrawerHistory';
import type { GuestDrawerHistoryTarget } from '../guestDrawerModel';
@@ -15,6 +17,7 @@ vi.mock('@/stores/license', () => ({
afterEach(() => {
cleanup();
resetCreateNonSuspendingQueryCacheForTest();
+ syncSessionPresentationPolicy(null);
vi.restoreAllMocks();
vi.useRealTimers();
});
@@ -34,6 +37,17 @@ const response = (value = 42, resourceId = target.resourceId): AllMetricsHistory
],
},
});
+// The plan lock links to Plans & Billing, which needs a router.
+const renderInRouter = (component: () => JSX.Element) =>
+ render(() => (
+ <Router>
+ <Route path="/*" component={component} />
+ </Router>
+ ));
+const setPresentationPolicy = (policy: { hideCommercial: boolean; hideUpgrade: boolean }) =>
+ syncSessionPresentationPolicy({
+ presentationPolicy: { demoMode: false, readOnly: false, ...policy },
+ } as Parameters<typeof syncSessionPresentationPolicy>[0]);
const paths = (container: HTMLElement) =>
container.querySelectorAll('[data-testid="guest-history-plot"] path');
@@ -313,7 +327,7 @@ describe('GuestDrawerHistory refresh recovery', () => {
.mockRejectedValueOnce(new Error('store offline'))
.mockReturnValueOnce(pending.promise);
const [range, setRange] = createSignal<HistoryTimeRange>('24h');
- const { container } = render(() => (
+ const { container } = renderInRouter(() => (
<GuestDrawerHistory
target={target}
range={range()}
@@ -361,13 +375,33 @@ describe('GuestDrawerHistory refresh recovery', () => {
it('offers no refresh when the target is absent or the range is locked', async () => {
const fetch = vi.spyOn(ChartsAPI, 'getMetricsHistory');
const [currentTarget, setTarget] = createSignal<GuestDrawerHistoryTarget | null>(null);
- render(() => <GuestDrawerHistory target={currentTarget()} range="14d" />);
+ renderInRouter(() => <GuestDrawerHistory target={currentTarget()} range="14d" />);
expect(screen.queryByRole('button', { name: /history/i })).not.toBeInTheDocument();
setTarget(target);
await screen.findByText(/14 days history requires a higher license plan/);
expect(screen.queryByRole('button', { name: /history/i })).not.toBeInTheDocument();
expect(fetch).not.toHaveBeenCalled();
});
+
+ it('links a locked range to Plans & Billing even when upgrade prompts are hidden', async () => {
+ // Free self-hosted installs hide proactive upgrade prompts; the lock the
+ // operator opened by choosing a range still says where the plan lives.
+ setPresentationPolicy({ hideCommercial: false, hideUpgrade: true });
+ renderInRouter(() => <GuestDrawerHistory target={target} range="30d" />);
+ const lock = await screen.findByText(/30 days history requires a higher license plan/);
+ expect(lock).toHaveTextContent("This instance's plan retains 7 days.");
+ expect(within(lock).getByRole('link', { name: 'Plans & Billing' })).toHaveAttribute(
+ 'href',
+ '/settings/pulse-intelligence/billing/plan',
+ );
+ });
+
+ it('keeps the plan lock text only when commercial surfaces are hidden', async () => {
+ setPresentationPolicy({ hideCommercial: true, hideUpgrade: true });
+ renderInRouter(() => <GuestDrawerHistory target={target} range="30d" />);
+ const lock = await screen.findByText(/30 days history requires a higher license plan/);
+ expect(within(lock).queryByRole('link')).toBeNull();
+ });
});
const accessTarget = { resourceType: 'agent', resourceId: 'pbs-host' } as const;
diff --git a/frontend-modern/src/components/Workloads/__tests__/GuestDrawerHistory.source-isolation.test.tsx b/frontend-modern/src/components/Workloads/__tests__/GuestDrawerHistory.source-isolation.test.tsx
index e5c16ba3d6..2d4453e24f 100644
--- a/frontend-modern/src/components/Workloads/__tests__/GuestDrawerHistory.source-isolation.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/GuestDrawerHistory.source-isolation.test.tsx
@@ -1,4 +1,5 @@
import { cleanup, render, screen, waitFor } from '@solidjs/testing-library';
+import { Route, Router } from '@solidjs/router';
import { createSignal } from 'solid-js';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { ChartsAPI, type AllMetricsHistoryResponse, type HistoryTimeRange } from '@/api/charts';
@@ -220,10 +221,16 @@ describe('GuestDrawerHistory source isolation', () => {
.mockImplementation(() => new Promise(() => {}));
const [range, setRange] = createSignal<HistoryTimeRange>('24h');
const target: GuestDrawerHistoryTarget = { resourceType: 'agent', resourceId: 'host-old' };
- const view = render(() => <GuestDrawerHistory target={target} range={range()} />);
+ // The plan lock links to Plans & Billing, which needs a router.
+ const view = render(() => (
+ <Router>
+ <Route path="/*" component={() => <GuestDrawerHistory target={target} range={range()} />} />
+ </Router>
+ ));
await waitFor(() => expect(fetch).toHaveBeenCalledTimes(1));
setRange('14d');
await screen.findByText(/14 days history requires a higher license plan/);
+ expect(screen.getByRole('link', { name: 'Plans & Billing' })).toBeInTheDocument();
expect(fetch.mock.calls[0][0].signal).toBeInstanceOf(AbortSignal);
expect(fetch.mock.calls[0][0].signal!.aborted).toBe(true);
expect(fetch).toHaveBeenCalledTimes(1);
diff --git a/frontend-modern/src/components/shared/HistoryChartOverlay.tsx b/frontend-modern/src/components/shared/HistoryChartOverlay.tsx
index 26f6950ba7..7a30e49b28 100644
--- a/frontend-modern/src/components/shared/HistoryChartOverlay.tsx
+++ b/frontend-modern/src/components/shared/HistoryChartOverlay.tsx
@@ -1,4 +1,5 @@
import { Component, Show } from 'solid-js';
+import { HistoryLockPlanLink } from './HistoryLockPlanLink';
import { LoadingSpinner } from './LoadingSpinner';
import type { HistoryChartState } from './useHistoryChartState';
@@ -78,6 +79,7 @@ export const HistoryChartOverlay: Component<HistoryChartOverlayProps> = (props)
<p class="text-sm text-muted text-center max-w-[220px] mb-4">
Historical data beyond {props.chart.lockDays()} days requires a higher license plan.
</p>
+ <HistoryLockPlanLink class="text-sm font-medium text-blue-600 hover:underline dark:text-blue-400" />
</div>
</Show>
</>
diff --git a/frontend-modern/src/components/shared/HistoryLockPlanLink.tsx b/frontend-modern/src/components/shared/HistoryLockPlanLink.tsx
new file mode 100644
index 0000000000..21f2336200
--- /dev/null
+++ b/frontend-modern/src/components/shared/HistoryLockPlanLink.tsx
@@ -0,0 +1,25 @@
+import { Show, type Component } from 'solid-js';
+import { UpgradeLink } from './UpgradeLink';
+import { getUpgradeActionDestination } from '@/stores/licenseCommercial';
+import { presentationPolicyHidesCommercialSurfaces } from '@/stores/sessionPresentationPolicy';
+
+const HISTORY_LOCK_FEATURE_KEY = 'long_term_metrics';
+
+interface HistoryLockPlanLinkProps {
+ class?: string;
+}
+
+// A locked history range is a lock the operator opened by choosing that range,
+// like the plan-locked lines in Settings, so it says where the plan lives even
+// on a free install that hides proactive upgrade prompts. Demo and white-label
+// runtimes hide commercial surfaces, and the lock then stays text only.
+export const HistoryLockPlanLink: Component<HistoryLockPlanLinkProps> = (props) => (
+ <Show when={!presentationPolicyHidesCommercialSurfaces()}>
+ <UpgradeLink
+ class={props.class ?? 'font-medium text-blue-600 hover:underline dark:text-blue-400'}
+ destination={getUpgradeActionDestination(HISTORY_LOCK_FEATURE_KEY)}
+ >
+ Plans &amp; Billing
+ </UpgradeLink>
+ </Show>
+);
diff --git a/frontend-modern/src/components/shared/__tests__/HistoryLockPlanLink.test.tsx b/frontend-modern/src/components/shared/__tests__/HistoryLockPlanLink.test.tsx
new file mode 100644
index 0000000000..f4a934ac3b
--- /dev/null
+++ b/frontend-modern/src/components/shared/__tests__/HistoryLockPlanLink.test.tsx
@@ -0,0 +1,68 @@
+import { cleanup, render, screen } from '@solidjs/testing-library';
+import { Route, Router } from '@solidjs/router';
+import type { JSX } from 'solid-js';
+import { afterEach, describe, expect, it } from 'vitest';
+import { HistoryChartOverlay } from '@/components/shared/HistoryChartOverlay';
+import type { HistoryChartState } from '@/components/shared/useHistoryChartState';
+import { syncSessionPresentationPolicy } from '@/stores/sessionPresentationPolicy';
+import type { SecurityStatusPresentationPolicy } from '@/types/config';
+
+const renderInRouter = (component: () => JSX.Element) =>
+ render(() => (
+ <Router>
+ <Route path="/*" component={component} />
+ </Router>
+ ));
+
+const lockedChart = {
+ loading: () => false,
+ data: () => [],
+ error: () => null,
+ isLocked: () => true,
+ lockDays: () => 7,
+} as unknown as HistoryChartState;
+
+const setPresentationPolicy = (policy: Partial<SecurityStatusPresentationPolicy>) =>
+ syncSessionPresentationPolicy({
+ presentationPolicy: { demoMode: false, readOnly: false, ...policy },
+ } as Parameters<typeof syncSessionPresentationPolicy>[0]);
+
+describe('HistoryChartOverlay plan lock', () => {
+ afterEach(() => {
+ cleanup();
+ syncSessionPresentationPolicy(null);
+ });
+
+ it('links a locked range to Plans & Billing on a free install', () => {
+ // Free self-hosted installs hide proactive upgrade prompts, but a lock the
+ // operator opened by choosing a range still says where the plan lives.
+ setPresentationPolicy({ hideCommercial: false, hideUpgrade: true });
+ renderInRouter(() => <HistoryChartOverlay chart={lockedChart} />);
+
+ expect(
+ screen.getByText('Historical data beyond 7 days requires a higher license plan.'),
+ ).toBeInTheDocument();
+ expect(screen.getByRole('link', { name: 'Plans & Billing' })).toHaveAttribute(
+ 'href',
+ '/settings/pulse-intelligence/billing/plan',
+ );
+ });
+
+ it('keeps the lock text only when commercial surfaces are hidden', () => {
+ setPresentationPolicy({ hideCommercial: true, hideUpgrade: true });
+ renderInRouter(() => <HistoryChartOverlay chart={lockedChart} />);
+
+ expect(
+ screen.getByText('Historical data beyond 7 days requires a higher license plan.'),
+ ).toBeInTheDocument();
+ expect(screen.queryByRole('link')).toBeNull();
+ });
+
+ it('shows no lock or link when the chart asks to hide its lock', () => {
+ setPresentationPolicy({ hideCommercial: false, hideUpgrade: false });
+ renderInRouter(() => <HistoryChartOverlay chart={lockedChart} hideLock />);
+
+ expect(screen.queryByText(/requires a higher license plan/)).toBeNull();
+ expect(screen.queryByRole('link')).toBeNull();
+ });
+});