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.

Label non-current guest filesystem readings in alert settings

pulse-triage[bot]36d73a956fbd
diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.md
index 7e3638ac2a..2da0fc08c1 100644
--- a/docs/release-control/v6/internal/subsystems/alerts.md
+++ b/docs/release-control/v6/internal/subsystems/alerts.md
@@ -4831,3 +4831,30 @@ only for usable live status, leaving non-metric rows unchanged. The ten-minute
stale boundary, evaluated breach date, legacy fallback, clear rule and operator
memory basis remain independent. This does not infer collection or recovery.
Mounted drawer controls and lazy-copy tests cover this boundary.
+
+
+### Guest filesystem settings do not assert current readings (12 October 2026)
+
+The existing Proxmox Guest Filesystems settings rows use
+`getWorkloadGuestDiskRead` for the same provider read/power-state admission as
+Workloads. A `prev-` read reason labels retained usage **Last known**; an
+unavailable read or explicitly stopped VM withdraws used bytes and percentage,
+without deleting mount identity, saved overrides or threshold controls. Native
+`runtimeStatus` takes precedence over a canonical resource held online by
+another source. Independent LXC platform storage does not inherit VM-only
+read reasons. A new accepted reading clears the explanation, including zero.
+
+The shared desktop row and phone card display the optional `readingMessage`
+as wrapping text beside the reading, not hover-only or truncated guidance.
+Missing filesystem samples keep saved settings editable with an explicit
+unavailable label. Existing numeric serialization, identity, persistence,
+active-alert linkage, edit-time row stabilisation and threshold evaluation
+remain unchanged. This presentation does not change collection, issue guest
+commands, prove thaw/writes/liveness, or establish installed/released recovery.
+
+Verification: `useThresholdsGuestData.test.ts` covers every fixed read reason,
+power/read replacement, LXC and source independence, unknown-reason privacy and
+saved-override retention. `ResourceTable.test.tsx` covers visible/reactive text
+in both layouts. `browser-tests/guest-filesystem-thresholds.cjs` connects the
+production hook, table and editors on desktop Chromium and phone WebKit,
+including scoped refusal text, custom settings and same-VMID/mount separation.
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 6451a53124..3760627ba8 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -9345,3 +9345,18 @@ This does not impose VM semantics on stopped LXC platform storage, alter
collection, probe a guest, or establish thaw, covered-filesystem writes or native
restart recovery. Regressions cover the helper, both row modes, details,
History and the native-facet-to-workload mapping with an unaffected second site.
+
+### Filesystem read provenance reaches alert settings (12 October 2026)
+
+The Alerts Guest Filesystems projection now consumes the Workloads read
+admission instead of treating retained numeric fields as a current reading.
+Explicit native stopped-VM state and unavailable reads withdraw usage; retained
+reads are labelled Last known. The shared threshold row/card display a wrapping
+`readingMessage` next to the reading, including before a missing saved mount
+has another sample, while preserving threshold values and override identities.
+Independent LXC platform storage and fresh zero remain unchanged.
+
+Verification connects `useThresholdsGuestData.test.ts`, both layouts in
+`ResourceTable.test.tsx`, and the production hook/table/editor browser fixture
+`guest-filesystem-thresholds.cjs`. Presentation proof is not native guest
+recovery, thaw/writes/liveness, alert delivery or installed/released acceptance.
diff --git a/frontend-modern/browser-tests/guest-filesystem-thresholds.cjs b/frontend-modern/browser-tests/guest-filesystem-thresholds.cjs
new file mode 100644
index 0000000000..5a1dc25562
--- /dev/null
+++ b/frontend-modern/browser-tests/guest-filesystem-thresholds.cjs
@@ -0,0 +1,163 @@
+const assert = require('node:assert/strict');
+const fs = require('node:fs');
+const path = require('node:path');
+const crypto = require('node:crypto');
+const { chromium, webkit } = require('playwright');
+const root = '/workspace/frontend-modern';
+const origin = 'http://127.0.0.1:5333';
+const runtime = [
+ 'frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsGuestData.ts',
+ 'frontend-modern/src/features/alerts/thresholds/tableTypes.ts',
+ 'frontend-modern/src/components/Alerts/AlertResourceTableRow.tsx',
+ 'frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx',
+];
+const hash = file => crypto.createHash('sha256').update(fs.readFileSync(file)).digest('hex');
+const settle = page => page.evaluate(async () => {
+ await document.fonts.ready;
+ await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)));
+});
+async function verify(original = false) {
+ const output = `/workspace/tmp/guest-filesystem-thresholds/browser-${original ? 'original' : 'final'}`;
+ fs.mkdirSync(output, { recursive: true });
+ const result = {
+ result: 'incomplete', phase: original ? 'original-adverse-observation' : 'candidate-verification',
+ playwright: require('playwright/package.json').version,
+ runtime_hashes: Object.fromEntries(runtime.map(file => [file, hash('/workspace/' + file)])),
+ cases: [], screenshots: [], cleanup: { browsers: false, server: false },
+ limits: 'Production hook, ResourceTable/desktop/mobile editors and CSS; synthetic resources only. No native QGA, thaw, filesystem writes, service restoration, alert delivery, reporter, installed or release acceptance.',
+ };
+ assert.equal(result.playwright, JSON.parse(fs.readFileSync('/workspace/tests/integration/package-lock.json')).packages['node_modules/@playwright/test'].version);
+ process.chdir(root);
+ const { createServer } = await import(path.join(root, 'node_modules/vite/dist/node/index.js'));
+ const server = await createServer({ root, configFile: path.join(root, 'vite.config.ts'), cacheDir: output + '/cache', optimizeDeps: {entries: ['browser-tests/guest-filesystem-thresholds.html']}, server: { host: '127.0.0.1', port: 5333, strictPort: true }});
+ let browser;
+ try {
+ await server.listen();
+ for (const [name, engine, width, height, dark] of [
+ ['chromium-desktop-light', chromium, 1280, 900, false],
+ ['webkit-phone-dark', webkit, 390, 844, true],
+ ]) {
+ browser = await engine.launch(engine === chromium ? { headless: true, channel: 'chromium', args: ['--no-sandbox'] } : { headless: true });
+ const context = await browser.newContext({viewport: { width, height }, isMobile: width < 768, hasTouch: width < 768, locale: 'en-GB', timezoneId: 'UTC'});
+ const page = await context.newPage();
+ page.setDefaultTimeout(12000);
+ const record = {name, browser: browser.version(), width, height, dark, errors: [], requests: [], checks: [], states: []};
+ result.cases.push(record);
+ page.on('pageerror', error => record.errors.push(error.message));
+ await page.route('**/*', route => {
+ const request = route.request(), url = new URL(request.url());
+ if (url.origin !== origin) { record.requests.push({method: request.method(), path: url.pathname, disposition: 'off-origin blocked'}); return route.abort(); }
+ if (url.pathname.startsWith('/api/')) { record.requests.push({method: request.method(), path: url.pathname, disposition: 'synthetic'}); return route.fulfill({json: {data: [], resources: [], alerts: [], enabled: false, hasAuthentication: true}}); }
+ return route.continue();
+ });
+ await page.addInitScript(isDark => {
+ document.addEventListener('DOMContentLoaded', () => { if (isDark) document.documentElement.classList.add('dark'); });
+ window.__trustedInput = [];
+ document.addEventListener('click', event => window.__trustedInput.push({type: 'click', trusted: event.isTrusted}), true);
+ document.addEventListener('keydown', event => window.__trustedInput.push({type: event.key, trusted: event.isTrusted}), true);
+ }, dark);
+ await page.goto(`${origin}/browser-tests/guest-filesystem-thresholds.html`, {waitUntil: 'domcontentloaded', timeout: 45000});
+ await page.waitForFunction(() => window.__guestFilesystemThresholds, null, {timeout: 45000});
+ const apply = async next => { await page.evaluate(next => window.__guestFilesystemThresholds.apply(next), next); await settle(page); };
+ const row = () => page.getByText('/data', {exact: true}).first().locator(width < 768 ? 'xpath=ancestor::div[contains(@class,"transition-opacity")][1]' : 'xpath=ancestor::tr');
+ const text = async () => (await row().innerText()).replace(/\s+/g, ' ').trim();
+ const capture = async state => {
+ await row().scrollIntoViewIfNeeded(); await settle(page);
+ const file = `${name}-${state}.png`;
+ await page.screenshot({path: path.join(output, file), fullPage: true});
+ result.screenshots.push({file, sha256: hash(path.join(output, file)), name, state});
+ };
+ await settle(page);
+ if (original) {
+ for (const [state, next] of [
+ ['retained', {reason: 'prev-vm-locked', power: 'running'}],
+ ['unavailable', {reason: 'agent-busy'}],
+ ['stopped', {reason: '', power: 'stopped'}],
+ ]) {
+ await apply(next);
+ const value = await text();
+ assert.match(value, /9\.0 \/ 10\.0 GB · 90\.0%/);
+ assert.doesNotMatch(value, /Last known|unavailable|paused|deferred/);
+ record.states.push({state, text: value});
+ record.checks.push(`${state} numeric carrier appears unqualified in the original production row.`);
+ await capture(state);
+ }
+ } else {
+ assert.match(await text(), /Last known 9\.0 \/ 10\.0 GB · 90\.0%/);
+ assert.match(await text(), /Guest reads paused while Proxmox reports a VM operation lock/);
+ await capture('retained');
+ record.checks.push('Explicit retained data is labelled Last known beside its mount; the reason is visible, not hover-only.');
+ const reasons = await page.evaluate(() => window.__guestFilesystemThresholds.deferrals.map(item => item[0]));
+ for (const reason of reasons) {
+ await apply({reason: `prev-${reason}`});
+ assert.match(await text(), /Last known 9\.0 \/ 10\.0 GB · 90\.0%/);
+ await apply({reason});
+ assert.match(await text(), /Usage unavailable/);
+ assert.doesNotMatch(await text(), /90\.0%|9\.0 \/ 10\.0/);
+ }
+ record.checks.push('All eight fixed guest-read reasons separate retained values from unavailable numeric carriers.');
+ await capture('unavailable');
+ await apply({reason: '', power: 'stopped'});
+ assert.match(await text(), /Usage unavailable/);
+ assert.match(await text(), /while the VM is stopped/);
+ assert.doesNotMatch(await text(), /90\.0%/);
+ await capture('stopped');
+ record.checks.push('Provider-native stopped state wins even when the canonical row is online and no read reason remains.');
+ await apply({reason: 'prev-agent-busy', power: 'running'});
+ assert.match(await text(), /Last known/);
+ await apply({reason: '', usage: 0});
+ assert.match(await text(), /0\.0 \/ 10\.0 GB · 0\.0%/);
+ assert.doesNotMatch(await text(), /Last known|Usage unavailable|deferred/);
+ record.checks.push('Same-mount restart/deferral/fresh-zero replacements are reactive without reloading the page.');
+ await apply({reason: 'permission-denied'});
+ assert.match(await text(), /Do not widen intentionally scoped access/);
+ const reason = row().getByText(/Permission denied\. If this VM/);
+ const bounds = await reason.evaluate(element => ({width: element.clientWidth, scrollWidth: element.scrollWidth, whiteSpace: getComputedStyle(element).whiteSpace, text: element.innerText}));
+ assert.ok(bounds.scrollWidth <= bounds.width + 1, JSON.stringify(bounds));
+ assert.equal(bounds.whiteSpace, 'normal');
+ assert.match(bounds.text, /Defer access changes and live probes/);
+ record.permission_layout = bounds;
+ await capture('permission-denied');
+ record.checks.push('Full refusal/safety explanation wraps on desktop and phone without truncation.');
+ const edit = row().getByRole('button', {name: 'Edit thresholds for /data'});
+ if (width < 768) await edit.tap(); else { await edit.focus(); await page.keyboard.press('Enter'); }
+ await row().getByRole('button', {name: width < 768 ? 'Cancel threshold edits' : 'Cancel editing'}).click();
+ assert.deepEqual(await page.evaluate(() => window.__guestFilesystemThresholds.actions()), ['edit:fixture-a:pve-a:101-disk-data-dev-vda1', 'cancel']);
+ assert.match(await text(), /95%/);
+ record.checks.push('Keyboard/touch edit and cancel preserve the intended VM filesystem identity and saved custom threshold.');
+ await apply({reason: 'prev-agent-busy', power: 'stopped', type: 'system-container', usage: 30});
+ assert.match(await text(), /3\.0 \/ 10\.0 GB · 30\.0%/);
+ assert.doesNotMatch(await text(), /Last known|Usage unavailable/);
+ record.checks.push('Independent stopped LXC platform storage ignores VM-only guest-read reasons.');
+ await apply({type: 'vm', power: 'running', data: false});
+ assert.match(await text(), /Usage unavailable/);
+ assert.match(await text(), /Saved alert settings are retained/);
+ assert.match(await text(), /95%/);
+ await capture('missing-reading');
+ const rows = await page.evaluate(() => window.__guestFilesystemThresholds.rows());
+ assert.equal(rows.length, 2);
+ assert.equal(rows.find(value => value.node === 'fresh-control').subtitle, '3.0 / 10.0 GB · 30.0%');
+ assert.equal(rows.find(value => value.node === 'backup-guest').overrideStorageId, 'guest-disk:guest:fixture-a:101/disk:data-dev-vda1');
+ record.checks.push('Missing samples retain editable saved settings; identical VMID/mount in another PVE connection remains fresh and separately addressed.');
+ assert.ok((await page.evaluate(() => window.__trustedInput)).some(event => event.trusted));
+ }
+ record.layout = await page.evaluate(() => ({width: document.documentElement.clientWidth, scrollWidth: document.documentElement.scrollWidth}));
+ assert.ok(record.layout.scrollWidth <= record.layout.width + 1, JSON.stringify(record.layout));
+ assert.deepEqual(record.errors, []);
+ assert.equal(record.requests.filter(request => !['GET','HEAD'].includes(request.method)).length, 0);
+ assert.equal(record.requests.filter(request => request.disposition === 'off-origin blocked').length, 0);
+ record.checks.push('No page error, page-level overflow, off-origin or mutating request.');
+ await context.close(); await browser.close(); browser = null;
+ }
+ result.result = original ? 'original-defect-reproduced' : 'passed';
+ } catch (error) {
+ result.error = String(error.stack || error); throw error;
+ } finally {
+ if (browser) await browser.close(); result.cleanup.browsers = true;
+ await server.close(); result.cleanup.server = true;
+ fs.writeFileSync(path.join(output, 'result.json'), JSON.stringify(result, null, 2) + '\n');
+ console.log(JSON.stringify({result: result.result, cases: result.cases.length, checks: result.cases.reduce((sum, value) => sum + value.checks.length, 0), captures: result.screenshots.length, cleanup: result.cleanup}));
+ }
+}
+module.exports = { verify };
+if (require.main === module) verify().catch(error => { console.error(error); process.exitCode = 1; });
diff --git a/frontend-modern/browser-tests/guest-filesystem-thresholds.html b/frontend-modern/browser-tests/guest-filesystem-thresholds.html
new file mode 100644
index 0000000000..f084cf5494
--- /dev/null
+++ b/frontend-modern/browser-tests/guest-filesystem-thresholds.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>Guest filesystem threshold reading verification</title>
+ </head>
+ <body>
+ <div id="root"></div>
+ <script type="module" src="./guest-filesystem-thresholds.tsx"></script>
+ </body>
+</html>
diff --git a/frontend-modern/browser-tests/guest-filesystem-thresholds.tsx b/frontend-modern/browser-tests/guest-filesystem-thresholds.tsx
new file mode 100644
index 0000000000..e9d9400caf
--- /dev/null
+++ b/frontend-modern/browser-tests/guest-filesystem-thresholds.tsx
@@ -0,0 +1,122 @@
+// Real alert row projection and desktop/mobile editors with synthetic observations.
+// No guest command, backup, alert delivery or installed acceptance is exercised.
+import { createSignal } from 'solid-js';
+import { render } from 'solid-js/web';
+import { ResourceTable } from '../src/components/Alerts/ResourceTable';
+import { useThresholdsGuestData } from '../src/features/alerts/thresholds/hooks/useThresholdsGuestData';
+import type { ThresholdsTableProps } from '../src/features/alerts/thresholds/types';
+import type { Resource } from '../src/types/resource';
+import { guestDiskDeferrals } from '../src/components/Workloads/__fixtures__/guestDiskDeferrals';
+import '../src/index.css';
+
+function Fixture() {
+ const [observation, setObservation] = createSignal({
+ reason: 'prev-vm-locked',
+ power: 'running',
+ type: 'vm' as Resource['type'],
+ data: true,
+ usage: 90,
+ });
+ const [editingId, setEditingId] = createSignal<string | null>(null);
+ const [editingThresholds, setEditingThresholds] = createSignal<
+ Record<string, number | undefined>
+ >({});
+ const [editingNote, setEditingNote] = createSignal('');
+ const [actions, setActions] = createSignal<string[]>([]);
+ const guest = (instance: string, name: string, control = false): Resource => ({
+ id: `${instance}:pve-a:101`,
+ name,
+ type: control ? 'vm' : observation().type,
+ status: 'online',
+ platformId: instance,
+ platformType: 'proxmox-pve',
+ platformScopes: ['proxmox-pve'],
+ sourceType: 'api',
+ lastSeen: 1,
+ proxmox: {
+ instance,
+ node: 'pve-a',
+ vmid: 101,
+ runtimeStatus: control ? 'running' : observation().power,
+ diskStatusReason: control ? '' : observation().reason,
+ disks:
+ control || observation().data
+ ? [
+ {
+ mountpoint: '/data',
+ device: '/dev/vda1',
+ type: 'ext4',
+ total: 10 * 1024 ** 3,
+ used: (control ? 0.3 : observation().usage / 100) * 10 * 1024 ** 3,
+ usage: control ? 30 : observation().usage,
+ },
+ ]
+ : [],
+ },
+ });
+ const data = useThresholdsGuestData({
+ props: {
+ allGuests: () => [
+ guest('fixture-a', 'backup-guest'),
+ guest('fixture-b', 'fresh-control', true),
+ ],
+ overrides: () => [
+ {
+ id: 'guest-disk:guest:fixture-a:101/disk:data-dev-vda1',
+ name: '/data',
+ node: 'backup-guest',
+ type: 'guestDisk',
+ thresholds: { disk: 95 },
+ },
+ ],
+ nodes: [],
+ guestDefaults: { disk: 85 },
+ backupDefaults: () => ({ enabled: false }),
+ snapshotDefaults: () => ({ enabled: false }),
+ } as unknown as ThresholdsTableProps,
+ editingId,
+ searchTerm: () => '',
+ });
+ (window as any).__guestFilesystemThresholds = {
+ apply: (next: Partial<ReturnType<typeof observation>>) =>
+ setObservation((previous) => ({ ...previous, ...next })),
+ rows: data.guestDisksWithOverrides,
+ actions,
+ deferrals: guestDiskDeferrals,
+ };
+ return (
+ <main class="min-h-screen bg-surface p-3 text-base-content">
+ <h1 class="mb-2 text-base font-semibold">Guest filesystem alert settings</h1>
+ <p class="mb-3 text-xs text-muted">Synthetic observations; no guest or backup operation.</p>
+ <ResourceTable
+ title="Guest Filesystems"
+ groupedResources={data.guestDisksGroupedByGuest()}
+ columns={['Disk %']}
+ editingId={editingId}
+ editingThresholds={editingThresholds}
+ setEditingThresholds={setEditingThresholds}
+ editingNote={editingNote}
+ setEditingNote={setEditingNote}
+ formatMetricValue={(_metric, value) => (value === undefined ? '—' : `${value}%`)}
+ hasActiveAlert={() => false}
+ onEdit={(id, thresholds, _defaults, note) => {
+ setEditingId(id);
+ setEditingThresholds(thresholds);
+ setEditingNote(note ?? '');
+ setActions((previous) => [...previous, `edit:${id}`]);
+ }}
+ onSaveEdit={(id) => {
+ setActions((previous) => [...previous, `save:${id}`]);
+ setEditingId(null);
+ }}
+ onCancelEdit={() => {
+ setActions((previous) => [...previous, 'cancel']);
+ setEditingId(null);
+ }}
+ onRemoveOverride={(id) => setActions((previous) => [...previous, `remove:${id}`])}
+ />
+ </main>
+ );
+}
+
+render(() => <Fixture />, document.getElementById('root')!);
diff --git a/frontend-modern/browser-verification/12f0a45fe7c7e532.json b/frontend-modern/browser-verification/12f0a45fe7c7e532.json
new file mode 100644
index 0000000000..1b10e9b2af
--- /dev/null
+++ b/frontend-modern/browser-verification/12f0a45fe7c7e532.json
@@ -0,0 +1,45 @@
+{
+ "version": 1,
+ "base_sha": "f056c382c1e0f41b47c7275aaae7aabb17a2efe5",
+ "verified_at": "2026-10-12T02:59:43.557554Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx",
+ "frontend-modern/src/components/Alerts/AlertResourceTableRow.tsx",
+ "frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsGuestData.ts",
+ "frontend-modern/src/features/alerts/thresholds/tableTypes.ts"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsGuestData.ts": "be020a06b2c6bb7521ef2fc0450368814da35c0ba27a5d180463b77c7e879faa",
+ "frontend-modern/src/features/alerts/thresholds/tableTypes.ts": "e2b384e4669b9f0c5eceb7b6af653e4b2ef9a4f0cf1c64f249b54708c9fb3f71",
+ "frontend-modern/src/components/Alerts/AlertResourceTableRow.tsx": "314b85d031372788b1e83e6ee8623e2d55c2a4dd4b8d43618650d972e14c686a",
+ "frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx": "f03055f749c3c2a929fdbee416f1f983cb7ff3fb1d66d4706d1081d439c8d7ff"
+ },
+ "routes": [
+ "/browser-tests/guest-filesystem-thresholds.html"
+ ],
+ "viewports": [
+ {
+ "width": 1280,
+ "height": 900
+ },
+ {
+ "width": 390,
+ "height": 844
+ }
+ ],
+ "states": [
+ "All eight fixed read deferrals with retained and unavailable numeric carriers",
+ "Native stopped VM while the canonical resource stays online",
+ "Same mount restart, retained read and fresh measured zero",
+ "Permission refusal and unknown/missing reading",
+ "Independent stopped LXC and identical mount/VMID in a second PVE connection"
+ ],
+ "interactions": [
+ "Production hook, desktop row and phone card with full wrapping read guidance",
+ "Trusted keyboard/touch edit and cancel preserve custom thresholds and intended identity",
+ "Reactive source replacement without page reload; no page error, page overflow, off-origin or mutating request",
+ "Inspected all ten desktop-light and phone-dark captures; browsers and preview server closed"
+ ],
+ "notes": "pulse-worker-browser frontend-modern/browser-tests/guest-filesystem-thresholds.cjs; Playwright 1.56.1 matches integration lock. Synthetic resources only, not native QGA/thaw/writes, alert delivery, installed/released/reporter acceptance. Original unqualified values reproduced in six separate captures. First candidate harness used the mobile Cancel label on desktop and timed out; that adverse result is retained. Corrected harness selector only, with unchanged runtime hashes."
+}
diff --git a/frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx b/frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx
index efc5d13af2..6d72d6f892 100644
--- a/frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx
+++ b/frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx
@@ -407,7 +407,15 @@ export function AlertResourceTableMobile(props: AlertResourceTableMobileProps) {
{getAlertResourceLabel(resource)}
</div>
<Show when={resource.subtitle}>
- <div class="text-xs text-slate-500 truncate">{resource.subtitle}</div>
+ <div
+ class="text-xs text-muted"
+ classList={{
+ truncate: !resource.readingMessage,
+ 'whitespace-normal break-words': Boolean(resource.readingMessage),
+ }}
+ >
+ {resource.subtitle}
+ </div>
</Show>
</div>
</div>
@@ -486,6 +494,11 @@ export function AlertResourceTableMobile(props: AlertResourceTableMobileProps) {
</Show>
</div>
</div>
+ <Show when={resource.readingMessage}>
+ <p class="text-xs text-muted whitespace-normal break-words">
+ {resource.readingMessage}
+ </p>
+ </Show>
<Show when={relaxedTriggerSummary()}>
{(summary) => (
diff --git a/frontend-modern/src/components/Alerts/AlertResourceTableRow.tsx b/frontend-modern/src/components/Alerts/AlertResourceTableRow.tsx
index 843e47942a..d183128be1 100644
--- a/frontend-modern/src/components/Alerts/AlertResourceTableRow.tsx
+++ b/frontend-modern/src/components/Alerts/AlertResourceTableRow.tsx
@@ -277,7 +277,10 @@ export function AlertResourceTableRow(props: AlertResourceTableRowProps) {
</TableCell>
<TableCell class={getPlatformTableCellClassForKind('name')}>
- <div class="flex items-center gap-2 min-w-0">
+ <div
+ class="flex items-center gap-2 min-w-0"
+ classList={{ 'flex-wrap': Boolean(props.resource.readingMessage) }}
+ >
<Show
when={props.resource.type === 'agent'}
fallback={
@@ -319,6 +322,11 @@ export function AlertResourceTableRow(props: AlertResourceTableRowProps) {
</span>
</Show>
</div>
+ <Show when={props.resource.readingMessage}>
+ <p class="mt-1 max-w-prose text-xs text-muted whitespace-normal break-words">
+ {props.resource.readingMessage}
+ </p>
+ </Show>
<Show when={isEditing()}>
<FormTextarea
id={`note-${props.resource.id}`}
diff --git a/frontend-modern/src/components/Alerts/ResourceTable.test.tsx b/frontend-modern/src/components/Alerts/ResourceTable.test.tsx
index dba379a224..5810870e33 100644
--- a/frontend-modern/src/components/Alerts/ResourceTable.test.tsx
+++ b/frontend-modern/src/components/Alerts/ResourceTable.test.tsx
@@ -218,6 +218,39 @@ describe('ResourceTable', () => {
});
describe('rendering basics', () => {
+ it.each([false, true])(
+ 'keeps filesystem reading explanations visible and reactive (mobile=%s)',
+ (mobile) => {
+ mockIsMobile.mockReturnValue(mobile);
+ const [resources, setResources] = createSignal([
+ makeResource({
+ id: 'disk-1',
+ name: '/data',
+ type: 'guestDisk',
+ subtitle: 'Last known 9.0 / 10.0 GB · 90.0%',
+ readingMessage: 'Guest reads paused while the backup lock is reported.',
+ }),
+ ]);
+ const props = makeProps({ columns: ['Disk %'] });
+ render(() => <ResourceTable {...props} resources={resources()} />);
+ expect(
+ screen.getByText('Guest reads paused while the backup lock is reported.'),
+ ).not.toHaveClass('truncate');
+ if (mobile)
+ expect(screen.getByText('Last known 9.0 / 10.0 GB · 90.0%')).not.toHaveClass('truncate');
+ setResources([
+ makeResource({
+ id: 'disk-1',
+ name: '/data',
+ type: 'guestDisk',
+ subtitle: '3.0 / 10.0 GB · 30.0%',
+ }),
+ ]);
+ expect(screen.queryByText(/Guest reads paused/)).not.toBeInTheDocument();
+ expect(screen.getByText('3.0 / 10.0 GB · 30.0%')).toBeInTheDocument();
+ },
+ );
+
it('renders the section header with the provided title', () => {
const props = makeProps({ title: 'Nodes' });
render(() => <ResourceTable {...props} />);
diff --git a/frontend-modern/src/features/alerts/thresholds/hooks/__tests__/useThresholdsGuestData.test.ts b/frontend-modern/src/features/alerts/thresholds/hooks/__tests__/useThresholdsGuestData.test.ts
index 096572dba6..1a9602180f 100644
--- a/frontend-modern/src/features/alerts/thresholds/hooks/__tests__/useThresholdsGuestData.test.ts
+++ b/frontend-modern/src/features/alerts/thresholds/hooks/__tests__/useThresholdsGuestData.test.ts
@@ -1,10 +1,165 @@
-import { createRoot } from 'solid-js';
+import { createRoot, createSignal } from 'solid-js';
import { describe, expect, it } from 'vitest';
+import type { Resource } from '@/types/resource';
+import { guestDiskDeferrals } from '@/components/Workloads/__fixtures__/guestDiskDeferrals';
import type { ThresholdsTableProps } from '../../types';
import { useThresholdsGuestData } from '../useThresholdsGuestData';
+const filesystemGuest = (reason = '', power = 'running'): Resource => ({
+ id: 'cluster-a:node-1:100',
+ name: 'files',
+ type: 'vm',
+ status: 'online',
+ platformId: 'cluster-a',
+ platformType: 'proxmox-pve',
+ sourceType: 'api',
+ lastSeen: 1,
+ proxmox: {
+ instance: 'cluster-a',
+ node: 'node-1',
+ vmid: 100,
+ diskStatusReason: reason,
+ runtimeStatus: power,
+ disks: [
+ {
+ device: '/dev/vda1',
+ mountpoint: '/data',
+ type: 'ext4',
+ total: 10 * 1024 ** 3,
+ used: 9 * 1024 ** 3,
+ usage: 90,
+ },
+ ],
+ },
+});
+
+function filesystemData(initial: Resource) {
+ const [guest, setGuest] = createSignal(initial);
+ const props = {
+ allGuests: () => [guest()],
+ overrides: () => [
+ {
+ id: 'guest-disk:guest:cluster-a:100/disk:data-dev-vda1',
+ name: '/data',
+ node: 'files',
+ type: 'guestDisk',
+ thresholds: { disk: 95 },
+ },
+ ],
+ nodes: [],
+ guestDefaults: { disk: 85 },
+ backupDefaults: () => ({ enabled: false }),
+ snapshotDefaults: () => ({ enabled: false }),
+ } as unknown as ThresholdsTableProps;
+ return {
+ setGuest,
+ data: useThresholdsGuestData({ props, editingId: () => null, searchTerm: () => '' }),
+ };
+}
+
describe('useThresholdsGuestData guest filesystems', () => {
+ it.each(guestDiskDeferrals)(
+ 'distinguishes retained and unavailable %s readings without losing alert settings',
+ (reason, message) => {
+ createRoot((dispose) => {
+ const { data, setGuest } = filesystemData(filesystemGuest(`prev-${reason}`));
+ expect(data.guestDisksWithOverrides()).toEqual([
+ expect.objectContaining({
+ id: 'cluster-a:node-1:100-disk-data-dev-vda1',
+ overrideStorageId: 'guest-disk:guest:cluster-a:100/disk:data-dev-vda1',
+ subtitle: 'Last known 9.0 / 10.0 GB · 90.0%',
+ readingMessage: `Using last known disk stats. ${message}`,
+ thresholds: { disk: 95 },
+ hasOverride: true,
+ }),
+ ]);
+ setGuest(filesystemGuest(reason));
+ expect(data.guestDisksWithOverrides()[0]).toMatchObject({
+ subtitle: 'Usage unavailable',
+ readingMessage: message,
+ thresholds: { disk: 95 },
+ });
+ setGuest(filesystemGuest());
+ expect(data.guestDisksWithOverrides()[0]).toMatchObject({
+ subtitle: '9.0 / 10.0 GB · 90.0%',
+ readingMessage: undefined,
+ thresholds: { disk: 95 },
+ });
+ dispose();
+ });
+ },
+ );
+
+ it('uses native power state ahead of an online carrier and keeps restart deferral until a fresh zero', () => {
+ createRoot((dispose) => {
+ const { data, setGuest } = filesystemData(filesystemGuest('', 'stopped'));
+ expect(data.guestDisksWithOverrides()[0]).toMatchObject({
+ subtitle: 'Usage unavailable',
+ readingMessage: 'Guest filesystem stats unavailable while the VM is stopped.',
+ });
+ setGuest(filesystemGuest('prev-agent-busy'));
+ expect(data.guestDisksWithOverrides()[0].subtitle).toContain('Last known');
+ const fresh = filesystemGuest();
+ fresh.proxmox!.disks![0].used = 0;
+ fresh.proxmox!.disks![0].usage = 0;
+ setGuest(fresh);
+ expect(data.guestDisksWithOverrides()[0]).toMatchObject({
+ subtitle: '0.0 / 10.0 GB · 0.0%',
+ readingMessage: undefined,
+ });
+ dispose();
+ });
+ });
+
+ it('does not make LXC platform storage or native QGA filesystems stale because of another producer', () => {
+ createRoot((dispose) => {
+ const initial = filesystemGuest('prev-agent-busy', 'stopped');
+ initial.type = 'system-container';
+ const { data, setGuest } = filesystemData(initial);
+ expect(data.guestDisksWithOverrides()[0]).toMatchObject({
+ subtitle: '9.0 / 10.0 GB · 90.0%',
+ readingMessage: undefined,
+ });
+ const native = filesystemGuest();
+ native.agent = { stale: true };
+ setGuest(native);
+ expect(data.guestDisksWithOverrides()[0]).toMatchObject({
+ subtitle: '9.0 / 10.0 GB · 90.0%',
+ readingMessage: undefined,
+ });
+ dispose();
+ });
+ });
+
+ it('explains a missing reading while keeping its saved override and identity editable', () => {
+ createRoot((dispose) => {
+ const initial = filesystemGuest('vm-locked');
+ initial.proxmox!.disks = [];
+ const { data } = filesystemData(initial);
+ expect(data.guestDisksWithOverrides()[0]).toMatchObject({
+ id: 'guest-disk:guest:cluster-a:100/disk:data-dev-vda1',
+ overrideStorageId: 'guest-disk:guest:cluster-a:100/disk:data-dev-vda1',
+ subtitle: 'Usage unavailable',
+ readingMessage: 'No current filesystem reading. Saved alert settings are retained.',
+ thresholds: { disk: 95 },
+ });
+ dispose();
+ });
+ });
+
+ it('uses bounded read guidance rather than leaking an unknown provider reason', () => {
+ createRoot((dispose) => {
+ const { data } = filesystemData(filesystemGuest('private provider text'));
+ expect(data.guestDisksWithOverrides()[0].subtitle).toBe('Usage unavailable');
+ expect(data.guestDisksWithOverrides()[0].readingMessage).toContain('The cause is unknown');
+ expect(data.guestDisksWithOverrides()[0].readingMessage).not.toContain(
+ 'private provider text',
+ );
+ dispose();
+ });
+ });
+
it('projects QEMU guest-agent filesystems with stable override identities', () => {
createRoot((dispose) => {
const props = {
diff --git a/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsGuestData.ts b/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsGuestData.ts
index e90e5d0e5d..14c0d52e5f 100644
--- a/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsGuestData.ts
+++ b/frontend-modern/src/features/alerts/thresholds/hooks/useThresholdsGuestData.ts
@@ -11,6 +11,7 @@ import { getAlertResourceDisplayLabel } from '@/features/alerts/helpers';
import type { Disk } from '@/types/api';
import { hasPulseRelaxedGuestTag } from '@/utils/metricThresholds';
import { resolveResourcePlatformType } from '@/utils/sourcePlatforms';
+import { getWorkloadGuestDiskRead } from '@/utils/workloadGuestPresentation';
import type { GroupHeaderMeta, Resource as TableResource } from '../tableTypes';
import { ThresholdsDataInputs } from '../thresholdsResourceModel';
@@ -128,6 +129,17 @@ export function useThresholdsGuestData(inputs: ThresholdsDataInputs) {
const disks = guest.proxmox?.disks ?? [];
const guestName = getAlertResourceDisplayLabel(guest);
const guestIdentity = getGuestOverrideIdentity(guest);
+ // Native power state stays separate from a canonical row kept online
+ // by another source. Use the same admission as Workloads, not the
+ // continued presence of filesystem numbers as a freshness claim.
+ const runtimeStatus = (guest.proxmox?.runtimeStatus || guest.status).trim().toLowerCase();
+ const diskRead = getWorkloadGuestDiskRead(
+ {
+ status: runtimeStatus === 'offline' ? 'stopped' : runtimeStatus,
+ diskStatusReason: guest.proxmox?.diskStatusReason,
+ },
+ guest.type === 'vm',
+ );
disks.forEach((disk: Disk) => {
// The unified resources payload omits zero-valued numerics, so
@@ -177,7 +189,11 @@ export function useThresholdsGuestData(inputs: ThresholdsDataInputs) {
disabled: override?.disabled || false,
thresholds: override?.thresholds || {},
defaults: { disk: props.guestDefaults.disk },
- subtitle: `${(used / 1024 / 1024 / 1024).toFixed(1)} / ${(total / 1024 / 1024 / 1024).toFixed(1)} GB · ${usagePercent.toFixed(1)}%`,
+ subtitle:
+ diskRead.state === 'unavailable'
+ ? 'Usage unavailable'
+ : `${diskRead.state === 'last-known' ? 'Last known ' : ''}${(used / 1024 / 1024 / 1024).toFixed(1)} / ${(total / 1024 / 1024 / 1024).toFixed(1)} GB · ${usagePercent.toFixed(1)}%`,
+ readingMessage: diskRead.message ?? undefined,
} satisfies TableResource);
});
});
@@ -198,6 +214,8 @@ export function useThresholdsGuestData(inputs: ThresholdsDataInputs) {
node: override.node || 'Unknown Guest',
instance: override.instance || '',
status: 'unknown',
+ subtitle: 'Usage unavailable',
+ readingMessage: 'No current filesystem reading. Saved alert settings are retained.',
hasOverride: true,
disabled: override.disabled || false,
thresholds: override.thresholds || {},
diff --git a/frontend-modern/src/features/alerts/thresholds/tableTypes.ts b/frontend-modern/src/features/alerts/thresholds/tableTypes.ts
index f9831775e3..b17535c7f5 100644
--- a/frontend-modern/src/features/alerts/thresholds/tableTypes.ts
+++ b/frontend-modern/src/features/alerts/thresholds/tableTypes.ts
@@ -20,6 +20,8 @@ export interface Resource {
type?: string;
resourceType?: string;
subtitle?: string;
+ /** Explanation beside a non-current reading; not threshold or alert state. */
+ readingMessage?: string;
thresholds?: AlertResourceThresholdMap;
defaults?: AlertResourceThresholdMap;
disabled?: boolean;