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.

Split TrueNAS API inventory into native tabs

rcourtmancb461a730479
diff --git a/frontend-modern/src/features/truenas/TrueNASPageSurface.tsx b/frontend-modern/src/features/truenas/TrueNASPageSurface.tsx
index 59101696af..9c5aac0f0d 100644
--- a/frontend-modern/src/features/truenas/TrueNASPageSurface.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASPageSurface.tsx
@@ -90,6 +90,15 @@ export function TrueNASPageSurface() {
<Show when={activeTab() === 'storage'}>
<TrueNASStorage model={model} />
</Show>
+ <Show when={activeTab() === 'apps'}>
+ <TrueNASApps model={model} />
+ </Show>
+ <Show when={activeTab() === 'vms'}>
+ <TrueNASVMs model={model} />
+ </Show>
+ <Show when={activeTab() === 'shares'}>
+ <TrueNASShares model={model} />
+ </Show>
<Show when={activeTab() === 'protection'}>
<TrueNASProtection />
</Show>
@@ -116,6 +125,42 @@ function TrueNASStorage(props: TrueNASOverviewProps) {
);
}
+function TrueNASApps(props: TrueNASOverviewProps) {
+ return (
+ <TrueNASAppsTable
+ apps={props.model().apps}
+ scope={props.model().resources}
+ emptyIcon={truenasIcon()}
+ emptyTitle="No TrueNAS apps"
+ emptyDescription="Apps appear here once the TrueNAS API reports app.query inventory."
+ />
+ );
+}
+
+function TrueNASVMs(props: TrueNASOverviewProps) {
+ return (
+ <TrueNASVirtualMachinesTable
+ vms={props.model().vms}
+ scope={props.model().resources}
+ emptyIcon={truenasIcon()}
+ emptyTitle="No TrueNAS VMs"
+ emptyDescription="VMs appear here once the TrueNAS API reports vm.query inventory."
+ />
+ );
+}
+
+function TrueNASShares(props: TrueNASOverviewProps) {
+ return (
+ <TrueNASNetworkSharesTable
+ shares={props.model().shares}
+ scope={props.model().resources}
+ emptyIcon={truenasIcon()}
+ emptyTitle="No TrueNAS shares"
+ emptyDescription="Shares appear here once the TrueNAS API reports SMB or NFS sharing inventory."
+ />
+ );
+}
+
function TrueNASProtection() {
const recoveryPoints = useRecoveryPoints(() => ({
platform: TRUENAS_PLATFORM_FILTER,
@@ -156,33 +201,6 @@ function TrueNASOverview(props: TrueNASOverviewProps) {
emptyDescription="TrueNAS health alerts appear here when the TrueNAS API reports active system, pool, or disk incidents."
/>
</Show>
- <Show when={props.model().shares.length > 0}>
- <TrueNASNetworkSharesTable
- shares={props.model().shares}
- scope={props.model().resources}
- emptyIcon={truenasIcon()}
- emptyTitle="No TrueNAS shares"
- emptyDescription="Shares appear here once the TrueNAS API reports SMB or NFS sharing inventory."
- />
- </Show>
- <Show when={props.model().vms.length > 0}>
- <TrueNASVirtualMachinesTable
- vms={props.model().vms}
- scope={props.model().resources}
- emptyIcon={truenasIcon()}
- emptyTitle="No TrueNAS VMs"
- emptyDescription="VMs appear here once the TrueNAS API reports vm.query inventory."
- />
- </Show>
- <Show when={props.model().apps.length > 0}>
- <TrueNASAppsTable
- apps={props.model().apps}
- scope={props.model().resources}
- emptyIcon={truenasIcon()}
- emptyTitle="No TrueNAS apps"
- emptyDescription="Apps appear here once the TrueNAS API reports app.query inventory."
- />
- </Show>
</div>
);
}
diff --git a/frontend-modern/src/features/truenas/__tests__/truenasPageModel.test.ts b/frontend-modern/src/features/truenas/__tests__/truenasPageModel.test.ts
index 489a0ff4ab..ae88360d38 100644
--- a/frontend-modern/src/features/truenas/__tests__/truenasPageModel.test.ts
+++ b/frontend-modern/src/features/truenas/__tests__/truenasPageModel.test.ts
@@ -45,8 +45,15 @@ const makeRecoveryPoint = (
});
describe('truenasPageModel', () => {
- it('declares the TrueNAS section set as Overview + Storage + Protection', () => {
- expect(TRUENAS_TAB_SPECS.map((tab) => tab.id)).toEqual(['overview', 'storage', 'protection']);
+ it('declares the native TrueNAS section set around API facets', () => {
+ expect(TRUENAS_TAB_SPECS.map((tab) => tab.id)).toEqual([
+ 'overview',
+ 'storage',
+ 'apps',
+ 'vms',
+ 'shares',
+ 'protection',
+ ]);
});
it('buckets systems, workloads, and native storage inventory by TrueNAS API facet', () => {
diff --git a/frontend-modern/src/features/truenas/truenasPageModel.ts b/frontend-modern/src/features/truenas/truenasPageModel.ts
index 6c4bc0abde..443b8a213b 100644
--- a/frontend-modern/src/features/truenas/truenasPageModel.ts
+++ b/frontend-modern/src/features/truenas/truenasPageModel.ts
@@ -3,7 +3,7 @@ import { asTrimmedString } from '@/utils/stringUtils';
import type { Resource, ResourceIncident, ResourceType } from '@/types/resource';
import type { RecoveryPoint } from '@/types/recovery';
-export type TrueNASPageTabId = 'overview' | 'storage' | 'protection';
+export type TrueNASPageTabId = 'overview' | 'storage' | 'apps' | 'vms' | 'shares' | 'protection';
export type TrueNASAppStatusFilter = 'all' | 'running' | 'attention' | 'stopped';
export type TrueNASVMStatusFilter = 'all' | 'running' | 'attention' | 'stopped';
export type TrueNASShareStatusFilter = 'all' | 'active' | 'attention' | 'disabled';
@@ -24,14 +24,17 @@ export type TrueNASTabSpec = {
path: string;
};
-// The Overview tab is intentionally narrow: appliance systems first, then
-// native workload inventory when present. Storage inventory, pool topology, and
-// physical disks all live on the Storage tab, while snapshots and replication
-// live on the Protection tab through a TrueNAS-native presentation over the
-// canonical recovery points contract.
+// The Overview tab is intentionally narrow: appliance systems and active
+// health signals. Native API inventory has first-class homes: Storage for
+// pools, datasets, and disks; Apps, VMs, and Shares for their TrueNAS API
+// facets; and Protection for snapshots and replication over the canonical
+// recovery points contract.
export const TRUENAS_TAB_SPECS: readonly TrueNASTabSpec[] = [
{ id: 'overview', label: 'Overview', path: '/truenas/overview' },
{ id: 'storage', label: 'Storage', path: '/truenas/storage' },
+ { id: 'apps', label: 'Apps', path: '/truenas/apps' },
+ { id: 'vms', label: 'VMs', path: '/truenas/vms' },
+ { id: 'shares', label: 'Shares', path: '/truenas/shares' },
{ id: 'protection', label: 'Protection', path: '/truenas/protection' },
] as const;
diff --git a/frontend-modern/src/routing/__tests__/resourceLinks.test.ts b/frontend-modern/src/routing/__tests__/resourceLinks.test.ts
index 0ad1a41ff8..862e0b603a 100644
--- a/frontend-modern/src/routing/__tests__/resourceLinks.test.ts
+++ b/frontend-modern/src/routing/__tests__/resourceLinks.test.ts
@@ -55,6 +55,9 @@ describe('resource link routing contract', () => {
expect(TRUENAS_PATH).toBe('/truenas');
expect(buildTrueNASPath()).toBe('/truenas/overview');
expect(buildTrueNASPath('storage')).toBe('/truenas/storage');
+ expect(buildTrueNASPath('apps')).toBe('/truenas/apps');
+ expect(buildTrueNASPath('vms')).toBe('/truenas/vms');
+ expect(buildTrueNASPath('shares')).toBe('/truenas/shares');
expect(buildTrueNASPath('protection')).toBe('/truenas/protection');
expect(VMWARE_PATH).toBe('/vmware');
diff --git a/tests/integration/tests/68-platform-pages-shell.spec.ts b/tests/integration/tests/68-platform-pages-shell.spec.ts
index 134823c2db..2c634cdd81 100644
--- a/tests/integration/tests/68-platform-pages-shell.spec.ts
+++ b/tests/integration/tests/68-platform-pages-shell.spec.ts
@@ -75,11 +75,28 @@ const PLATFORM_PAGES: readonly PlatformPageCase[] = [
rootPath: '/truenas',
testId: 'truenas-page',
ariaLabel: 'TrueNAS sections',
- tabPaths: ['/truenas/overview', '/truenas/storage', '/truenas/protection'],
- populatedTabPaths: ['/truenas/overview', '/truenas/storage', '/truenas/protection'],
+ tabPaths: [
+ '/truenas/overview',
+ '/truenas/storage',
+ '/truenas/apps',
+ '/truenas/vms',
+ '/truenas/shares',
+ '/truenas/protection',
+ ],
+ populatedTabPaths: [
+ '/truenas/overview',
+ '/truenas/storage',
+ '/truenas/apps',
+ '/truenas/vms',
+ '/truenas/shares',
+ '/truenas/protection',
+ ],
populatedRowSelectors: {
'/truenas/overview': '[data-truenas-system-row]',
'/truenas/storage': '[data-truenas-storage-row]',
+ '/truenas/apps': '[data-truenas-app-row]',
+ '/truenas/vms': '[data-truenas-vm-row]',
+ '/truenas/shares': '[data-truenas-share-row]',
'/truenas/protection': '[data-truenas-protection-row]',
},
},
@@ -192,6 +209,9 @@ test.describe('Platform pages shell', () => {
{ path: '/kubernetes/deployments', testId: 'kubernetes-page' },
{ path: '/truenas/overview', testId: 'truenas-page' },
{ path: '/truenas/storage', testId: 'truenas-page' },
+ { path: '/truenas/apps', testId: 'truenas-page' },
+ { path: '/truenas/vms', testId: 'truenas-page' },
+ { path: '/truenas/shares', testId: 'truenas-page' },
{ path: '/truenas/protection', testId: 'truenas-page' },
{ path: '/vmware/overview', testId: 'vmware-page' },
{ path: '/vmware/vms', testId: 'vmware-page' },