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.

Auto-expand vSphere drawer section on platform pages

rcourtman9008e5f45e83
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
index ddd29b865b..0192e2833c 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
@@ -21,6 +21,7 @@ interface ResourceDetailDrawerProps {
presentation?: ResourceDetailDrawerPresentation;
resolveResourceLabel?: (resourceId: string) => string | null | undefined;
initialShowTrueNASDetails?: boolean;
+ initialShowVMwareDetails?: boolean;
}
const TabAvailabilityNotice: Component<{ message: string }> = (props) => (
@@ -50,6 +51,7 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
presentation: presentation(),
resolveResourceLabel: props.resolveResourceLabel,
initialShowTrueNASDetails: props.initialShowTrueNASDetails,
+ initialShowVMwareDetails: props.initialShowVMwareDetails,
});
const headingId = () => `resource-detail-drawer-heading-${props.resource.id}`;
@@ -273,6 +275,7 @@ export const ResourceDetailDrawer: Component<ResourceDetailDrawerProps> = (props
presentation={props.presentation}
resolveResourceLabel={props.resolveResourceLabel}
initialShowTrueNASDetails={props.initialShowTrueNASDetails}
+ initialShowVMwareDetails={props.initialShowVMwareDetails}
/>
);
};
diff --git a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerVmwareModel.ts b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerVmwareModel.ts
index 0a25f87eeb..cb7d5061a9 100644
--- a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerVmwareModel.ts
+++ b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerVmwareModel.ts
@@ -1,4 +1,5 @@
import type {
+ Resource,
ResourceType,
ResourceVMwareBootDevice,
ResourceVMwareHardware,
@@ -754,3 +755,6 @@ export const buildVMwareDetailSections = (
return sections.filter((section) => hasRows(section.rows));
};
+
+export const hasVMwareDetailSections = (resource: Resource): boolean =>
+ buildVMwareDetailSections(resource.type, resource.vmware).length > 0;
diff --git a/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts b/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts
index 777415977b..3d3a039834 100644
--- a/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts
+++ b/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts
@@ -13,6 +13,7 @@ export interface UseResourceDetailDrawerStateOptions {
resolveResourceLabel?: (resourceId: string) => string | null | undefined;
presentation?: ResourceDetailDrawerPresentation;
initialShowTrueNASDetails?: boolean;
+ initialShowVMwareDetails?: boolean;
}
export const useResourceDetailDrawerState = (options: UseResourceDetailDrawerStateOptions) => {
@@ -27,7 +28,9 @@ export const useResourceDetailDrawerState = (options: UseResourceDetailDrawerSta
const [showDiscoveryContext, setShowDiscoveryContext] = createSignal(false);
const [showHostDetails, setShowHostDetails] = createSignal(false);
const [showServiceDetails, setShowServiceDetails] = createSignal(false);
- const [showVMwareDetails, setShowVMwareDetails] = createSignal(false);
+ const [showVMwareDetails, setShowVMwareDetails] = createSignal(
+ options.initialShowVMwareDetails === true,
+ );
const [showTrueNASDetails, setShowTrueNASDetails] = createSignal(
options.initialShowTrueNASDetails === true,
);
diff --git a/frontend-modern/src/features/platformPage/PlatformResourceDetailTableRow.tsx b/frontend-modern/src/features/platformPage/PlatformResourceDetailTableRow.tsx
index c9bb6b1a22..469214b1a7 100644
--- a/frontend-modern/src/features/platformPage/PlatformResourceDetailTableRow.tsx
+++ b/frontend-modern/src/features/platformPage/PlatformResourceDetailTableRow.tsx
@@ -1,6 +1,7 @@
import { Show, createSignal, type Component, type JSX } from 'solid-js';
import { ResourceDetailDrawer } from '@/components/Infrastructure/ResourceDetailDrawer';
import { hasTrueNASDetailSections } from '@/components/Infrastructure/resourceDetailDrawerTrueNASModel';
+import { hasVMwareDetailSections } from '@/components/Infrastructure/resourceDetailDrawerVmwareModel';
import { TableCell, TableRow } from '@/components/shared/Table';
import type { Resource } from '@/types/resource';
import { getPreferredInfrastructureDisplayName } from '@/utils/resourceIdentity';
@@ -71,10 +72,13 @@ export const PlatformResourceDetailTableRow: Component<{
colSpan: number;
resolveResourceLabel?: (resourceId: string) => string | null | undefined;
initialShowTrueNASDetails?: boolean;
+ initialShowVMwareDetails?: boolean;
onClose?: () => void;
}> = (props) => {
const initialShowTrueNASDetails = () =>
props.initialShowTrueNASDetails ?? hasTrueNASDetailSections(props.resource);
+ const initialShowVMwareDetails = () =>
+ props.initialShowVMwareDetails ?? hasVMwareDetailSections(props.resource);
return (
<Show when={props.open}>
@@ -93,6 +97,7 @@ export const PlatformResourceDetailTableRow: Component<{
presentation="table-row"
resolveResourceLabel={props.resolveResourceLabel}
initialShowTrueNASDetails={initialShowTrueNASDetails()}
+ initialShowVMwareDetails={initialShowVMwareDetails()}
onClose={props.onClose}
/>
</div>