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.

Read TrueNAS and vSphere states in their dot's colour

rcourtmanfd45bd011618
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index ff8fda3b61..0072788da1 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -5561,8 +5561,8 @@ amber or red count. Docker State words read in their row dot's colour through
`dockerStateTextToneClass` (`DockerNativeTableShared.tsx`) with no second dot,
which now delegates to the platform helper `getPlatformStatusTextToneClass`
(`features/platformPage/platformStatusTone.ts`): every platform table colours
-the cell behind a dot's verdict through it, and `PlatformIssueReason` takes its
-tones from it too;
+the cell behind a dot's verdict through it, and `PlatformIssueReason` and the
+TrueNAS Services and VMs state notes take their tones from it too;
the Docker Networks row's single name-cell dot carries its attached-container
verdict the same way, and each attached-container card's state words take its
dot's tone through the same helper. The Swarm tables follow it too: the cell
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 1fd599e56c..4ea9e8b2f3 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -1124,7 +1124,12 @@ its dot's colour through `getPlatformStatusTextToneClass`: a Pod's Status
count while replicas are short, a controller's Exceptions. The Pods Status
column takes 12 percent so a failure reason such as CrashLoopBackOff reads
whole, and a phone, which hides that column, reads the same words under the
-Pod name. StatefulSet, DaemonSet, Job, and CronJob rows
+Pod name. The TrueNAS and vSphere tables follow the same rule: a TrueNAS app,
+which has no State column, reads its state under its name at every width
+("Crashed" amber, Running plain); a share's State ("Disabled" red, "Attention"
+amber) and a vSphere activity's State ("Error" red) take the dot's tone; and
+where a phone hides a State column (shares, services, VMs, vSphere activity)
+the state, with any note such as "should be running", reads under the name. StatefulSet, DaemonSet, Job, and CronJob rows
render through
`frontend-modern/src/features/kubernetes/KubernetesControllersTable.tsx` and must
preserve the Kubernetes API status semantics for desired replica/node/job
diff --git a/frontend-modern/browser-tests/truenas-vsphere-status-rows.cjs b/frontend-modern/browser-tests/truenas-vsphere-status-rows.cjs
new file mode 100644
index 0000000000..04db7a0d92
--- /dev/null
+++ b/frontend-modern/browser-tests/truenas-vsphere-status-rows.cjs
@@ -0,0 +1,183 @@
+const assert = require('node:assert/strict');
+const fs = require('node:fs');
+const path = require('node:path');
+const { chromium, webkit } = require('playwright');
+
+// Each TrueNAS and vSphere row's status words read in its dot's colour: a
+// crashed app says "Crashed" under its name (it has no State column), a
+// disabled share's State reads red and a locked one amber, a failed vSphere
+// task reads red; phones, which hide those State columns, read the words
+// under the name.
+const now = '2026-10-03T12:00:00Z';
+
+const rgb = (colour) => colour.match(/\d+/g).map(Number);
+// Red in light mode is deep, in dark mode a light pink: red leads either way.
+const isRed = (colour) => {
+ const [r, g, b] = rgb(colour);
+ return r > 150 && r - g > 60 && r - b > 60;
+};
+const isAmber = (colour) => {
+ const [r, g, b] = rgb(colour);
+ return r > 150 && g > 70 && b < 80;
+};
+
+(async () => {
+ const root = '/workspace/frontend-modern';
+ const output = '/workspace/tmp/truenas-vsphere-status-rows';
+ fs.mkdirSync(output, { recursive: true });
+ 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: path.join(output, 'vite-cache'),
+ server: { host: '127.0.0.1', port: 5274, strictPort: true },
+ });
+ const results = [],
+ screenshots = [];
+ let browser;
+ try {
+ await server.listen();
+ for (const [name, engine, width] of [
+ ['desktop', chromium, 1440],
+ ['phone', webkit, 390],
+ ]) {
+ browser = await engine.launch(
+ engine === chromium
+ ? { headless: true, channel: 'chromium', args: ['--no-sandbox'] }
+ : { headless: true },
+ );
+ const page = await browser.newPage({
+ viewport: { width, height: width === 390 ? 844 : 900 },
+ isMobile: width === 390,
+ hasTouch: width === 390,
+ locale: 'en-GB',
+ timezoneId: 'UTC',
+ });
+ await page.clock.setFixedTime(new Date(now));
+ page.setDefaultTimeout(15000);
+ const checks = [],
+ errors = [];
+ page.on('pageerror', (e) => errors.push(e.message));
+ await page.route('**/*', async (route) => {
+ const request = route.request(),
+ url = new URL(request.url());
+ if (url.origin !== 'http://127.0.0.1:5274') return route.abort();
+ if (!url.pathname.startsWith('/api/')) return route.continue();
+ return route.fulfill({
+ json: {
+ enabled: false,
+ data: [],
+ capabilities: [],
+ facets: [],
+ relationships: [],
+ recentChanges: [],
+ alerts: {},
+ },
+ });
+ });
+ const check = async (label, run) => {
+ try {
+ await run();
+ checks.push({ label, passed: true });
+ } catch (e) {
+ checks.push({ label, passed: false, error: e.message });
+ }
+ };
+ const colour = (locator) => locator.evaluate((el) => getComputedStyle(el).color);
+ const dotColour = (locator) => locator.evaluate((el) => getComputedStyle(el).backgroundColor);
+ // A fresh Vite cache compiles the app on the first load.
+ await page.goto('http://127.0.0.1:5274/browser-tests/truenas-vsphere-status-rows.html', {
+ timeout: 180000,
+ });
+ await page.getByText('fixture ready', { exact: true }).waitFor({ timeout: 60000 });
+ if (width === 390) await page.evaluate(() => document.documentElement.classList.add('dark'));
+ const plain = (c) => !isRed(c) && !isAmber(c);
+
+ await check('A TrueNAS app reads its state under its name', async () => {
+ const table = page.getByRole('region', { name: 'App table' });
+ const crashed = table.locator('[data-truenas-app-state="warning"]');
+ await crashed.waitFor();
+ assert.equal((await crashed.textContent()).trim(), 'Crashed');
+ assert.ok(isAmber(await colour(crashed)), 'crashed app amber');
+ const running = table.locator('[data-truenas-app-state="success"]');
+ assert.equal((await running.textContent()).trim(), 'Running');
+ assert.ok(plain(await colour(running)), 'running app plain');
+ });
+ await check('A TrueNAS share state reads in its dot colour', async () => {
+ const table = page.getByRole('region', { name: 'Share table' });
+ const attr = width === 390 ? 'data-truenas-share-state-phone' : 'data-truenas-share-state';
+ const disabled = table.locator(`[${attr}="danger"]`);
+ await disabled.waitFor();
+ assert.equal((await disabled.textContent()).trim(), 'Disabled');
+ assert.ok(isRed(await colour(disabled)), 'disabled share red');
+ const locked = table.locator(`[${attr}="warning"]`);
+ assert.equal((await locked.textContent()).trim(), 'Attention');
+ assert.ok(isAmber(await colour(locked)), 'locked share amber');
+ });
+ await check('A stopped TrueNAS service that should run says so', async () => {
+ const table = page.getByRole('region', { name: 'Service table' });
+ const note =
+ width === 390
+ ? table.locator('[data-truenas-service-state-phone="danger"]')
+ : table.locator('[data-truenas-service-state-note="danger"]');
+ await note.waitFor();
+ assert.match((await note.textContent()).replace(/\s+/g, ' '), /should be running/);
+ const words = width === 390 ? note : note.getByText('should be running');
+ assert.ok(isRed(await colour(words)), 'should-be-running note red');
+ });
+ await check('A failed vSphere task reads red', async () => {
+ const table = page.getByRole('region', { name: 'Activity table' });
+ const attr =
+ width === 390 ? 'data-vsphere-activity-state-phone' : 'data-vsphere-activity-state';
+ const failed = table.locator(`[${attr}="danger"]`);
+ await failed.waitFor();
+ assert.equal((await failed.textContent()).trim(), 'Error');
+ assert.ok(isRed(await colour(failed)), 'failed task red');
+ if (width !== 390) {
+ assert.equal(
+ await table.locator('[data-vsphere-activity-state-phone]').isVisible(),
+ false,
+ );
+ }
+ });
+ const dimensions = await page.evaluate(() => ({
+ width: innerWidth,
+ scroll: document.documentElement.scrollWidth,
+ }));
+ checks.push({
+ label: 'No horizontal page overflow',
+ passed: dimensions.scroll <= dimensions.width + 1,
+ dimensions,
+ });
+ checks.push({ label: 'No page errors', passed: errors.length === 0, errors });
+ const file = `${name}-truenas-vsphere.png`;
+ await page.screenshot({ path: path.join(output, file), fullPage: true });
+ screenshots.push({ file, engine: name, width });
+ results.push({ engine: name, width, checks });
+ await browser.close();
+ browser = undefined;
+ }
+ } finally {
+ if (browser) await browser.close();
+ await server.close();
+ }
+ const failures = results.flatMap((r) =>
+ r.checks.filter((c) => !c.passed).map((c) => ({ engine: r.engine, ...c })),
+ );
+ fs.writeFileSync(
+ path.join(output, 'result.json'),
+ JSON.stringify({ verified_at: new Date().toISOString(), results, screenshots }, null, 2),
+ );
+ console.log(
+ JSON.stringify({
+ checked: results.reduce((n, r) => n + r.checks.length, 0),
+ screenshots: screenshots.length,
+ failures,
+ }),
+ );
+ assert.equal(failures.length, 0, JSON.stringify(failures));
+})().catch((error) => {
+ console.error(error);
+ process.exitCode = 1;
+});
diff --git a/frontend-modern/browser-tests/truenas-vsphere-status-rows.html b/frontend-modern/browser-tests/truenas-vsphere-status-rows.html
new file mode 100644
index 0000000000..34a9a66ad5
--- /dev/null
+++ b/frontend-modern/browser-tests/truenas-vsphere-status-rows.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>TrueNAS and vSphere status rows verification</title>
+ </head>
+ <body>
+ <div id="root"></div>
+ <script type="module" src="./truenas-vsphere-status-rows.tsx"></script>
+ </body>
+</html>
diff --git a/frontend-modern/browser-tests/truenas-vsphere-status-rows.tsx b/frontend-modern/browser-tests/truenas-vsphere-status-rows.tsx
new file mode 100644
index 0000000000..8df45306d2
--- /dev/null
+++ b/frontend-modern/browser-tests/truenas-vsphere-status-rows.tsx
@@ -0,0 +1,197 @@
+// Synthetic resources through the production TrueNAS Apps and Shares tables and
+// the vSphere Activity table with app CSS. No real appliance, vCenter or
+// installed/released acceptance claim.
+import { createSignal } from 'solid-js';
+import { createStore } from 'solid-js/store';
+import { render } from 'solid-js/web';
+import { Router, Route } from '@solidjs/router';
+import { TrueNASAppsTable } from '../src/features/truenas/TrueNASAppsTable';
+import { TrueNASNetworkSharesTable } from '../src/features/truenas/TrueNASNetworkSharesTable';
+import { TrueNASServicesTable } from '../src/features/truenas/TrueNASServicesTable';
+import { buildTrueNASServiceRows } from '../src/features/truenas/truenasPageModel';
+import { VsphereActivityTable } from '../src/features/vmware/VsphereActivityTable';
+import { buildVmwareActivityRows } from '../src/features/vmware/vmwarePageModel';
+import { DarkModeContext, WebSocketContext } from '../src/contexts/appRuntime';
+import type { Resource } from '../src/types/resource';
+import { markSystemSettingsLoadedWithDefaults } from '../src/stores/systemSettings';
+import '../src/index.css';
+
+markSystemSettingsLoadedWithDefaults();
+
+const [wsState] = createStore({
+ resources: [] as Resource[],
+ lastUpdate: 0,
+ nodes: [],
+ pbs: [],
+ pmg: [],
+ vms: [],
+ containers: [],
+});
+const [connected] = createSignal(false);
+const ws = {
+ state: wsState,
+ connected,
+ initialDataReceived: () => true,
+ resourceChange: () => ({ version: 0, changedIds: null, changedKeys: null }),
+ activeAlerts: () => ({}),
+ shutdown: () => {},
+};
+window.__pulseWsStore = ws as any;
+
+const now = '2026-10-03T12:00:00Z';
+const truenas = (resource: Partial<Resource>): Resource =>
+ ({
+ status: 'online',
+ lastSeen: now,
+ platformType: 'truenas',
+ platformScopes: ['truenas'],
+ sourceType: 'api',
+ parentName: 'nas-primary',
+ ...resource,
+ }) as Resource;
+
+const system = truenas({
+ id: 'system-primary',
+ type: 'agent',
+ name: 'nas-primary',
+ displayName: 'nas-primary',
+ truenas: {
+ hostname: 'nas-primary',
+ version: 'TrueNAS-SCALE-24.10.2',
+ services: [
+ { id: '1', service: 'smb', enabled: true, state: 'RUNNING' },
+ { id: '2', service: 'smartd', enabled: true, state: 'STOPPED' },
+ ],
+ },
+});
+// statusFromApp / statusFromNetworkShare: CRASHED -> warning, disabled -> offline.
+const apps = [
+ truenas({
+ id: 'app-plex',
+ type: 'app-container',
+ name: 'plex',
+ status: 'warning',
+ truenas: { app: { id: 'plex', name: 'plex', state: 'CRASHED', containerCount: 1 } },
+ }),
+ truenas({
+ id: 'app-immich',
+ type: 'app-container',
+ name: 'immich',
+ status: 'online',
+ truenas: { app: { id: 'immich', name: 'immich', state: 'RUNNING', containerCount: 4 } },
+ }),
+];
+const shares = [
+ truenas({
+ id: 'share-archive',
+ type: 'network-share',
+ name: 'archive',
+ status: 'offline',
+ truenas: {
+ share: {
+ id: '1',
+ name: 'archive',
+ protocol: 'smb',
+ path: '/mnt/tank/archive',
+ enabled: false,
+ },
+ },
+ }),
+ truenas({
+ id: 'share-media',
+ type: 'network-share',
+ name: 'media',
+ status: 'warning',
+ truenas: {
+ share: {
+ id: '2',
+ name: 'media',
+ protocol: 'nfs',
+ path: '/mnt/tank/media',
+ enabled: true,
+ locked: true,
+ },
+ },
+ }),
+];
+const vm = {
+ id: 'vm-201',
+ type: 'vm',
+ name: 'warehouse-api-01',
+ displayName: 'warehouse-api-01',
+ status: 'online',
+ platformType: 'vmware-vsphere',
+ platformScopes: ['vmware-vsphere'],
+ sourceType: 'api',
+ vmware: { entityType: 'vm', managedObjectId: 'vm-201', connectionName: 'lab-vcenter' },
+ recentChanges: [
+ {
+ id: 'activity-task-reconfigure',
+ observedAt: now,
+ occurredAt: now,
+ resourceId: 'vm-201',
+ kind: 'activity',
+ sourceType: 'platform_event',
+ sourceAdapter: 'vmware_adapter',
+ confidence: 'high',
+ reason: 'Reconfigure virtual machine (error)',
+ metadata: {
+ activity_type: 'vmware_task',
+ activity_native_id: 'task-901',
+ activity_title: 'Reconfigure virtual machine',
+ activity_state: 'error',
+ activity_message: 'Permission denied while reconfiguring VM',
+ vmwareManagedObjectId: 'vm-201',
+ vmwareEntityType: 'vm',
+ },
+ },
+ ],
+} as unknown as Resource;
+
+function Fixture() {
+ const tableProps = {
+ emptyIcon: <span />,
+ emptyTitle: 'No fixture rows',
+ emptyDescription: 'No fixture rows',
+ showToolbar: false,
+ };
+ return (
+ <WebSocketContext.Provider value={ws as any}>
+ <DarkModeContext.Provider value={() => document.documentElement.classList.contains('dark')}>
+ <main class="min-h-screen space-y-4 bg-surface p-4 text-base-content">
+ <h1 class="text-lg font-semibold">TrueNAS and vSphere status rows</h1>
+ <p data-fixture-loaded>fixture ready</p>
+ <section aria-label="App table">
+ <TrueNASAppsTable apps={apps} scope={[system, ...apps]} {...tableProps} />
+ </section>
+ <section aria-label="Share table">
+ <TrueNASNetworkSharesTable
+ shares={shares}
+ scope={[system, ...shares]}
+ {...tableProps}
+ />
+ </section>
+ <section aria-label="Service table">
+ <TrueNASServicesTable services={buildTrueNASServiceRows([system])} {...tableProps} />
+ </section>
+ <section aria-label="Activity table">
+ <VsphereActivityTable
+ singleVcenter
+ activity={buildVmwareActivityRows([vm])}
+ {...tableProps}
+ />
+ </section>
+ </main>
+ </DarkModeContext.Provider>
+ </WebSocketContext.Provider>
+ );
+}
+
+render(
+ () => (
+ <Router>
+ <Route path="/*" component={Fixture} />
+ </Router>
+ ),
+ document.getElementById('root')!,
+);
diff --git a/frontend-modern/browser-verification/ed2a1362e8b8ed7a.json b/frontend-modern/browser-verification/ed2a1362e8b8ed7a.json
new file mode 100644
index 0000000000..302fb41cea
--- /dev/null
+++ b/frontend-modern/browser-verification/ed2a1362e8b8ed7a.json
@@ -0,0 +1,44 @@
+{
+ "version": 1,
+ "base_sha": "477a81e603792a131474e7c2f6b82ef197a99c11",
+ "verified_at": "2026-10-14T20:30:40Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/features/truenas/TrueNASAppsTable.tsx",
+ "frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx",
+ "frontend-modern/src/features/truenas/TrueNASServicesTable.tsx",
+ "frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx",
+ "frontend-modern/src/features/vmware/VsphereActivityTable.tsx"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/features/truenas/TrueNASAppsTable.tsx": "9440c10b1dcefe09d77d78d2dfbcbddfd07fcfd95c13053eb8c553607429f71d",
+ "frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx": "9efe5c1931c60f4c0a634ddf55e75fa50c7d9fa8a3e4cfdaae0178d6da4857ee",
+ "frontend-modern/src/features/truenas/TrueNASServicesTable.tsx": "371903d7b9fe96c51284398efffe9f54735c749b6d7fe0fa88318995e8dee226",
+ "frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx": "3884cbef89eabec3fec2d8fd936bc6c2ba34815d995f9400320aafc7b04ccf59",
+ "frontend-modern/src/features/vmware/VsphereActivityTable.tsx": "95de736ff751cc8c00125196f7681ac47776989b020a9c0308f836a88bab0fc0"
+ },
+ "routes": [
+ "browser-tests/truenas-vsphere-status-rows.html (production TrueNASAppsTable, TrueNASNetworkSharesTable, TrueNASServicesTable and VsphereActivityTable, Chromium and WebKit via Playwright 1.56.1 on pulse-dev, tree built on origin/main)"
+ ],
+ "viewports": [
+ {
+ "width": 1440,
+ "height": 900
+ },
+ {
+ "width": 390,
+ "height": 844
+ }
+ ],
+ "states": [
+ "TrueNAS app CRASHED: \"Crashed\" amber under the name beside its amber dot (old: no state words, hover only); running app \"Running\" plain",
+ "TrueNAS share disabled: State \"Disabled\" red; locked: \"Attention\" amber (old: plain)",
+ "TrueNAS service stopped while set to start at boot: red \"should be running\" note on desktop; on the phone \"Stopped \u00b7 should be running\" under the name (old: dot only)",
+ "vSphere task error: State \"Error\" red; phone reads it under the resource name",
+ "phone (dark WebKit) state lines for apps, shares, services and activity",
+ "reviewed by Sol from desktop and phone screenshots; its Apps fallback and Services/VMs phone-line points applied"
+ ],
+ "interactions": [
+ "page load at both widths"
+ ]
+}
diff --git a/frontend-modern/src/features/truenas/TrueNASAppsTable.tsx b/frontend-modern/src/features/truenas/TrueNASAppsTable.tsx
index 83da658544..34eb2c34b1 100644
--- a/frontend-modern/src/features/truenas/TrueNASAppsTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASAppsTable.tsx
@@ -26,6 +26,7 @@ import {
PlatformTableShell,
withPlatformStatusCounts,
} from '@/features/platformPage/sharedPlatformPage';
+import { getPlatformStatusTextToneClass } from '@/features/platformPage/platformStatusTone';
import {
PlatformResourceDetailToggleButton,
PlatformResourceDetailTableRow,
@@ -379,6 +380,15 @@ export const TrueNASAppsTable: Component<{
>
{name()}
</div>
+ {/* The app has no State column: its state reads under the name,
+ in its dot's colour, so a crashed app says so without a hover. */}
+ <div
+ class={`truncate text-[11px] ${getPlatformStatusTextToneClass(indicator().variant)}`}
+ data-truenas-app-state={indicator().variant}
+ >
+ {formatPlatformTableTitleCaseValue(app()?.state, '') ||
+ indicator().label}
+ </div>
</div>
</div>
</TableCell>
diff --git a/frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx b/frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx
index 78e15a1cc5..9a1905c6fa 100644
--- a/frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASNetworkSharesTable.tsx
@@ -19,6 +19,7 @@ import {
PlatformTableShell,
withPlatformStatusCounts,
} from '@/features/platformPage/sharedPlatformPage';
+import { getPlatformStatusTextToneClass } from '@/features/platformPage/platformStatusTone';
import {
PlatformResourceDetailToggleButton,
PlatformResourceDetailTableRow,
@@ -287,6 +288,13 @@ export const TrueNASNetworkSharesTable: Component<{
>
{name()}
</div>
+ {/* A phone hides State; the same words read under the name. */}
+ <span
+ class={`platform-table-phone-only-inline max-w-full text-[11px] ${getPlatformStatusTextToneClass(indicator().variant)}`}
+ data-truenas-share-state-phone={indicator().variant}
+ >
+ <span class="min-w-0 truncate">{stateLabel()}</span>
+ </span>
</div>
</div>
</TableCell>
@@ -320,7 +328,10 @@ export const TrueNASNetworkSharesTable: Component<{
<TableCell
class={`${getPlatformTableCellClassForKind('badge')} platform-table-phone-hidden`}
>
- <span class="text-[11px] font-medium text-base-content">
+ <span
+ class={`text-[11px] font-medium ${getPlatformStatusTextToneClass(indicator().variant) || 'text-base-content'}`}
+ data-truenas-share-state={indicator().variant}
+ >
{stateLabel()}
</span>
</TableCell>
diff --git a/frontend-modern/src/features/truenas/TrueNASServicesTable.tsx b/frontend-modern/src/features/truenas/TrueNASServicesTable.tsx
index ae8ae9accf..12ce3b9b22 100644
--- a/frontend-modern/src/features/truenas/TrueNASServicesTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASServicesTable.tsx
@@ -18,6 +18,7 @@ import {
PlatformTableShell,
withPlatformStatusCounts,
} from '@/features/platformPage/sharedPlatformPage';
+import { getPlatformStatusTextToneClass } from '@/features/platformPage/platformStatusTone';
import {
PlatformResourceDetailToggleButton,
createPlatformResourceDetailState,
@@ -105,11 +106,6 @@ const serviceConditionLabel = (row: TrueNASServiceRow): string | null => {
return note.short.charAt(0).toUpperCase() + note.short.slice(1);
};
-const SERVICE_STATE_NOTE_CLASS: Record<ServiceStateNote['tone'], string> = {
- danger: 'text-red-600 dark:text-red-300',
- warning: 'text-amber-700 dark:text-amber-300',
-};
-
const serviceStatusVariant = (
status: Exclude<TrueNASServiceStatusFilter, 'all'>,
): 'success' | 'warning' | 'danger' | 'muted' => {
@@ -350,8 +346,21 @@ export const TrueNASServicesTable: Component<{
variant={serviceStatusVariant(status())}
title={formatPlatformTableTitleCaseValue(status())}
/>
- <div class="min-w-0 truncate font-medium text-base-content">
- {formatServiceName(row.service.service)}
+ <div class="flex min-w-0 flex-col">
+ <div class="min-w-0 truncate font-medium text-base-content">
+ {formatServiceName(row.service.service)}
+ </div>
+ {/* A phone hides State; the state and any note read under the name. */}
+ <span
+ class={`platform-table-phone-only-inline max-w-full text-[11px] ${note() ? getPlatformStatusTextToneClass(note()!.tone) : ''}`}
+ data-truenas-service-state-phone={note() ? note()!.tone : 'none'}
+ >
+ <span class="min-w-0 truncate">
+ {[formatPlatformTableTitleCaseValue(rawState()), note()?.short]
+ .filter(Boolean)
+ .join(' · ')}
+ </span>
+ </span>
</div>
</div>
</TableCell>
@@ -369,7 +378,7 @@ export const TrueNASServicesTable: Component<{
<Show when={note()?.short}>
{(short) => (
<span
- class={`min-w-0 truncate text-[11px] font-medium ${SERVICE_STATE_NOTE_CLASS[note()!.tone]}`}
+ class={`min-w-0 truncate text-[11px] font-medium ${getPlatformStatusTextToneClass(note()!.tone)}`}
>
{short()}
</span>
diff --git a/frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx b/frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx
index 59c13517e9..ea157d36f1 100644
--- a/frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASVirtualMachinesTable.tsx
@@ -20,6 +20,7 @@ import {
PlatformTableShell,
withPlatformStatusCounts,
} from '@/features/platformPage/sharedPlatformPage';
+import { getPlatformStatusTextToneClass } from '@/features/platformPage/platformStatusTone';
import {
PlatformResourceDetailToggleButton,
PlatformResourceDetailTableRow,
@@ -99,11 +100,6 @@ const vmStateNote = (resource: Resource): VMStateNote | null => {
};
};
-const VM_STATE_NOTE_CLASS: Record<VMStateNote['tone'], string> = {
- danger: 'text-red-600 dark:text-red-300',
- warning: 'text-amber-700 dark:text-amber-300',
-};
-
// Columns a user can sort by. Flags summarize several values at once, so they
// carry no single scalar to order on. CPU orders on the provisioned vCPU count
// (cores × threads when vCPUs are not reported) and Memory on the provisioned
@@ -315,6 +311,15 @@ export const TrueNASVirtualMachinesTable: Component<{
>
{name()}
</div>
+ {/* A phone hides State; the state and any note read under the name. */}
+ <span
+ class={`platform-table-phone-only-inline max-w-full text-[11px] ${note() ? getPlatformStatusTextToneClass(note()!.tone) : ''}`}
+ data-truenas-vm-state-phone={note() ? note()!.tone : 'none'}
+ >
+ <span class="min-w-0 truncate">
+ {[stateLabel(), note()?.short].filter(Boolean).join(' · ')}
+ </span>
+ </span>
</div>
</div>
</TableCell>
@@ -332,7 +337,7 @@ export const TrueNASVirtualMachinesTable: Component<{
<Show when={note()?.short}>
{(short) => (
<span
- class={`min-w-0 truncate text-[11px] font-medium ${VM_STATE_NOTE_CLASS[note()!.tone]}`}
+ class={`min-w-0 truncate text-[11px] font-medium ${getPlatformStatusTextToneClass(note()!.tone)}`}
>
{short()}
</span>
diff --git a/frontend-modern/src/features/truenas/__tests__/TrueNASServicesTable.test.tsx b/frontend-modern/src/features/truenas/__tests__/TrueNASServicesTable.test.tsx
index 85099041bc..cce272d628 100644
--- a/frontend-modern/src/features/truenas/__tests__/TrueNASServicesTable.test.tsx
+++ b/frontend-modern/src/features/truenas/__tests__/TrueNASServicesTable.test.tsx
@@ -110,14 +110,21 @@ describe('TrueNASServicesTable', () => {
expect(noteFor('SMB')).toBeNull();
expect(noteFor('NFS')).toHaveAttribute('title', 'TrueNAS reports Crashed');
expect(noteFor('NFS')).toHaveAttribute('data-truenas-service-state-note', 'warning');
- const smartNameCell = screen.getByText('SMART').closest('td');
- expect(smartNameCell).not.toHaveTextContent('should be running');
+ // On desktop the name cell stays single-line: the note under the name is
+ // the phone line alone, shown where the State column is hidden.
+ const smartNameCell = screen.getByText('SMART').closest('td')!;
+ const smartPhoneLine = smartNameCell.querySelector('[data-truenas-service-state-phone]');
+ expect(smartPhoneLine).toHaveClass('platform-table-phone-only-inline', 'text-red-600');
+ expect(smartPhoneLine).toHaveTextContent('Stopped · should be running');
+ const smartNameText = smartNameCell.cloneNode(true) as HTMLElement;
+ smartNameText.querySelector('[data-truenas-service-state-phone]')?.remove();
+ expect(smartNameText).not.toHaveTextContent('should be running');
const headers = [...container.querySelectorAll('thead th')].map((th) => th.textContent?.trim());
expect(headers).toEqual(['Service', 'State', 'Boot', 'System']);
expect(container).not.toHaveTextContent('2418');
- // Phones hide the State column, so the drawer carries the condition.
+ // The drawer carries the full condition too.
await fireEvent.click(screen.getByText('SMART').closest('tr')!);
const detail = within(screen.getByTestId('truenas-service-detail'));
expect(detail.getByText('Condition')).toBeInTheDocument();
diff --git a/frontend-modern/src/features/truenas/__tests__/TrueNASVirtualMachinesTable.test.tsx b/frontend-modern/src/features/truenas/__tests__/TrueNASVirtualMachinesTable.test.tsx
index 33b4b696fb..2fea127dd5 100644
--- a/frontend-modern/src/features/truenas/__tests__/TrueNASVirtualMachinesTable.test.tsx
+++ b/frontend-modern/src/features/truenas/__tests__/TrueNASVirtualMachinesTable.test.tsx
@@ -55,6 +55,10 @@ describe('TrueNASVirtualMachinesTable', () => {
expect(noteFor('router')).toHaveTextContent('Stoppedshould be running');
expect(noteFor('router')).toHaveAttribute('title', 'Set to start at boot but stopped');
+ // A phone hides State, so the state and its note read under the name there.
+ expect(
+ screen.getByText('router').closest('td')?.querySelector('[data-truenas-vm-state-phone]'),
+ ).toHaveTextContent('Stopped · should be running');
expect(noteFor('ubuntu-build')).toBeNull();
expect(noteFor('windows-lab')).toBeNull();
expect(noteFor('lab-paused')).toHaveAttribute('title', 'TrueNAS reports Paused');
diff --git a/frontend-modern/src/features/vmware/VsphereActivityTable.tsx b/frontend-modern/src/features/vmware/VsphereActivityTable.tsx
index 229698a9d9..6f5e6ace3a 100644
--- a/frontend-modern/src/features/vmware/VsphereActivityTable.tsx
+++ b/frontend-modern/src/features/vmware/VsphereActivityTable.tsx
@@ -26,6 +26,7 @@ import {
PlatformTableShell,
withPlatformStatusCounts,
} from '@/features/platformPage/sharedPlatformPage';
+import { getPlatformStatusTextToneClass } from '@/features/platformPage/platformStatusTone';
import {
PlatformResourceDetailToggleButton,
createPlatformResourceDetailState,
@@ -428,6 +429,17 @@ export const VsphereActivityTable: Component<{
>
{activity.resourceName}
</div>
+ {/* A phone hides State; the same words read under the name. */}
+ <span
+ class={`platform-table-phone-only-inline max-w-full text-[11px] ${getPlatformStatusTextToneClass(activityStateVariant(activity.stateBucket))}`}
+ data-vsphere-activity-state-phone={activityStateVariant(
+ activity.stateBucket,
+ )}
+ >
+ <span class="min-w-0 truncate">
+ {formatActivityState(activity)}
+ </span>
+ </span>
</div>
</div>
</TableCell>
@@ -454,7 +466,12 @@ export const VsphereActivityTable: Component<{
<TableCell
class={`${getPlatformTableCellClassForKind('badge')} platform-table-phone-hidden`}
>
- <span class="text-[11px] font-semibold text-base-content">
+ <span
+ class={`text-[11px] font-semibold ${getPlatformStatusTextToneClass(activityStateVariant(activity.stateBucket)) || 'text-base-content'}`}
+ data-vsphere-activity-state={activityStateVariant(
+ activity.stateBucket,
+ )}
+ >
{formatActivityState(activity)}
</span>
</TableCell>
diff --git a/frontend-modern/src/features/vmware/__tests__/VsphereActivityTable.test.tsx b/frontend-modern/src/features/vmware/__tests__/VsphereActivityTable.test.tsx
index 20f33fbf57..0a21f4ea49 100644
--- a/frontend-modern/src/features/vmware/__tests__/VsphereActivityTable.test.tsx
+++ b/frontend-modern/src/features/vmware/__tests__/VsphereActivityTable.test.tsx
@@ -104,7 +104,15 @@ describe('VsphereActivityTable', () => {
expect(
screen.getByTitle('Reconfigure virtual machine · Permission denied while reconfiguring VM'),
).toBeInTheDocument();
- expect(screen.getByText('Error')).toBeInTheDocument();
+ // The State column and the phone line under the name both read "Error",
+ // in the red its dot shows.
+ const state = document.querySelector('[data-vsphere-activity-state="danger"]');
+ expect(state).toHaveTextContent('Error');
+ expect(state).toHaveClass('text-red-600');
+ expect(document.querySelector('[data-vsphere-activity-state-phone="danger"]')).toHaveClass(
+ 'platform-table-phone-only-inline',
+ 'text-red-600',
+ );
expect(screen.getByText('Virtual machine warehouse-api-01 was powered on')).toBeInTheDocument();
expect(screen.queryByText('VmPoweredOnEvent')).not.toBeInTheDocument();
expect(screen.getByText('[email protected]')).toBeInTheDocument();