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.

Bind drawer checks to actual chart groups and complete rows

pulse-triage[bot]c1cda2a9072f
diff --git a/frontend-modern/browser-tests/build-drawer-integration.mjs b/frontend-modern/browser-tests/build-drawer-integration.mjs
index bef9bc79af..36c774d417 100644
--- a/frontend-modern/browser-tests/build-drawer-integration.mjs
+++ b/frontend-modern/browser-tests/build-drawer-integration.mjs
@@ -21,36 +21,77 @@ const binding = {
...sourceIdentity.publicationSourceIdentity(process.argv.slice(3), () =>
execFileSync('git', ['rev-parse', 'HEAD'], { cwd: root, encoding: 'utf8' }),
),
- variant, graph: hash(fs.readFileSync(path.join(root, 'package-lock.json'))), sources: {}, artifacts: {},
+ variant,
+ graph: hash(fs.readFileSync(path.join(root, 'package-lock.json'))),
+ sources: {},
+ artifacts: {},
};
try {
await build({
- root, base: '/', configFile: false, publicDir: false,
- plugins: [{
- name: 'notice-action-source-binding', generateBundle() {
- for (const id of this.getModuleIds()) {
- const file = id.split('?')[0];
- if (file.startsWith(root + '/') && !file.includes('/node_modules/') && fs.existsSync(file) && fs.statSync(file).isFile())
- binding.sources[path.relative(root, file)] = hash(fs.readFileSync(file));
- }
- for (const file of ['src/components/Workloads/GuestDrawerOverview.tsx', 'src/components/Workloads/NodeDrawerOverview.tsx', 'src/components/Workloads/guestDrawerModel.ts', 'src/utils/proxmoxUpdateEvidence.ts'])
- if (!binding.sources[file]) throw new Error(`Required consumer not compiled: ${file}`);
+ root,
+ base: '/',
+ configFile: false,
+ publicDir: false,
+ plugins: [
+ {
+ name: 'notice-action-source-binding',
+ generateBundle() {
+ for (const id of this.getModuleIds()) {
+ const file = id.split('?')[0];
+ if (
+ file.startsWith(root + '/') &&
+ !file.includes('/node_modules/') &&
+ fs.existsSync(file) &&
+ fs.statSync(file).isFile()
+ )
+ binding.sources[path.relative(root, file)] = hash(fs.readFileSync(file));
+ }
+ for (const file of [
+ 'src/components/Workloads/GuestDrawerOverview.tsx',
+ 'src/components/Workloads/NodeDrawerOverview.tsx',
+ 'src/components/Workloads/guestDrawerModel.ts',
+ 'src/utils/proxmoxUpdateEvidence.ts',
+ ])
+ if (!binding.sources[file]) throw new Error(`Required consumer not compiled: ${file}`);
+ },
},
- }, tailwindcss(), solid()],
- resolve: { alias: { '@': path.join(root, 'src') }, conditions: ['import', 'browser', 'default'] },
- build: { target: 'esnext', outDir, emptyOutDir: true, rollupOptions: { input: path.join(root, 'browser-tests/drawer-integration.html') } },
+ tailwindcss(),
+ solid(),
+ ],
+ resolve: {
+ alias: { '@': path.join(root, 'src') },
+ conditions: ['import', 'browser', 'default'],
+ },
+ build: {
+ target: 'esnext',
+ outDir,
+ emptyOutDir: true,
+ rollupOptions: { input: path.join(root, 'browser-tests/drawer-integration.html') },
+ },
});
const bind = (directory) => {
for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
const file = path.join(directory, entry.name);
if (entry.isDirectory()) bind(file);
- else if (/\.(css|js|jsx|ts|tsx|html|mjs|cjs)$/.test(file)) binding.sources[path.relative(root, file)] = hash(fs.readFileSync(file));
+ else if (/\.(css|js|jsx|ts|tsx|html|mjs|cjs)$/.test(file))
+ binding.sources[path.relative(root, file)] = hash(fs.readFileSync(file));
}
};
bind(path.join(root, 'src'));
- for (const file of ['browser-tests/drawer-integration.tsx', 'browser-tests/drawer-integration.html', 'browser-tests/build-drawer-integration.mjs', 'browser-tests/drawer-integration.cjs'])
+ for (const file of [
+ 'browser-tests/drawer-integration.tsx',
+ 'browser-tests/drawer-integration.html',
+ 'browser-tests/build-drawer-integration.mjs',
+ 'browser-tests/drawer-integration.cjs',
+ ])
binding.sources[file] = hash(fs.readFileSync(path.join(root, file)));
- for (const file of ['index.html', 'package.json', 'package-lock.json', 'tsconfig.json', 'public/docs/VM_DISK_MONITORING.md'])
+ for (const file of [
+ 'index.html',
+ 'package.json',
+ 'package-lock.json',
+ 'tsconfig.json',
+ 'public/docs/VM_DISK_MONITORING.md',
+ ])
binding.sources[file] = hash(fs.readFileSync(path.join(root, file)));
fs.mkdirSync(path.join(outDir, 'docs'), { recursive: true });
for (const doc of ['VM_DISK_MONITORING.md', 'TROUBLESHOOTING.md'])
@@ -64,5 +105,14 @@ try {
};
artifacts(outDir);
fs.writeFileSync(path.join(outDir, 'binding.json'), JSON.stringify(binding, null, 2) + '\n');
- console.log(JSON.stringify({ variant, source: binding.source_sha, source_inputs: Object.keys(binding.sources).length, artifacts: Object.keys(binding.artifacts).length }));
-} finally { stop(); }
+ console.log(
+ JSON.stringify({
+ variant,
+ source: binding.source_sha,
+ source_inputs: Object.keys(binding.sources).length,
+ artifacts: Object.keys(binding.artifacts).length,
+ }),
+ );
+} finally {
+ stop();
+}
diff --git a/frontend-modern/browser-tests/drawer-integration.cjs b/frontend-modern/browser-tests/drawer-integration.cjs
index fc5a2390da..ed5646fadb 100644
--- a/frontend-modern/browser-tests/drawer-integration.cjs
+++ b/frontend-modern/browser-tests/drawer-integration.cjs
@@ -5,233 +5,574 @@ const http = require('node:http');
const crypto = require('node:crypto');
const assert = require('node:assert/strict');
const { chromium, webkit } = require('playwright');
-const root = '/workspace', origin = 'http://127.0.0.1:5335';
+const root = '/workspace',
+ origin = 'http://127.0.0.1:5335';
const compiled = root + '/tmp/drawer-integration/final-static';
const output = root + '/tmp/drawer-integration/results';
const hash = (b) => crypto.createHash('sha256').update(b).digest('hex');
async function box(locator) {
return locator.evaluate((element) => {
- const focused = element === document.activeElement, focusVisible = element.matches(':focus-visible');
- const rect = element.getBoundingClientRect(), css = getComputedStyle(element);
- return { class: element.className, width: rect.width, height: rect.height, left: rect.left, right: rect.right,
- client: element.clientWidth, scroll: element.scrollWidth, text: element.textContent,
- focused, focusVisible,
- whiteSpace: css.whiteSpace, overflowWrap: css.overflowWrap, colour: css.color,
- outline: css.outlineStyle, outlineWidth: css.outlineWidth, outlineOffset: css.outlineOffset };
+ const focused = element === document.activeElement,
+ focusVisible = element.matches(':focus-visible');
+ const rect = element.getBoundingClientRect(),
+ css = getComputedStyle(element);
+ return {
+ class: element.className,
+ width: rect.width,
+ height: rect.height,
+ left: rect.left,
+ right: rect.right,
+ client: element.clientWidth,
+ scroll: element.scrollWidth,
+ text: element.textContent,
+ focused,
+ focusVisible,
+ whiteSpace: css.whiteSpace,
+ overflowWrap: css.overflowWrap,
+ colour: css.color,
+ outline: css.outlineStyle,
+ outlineWidth: css.outlineWidth,
+ outlineOffset: css.outlineOffset,
+ };
});
}
(async () => {
fs.mkdirSync(output, { recursive: true });
const binding = JSON.parse(fs.readFileSync(compiled + '/binding.json'));
- const result = { result: 'incomplete', source: binding.source_sha, driver: hash(fs.readFileSync(__filename)),
- playwright: require('playwright/package.json').version, binding, cases: [], captures: [],
+ const result = {
+ result: 'incomplete',
+ source: binding.source_sha,
+ driver: hash(fs.readFileSync(__filename)),
+ playwright: require('playwright/package.json').version,
+ binding,
+ cases: [],
+ captures: [],
cleanup: { browser: false, server: false },
- limits: 'Synthetic observation/API data through actual adapter, rows, drawers, history and Docs; no native thaw, monitoring restoration, QGA restart, permissions, deployed or release acceptance.' };
+ limits:
+ 'Synthetic observation/API data through actual adapter, rows, drawers, history and Docs; no native thaw, monitoring restoration, QGA restart, permissions, deployed or release acceptance.',
+ };
let server, browser;
try {
assert.match(result.source, /^[0-9a-f]{40}$/);
- assert.equal(result.playwright, JSON.parse(fs.readFileSync(root + '/tests/integration/package-lock.json')).packages['node_modules/@playwright/test'].version);
+ assert.equal(
+ result.playwright,
+ JSON.parse(fs.readFileSync(root + '/tests/integration/package-lock.json')).packages[
+ 'node_modules/@playwright/test'
+ ].version,
+ );
for (const [file, digest] of Object.entries(binding.sources))
assert.equal(hash(fs.readFileSync(root + '/frontend-modern/' + file)), digest, file);
const assets = new Map();
for (const [file, digest] of Object.entries(binding.artifacts)) {
- const bytes = fs.readFileSync(compiled + '/' + file); assert.equal(hash(bytes), digest, file); assets.set('/' + file, bytes);
+ const bytes = fs.readFileSync(compiled + '/' + file);
+ assert.equal(hash(bytes), digest, file);
+ assets.set('/' + file, bytes);
}
for (const doc of ['VM_DISK_MONITORING.md', 'TROUBLESHOOTING.md'])
assert.equal(hash(fs.readFileSync(root + '/docs/' + doc)), binding.artifacts['docs/' + doc]);
server = http.createServer((request, response) => {
- if (!['GET', 'HEAD'].includes(request.method)) { response.writeHead(405); return response.end(); }
+ if (!['GET', 'HEAD'].includes(request.method)) {
+ response.writeHead(405);
+ return response.end();
+ }
let pathname = new URL(request.url, origin).pathname;
- if (['/', '/guest', '/node', '/docs/VM_DISK_MONITORING', '/docs/TROUBLESHOOTING'].includes(pathname)) pathname = '/browser-tests/drawer-integration.html';
+ if (
+ ['/', '/guest', '/node', '/docs/VM_DISK_MONITORING', '/docs/TROUBLESHOOTING'].includes(
+ pathname,
+ )
+ )
+ pathname = '/browser-tests/drawer-integration.html';
const bytes = assets.get(pathname);
- if (!bytes) { response.writeHead(404); return response.end(); }
- response.setHeader('Content-Type', { '.html': 'text/html', '.js': 'text/javascript', '.css': 'text/css', '.md': 'text/markdown; charset=utf-8' }[path.extname(pathname)] || 'application/octet-stream');
- response.setHeader('Cache-Control', 'no-store'); response.end(request.method === 'HEAD' ? undefined : bytes);
+ if (!bytes) {
+ response.writeHead(404);
+ return response.end();
+ }
+ response.setHeader(
+ 'Content-Type',
+ {
+ '.html': 'text/html',
+ '.js': 'text/javascript',
+ '.css': 'text/css',
+ '.md': 'text/markdown; charset=utf-8',
+ }[path.extname(pathname)] || 'application/octet-stream',
+ );
+ response.setHeader('Cache-Control', 'no-store');
+ response.end(request.method === 'HEAD' ? undefined : bytes);
});
- await new Promise((resolve, reject) => { server.once('error', reject); server.listen(5335, '127.0.0.1', resolve); });
- for (const [engine, width, theme] of [[chromium, 1365, 'light'], [chromium, 1365, 'dark'], [webkit, 390, 'light'], [webkit, 390, 'dark']]) {
+ await new Promise((resolve, reject) => {
+ server.once('error', reject);
+ server.listen(5335, '127.0.0.1', resolve);
+ });
+ for (const [engine, width, theme] of [
+ [chromium, 1365, 'light'],
+ [chromium, 1365, 'dark'],
+ [webkit, 390, 'light'],
+ [webkit, 390, 'dark'],
+ ]) {
const name = `${engine === chromium ? 'chromium' : 'webkit'}-${width}-${theme}`;
- browser = await engine.launch(engine === chromium ? { headless: true, channel: 'chromium', args: ['--no-sandbox'] } : { headless: true });
- const context = await browser.newContext({ viewport: { width, height: 900 }, isMobile: width < 768, hasTouch: width < 768, colorScheme: theme, locale: 'en-GB', reducedMotion: 'reduce' });
+ browser = await engine.launch(
+ engine === chromium
+ ? { headless: true, channel: 'chromium', args: ['--no-sandbox'] }
+ : { headless: true },
+ );
+ const context = await browser.newContext({
+ viewport: { width, height: 900 },
+ isMobile: width < 768,
+ hasTouch: width < 768,
+ colorScheme: theme,
+ locale: 'en-GB',
+ reducedMotion: 'reduce',
+ });
await context.addInitScript((theme) => {
- window.__trustedInputs = []; document.addEventListener('click', (event) => window.__trustedInputs.push({ trusted: event.isTrusted, label: event.target.closest('a,button,summary')?.textContent }), true);
- document.addEventListener('DOMContentLoaded', () => document.documentElement.classList.toggle('dark', theme === 'dark'));
+ window.__trustedInputs = [];
+ document.addEventListener(
+ 'click',
+ (event) =>
+ window.__trustedInputs.push({
+ trusted: event.isTrusted,
+ label: event.target.closest('a,button,summary')?.textContent,
+ }),
+ true,
+ );
+ document.addEventListener('DOMContentLoaded', () =>
+ document.documentElement.classList.toggle('dark', theme === 'dark'),
+ );
}, theme);
- const page = await context.newPage(); page.setDefaultTimeout(10000);
- const record = { name, browser: browser.version(), width, theme, requests: [], errors: [], states: [] }; result.cases.push(record);
+ const page = await context.newPage();
+ page.setDefaultTimeout(10000);
+ const record = {
+ name,
+ browser: browser.version(),
+ width,
+ theme,
+ requests: [],
+ errors: [],
+ states: [],
+ };
+ result.cases.push(record);
page.on('pageerror', (error) => record.errors.push(error.message));
await page.clock.install({ time: new Date('2026-10-13T13:00:00Z') });
await context.route('**/*', (route) => {
- const request = route.request(), url = new URL(request.url());
+ const request = route.request(),
+ url = new URL(request.url());
record.requests.push({ method: request.method(), path: url.pathname, search: url.search });
- assert.equal(url.origin, origin); assert.equal(request.method(), 'GET');
+ assert.equal(url.origin, origin);
+ assert.equal(request.method(), 'GET');
assert(!/\/(?:diagnostics|run-command|guest-agent|qemu)(?:\/|$)/.test(url.pathname));
if (!url.pathname.startsWith('/api/')) return route.continue();
if (url.pathname === '/api/metrics-store/history') {
const range = url.searchParams.get('range');
assert(['24h', '7d'].includes(range));
- const end = Date.parse('2026-10-13T13:00:00Z'), start = end - (range === '7d' ? 7 : 1) * 86400000;
- const metrics = Object.fromEntries(['cpu', 'memory', 'disk', 'temperature', 'netin', 'netout', 'diskread', 'diskwrite'].map((metric) => [metric, [
- { timestamp: start, value: /in|out|read|write/.test(metric) ? 1024 ** 2 : 20, min: 10, max: 40 }, { timestamp: end, value: /in|out|read|write/.test(metric) ? 2 * 1024 ** 2 : 30, min: 20, max: 90 },
- ]]));
- return route.fulfill({ json: { resourceType: url.searchParams.get('resourceType'), resourceId: url.searchParams.get('resourceId'), range, start, end, metrics, source: 'mock_synthetic' } });
+ const end = Date.parse('2026-10-13T13:00:00Z'),
+ start = end - (range === '7d' ? 7 : 1) * 86400000;
+ const metrics = Object.fromEntries(
+ [
+ 'cpu',
+ 'memory',
+ 'disk',
+ 'temperature',
+ 'netin',
+ 'netout',
+ 'diskread',
+ 'diskwrite',
+ ].map((metric) => [
+ metric,
+ [
+ {
+ timestamp: start,
+ value: /in|out|read|write/.test(metric) ? 1024 ** 2 : 20,
+ min: 10,
+ max: 40,
+ },
+ {
+ timestamp: end,
+ value: /in|out|read|write/.test(metric) ? 2 * 1024 ** 2 : 30,
+ min: 20,
+ max: 90,
+ },
+ ],
+ ]),
+ );
+ return route.fulfill({
+ json: {
+ resourceType: url.searchParams.get('resourceType'),
+ resourceId: url.searchParams.get('resourceId'),
+ range,
+ start,
+ end,
+ metrics,
+ source: 'mock_synthetic',
+ },
+ });
}
- if (url.pathname === '/api/license/runtime-capabilities') return route.fulfill({ json: { capabilities: [], hosted_mode: false, max_history_days: 7, runtime: { build: 'free' }, blocked_capabilities: [] } });
- return route.fulfill({ json: { success: true, data: [], alerts: [], anomalies: [], config: null } });
+ if (url.pathname === '/api/license/runtime-capabilities')
+ return route.fulfill({
+ json: {
+ capabilities: [],
+ hosted_mode: false,
+ max_history_days: 7,
+ runtime: { build: 'free' },
+ blocked_capabilities: [],
+ },
+ });
+ return route.fulfill({
+ json: { success: true, data: [], alerts: [], anomalies: [], config: null },
+ });
});
const capture = async (suffix, target = page, fullPage = true) => {
- const file = `${name}-${suffix}.png`; await target.screenshot({ path: output + '/' + file, fullPage });
- result.captures.push({ file, bytes: fs.statSync(output + '/' + file).size, sha256: hash(fs.readFileSync(output + '/' + file)) });
+ const file = `${name}-${suffix}.png`;
+ await target.screenshot({ path: output + '/' + file, fullPage });
+ result.captures.push({
+ file,
+ bytes: fs.statSync(output + '/' + file).size,
+ sha256: hash(fs.readFileSync(output + '/' + file)),
+ });
+ };
+ const noOverflow = async () =>
+ assert.equal(
+ await page.evaluate(
+ () => document.documentElement.scrollWidth - document.documentElement.clientWidth,
+ ),
+ 0,
+ );
+ const activate = async (control) => {
+ if (width < 768) await control.tap();
+ else {
+ await control.focus();
+ await page.keyboard.press('Enter');
+ }
};
- const noOverflow = async () => assert.equal(await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth), 0);
- const activate = async (control) => { if (width < 768) await control.tap(); else { await control.focus(); await page.keyboard.press('Enter'); } };
const openGuest = async () => {
await page.goto(origin + '/guest', { waitUntil: 'networkidle' });
if (width < 768) await page.getByText('integration-guest', { exact: true }).first().tap();
else {
const row = page.locator('[data-guest-id="fixture:pve1:101"] [data-row-action]').first();
- await row.focus(); await page.keyboard.press('Enter');
+ await row.focus();
+ await page.keyboard.press('Enter');
}
};
await openGuest();
- const overview = page.getByTestId('guest-drawer-overview'); await overview.waitFor();
- const details = page.getByTestId('guest-technical-details'); assert.equal(await details.getAttribute('open'), null);
+ const overview = page.getByTestId('guest-drawer-overview');
+ await overview.waitFor();
+ const details = page.getByTestId('guest-technical-details');
+ assert.equal(await details.getAttribute('open'), null);
const os = (await page.evaluate(() => window.__integration.evidence())).os;
- const fact = page.getByTestId('guest-drawer-facts').getByText(os, { exact: true }); await fact.waitFor();
- record.os = await box(fact); assert.equal(record.os.text, os); assert(record.os.scroll <= record.os.client); assert.equal(record.os.whiteSpace, 'normal');
- assert(record.os.right <= width && record.os.left >= 0); await noOverflow();
- await overview.getByTestId('drawer-trend-card-memory').locator('[data-testid="drawer-trend-threshold"]').waitFor({ state: 'attached' });
+ const fact = page.getByTestId('guest-drawer-facts').getByText(os, { exact: true });
+ await fact.waitFor();
+ record.os = await box(fact);
+ assert.equal(record.os.text, os);
+ assert(record.os.scroll <= record.os.client);
+ assert.equal(record.os.whiteSpace, 'normal');
+ assert(record.os.right <= width && record.os.left >= 0);
+ await noOverflow();
+ await overview
+ .getByTestId('drawer-trend-card-memory')
+ .locator('[data-testid="drawer-trend-threshold"]')
+ .waitFor({ state: 'attached' });
await overview.getByTestId('drawer-trend-card-memory').locator('svg').waitFor();
const reading = overview.getByRole('link', { name: 'Filesystem reading guidance' });
- await reading.scrollIntoViewIfNeeded(); await reading.focus(); await page.keyboard.press('Shift+Tab'); await page.keyboard.press('Tab');
- await page.evaluate(async () => { await document.fonts.ready; await new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve))); });
+ await reading.scrollIntoViewIfNeeded();
+ await reading.focus();
+ await page.keyboard.press('Shift+Tab');
+ await page.keyboard.press('Tab');
+ await page.evaluate(async () => {
+ await document.fonts.ready;
+ await new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)));
+ });
record.readingBeforeCapture = await box(reading);
- assert.equal(await overview.getByTestId('drawer-trend-cards').getAttribute('aria-label'), 'Last 24 hours');
- assert(record.requests.some((r) => r.path === '/api/metrics-store/history' && new URLSearchParams(r.search).get('range') === '24h'));
+ assert.equal(
+ await overview.getByTestId('drawer-trend-cards').getAttribute('aria-label'),
+ 'Last 24 hours',
+ );
+ assert(
+ record.requests.some(
+ (r) =>
+ r.path === '/api/metrics-store/history' &&
+ new URLSearchParams(r.search).get('range') === '24h',
+ ),
+ );
await activate(details.locator('summary'));
const completed = details.locator('time[datetime="2026-10-13T12:30:00.000Z"]');
assert.equal(await completed.textContent(), '2026-10-13 12:30:00 UTC');
await activate(details.locator('summary'));
- await reading.focus(); await page.keyboard.press('Shift+Tab'); await page.keyboard.press('Tab');
+ await reading.focus();
+ await page.keyboard.press('Shift+Tab');
+ await page.keyboard.press('Tab');
await capture('guest-unknown');
- record.reading = await box(reading); assert.equal(record.reading.focusVisible, true); assert.equal(record.reading.outline, 'solid'); assert.equal(record.reading.outlineWidth, '2px');
+ record.reading = await box(reading);
+ assert.equal(record.reading.focusVisible, true);
+ assert.equal(record.reading.outline, 'solid');
+ assert.equal(record.reading.outlineWidth, '2px');
assert.equal(record.reading.height, width < 768 ? 44 : 16);
- await activate(reading); await page.waitForURL('**/docs/VM_DISK_MONITORING#*');
- await page.getByRole('heading', { name: 'A missing reading is not an installation diagnosis' }).waitFor();
+ await activate(reading);
+ await page.waitForURL('**/docs/VM_DISK_MONITORING#*');
+ await page
+ .getByRole('heading', { name: 'A missing reading is not an installation diagnosis' })
+ .waitFor();
record.filesystemDoc = page.url();
- const digest = await page.evaluate(async () => { const b = await (await fetch('/docs/VM_DISK_MONITORING.md')).arrayBuffer(); return Array.from(new Uint8Array(await crypto.subtle.digest('SHA-256', b))).map((x) => x.toString(16).padStart(2, '0')).join(''); });
+ const digest = await page.evaluate(async () => {
+ const b = await (await fetch('/docs/VM_DISK_MONITORING.md')).arrayBuffer();
+ return Array.from(new Uint8Array(await crypto.subtle.digest('SHA-256', b)))
+ .map((x) => x.toString(16).padStart(2, '0'))
+ .join('');
+ });
assert.equal(digest, binding.artifacts['docs/VM_DISK_MONITORING.md']);
await openGuest();
- await page.evaluate(() => { window.__integration.backup('2026-10-08T00:30:00Z'); window.__integration.mode('retained'); });
- await overview.getByTestId('guest-drawer-filesystems').getByText(/Using last known/).waitFor();
- await overview.getByTestId('drawer-trend-card-disk').getByText(/Using last known/).waitFor(); await overview.getByText('/data', { exact: true }).waitFor();
+ await page.evaluate(() => {
+ window.__integration.backup('2026-10-08T00:30:00Z');
+ window.__integration.mode('retained');
+ });
+ await overview
+ .getByTestId('guest-drawer-filesystems')
+ .getByText(/Using last known/)
+ .waitFor();
+ await overview
+ .getByTestId('drawer-trend-card-disk')
+ .getByText(/Using last known/)
+ .waitFor();
+ await overview.getByText('/data', { exact: true }).waitFor();
assert.equal(await details.getAttribute('open'), null);
const exceptions = overview.getByTestId('guest-drawer-exceptions');
assert.equal(await exceptions.locator('h3').textContent(), 'Worth checking');
const retainedCompletion = exceptions.locator('time');
assert.equal(await retainedCompletion.textContent(), '2026-10-08 00:30:00 UTC');
assert.equal(await retainedCompletion.getAttribute('datetime'), '2026-10-08T00:30:00.000Z');
- assert.equal(await exceptions.locator('time').evaluate((e) => getComputedStyle(e).display), 'inline');
- await noOverflow(); await capture('guest-retained');
- record.states.push('Unknown reading and full OS outside closed Details; retained /data and last-known notice preserved');
+ assert.equal(
+ await exceptions.locator('time').evaluate((e) => getComputedStyle(e).display),
+ 'inline',
+ );
+ await noOverflow();
+ await capture('guest-retained');
+ record.states.push(
+ 'Unknown reading and full OS outside closed Details; retained /data and last-known notice preserved',
+ );
await page.evaluate(() => window.__integration.mode('fresh'));
- await overview.getByTestId('guest-drawer-filesystems').getByText(/Using last known/).waitFor({ state: 'hidden' });
- await overview.getByTestId('drawer-trend-card-disk').getByText(/Using last known/).waitFor({ state: 'hidden' });
- assert.equal(await overview.getByRole('link', { name: 'Filesystem reading guidance' }).count(), 0);
- const memoryCard = overview.getByTestId('drawer-trend-card-memory'); assert.match(await memoryCard.getAttribute('class'), /amber/);
- await memoryCard.locator('[data-testid="drawer-trend-threshold"]').waitFor({ state: 'attached' });
+ await overview
+ .getByTestId('guest-drawer-filesystems')
+ .getByText(/Using last known/)
+ .waitFor({ state: 'hidden' });
+ await overview
+ .getByTestId('drawer-trend-card-disk')
+ .getByText(/Using last known/)
+ .waitFor({ state: 'hidden' });
+ assert.equal(
+ await overview.getByRole('link', { name: 'Filesystem reading guidance' }).count(),
+ 0,
+ );
+ const memoryCard = overview.getByTestId('drawer-trend-card-memory');
+ assert.match(await memoryCard.getAttribute('class'), /amber/);
+ await memoryCard
+ .locator('[data-testid="drawer-trend-threshold"]')
+ .waitFor({ state: 'attached' });
await overview.getByTestId('drawer-trend-card-memory').locator('svg').waitFor();
await activate(page.getByRole('tab', { name: 'History', exact: true }));
await page.getByTestId('guest-history-group-chart').first().waitFor();
assert.equal(await page.getByTestId('guest-history-range-control').inputValue(), '7d');
- assert(record.requests.some((r) => r.path === '/api/metrics-store/history' && new URLSearchParams(r.search).get('range') === '7d'));
- const historyCpu = page.locator('[data-history-group="cpu"]');
+ assert(
+ record.requests.some(
+ (r) =>
+ r.path === '/api/metrics-store/history' &&
+ new URLSearchParams(r.search).get('range') === '7d',
+ ),
+ );
+ const historyCpu = page.locator('[data-history-group="utilization"]');
await historyCpu.getByTestId('guest-history-hover-time').waitFor();
- for (const axis of ['100%', '50%', '0%']) await historyCpu.getByText(axis, { exact: true }).waitFor();
+ for (const axis of ['100%', '50%', '0%'])
+ await historyCpu.getByText(axis, { exact: true }).waitFor();
assert.equal(await page.getByText('Avg', { exact: true }).count(), 0);
const plot = historyCpu.getByTestId('guest-history-plot');
- await plot.scrollIntoViewIfNeeded(); const rect = await plot.boundingBox();
+ await plot.scrollIntoViewIfNeeded();
+ const rect = await plot.boundingBox();
if (width < 768) await plot.tap({ position: { x: rect.width * 0.6, y: rect.height / 2 } });
else await plot.hover({ position: { x: rect.width * 0.6, y: rect.height / 2 } });
await page.locator('[data-history-hover-marker="cpu"]').first().waitFor();
- assert.equal(await page.locator('[data-history-hover-marker="cpu"]').first().getAttribute('vector-effect'), 'non-scaling-stroke');
- await noOverflow(); await capture('guest-history');
+ assert.equal(
+ await page
+ .locator('[data-history-hover-marker="cpu"]')
+ .first()
+ .getAttribute('vector-effect'),
+ 'non-scaling-stroke',
+ );
+ await noOverflow();
+ await capture('guest-history');
await activate(page.getByRole('tab', { name: 'Overview', exact: true }));
- record.states.push('Fresh read withdraws deferral; metric alert trend threshold and on-demand History retained');
+ record.states.push(
+ 'Fresh read withdraws deferral; metric alert trend threshold and on-demand History retained',
+ );
await page.goto(origin + '/node', { waitUntil: 'networkidle' });
- const node = page.getByTestId('node-drawer-overview'), nodeDetails = page.getByTestId('node-technical-details');
- const trigger = node.getByRole('button', { name: 'Why update checks are unavailable' }); await trigger.waitFor();
+ const node = page.getByTestId('node-drawer-overview'),
+ nodeDetails = page.getByTestId('node-technical-details');
+ const trigger = node.getByRole('button', { name: 'Why update checks are unavailable' });
+ await trigger.waitFor();
assert.equal(await nodeDetails.getAttribute('open'), null);
await node.getByText(/7 pending.*stale/).waitFor();
await node.getByText(/Other monitoring can still work/).waitFor();
- const plain = node.getByTestId('drawer-trend-card-memory'); assert(!/amber|red-/.test(await plain.getAttribute('class')), 'guest alert must not colour node trend');
- await trigger.scrollIntoViewIfNeeded(); await activate(trigger);
- const help = page.getByRole('dialog', { name: 'Proxmox update-check access' }); await help.waitFor();
- assert.match(await help.textContent(), /Sys.Modify/); assert.match(await help.textContent(), /broader than read-only monitoring/);
- await help.evaluate((element) => { window.__retainedHelp = element; });
- await trigger.evaluate((element) => { window.__retainedTrigger = element; });
+ const plain = node.getByTestId('drawer-trend-card-memory');
+ assert(
+ !/amber|red-/.test(await plain.getAttribute('class')),
+ 'guest alert must not colour node trend',
+ );
+ await trigger.scrollIntoViewIfNeeded();
+ await activate(trigger);
+ const help = page.getByRole('dialog', { name: 'Proxmox update-check access' });
+ await help.waitFor();
+ assert.match(await help.textContent(), /Sys.Modify/);
+ assert.match(await help.textContent(), /broader than read-only monitoring/);
+ await help.evaluate((element) => {
+ window.__retainedHelp = element;
+ });
+ await trigger.evaluate((element) => {
+ window.__retainedTrigger = element;
+ });
await page.evaluate(() => window.__integration.update({ cpu: 0.2 }));
await page.clock.runFor(60001);
assert.equal(await help.evaluate((element) => window.__retainedHelp === element), true);
assert.equal(await trigger.evaluate((element) => window.__retainedTrigger === element), true);
await node.getByText(/7 pending.*stale.*checked 2 mins ago/).waitFor();
- await page.evaluate(() => window.__integration.update({ pendingUpdatesStatus: 'unavailable' }));
+ await page.evaluate(() =>
+ window.__integration.update({ pendingUpdatesStatus: 'unavailable' }),
+ );
assert.equal(await node.getByTestId('node-drawer-exceptions').count(), 0);
assert.equal(await nodeDetails.getAttribute('open'), null);
- assert.equal(await node.getByText('Unavailable · Update check access denied', { exact: true }).count(), 1);
+ assert.equal(
+ await node.getByText('Unavailable · Update check access denied', { exact: true }).count(),
+ 1,
+ );
assert.equal(await help.evaluate((element) => window.__retainedHelp === element), true);
- record.trigger = await box(trigger); assert(record.trigger.height >= (width < 768 ? 44 : 32));
- record.help = await box(help); assert(record.help.right <= width && record.help.left >= 0);
- await noOverflow(); await capture('node-help');
+ record.trigger = await box(trigger);
+ assert(record.trigger.height >= (width < 768 ? 44 : 32));
+ record.help = await box(help);
+ assert(record.help.right <= width && record.help.left >= 0);
+ await noOverflow();
+ await capture('node-help');
const learnMore = help.getByRole('link', { name: 'Learn more', exact: true });
- assert.equal(await learnMore.getAttribute('href'), '/docs/TROUBLESHOOTING#proxmox-pending-update-access');
+ assert.equal(
+ await learnMore.getAttribute('href'),
+ '/docs/TROUBLESHOOTING#proxmox-pending-update-access',
+ );
const [docsPage] = await Promise.all([context.waitForEvent('page'), learnMore.click()]);
await docsPage.waitForLoadState('networkidle');
- await docsPage.getByRole('heading', { name: 'Proxmox pending-update access', exact: true }).waitFor();
- const docDigest = await docsPage.evaluate(async () => { const b = await (await fetch('/docs/TROUBLESHOOTING.md')).arrayBuffer(); return Array.from(new Uint8Array(await crypto.subtle.digest('SHA-256', b))).map((x) => x.toString(16).padStart(2, '0')).join(''); });
+ await docsPage
+ .getByRole('heading', { name: 'Proxmox pending-update access', exact: true })
+ .waitFor();
+ const docDigest = await docsPage.evaluate(async () => {
+ const b = await (await fetch('/docs/TROUBLESHOOTING.md')).arrayBuffer();
+ return Array.from(new Uint8Array(await crypto.subtle.digest('SHA-256', b)))
+ .map((x) => x.toString(16).padStart(2, '0'))
+ .join('');
+ });
assert.equal(docDigest, binding.artifacts['docs/TROUBLESHOOTING.md']);
record.updateDoc = { url: docsPage.url(), sha256: docDigest };
await docsPage.close();
- await page.keyboard.press('Escape'); await help.waitFor({ state: 'hidden' }); assert.equal(await trigger.evaluate((e) => e === document.activeElement), true);
- await activate(nodeDetails.locator('summary')); assert.notEqual(await nodeDetails.getAttribute('open'), null);
- const denied = nodeDetails.getByText('Unavailable · Update check access denied', { exact: true });
- await denied.waitFor(); record.denied = await box(denied);
- assert.equal(record.denied.whiteSpace, 'normal'); assert(!/amber|yellow/.test(record.denied.class));
+ await page.keyboard.press('Escape');
+ await help.waitFor({ state: 'hidden' });
+ assert.equal(await trigger.evaluate((e) => e === document.activeElement), true);
+ await activate(nodeDetails.locator('summary'));
+ assert.notEqual(await nodeDetails.getAttribute('open'), null);
+ const denied = nodeDetails.getByText('Unavailable · Update check access denied', {
+ exact: true,
+ });
+ await denied.waitFor();
+ record.denied = await box(denied);
+ assert.equal(record.denied.whiteSpace, 'normal');
+ assert(!/amber|yellow/.test(await denied.locator('..').getAttribute('class')));
assert(record.denied.scroll <= record.denied.client);
- const fullModel = 'Fixture CPU with a deliberately long hardware model and complete revision identifier 2026-A-extended';
+ const fullModel =
+ 'Fixture CPU with a deliberately long hardware model and complete revision identifier 2026-A-extended';
const cpuModel = nodeDetails.getByText(fullModel, { exact: true });
- assert.equal((await box(cpuModel)).whiteSpace, 'normal'); assert((await box(cpuModel)).scroll <= (await box(cpuModel)).client);
- const storage = nodeDetails.getByText('/unknown', { exact: true }).locator('..');
+ assert.equal((await box(cpuModel)).whiteSpace, 'normal');
+ assert((await box(cpuModel)).scroll <= (await box(cpuModel)).client);
+ const storage = nodeDetails
+ .getByText('/unknown', { exact: true })
+ .locator('xpath=ancestor::tr[1]');
assert.match(await storage.textContent(), /Usage unavailable.*10.0 GB total/);
- assert.match(await nodeDetails.getByText('/empty', { exact: true }).locator('..').textContent(), /0%.*0 B/);
- assert.match(await nodeDetails.getByText('/measured', { exact: true }).locator('..').textContent(), /50%.*5.00 GB/);
+ assert.match(
+ await nodeDetails
+ .getByText('/empty', { exact: true })
+ .locator('xpath=ancestor::tr[1]')
+ .textContent(),
+ /0%.*0 B/,
+ );
+ assert.match(
+ await nodeDetails
+ .getByText('/measured', { exact: true })
+ .locator('xpath=ancestor::tr[1]')
+ .textContent(),
+ /50%.*5.00 GB/,
+ );
await page.evaluate(() => window.__integration.update({ status: 'offline' }));
- await node.getByTestId('drawer-trend-card-disk').getByText('Node is offline. Showing its history only.', { exact: true }).waitFor();
- assert.match(await nodeDetails.getByText('/measured', { exact: true }).locator('..').textContent(), /50%.*5.00 GB/);
+ await node
+ .getByTestId('drawer-trend-card-disk')
+ .getByText('Node is offline. Showing its history only.', { exact: true })
+ .waitFor();
+ assert.match(
+ await nodeDetails
+ .getByText('/measured', { exact: true })
+ .locator('xpath=ancestor::tr[1]')
+ .textContent(),
+ /50%.*5.00 GB/,
+ );
await page.evaluate(() => window.__integration.update({ status: 'online' }));
- await noOverflow(); await capture('node-details');
- await activate(nodeDetails.locator('summary')); assert.equal(await nodeDetails.getAttribute('open'), null);
- await page.evaluate(() => window.__integration.update({ pendingUpdatesStatus: 'unavailable', pendingUpdatesReason: 'source_unavailable' }));
+ await noOverflow();
+ await capture('node-details');
+ await activate(nodeDetails.locator('summary'));
+ assert.equal(await nodeDetails.getAttribute('open'), null);
+ await page.evaluate(() =>
+ window.__integration.update({
+ pendingUpdatesStatus: 'unavailable',
+ pendingUpdatesReason: 'source_unavailable',
+ }),
+ );
await trigger.waitFor({ state: 'hidden' });
const failed = node.getByTestId('node-drawer-exceptions');
await failed.getByText('Unavailable · Proxmox source unavailable', { exact: true }).waitFor();
- assert.match(await failed.getByText('Unavailable · Proxmox source unavailable', { exact: true }).getAttribute('class'), /amber|yellow/);
- await noOverflow(); await capture('node-failed');
- await page.evaluate(() => window.__integration.update({ pendingUpdates: 0, pendingUpdatesStatus: 'checked', pendingUpdatesReason: undefined }));
+ assert.match(
+ await failed
+ .getByText('Unavailable · Proxmox source unavailable', { exact: true })
+ .getAttribute('class'),
+ /amber|yellow/,
+ );
+ await noOverflow();
+ await capture('node-failed');
+ await page.evaluate(() =>
+ window.__integration.update({
+ pendingUpdates: 0,
+ pendingUpdatesStatus: 'checked',
+ pendingUpdatesReason: undefined,
+ }),
+ );
await failed.waitFor({ state: 'hidden' });
await trigger.waitFor({ state: 'hidden' });
- record.states.push('Denied status neutral in Details with usable guidance outside closed Details; failed check remains a compact warning; full values and unknown/empty/measured disk controls preserved; same dialog/trigger survives readings, age and verdict changes; Escape restores focus; actual success removes denial help');
- record.inputs = await page.evaluate(() => window.__trustedInputs); assert(record.inputs.some((event) => event.trusted && event.label?.includes('Why update checks')));
+ record.states.push(
+ 'Denied status neutral in Details with usable guidance outside closed Details; failed check remains a compact warning; full values and unknown/empty/measured disk controls preserved; same dialog/trigger survives readings, age and verdict changes; Escape restores focus; actual success removes denial help',
+ );
+ record.inputs = await page.evaluate(() => window.__trustedInputs);
+ assert(
+ record.inputs.some((event) => event.trusted && event.label?.includes('Why update checks')),
+ );
assert.deepEqual(record.errors, []);
- await context.close(); await browser.close(); browser = null;
+ await context.close();
+ await browser.close();
+ browser = null;
}
- result.result = 'passed'; result.verified_at = new Date().toISOString();
- } catch (error) { result.error = String(error.stack || error); throw error; }
- finally {
- if (browser) await browser.close(); result.cleanup.browser = true;
- if (server) await new Promise((resolve, reject) => { server.close((error) => error ? reject(error) : resolve()); server.closeAllConnections(); });
+ result.result = 'passed';
+ result.verified_at = new Date().toISOString();
+ } catch (error) {
+ result.error = String(error.stack || error);
+ throw error;
+ } finally {
+ if (browser) await browser.close();
+ result.cleanup.browser = true;
+ if (server)
+ await new Promise((resolve, reject) => {
+ server.close((error) => (error ? reject(error) : resolve()));
+ server.closeAllConnections();
+ });
result.cleanup.server = true;
fs.writeFileSync(output + '/result.json', JSON.stringify(result, null, 2) + '\n');
}
-})().catch((error) => { console.error(error); process.exitCode = 1; });
+})().catch((error) => {
+ console.error(error);
+ process.exitCode = 1;
+});
diff --git a/frontend-modern/browser-tests/drawer-integration.html b/frontend-modern/browser-tests/drawer-integration.html
index 3f8f3fbd8a..ad50727e79 100644
--- a/frontend-modern/browser-tests/drawer-integration.html
+++ b/frontend-modern/browser-tests/drawer-integration.html
@@ -1,2 +1,12 @@
<!doctype html>
-<html lang="en-GB"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Drawer integration proof</title></head><body><div id="root"></div><script type="module" src="/browser-tests/drawer-integration.tsx"></script></body></html>
+<html lang="en-GB">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>Drawer integration proof</title>
+ </head>
+ <body>
+ <div id="root"></div>
+ <script type="module" src="/browser-tests/drawer-integration.tsx"></script>
+ </body>
+</html>
diff --git a/frontend-modern/browser-tests/drawer-integration.tsx b/frontend-modern/browser-tests/drawer-integration.tsx
index 66f7533b00..a7a94cc5cf 100644
--- a/frontend-modern/browser-tests/drawer-integration.tsx
+++ b/frontend-modern/browser-tests/drawer-integration.tsx
@@ -13,66 +13,173 @@ import type { Resource } from '../src/types/resource';
import type { Alert, Node } from '../src/types/api';
import '../src/index.css';
-const os = 'Microsoft Windows Server 2025 Datacenter Evaluation with retained build identity 26100.1742';
+const os =
+ 'Microsoft Windows Server 2025 Datacenter Evaluation with retained build identity 26100.1742';
const capacity = 10 * 1024 ** 3;
-const alert = (id: string, resourceId: string, type = 'memory'): Alert => ({
- id, resourceId, resourceName: 'integration-guest', type, level: 'warning', value: 92,
- threshold: 85, message: 'Synthetic metric warning', startTime: new Date().toISOString(),
-} as Alert);
+const alert = (id: string, resourceId: string, type = 'memory'): Alert =>
+ ({
+ id,
+ resourceId,
+ resourceName: 'integration-guest',
+ type,
+ level: 'warning',
+ value: 92,
+ threshold: 85,
+ message: 'Synthetic metric warning',
+ startTime: new Date().toISOString(),
+ }) as Alert;
function GuestFixture() {
const [mode, setMode] = createSignal('unknown');
const [open, setOpen] = createSignal(false);
const [backup, setBackup] = createSignal('2026-10-13T12:30:00Z');
- const snapshot = (): Resource[] => [{
- id: 'fixture:pve1:101', type: 'vm', name: 'integration-guest', displayName: 'integration-guest',
- platformId: 'fixture', platformType: 'proxmox-pve', platformScopes: ['proxmox-pve'],
- sourceType: 'api', sources: ['proxmox'], status: 'online', lastSeen: Date.now(),
- metricsTarget: { resourceType: 'vm', resourceId: 'fixture:pve1:101' },
- cpu: { current: 10 }, memory: { current: 92, total: capacity, used: capacity * 0.92 },
- ...(mode() !== 'unknown' ? { disk: { current: 50, used: capacity / 2, total: capacity } } : {}),
- proxmox: {
- lastBackup: backup(), backupInProgress: mode() === 'retained',
- vmid: 101, nodeName: 'pve1', instance: 'fixture', runtimeStatus: 'running', osName: os,
- guestAgentStatus: mode() === 'unknown' ? 'not-running' : mode() === 'retained' ? 'deferred' : 'available',
- diskStatusReason: mode() === 'unknown' ? 'agent-not-running' : mode() === 'retained' ? 'prev-vm-locked' : '',
- lock: mode() === 'retained' ? 'backup' : '',
- disks: mode() === 'unknown' ? [] : [{ mountpoint: '/data', type: 'ext4', total: capacity, used: capacity / 2, usage: 50 }],
+ const snapshot = (): Resource[] => [
+ {
+ id: 'fixture:pve1:101',
+ type: 'vm',
+ name: 'integration-guest',
+ displayName: 'integration-guest',
+ platformId: 'fixture',
+ platformType: 'proxmox-pve',
+ platformScopes: ['proxmox-pve'],
+ sourceType: 'api',
+ sources: ['proxmox'],
+ status: 'online',
+ lastSeen: Date.now(),
+ metricsTarget: { resourceType: 'vm', resourceId: 'fixture:pve1:101' },
+ cpu: { current: 10 },
+ memory: { current: 92, total: capacity, used: capacity * 0.92 },
+ ...(mode() !== 'unknown'
+ ? { disk: { current: 50, used: capacity / 2, total: capacity } }
+ : {}),
+ proxmox: {
+ lastBackup: backup(),
+ backupInProgress: mode() === 'retained',
+ vmid: 101,
+ nodeName: 'pve1',
+ instance: 'fixture',
+ runtimeStatus: 'running',
+ osName: os,
+ guestAgentStatus:
+ mode() === 'unknown' ? 'not-running' : mode() === 'retained' ? 'deferred' : 'available',
+ diskStatusReason:
+ mode() === 'unknown'
+ ? 'agent-not-running'
+ : mode() === 'retained'
+ ? 'prev-vm-locked'
+ : '',
+ lock: mode() === 'retained' ? 'backup' : '',
+ disks:
+ mode() === 'unknown'
+ ? []
+ : [
+ {
+ mountpoint: '/data',
+ type: 'ext4',
+ total: capacity,
+ used: capacity / 2,
+ usage: 50,
+ },
+ ],
+ },
},
- }];
+ ];
const state = useWorkloads(() => true, { resourceSnapshot: snapshot });
const guest = () => state.workloads()[0];
- (window as any).__integration = { mode: setMode, backup: setBackup, evidence: () => ({ mode: mode(), projected: guest(), os }) };
- return <main class="mx-auto min-h-screen max-w-4xl space-y-3 bg-surface p-3 text-base-content">
- <h1>Combined guest drawer</h1><p class="text-xs text-muted">Synthetic observations; no guest commands.</p>
- <Show when={guest()}>
- <table class="w-full table-fixed"><tbody><GuestRow guest={guest()} visibleColumnIds={['name', 'disk']}
- isExpanded={open()} workloadTableLayoutMode={window.innerWidth < 768 ? 'phone' : 'wide'} onClick={() => setOpen(!open())} /></tbody></table>
- <Show when={open()}><GuestDrawer guest={guest()} alerts={[alert('fixture-warning', 'fixture:pve1:101')]} onClose={() => setOpen(false)} /></Show>
- </Show>
- </main>;
+ (window as any).__integration = {
+ mode: setMode,
+ backup: setBackup,
+ evidence: () => ({ mode: mode(), projected: guest(), os }),
+ };
+ return (
+ <main class="mx-auto min-h-screen max-w-4xl space-y-3 bg-surface p-3 text-base-content">
+ <h1>Combined guest drawer</h1>
+ <p class="text-xs text-muted">Synthetic observations; no guest commands.</p>
+ <Show when={guest()}>
+ <table class="w-full table-fixed">
+ <tbody>
+ <GuestRow
+ guest={guest()}
+ visibleColumnIds={['name', 'disk']}
+ isExpanded={open()}
+ workloadTableLayoutMode={window.innerWidth < 768 ? 'phone' : 'wide'}
+ onClick={() => setOpen(!open())}
+ />
+ </tbody>
+ </table>
+ <Show when={open()}>
+ <GuestDrawer
+ guest={guest()}
+ alerts={[alert('fixture-warning', 'fixture:pve1:101')]}
+ onClose={() => setOpen(false)}
+ />
+ </Show>
+ </Show>
+ </main>
+ );
}
function NodeFixture() {
const [node, setNode] = createSignal<Node>({
- id: 'fixture-pve1', name: 'pve1', instance: 'fixture', host: 'pve1', status: 'online', type: 'node',
- cpu: 0.1, memory: { total: capacity, used: capacity / 4, free: capacity * 0.75, usage: 25 },
+ id: 'fixture-pve1',
+ name: 'pve1',
+ instance: 'fixture',
+ host: 'pve1',
+ status: 'online',
+ type: 'node',
+ cpu: 0.1,
+ memory: { total: capacity, used: capacity / 4, free: capacity * 0.75, usage: 25 },
disk: { total: capacity, used: capacity / 2, free: capacity / 2, usage: 50 },
- uptime: 3600, loadAverage: [0.1, 0.2, 0.3], kernelVersion: '6.8.12', pveVersion: 'pve-manager/9.2.21',
- cpuInfo: { model: 'Fixture CPU with a deliberately long hardware model and complete revision identifier 2026-A-extended', cores: 4, sockets: 1, mhz: '2400' },
- lastSeen: new Date().toISOString(), connectionHealth: 'healthy',
+ uptime: 3600,
+ loadAverage: [0.1, 0.2, 0.3],
+ kernelVersion: '6.8.12',
+ pveVersion: 'pve-manager/9.2.21',
+ cpuInfo: {
+ model:
+ 'Fixture CPU with a deliberately long hardware model and complete revision identifier 2026-A-extended',
+ cores: 4,
+ sockets: 1,
+ mhz: '2400',
+ },
+ lastSeen: new Date().toISOString(),
+ connectionHealth: 'healthy',
linkedAgentId: 'agent:fixture-node-with-a-long-retained-identity-2026',
- networkIn: 1024 ** 2, networkOut: 2 * 1024 ** 2, diskRead: 1024 ** 2, diskWrite: 2 * 1024 ** 2,
- pendingUpdates: 7, pendingUpdatesStatus: 'stale', pendingUpdatesReason: 'permission_denied',
+ networkIn: 1024 ** 2,
+ networkOut: 2 * 1024 ** 2,
+ diskRead: 1024 ** 2,
+ diskWrite: 2 * 1024 ** 2,
+ pendingUpdates: 7,
+ pendingUpdatesStatus: 'stale',
+ pendingUpdatesReason: 'permission_denied',
pendingUpdatesCheckedAt: new Date(Date.now() - 60000).toISOString(),
});
- (window as any).__integration = { update: (delta: Partial<Node>) => setNode((previous) => ({ ...previous, ...delta })), evidence: node };
- return <main class="mx-auto min-h-screen max-w-4xl space-y-3 bg-surface p-3 text-base-content">
- <h1>Combined node drawer</h1><p class="text-xs text-muted">Synthetic observations; no permissions changed.</p>
- <NodeDrawer node={node()} alerts={[alert('fixture-guest-warning', 'fixture:pve1:101')]}
- disks={[{ mountpoint: '/unknown', total: capacity, usage: -1 },
- { mountpoint: '/empty', total: capacity, free: capacity },
- { mountpoint: '/measured', total: capacity, used: capacity / 2, usage: 50 }]} />
- </main>;
+ (window as any).__integration = {
+ update: (delta: Partial<Node>) => setNode((previous) => ({ ...previous, ...delta })),
+ evidence: node,
+ };
+ return (
+ <main class="mx-auto min-h-screen max-w-4xl space-y-3 bg-surface p-3 text-base-content">
+ <h1>Combined node drawer</h1>
+ <p class="text-xs text-muted">Synthetic observations; no permissions changed.</p>
+ <NodeDrawer
+ node={node()}
+ alerts={[alert('fixture-guest-warning', 'fixture:pve1:101')]}
+ disks={[
+ { mountpoint: '/unknown', total: capacity, usage: -1 },
+ { mountpoint: '/empty', total: capacity, free: capacity },
+ { mountpoint: '/measured', total: capacity, used: capacity / 2, usage: 50 },
+ ]}
+ />
+ </main>
+ );
}
-render(() => <DarkModeContext.Provider value={() => document.documentElement.classList.contains('dark')}>
- <Router><Route path="/docs/*docPath" component={Docs} /><Route path="/node" component={NodeFixture} /><Route path="*" component={GuestFixture} /></Router>
-</DarkModeContext.Provider>, document.getElementById('root')!);
+render(
+ () => (
+ <DarkModeContext.Provider value={() => document.documentElement.classList.contains('dark')}>
+ <Router>
+ <Route path="/docs/*docPath" component={Docs} />
+ <Route path="/node" component={NodeFixture} />
+ <Route path="*" component={GuestFixture} />
+ </Router>
+ </DarkModeContext.Provider>
+ ),
+ document.getElementById('root')!,
+);