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.

Improve object drawer information hierarchy

rcourtman9e622c291d49
diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.md
index c4196981c8..1f010e1aac 100644
--- a/docs/release-control/v6/internal/subsystems/alerts.md
+++ b/docs/release-control/v6/internal/subsystems/alerts.md
@@ -1744,6 +1744,19 @@ and `pulse-no-alerts` bulk rules remain compatible inputs and do not create a
second per-resource state store. `internal/alerts/intent_policy_test.go` pins
factory operator-state evaluation, writer gating, and active reconciliation.
+### Object drawers expose the active problem across identity aliases
+
+An object drawer with active alerts must show the exact problem in its default
+Overview, not only an alert accent or aggregate status already present in the
+table row. Frontend matching accepts a bounded ordered set containing the
+canonical resource id and provider-authored, metrics-target, alias, and
+superseded identities. The same candidate set drives row alert decoration and
+drawer message selection so opening a highlighted object cannot lose the alert
+because the provider stream and unified-resource projection use different
+keys. This is a read-only projection of the existing active-alert map; it does
+not create alert truth, change acknowledgement, or add a detector or delivery
+path.
+
### Large alert collections stay continuously scrollable
Resource alert tables, active-alert lists, incident timelines, and resolved
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index c78b37d759..e3c0536e7e 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -3592,6 +3592,21 @@ owns canonical metadata-id and discovery-hostname derivation. Future
infrastructure-details-drawer work should extend those owners instead of
pushing tab state or resource-identity normalization back into the shared
shell.
+Object detail drawers follow one operator-first information hierarchy across
+platform implementations. Overview must begin with `DrawerAttentionSection`
+when active alert or health evidence exists and show the actual problem text,
+not only repeat a coloured status. The remaining Overview rows are additive
+operator context that the parent table row cannot carry, such as OS/runtime,
+Pulse observation or action coverage, primary reachability, protection gaps,
+pending updates, or an identified service. Routine health, placement, and
+metric values already visible in the row must not be restated merely to fill
+the drawer. `TechnicalDetailsDisclosure` owns the collapsed, lazily mounted
+inventory boundary for raw IDs, kernel/build strings, full interface and disk
+lists, and provider metadata. Monitoring mode, lifecycle, notes, maintenance,
+automatic-action policy, saved access configuration, and action audit belong
+to a dedicated `Manage` tab and must not render inside Overview. Guest, node,
+Docker-host, and unified-resource drawers must compose these shared primitives
+instead of defining provider-local attention or technical disclosure shells.
The shared interactive sparkline now follows that same split.
`frontend-modern/src/components/shared/InteractiveSparkline.tsx` stays the
render shell, `frontend-modern/src/components/shared/useInteractiveSparklineState.ts`
@@ -3860,7 +3875,7 @@ linked resource names, or duplicated new-tab safety handling for that launch
affordance.
Docker host rows follow the same primitive-owned contract end to end.
`DockerHostsTable.tsx` composes `ResourceNameWithWebInterfaceLink` beside the
-inert host name, while the host drawer's Overview access surface embeds
+inert host name, while the host drawer's Manage access surface embeds
`WebInterfaceUrlField` with `metadataKind="docker-host"` and the stable host
source id. The drawer must return saved URL changes to its owning table row so
the adjacent launch control updates immediately; neither the table nor drawer
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
index 2c063c18fc..63f07c0da3 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -1357,6 +1357,15 @@ The Proxmox node drawer overview should follow the existing guest drawer
compact detail-card pattern and expose node-specific context such as platform,
kernel, hardware, raw capacity, telemetry, and thermal facts rather than
repeating the metric cells already visible in the grouped table row.
+Object drawers across workload, node, Docker, and unified-resource surfaces
+must keep their default render bounded to active attention plus a small
+additive context projection. Full inventory and provider-specific support
+tables remain lazy behind collapsed technical disclosures, while operator
+policy, update actions, and saved access mount only after the Manage tab is
+selected. Alert lookup may consume the already-loaded active-alert map through
+the resource's bounded canonical/provider identity candidate list; it must not
+add a per-drawer fetch, rescan the workload inventory, or eagerly mount hidden
+technical sections.
The investigation enrichment path in `MaybeInvestigateFinding`
adds at most one operator-state projection lookup per investigation
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index b3573a0e72..30c86e363f 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -4646,3 +4646,16 @@ to that boolean. Identity succession continues to rekey the same state row.
`resource_operator_state_policy_test.go` pin normalization, validation,
round-trip persistence, attention suppression, and the retired remediation
lock.
+
+### Canonical object drawer hierarchy
+
+The unified resource drawer is the shared operator-facing detail contract for
+provider resources. Its default Overview begins with exact active-alert
+messages for every canonical, provider, alias, or superseded identity that can
+name the resource, then shows only bounded context not already present in the
+expanded table row. Raw identity/runtime fields and provider, service, or host
+support tables remain collapsed and lazy under Technical details and Platform
+details. Operator overrides, lifecycle policy, update actions, audit controls,
+and saved web access belong to Manage. Provider pages may supply typed detail
+models, but they must not create a provider-local drawer hierarchy or promote
+metadata into Overview solely because it exists.
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index 21cb243686..098a49c732 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,33 +1,87 @@
{
"version": 1,
- "base_sha": "78be1b1c2a33c6d5df87bc08098c4ef67132070f",
- "verified_at": "2026-08-24T10:59:15Z",
+ "base_sha": "a73abe909caceee084e647b959f9adae9a355bb3",
+ "verified_at": "2026-08-24T11:27:51Z",
"result": "passed",
- "changed_paths": ["frontend-modern/src/components/Workloads/GuestRowCells.tsx"],
+ "changed_paths": [
+ "frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx",
+ "frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx",
+ "frontend-modern/src/components/Infrastructure/ResourceDetailDrawerSupportDisclosure.tsx",
+ "frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx",
+ "frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts",
+ "frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts",
+ "frontend-modern/src/components/Workloads/GuestDrawer.tsx",
+ "frontend-modern/src/components/Workloads/GuestDrawerManage.tsx",
+ "frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx",
+ "frontend-modern/src/components/Workloads/NodeDrawer.tsx",
+ "frontend-modern/src/components/Workloads/NodeDrawerOverview.tsx",
+ "frontend-modern/src/components/Workloads/WorkloadPanel.tsx",
+ "frontend-modern/src/components/Workloads/guestDrawerModel.ts",
+ "frontend-modern/src/components/shared/DetailSectionTable.tsx",
+ "frontend-modern/src/components/shared/DrawerAttentionSection.tsx",
+ "frontend-modern/src/components/shared/TechnicalDetailsDisclosure.tsx",
+ "frontend-modern/src/components/shared/detailSectionModel.ts",
+ "frontend-modern/src/features/alerts/alertOverridesModel.ts",
+ "frontend-modern/src/features/docker/DockerHostDrawer.tsx",
+ "frontend-modern/src/features/docker/DockerHostDrawerOverview.tsx",
+ "frontend-modern/src/features/platformPage/PlatformResourceDetailTableRow.tsx",
+ "frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx",
+ "frontend-modern/src/hooks/useWorkloads.ts",
+ "frontend-modern/src/types/workloads.ts",
+ "frontend-modern/src/utils/alerts.ts",
+ "frontend-modern/src/utils/workloadGuestPresentation.ts"
+ ],
"content_sha256": {
- "frontend-modern/src/components/Workloads/GuestRowCells.tsx": "e745e1cf5875af055c2846b5ae4638be5a71ab6c08a5333b99cf700c6c05b806"
+ "frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx": "8d759c4043eca6ffc4353e478e8ecc9117eb5cac0ee0799afb186f669802bf09",
+ "frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx": "7a69a40a65452affb25c5a136dcfb5a84bb07d3ee948c08eb77e0fe6707bee8f",
+ "frontend-modern/src/components/Infrastructure/ResourceDetailDrawerSupportDisclosure.tsx": "040da0942faabe89455b2d478b2fac03697e50ee9c12426a399b2cb0004327dd",
+ "frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx": "0d40dbff2b59f63813f98419004fedf1269c99efa29308210e11c3d18ee8d904",
+ "frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts": "10dc7c47e116f50f197908b52b88c9acca42ffd35e89106390a5d69f73a00837",
+ "frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts": "850cd9dba3b91530068c8542121e4929bebc547b3abda1a10744fa886c0f9361",
+ "frontend-modern/src/components/Workloads/GuestDrawer.tsx": "543a17e2bcb03cc7e411aebe63330e575c069e03f78ceb31baa6ca727cb01f57",
+ "frontend-modern/src/components/Workloads/GuestDrawerManage.tsx": "8def7d128956c2e24e7f8c0913b7f79f7c9b3f21c54130ed51f4149915f417b5",
+ "frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx": "b9bddadb3c2386329a2caae6c8ae6d785e935af35c41c79be9f47f2163463252",
+ "frontend-modern/src/components/Workloads/NodeDrawer.tsx": "f6803503882e380e2d0d3df56d6676607717579da81ed7e24c06894961fb1258",
+ "frontend-modern/src/components/Workloads/NodeDrawerOverview.tsx": "5d9f130c58cffe8f653730b961b297fb789df3a5bc79b83c3da874c2067bc31e",
+ "frontend-modern/src/components/Workloads/WorkloadPanel.tsx": "e5ccf2149958fc5cfe3b0711b9d56557e0c86d525efdef69af229f325a0fe4df",
+ "frontend-modern/src/components/Workloads/guestDrawerModel.ts": "faf23c024fd0c0395ef1fbcebb10f13063ed9a4b7dcb5800c2ab836c9d5c5e8b",
+ "frontend-modern/src/components/shared/DetailSectionTable.tsx": "871c66c39f727ae46fbfb6e3246c6ea0acd37d02e9abe6ba7143013913f19e22",
+ "frontend-modern/src/components/shared/DrawerAttentionSection.tsx": "b9035090571c09e791021f789e8e4a4bcaffbff33dd37458ffbebf9a223d319c",
+ "frontend-modern/src/components/shared/TechnicalDetailsDisclosure.tsx": "d6a8ed7f006cecbe1b2e7055d041e767ff8d200ecb2c8454827bfc397e0dbdeb",
+ "frontend-modern/src/components/shared/detailSectionModel.ts": "b2effcc4ff9ce98e9fdd73d4853cb38166b92487c553e8cd981bb41ff7c11d86",
+ "frontend-modern/src/features/alerts/alertOverridesModel.ts": "8e344f8d76f4038efad5fe2765ba92ef5ca8edc0afbcdbfbc3d4cda9696a1d0a",
+ "frontend-modern/src/features/docker/DockerHostDrawer.tsx": "8bfd9ea8ec7cd8be5a77568aa33774a2c30f6bcc33113044ef4bf1e34422bcc4",
+ "frontend-modern/src/features/docker/DockerHostDrawerOverview.tsx": "4adb8252dcac84ed8523f798338091852869f891f1583e130053649affc987a7",
+ "frontend-modern/src/features/platformPage/PlatformResourceDetailTableRow.tsx": "05bc58b83bb5ecce65243a6849d6ded08bcbb656fcb3eda23d13129463e94ccd",
+ "frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx": "65c945d3ae01adeb6f41b2ba144b5b7b523c3e7c118721890c78bd6d19b42efb",
+ "frontend-modern/src/hooks/useWorkloads.ts": "f56021125846e931dd175ed8c4a0c46bd884edce434c61bf5a332a8c0a444f52",
+ "frontend-modern/src/types/workloads.ts": "e878e4d96359b4add4ea650ce5e3af361e6cb15e3fede51a8f7bc9d2c8ca8aa9",
+ "frontend-modern/src/utils/alerts.ts": "6b9556d0415294a8151d786489a4ecb9667b26ddc272c8fe33cf955a9ebcbbeb",
+ "frontend-modern/src/utils/workloadGuestPresentation.ts": "ef23c08bed5f507a163aca438ec8edd2e95e47e20d164a68e0e15b7697941886"
},
- "routes": ["/proxmox"],
+ "routes": ["/proxmox/overview", "/docker/overview", "/truenas/overview"],
"viewports": [
{
- "width": 390,
- "height": 844
+ "width": 1440,
+ "height": 900
},
{
- "width": 1280,
- "height": 720
+ "width": 390,
+ "height": 844
}
],
"states": [
- "managed hot-dev mock estate with the compact Proxmox Guests table visible",
- "phone identity cells showing fresh, stale or overdue, missing, and running backup shields",
- "desktop Guests table showing the existing dedicated Backup column"
+ "Proxmox guest with an active powered-off alert and condensed additive operator context",
+ "Proxmox node with an active offline alert and condensed node context",
+ "Docker host overview and Manage tab with update actions separated from context",
+ "TrueNAS system with multiple active health issues and both technical disclosure groups collapsed",
+ "generic resource Manage tab with operator overrides and saved web access"
],
"interactions": [
- "confirmed fresh phone rows retain a fixed-size green checked shield when the Backup column is hidden",
- "confirmed stale or overdue rows remain amber, missing backups remain red, and an active backup is blue",
- "confirmed shield tooltips and accessible labels retain the completed-backup age or running state",
- "confirmed the desktop Backup column continues to show its green healthy state and the table has no horizontal overflow",
- "restored the browser viewport after verification"
+ "expanded guest, node, Docker host, and TrueNAS resource drawers",
+ "confirmed exact active alert messages render immediately and wrap at phone width",
+ "expanded Technical details and Platform details independently",
+ "switched to Manage and confirmed overrides, actions, and access are absent from Overview",
+ "confirmed the hierarchy at desktop width and restored the temporary browser viewport"
]
}
diff --git a/frontend-modern/scripts/shared-template-registry.json b/frontend-modern/scripts/shared-template-registry.json
index f53bebf60d..9f94d4edf6 100644
--- a/frontend-modern/scripts/shared-template-registry.json
+++ b/frontend-modern/scripts/shared-template-registry.json
@@ -1,6 +1,62 @@
{
"version": 1,
"rules": [
+ {
+ "id": "operator-first-drawer-attention",
+ "category": "drawer-information-hierarchy",
+ "summary": "Object drawers surface active problem messages before additive operator context through one shared compact attention section.",
+ "canonical": {
+ "path": "src/components/shared/DrawerAttentionSection.tsx",
+ "export": "DrawerAttentionSection"
+ },
+ "requiredConsumers": [
+ {
+ "path": "src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx"
+ },
+ {
+ "path": "src/components/Workloads/GuestDrawerOverview.tsx"
+ },
+ {
+ "path": "src/components/Workloads/NodeDrawerOverview.tsx"
+ },
+ {
+ "path": "src/features/docker/DockerHostDrawerOverview.tsx"
+ }
+ ],
+ "proof": [
+ "src/components/shared/SharedPrimitives.guardrails.test.ts",
+ "src/components/Workloads/GuestDrawer.test.tsx",
+ "src/components/Workloads/NodeDrawer.test.tsx"
+ ]
+ },
+ {
+ "id": "operator-first-technical-disclosure",
+ "category": "drawer-information-hierarchy",
+ "summary": "Object drawers keep raw inventory behind one shared lazy technical-details disclosure while promoting additive operator facts into Overview.",
+ "canonical": {
+ "path": "src/components/shared/TechnicalDetailsDisclosure.tsx",
+ "export": "TechnicalDetailsDisclosure"
+ },
+ "requiredConsumers": [
+ {
+ "path": "src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx"
+ },
+ {
+ "path": "src/components/Workloads/GuestDrawerOverview.tsx"
+ },
+ {
+ "path": "src/components/Workloads/NodeDrawerOverview.tsx"
+ },
+ {
+ "path": "src/features/docker/DockerHostDrawerOverview.tsx"
+ }
+ ],
+ "proof": [
+ "src/components/shared/SharedPrimitives.guardrails.test.ts",
+ "src/components/Workloads/GuestDrawer.test.tsx",
+ "src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx"
+ ]
+ },
{
"id": "runtime-web-interface-inline-link",
"category": "resource-launch",
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
index c81e8cd56f..b307595523 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
@@ -22,7 +22,10 @@ import {
GuestDrawerHistoryRangeSelect,
} from '@/components/Workloads/GuestDrawerHistory';
import { ResourceDetailDrawerDebugTab } from './ResourceDetailDrawerDebugTab';
-import { ResourceDetailDrawerOverviewTab } from './ResourceDetailDrawerOverviewTab';
+import {
+ ResourceAccessDisclosure,
+ ResourceDetailDrawerOverviewTab,
+} from './ResourceDetailDrawerOverviewTab';
import { useResourceDetailDrawerState } from './useResourceDetailDrawerState';
import { DiscoveryTab } from '@/components/Discovery/DiscoveryTab';
import {
@@ -31,6 +34,9 @@ import {
} from './resourceDetailDrawerPresentation';
import { DockerContainerLifecycleControls } from '@/features/docker/DockerContainerLifecycleControls';
import { isDockerContainerLifecycleResource } from '@/features/docker/dockerContainerLifecycleActions';
+import { ResourceOperatorStateSection } from './ResourceOperatorStateSection';
+import { MaintenanceVerificationSection } from './MaintenanceVerificationSection';
+import { ResourceActionHistory } from './ResourceActionHistory';
interface ResourceDetailDrawerProps {
resource: Resource;
@@ -206,6 +212,37 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
</Show>
</div>
+ <div
+ class={drawer.activeTab() === 'manage' ? '' : 'hidden'}
+ style={{ 'overflow-anchor': 'none' }}
+ >
+ <Show when={drawer.activeTab() === 'manage'}>
+ <div class="space-y-3" data-testid="resource-manage-tab">
+ <ResourceOperatorStateSection
+ resourceId={props.resource.id}
+ resourceType={props.resource.type}
+ platformType={props.resource.platformType}
+ capabilities={props.resource.capabilities}
+ />
+ <Show when={drawer.hasAccessContext()}>
+ <ResourceAccessDisclosure resource={props.resource} drawer={drawer} />
+ </Show>
+ <Show when={presentation() !== 'table-row'}>
+ <MaintenanceVerificationSection resourceId={props.resource.id} />
+ </Show>
+ <Show when={drawer.actionAuditAvailable()}>
+ <ResourceActionHistory
+ audits={drawer.sortedActionAudits()}
+ count={drawer.actionAuditCount()}
+ loadingLabel={drawer.actionAuditLoadingLabel()}
+ error={drawer.actionAuditError()}
+ onRetry={drawer.refetchActionAudits}
+ />
+ </Show>
+ </div>
+ </Show>
+ </div>
+
{/* Discovery Tab */}
<div
class={drawer.activeTab() === 'discovery' ? '' : 'hidden'}
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx
index 4265bb0d21..1e826b06d8 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx
@@ -28,12 +28,11 @@ import { getAllFilterOptionLabel } from '@/components/shared/filterOptionPresent
import { getServiceHealthPresentation } from '@/utils/serviceHealthPresentation';
import { ResourceCorrelationSummary } from './ResourceCorrelationSummary';
import { ResourceFacetSummary } from './ResourceFacetSummary';
-import { ResourceActionHistory } from './ResourceActionHistory';
-import { ResourceOperatorStateSection } from './ResourceOperatorStateSection';
-import { MaintenanceVerificationSection } from './MaintenanceVerificationSection';
-import { InlineResourceSummaryTables, ResourceSummaryCards } from './ResourceDetailSummary';
+import { InlineResourceSummaryTables } from './ResourceDetailSummary';
import { ResourceInvestigationContextTables } from './ResourceInvestigationContextTables';
import { DetailSectionTable } from '@/components/shared/DetailSectionTable';
+import { TechnicalDetailsDisclosure } from '@/components/shared/TechnicalDetailsDisclosure';
+import { DrawerAttentionSection } from '@/components/shared/DrawerAttentionSection';
import {
RESOURCE_CHANGE_KIND_ORDER,
RESOURCE_CHANGE_SOURCE_ADAPTER_ORDER,
@@ -219,7 +218,7 @@ const timelineSourceAdapterOptions: Array<{
})),
];
-const AccessDisclosure: Component<{
+export const ResourceAccessDisclosure: Component<{
resource: Resource;
drawer: UseResourceDetailDrawerStateResult;
class?: string;
@@ -356,90 +355,52 @@ export const ResourceDetailDrawerOverviewTab: Component<ResourceDetailDrawerOver
drawer.sortedResourceTimeline().length > 0 ||
drawer.resourceTimelineCount() > 0 ||
Boolean(drawer.facetBundleError());
- const shouldRenderOperationalGovernanceSections = () => !compactTableRow();
- const shouldRenderActionHistorySection = () =>
- drawer.actionAuditAvailable() &&
- (!compactTableRow() ||
- drawer.sortedActionAudits().length > 0 ||
- drawer.actionAuditCount() > 0 ||
- Boolean(drawer.actionAuditError()));
- const shouldPromoteTrueNASDetails = () => compactTableRow() && drawer.hasTrueNASDetails();
- const shouldPromoteKubernetesDetails = () => compactTableRow() && drawer.hasKubernetesDetails();
- const shouldPromoteHostDetails = () =>
- compactTableRow() && isPulseAgentPlatformResource(resource) && drawer.hasHostDetails();
- // Access is promoted whenever it exists in row presentation — not only when
- // expanded — so the section (and its open-URL link) sits in one stable spot
- // at the top of the drawer instead of teleporting from the bottom of the
- // drawer to the top when "Show access" is clicked.
- const shouldPromoteAccessContext = () => compactTableRow() && drawer.hasAccessContext();
+ const attentionItems = () => {
+ const items = (resource.alerts ?? []).map((alert) => ({
+ id: alert.id,
+ message: alert.message,
+ severity: alert.level,
+ }));
+ const healthIssue = drawer.healthIssue();
+ if (healthIssue && !items.some((item) => item.message === healthIssue.primary)) {
+ const severity = /critical|failed|faulted|error/i.test(resource.status)
+ ? 'critical'
+ : 'warning';
+ items.unshift(
+ ...[healthIssue.primary, ...healthIssue.details].map((message, index) => ({
+ id: `resource-health-issue-${index}`,
+ message,
+ severity,
+ })),
+ );
+ }
+ return items;
+ };
return (
<div class="space-y-3">
- <Show when={shouldPromoteAccessContext()}>
- <AccessDisclosure resource={resource} drawer={drawer} />
+ <DrawerAttentionSection items={attentionItems()} />
+ <Show when={drawer.sourceSummary() || drawer.identityIpValues()[0]}>
+ <InlineResourceSummaryTables
+ resource={resource}
+ drawer={drawer}
+ showPlatformId={showPlatformId}
+ content="overview"
+ />
</Show>
- <Show when={shouldPromoteTrueNASDetails()}>
- <TrueNASDetailsDisclosure drawer={drawer} class="space-y-2" contentClass="space-y-2" />
- </Show>
-
- <Show when={shouldPromoteKubernetesDetails()}>
- <KubernetesDetailsDisclosure drawer={drawer} class="space-y-2" contentClass="space-y-2" />
- </Show>
-
- <Show when={shouldPromoteHostDetails()}>
- <HostDetailsDisclosure resource={resource} drawer={drawer} />
- </Show>
-
- <Show
- when={isPulseAgentPlatformResource(resource)}
- fallback={
- <Show
- when={compactTableRow()}
- fallback={
- <ResourceSummaryCards
- resource={resource}
- drawer={drawer}
- showPlatformId={showPlatformId}
- />
- }
- >
- <InlineResourceSummaryTables
- resource={resource}
- drawer={drawer}
- showPlatformId={showPlatformId}
- />
- </Show>
- }
+ <TechnicalDetailsDisclosure
+ dataTestId="resource-technical-details"
+ subtitle="Identity, runtime, and source IDs"
>
- <details
- data-testid="resource-technical-details"
- class="rounded border border-border bg-surface px-3 py-2"
- >
- <summary class="cursor-pointer list-none text-[11px] font-medium text-base-content">
- Technical details
- <span class="ml-2 font-normal text-muted">State, identity, and source IDs</span>
- </summary>
- <div class="mt-3 border-t border-border pt-3">
- <Show
- when={compactTableRow()}
- fallback={
- <ResourceSummaryCards
- resource={resource}
- drawer={drawer}
- showPlatformId={showPlatformId}
- />
- }
- >
- <InlineResourceSummaryTables
- resource={resource}
- drawer={drawer}
- showPlatformId={showPlatformId}
- />
- </Show>
- </div>
- </details>
- </Show>
+ <InlineResourceSummaryTables
+ resource={resource}
+ drawer={drawer}
+ showPlatformId={showPlatformId}
+ content="technical"
+ dataTestId="resource-technical-summary-section"
+ />
+ </TechnicalDetailsDisclosure>
<Show when={resource.availability || (resource.availabilityChecks?.length ?? 0) > 0}>
<div class="flex flex-wrap gap-3 [&>*]:min-w-[240px] [&>*]:flex-1">
@@ -699,652 +660,620 @@ export const ResourceDetailDrawerOverviewTab: Component<ResourceDetailDrawerOver
/>
</Show>
- {/* Operator-set per-resource state (intentionally offline,
- never auto-remediate) sits next to the action history so
- the "what overrides has the operator set" and "what actions
- has Pulse taken" stories read together. The section is
- self-fetching keyed on the canonical resource id. Rendered
- for every resource with an id — the operator overrides
- (intentionally offline, never auto-remediate, note, priority)
- don't depend on capabilities; only the automatic-actions
- block does, and it gates itself inside the section
- (issue #1622). */}
- <Show when={resource.id}>
- <ResourceOperatorStateSection
- resourceId={resource.id}
- resourceType={resource.type}
- platformType={resource.platformType}
- capabilities={resource.capabilities}
- />
- </Show>
-
- {/* Maintenance Verification Reports sit directly under the
- operator-state section because the same operator who set
- the maintenance window above is the one who needs to read
- the verification result here. Self-fetching component;
- empty state hides gracefully when no reports exist. */}
- <Show when={shouldRenderOperationalGovernanceSections() && resource.id}>
- <MaintenanceVerificationSection resourceId={resource.id} />
- </Show>
-
- <Show when={shouldRenderActionHistorySection()}>
- <ResourceActionHistory
- audits={drawer.sortedActionAudits()}
- count={drawer.actionAuditCount()}
- loadingLabel={drawer.actionAuditLoadingLabel()}
- error={drawer.actionAuditError()}
- onRetry={drawer.refetchActionAudits}
- />
- </Show>
-
<Show
when={
drawer.hasServiceDetails() ||
drawer.hasVMwareDetails() ||
drawer.hasTrueNASDetails() ||
drawer.hasKubernetesDetails() ||
- (drawer.hasHostDetails() && !shouldPromoteHostDetails()) ||
- (drawer.hasAccessContext() && !shouldPromoteAccessContext()) ||
+ drawer.hasHostDetails() ||
drawer.hasInvestigationContext()
}
>
- <div
- data-testid="resource-support-sections"
- class="flex flex-wrap gap-3 [&>*]:flex-1 [&>*]:basis-[calc(50%-0.375rem)] [&>*]:min-w-[260px] [&>*]:max-w-full [&>*]:overflow-hidden"
+ <TechnicalDetailsDisclosure
+ title="Platform details"
+ subtitle="Provider, service, and host context"
+ dataTestId="resource-platform-details"
>
- <Show when={drawer.hasTrueNASDetails() && !shouldPromoteTrueNASDetails()}>
- <TrueNASDetailsDisclosure drawer={drawer} class="h-full" />
- </Show>
-
- <Show when={drawer.hasKubernetesDetails() && !shouldPromoteKubernetesDetails()}>
- <KubernetesDetailsDisclosure drawer={drawer} class="h-full" />
- </Show>
+ <div
+ data-testid="resource-support-sections"
+ class="flex flex-wrap gap-3 [&>*]:flex-1 [&>*]:basis-[calc(50%-0.375rem)] [&>*]:min-w-[260px] [&>*]:max-w-full [&>*]:overflow-hidden"
+ >
+ <Show when={drawer.hasTrueNASDetails()}>
+ <TrueNASDetailsDisclosure drawer={drawer} class="h-full" />
+ </Show>
- <Show when={drawer.hasAccessContext() && !shouldPromoteAccessContext()}>
- <AccessDisclosure resource={resource} drawer={drawer} class="h-full" />
- </Show>
+ <Show when={drawer.hasKubernetesDetails()}>
+ <KubernetesDetailsDisclosure drawer={drawer} class="h-full" />
+ </Show>
- <Show when={drawer.hasInvestigationContext()}>
- <SupportDisclosure
- title="Context"
- summary={drawer.investigationContextSummary()}
- expanded={drawer.showInvestigationContext()}
- onToggle={() => drawer.setShowInvestigationContext((value) => !value)}
- showLabel="Show context"
- hideLabel="Hide context"
- class="h-full"
- contentClass="mt-3 space-y-3"
- dataTestId="resource-investigation-context"
- >
- <ResourceInvestigationContextTables resource={resource} drawer={drawer} />
- </SupportDisclosure>
- </Show>
+ <Show when={drawer.hasInvestigationContext()}>
+ <SupportDisclosure
+ title="Context"
+ summary={drawer.investigationContextSummary()}
+ expanded={drawer.showInvestigationContext()}
+ onToggle={() => drawer.setShowInvestigationContext((value) => !value)}
+ showLabel="Show context"
+ hideLabel="Hide context"
+ class="h-full"
+ contentClass="mt-3 space-y-3"
+ dataTestId="resource-investigation-context"
+ >
+ <ResourceInvestigationContextTables resource={resource} drawer={drawer} />
+ </SupportDisclosure>
+ </Show>
- <Show when={drawer.hasServiceDetails()}>
- <SupportDisclosure
- title="Service"
- summary={drawer.serviceDetailsSummary()}
- expanded={drawer.showServiceDetails()}
- onToggle={() => drawer.setShowServiceDetails((value) => !value)}
- showLabel="Show service"
- hideLabel="Hide service"
- class="h-full"
- contentClass="mt-3 space-y-3"
- dataTestId="resource-service-details-section"
- >
- <Show when={resource.type === 'docker-host'}>
- <div class="rounded border border-sky-200 bg-sky-50 p-3 dark:border-sky-700 dark:bg-sky-900">
- <div class="mb-2 flex items-center justify-between gap-2">
- <div class="text-[11px] font-medium uppercase tracking-wide text-sky-700 dark:text-sky-300">
- Docker runtime
+ <Show when={drawer.hasServiceDetails()}>
+ <SupportDisclosure
+ title="Service"
+ summary={drawer.serviceDetailsSummary()}
+ expanded={drawer.showServiceDetails()}
+ onToggle={() => drawer.setShowServiceDetails((value) => !value)}
+ showLabel="Show service"
+ hideLabel="Hide service"
+ class="h-full"
+ contentClass="mt-3 space-y-3"
+ dataTestId="resource-service-details-section"
+ >
+ <Show when={resource.type === 'docker-host'}>
+ <div class="rounded border border-sky-200 bg-sky-50 p-3 dark:border-sky-700 dark:bg-sky-900">
+ <div class="mb-2 flex items-center justify-between gap-2">
+ <div class="text-[11px] font-medium uppercase tracking-wide text-sky-700 dark:text-sky-300">
+ Docker runtime
+ </div>
+ <Show when={drawer.dockerHostData()?.runtime}>
+ <span
+ class="max-w-[55%] truncate text-[10px] text-sky-700 dark:text-sky-300"
+ title={drawer.dockerHostData()?.runtime}
+ >
+ {drawer.dockerHostData()?.runtime}
+ </span>
+ </Show>
</div>
- <Show when={drawer.dockerHostData()?.runtime}>
- <span
- class="max-w-[55%] truncate text-[10px] text-sky-700 dark:text-sky-300"
- title={drawer.dockerHostData()?.runtime}
- >
- {drawer.dockerHostData()?.runtime}
- </span>
- </Show>
- </div>
- <div class="space-y-1.5 text-[11px]">
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Containers</span>
- <span class="font-medium text-base-content">
- {formatInteger(drawer.dockerContainerCount())}
- </span>
- </div>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Updates</span>
- <span
- class={`font-medium ${drawer.dockerUpdatesAvailable() > 0 ? 'text-sky-700 dark:text-sky-300' : 'text-base-content'}`}
- >
- {formatInteger(drawer.dockerUpdatesAvailable())}
- </span>
- </div>
- <Show when={drawer.dockerUpdatesCheckedRelative()}>
+ <div class="space-y-1.5 text-[11px]">
<div class="flex items-center justify-between gap-2">
- <span class="text-muted">Checked</span>
+ <span class="text-muted">Containers</span>
<span class="font-medium text-base-content">
- {drawer.dockerUpdatesCheckedRelative()}
+ {formatInteger(drawer.dockerContainerCount())}
</span>
</div>
- </Show>
-
- <Show when={drawer.showDockerUpdateControls()}>
- <div class="space-y-1.5 border-t border-sky-200 pt-2 dark:border-sky-700">
- <Show
- when={
- drawer.dockerHostCommand()?.type || drawer.dockerHostCommand()?.status
- }
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Updates</span>
+ <span
+ class={`font-medium ${drawer.dockerUpdatesAvailable() > 0 ? 'text-sky-700 dark:text-sky-300' : 'text-base-content'}`}
>
- <div class="rounded border border-sky-200 bg-surface px-2 py-1.5 text-[10px] dark:border-sky-700">
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Action</span>
- <span class="font-medium text-base-content">
- {formatIdentifierLabel(drawer.dockerHostCommand()?.type, {
- fallback: 'command',
- })}
- </span>
- </div>
- <div class="mt-1 flex items-center justify-between gap-2">
- <span class="text-muted">State</span>
- <span
- class={`font-medium ${drawer.dockerHostCommandActive() ? 'text-sky-700 dark:text-sky-300' : 'text-base-content'}`}
- >
- {formatIdentifierLabel(drawer.dockerHostCommand()?.status, {
- fallback: 'unknown',
- })}
- </span>
- </div>
- <Show when={drawer.dockerHostCommand()?.message}>
- <div
- class="mt-1 text-muted truncate"
- title={drawer.dockerHostCommand()?.message}
- >
- {drawer.dockerHostCommand()?.message}
+ {formatInteger(drawer.dockerUpdatesAvailable())}
+ </span>
+ </div>
+ <Show when={drawer.dockerUpdatesCheckedRelative()}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Checked</span>
+ <span class="font-medium text-base-content">
+ {drawer.dockerUpdatesCheckedRelative()}
+ </span>
+ </div>
+ </Show>
+
+ <Show when={drawer.showDockerUpdateControls()}>
+ <div class="space-y-1.5 border-t border-sky-200 pt-2 dark:border-sky-700">
+ <Show
+ when={
+ drawer.dockerHostCommand()?.type ||
+ drawer.dockerHostCommand()?.status
+ }
+ >
+ <div class="rounded border border-sky-200 bg-surface px-2 py-1.5 text-[10px] dark:border-sky-700">
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Action</span>
+ <span class="font-medium text-base-content">
+ {formatIdentifierLabel(drawer.dockerHostCommand()?.type, {
+ fallback: 'command',
+ })}
+ </span>
</div>
- </Show>
- <Show when={drawer.dockerHostCommand()?.failureReason}>
- <div
- class="mt-1 text-red-700 dark:text-red-300 truncate"
- title={drawer.dockerHostCommand()?.failureReason}
- >
- {drawer.dockerHostCommand()?.failureReason}
+ <div class="mt-1 flex items-center justify-between gap-2">
+ <span class="text-muted">State</span>
+ <span
+ class={`font-medium ${drawer.dockerHostCommandActive() ? 'text-sky-700 dark:text-sky-300' : 'text-base-content'}`}
+ >
+ {formatIdentifierLabel(drawer.dockerHostCommand()?.status, {
+ fallback: 'unknown',
+ })}
+ </span>
</div>
- </Show>
- </div>
- </Show>
+ <Show when={drawer.dockerHostCommand()?.message}>
+ <div
+ class="mt-1 text-muted truncate"
+ title={drawer.dockerHostCommand()?.message}
+ >
+ {drawer.dockerHostCommand()?.message}
+ </div>
+ </Show>
+ <Show when={drawer.dockerHostCommand()?.failureReason}>
+ <div
+ class="mt-1 text-red-700 dark:text-red-300 truncate"
+ title={drawer.dockerHostCommand()?.failureReason}
+ >
+ {drawer.dockerHostCommand()?.failureReason}
+ </div>
+ </Show>
+ </div>
+ </Show>
- <Show when={drawer.dockerActionError()}>
- <div class="rounded border border-red-200 bg-red-50 px-2 py-1.5 text-[10px] text-red-700 dark:border-red-700 dark:bg-red-900 dark:text-red-200">
- {drawer.dockerActionError()}
- </div>
- </Show>
- <Show when={drawer.dockerActionNote()}>
- <div class="rounded border border-sky-200 bg-surface px-2 py-1.5 text-[10px] text-base-content dark:border-sky-700">
- {drawer.dockerActionNote()}
- </div>
- </Show>
+ <Show when={drawer.dockerActionError()}>
+ <div class="rounded border border-red-200 bg-red-50 px-2 py-1.5 text-[10px] text-red-700 dark:border-red-700 dark:bg-red-900 dark:text-red-200">
+ {drawer.dockerActionError()}
+ </div>
+ </Show>
+ <Show when={drawer.dockerActionNote()}>
+ <div class="rounded border border-sky-200 bg-surface px-2 py-1.5 text-[10px] text-base-content dark:border-sky-700">
+ {drawer.dockerActionNote()}
+ </div>
+ </Show>
- <div class="flex flex-wrap items-center gap-2">
- <button
- type="button"
- disabled={
- drawer.dockerActionBusy() ||
- drawer.dockerUpdateActionsLoading() ||
- drawer.dockerHostCommandActive() ||
- drawer.dockerHostSourceId() === null
- }
- onClick={drawer.queueDockerUpdateCheck}
- class="rounded-md border border-border bg-surface px-2.5 py-1 text-[11px] font-semibold text-base-content hover:bg-surface-hover disabled:opacity-60"
- title={
- drawer.dockerUpdateActionsLoading()
- ? 'Loading settings...'
- : undefined
- }
- >
- Check now
- </button>
+ <div class="flex flex-wrap items-center gap-2">
+ <button
+ type="button"
+ disabled={
+ drawer.dockerActionBusy() ||
+ drawer.dockerUpdateActionsLoading() ||
+ drawer.dockerHostCommandActive() ||
+ drawer.dockerHostSourceId() === null
+ }
+ onClick={drawer.queueDockerUpdateCheck}
+ class="rounded-md border border-border bg-surface px-2.5 py-1 text-[11px] font-semibold text-base-content hover:bg-surface-hover disabled:opacity-60"
+ title={
+ drawer.dockerUpdateActionsLoading()
+ ? 'Loading settings...'
+ : undefined
+ }
+ >
+ Check now
+ </button>
- <button
- type="button"
- disabled={
- drawer.dockerActionBusy() ||
- drawer.dockerUpdateActionsLoading() ||
- drawer.dockerUpdateActionsDisabled() ||
- drawer.dockerHostCommandActive() ||
- drawer.dockerHostSourceId() === null ||
- drawer.dockerUpdatesAvailable() <= 0
- }
- onClick={drawer.queueDockerUpdateAll}
- class="rounded-md border border-sky-200 bg-sky-600 px-2.5 py-1 text-[11px] font-semibold text-white hover:bg-sky-700 disabled:opacity-60 disabled:hover:bg-sky-600 dark:border-sky-700 dark:bg-sky-600 dark:hover:bg-sky-500 dark:disabled:hover:bg-sky-600"
- title={
- drawer.dockerUpdateActionsDisabled()
- ? 'Updates disabled by server settings.'
- : undefined
- }
- >
- {drawer.confirmUpdateAll()
- ? 'Confirm update'
- : `Update all${drawer.dockerUpdatesAvailable() > 0 ? ` (${drawer.dockerUpdatesAvailable()})` : ''}`}
- </button>
+ <button
+ type="button"
+ disabled={
+ drawer.dockerActionBusy() ||
+ drawer.dockerUpdateActionsLoading() ||
+ drawer.dockerUpdateActionsDisabled() ||
+ drawer.dockerHostCommandActive() ||
+ drawer.dockerHostSourceId() === null ||
+ drawer.dockerUpdatesAvailable() <= 0
+ }
+ onClick={drawer.queueDockerUpdateAll}
+ class="rounded-md border border-sky-200 bg-sky-600 px-2.5 py-1 text-[11px] font-semibold text-white hover:bg-sky-700 disabled:opacity-60 disabled:hover:bg-sky-600 dark:border-sky-700 dark:bg-sky-600 dark:hover:bg-sky-500 dark:disabled:hover:bg-sky-600"
+ title={
+ drawer.dockerUpdateActionsDisabled()
+ ? 'Updates disabled by server settings.'
+ : undefined
+ }
+ >
+ {drawer.confirmUpdateAll()
+ ? 'Confirm update'
+ : `Update all${drawer.dockerUpdatesAvailable() > 0 ? ` (${drawer.dockerUpdatesAvailable()})` : ''}`}
+ </button>
+ </div>
</div>
- </div>
- </Show>
+ </Show>
- <button
- type="button"
- onClick={drawer.toggleDockerUpdateControls}
- class="inline-flex items-center rounded-md border border-sky-200 bg-surface px-2.5 py-1 text-[10px] font-medium text-sky-700 transition-colors hover:bg-base dark:border-sky-700 dark:text-sky-300"
- >
- {drawer.showDockerUpdateControls() ? 'Hide actions' : 'Show actions'}
- </button>
+ <button
+ type="button"
+ onClick={drawer.toggleDockerUpdateControls}
+ class="inline-flex items-center rounded-md border border-sky-200 bg-surface px-2.5 py-1 text-[10px] font-medium text-sky-700 transition-colors hover:bg-base dark:border-sky-700 dark:text-sky-300"
+ >
+ {drawer.showDockerUpdateControls() ? 'Hide actions' : 'Show actions'}
+ </button>
+ </div>
</div>
- </div>
- </Show>
+ </Show>
- <Show when={drawer.pbsData()}>
- {(pbs) => {
- const connection = getServiceHealthPresentation(
- resource.status,
- pbs().connectionHealth,
- );
- return (
- <div class="rounded border border-indigo-200 bg-indigo-50 p-3 dark:border-indigo-700 dark:bg-indigo-900">
- <div class="mb-2 flex items-center justify-between gap-2">
- <div class="text-[11px] font-medium uppercase tracking-wide text-indigo-700 dark:text-indigo-300">
- PBS
- </div>
- <Show when={pbs().hostname}>
- <span
- class="max-w-[55%] truncate text-[10px] text-indigo-700 dark:text-indigo-300"
- title={pbs().hostname}
- >
- {pbs().hostname}
- </span>
- </Show>
- </div>
- <div class="space-y-1.5 text-[11px]">
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">State</span>
- <span class={`font-medium ${connection.text}`}>{connection.label}</span>
- </div>
- <Show when={pbs().version}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Version</span>
- <span class="font-medium text-base-content">{pbs().version}</span>
+ <Show when={drawer.pbsData()}>
+ {(pbs) => {
+ const connection = getServiceHealthPresentation(
+ resource.status,
+ pbs().connectionHealth,
+ );
+ return (
+ <div class="rounded border border-indigo-200 bg-indigo-50 p-3 dark:border-indigo-700 dark:bg-indigo-900">
+ <div class="mb-2 flex items-center justify-between gap-2">
+ <div class="text-[11px] font-medium uppercase tracking-wide text-indigo-700 dark:text-indigo-300">
+ PBS
</div>
- </Show>
- <Show when={pbs().uptimeSeconds || resource.uptime}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Uptime</span>
- <span class="font-medium text-base-content">
- {formatUptime(pbs().uptimeSeconds ?? resource.uptime ?? 0)}
+ <Show when={pbs().hostname}>
+ <span
+ class="max-w-[55%] truncate text-[10px] text-indigo-700 dark:text-indigo-300"
+ title={pbs().hostname}
+ >
+ {pbs().hostname}
</span>
- </div>
- </Show>
- <Show when={drawer.pbsActiveTaskCount() > 0}>
+ </Show>
+ </div>
+ <div class="space-y-1.5 text-[11px]">
<div class="flex items-center justify-between gap-2">
- <span class="text-muted">Active tasks</span>
- <span class="font-medium text-emerald-700 dark:text-emerald-300">
- {formatInteger(drawer.pbsActiveTaskCount())}
+ <span class="text-muted">State</span>
+ <span class={`font-medium ${connection.text}`}>
+ {connection.label}
</span>
</div>
- </Show>
- <Show when={drawer.showPbsJobDetail()}>
- <div class="space-y-1.5 border-t border-indigo-200 pt-2 dark:border-indigo-700">
- <div class="grid grid-cols-2 gap-2 md:grid-cols-3">
- <div class="rounded border border-indigo-200 bg-surface px-2 py-1.5 dark:border-indigo-700">
- <div class="text-[10px] text-muted">Datastores</div>
- <div class="text-sm font-semibold text-base-content">
- {formatInteger(pbs().datastoreCount)}
+ <Show when={pbs().version}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Version</span>
+ <span class="font-medium text-base-content">{pbs().version}</span>
+ </div>
+ </Show>
+ <Show when={pbs().uptimeSeconds || resource.uptime}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Uptime</span>
+ <span class="font-medium text-base-content">
+ {formatUptime(pbs().uptimeSeconds ?? resource.uptime ?? 0)}
+ </span>
+ </div>
+ </Show>
+ <Show when={drawer.pbsActiveTaskCount() > 0}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Active tasks</span>
+ <span class="font-medium text-emerald-700 dark:text-emerald-300">
+ {formatInteger(drawer.pbsActiveTaskCount())}
+ </span>
+ </div>
+ </Show>
+ <Show when={drawer.showPbsJobDetail()}>
+ <div class="space-y-1.5 border-t border-indigo-200 pt-2 dark:border-indigo-700">
+ <div class="grid grid-cols-2 gap-2 md:grid-cols-3">
+ <div class="rounded border border-indigo-200 bg-surface px-2 py-1.5 dark:border-indigo-700">
+ <div class="text-[10px] text-muted">Datastores</div>
+ <div class="text-sm font-semibold text-base-content">
+ {formatInteger(pbs().datastoreCount)}
+ </div>
</div>
- </div>
- <div class="rounded border border-indigo-200 bg-surface px-2 py-1.5 dark:border-indigo-700">
- <div class="text-[10px] text-muted">Jobs</div>
- <div class="text-sm font-semibold text-base-content">
- {formatInteger(drawer.pbsJobTotal())}
+ <div class="rounded border border-indigo-200 bg-surface px-2 py-1.5 dark:border-indigo-700">
+ <div class="text-[10px] text-muted">Jobs</div>
+ <div class="text-sm font-semibold text-base-content">
+ {formatInteger(drawer.pbsJobTotal())}
+ </div>
</div>
+ <Show when={drawer.pbsActiveTaskCount() > 0}>
+ <div class="rounded border border-emerald-200 bg-emerald-50 px-2 py-1.5 dark:border-emerald-700 dark:bg-emerald-950/40">
+ <div class="text-[10px] text-muted">Active</div>
+ <div class="text-sm font-semibold text-emerald-700 dark:text-emerald-300">
+ {formatInteger(drawer.pbsActiveTaskCount())}
+ </div>
+ </div>
+ </Show>
</div>
<Show when={drawer.pbsActiveTaskCount() > 0}>
- <div class="rounded border border-emerald-200 bg-emerald-50 px-2 py-1.5 dark:border-emerald-700 dark:bg-emerald-950/40">
- <div class="text-[10px] text-muted">Active</div>
- <div class="text-sm font-semibold text-emerald-700 dark:text-emerald-300">
- {formatInteger(drawer.pbsActiveTaskCount())}
+ <div
+ data-testid="pbs-active-tasks"
+ class="rounded border border-emerald-200 bg-surface px-2 py-1.5 dark:border-emerald-700"
+ >
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-[10px] font-medium uppercase tracking-wide text-muted">
+ Active tasks
+ </span>
+ <span class="text-[10px] font-semibold text-emerald-700 dark:text-emerald-300">
+ {formatInteger(drawer.pbsActiveTaskCount())}
+ </span>
</div>
- </div>
- </Show>
- </div>
- <Show when={drawer.pbsActiveTaskCount() > 0}>
- <div
- data-testid="pbs-active-tasks"
- class="rounded border border-emerald-200 bg-surface px-2 py-1.5 dark:border-emerald-700"
- >
- <div class="flex items-center justify-between gap-2">
- <span class="text-[10px] font-medium uppercase tracking-wide text-muted">
- Active tasks
- </span>
- <span class="text-[10px] font-semibold text-emerald-700 dark:text-emerald-300">
- {formatInteger(drawer.pbsActiveTaskCount())}
- </span>
- </div>
- <div class="mt-2 space-y-2 border-t border-emerald-200 pt-2 dark:border-emerald-700">
- <For each={drawer.pbsActiveTasks()}>
- {(task) => (
- <div class="flex items-start justify-between gap-2 text-[10px]">
- <div class="min-w-0">
- <div
- class="truncate font-medium text-base-content"
- title={task.label}
- >
- {task.label}
- </div>
- <Show when={task.context}>
- <div
- class="truncate text-muted"
- title={task.context ?? undefined}
- >
- {task.context}
- </div>
- </Show>
- <Show when={task.error}>
+ <div class="mt-2 space-y-2 border-t border-emerald-200 pt-2 dark:border-emerald-700">
+ <For each={drawer.pbsActiveTasks()}>
+ {(task) => (
+ <div class="flex items-start justify-between gap-2 text-[10px]">
+ <div class="min-w-0">
<div
- class="truncate text-rose-700 dark:text-rose-300"
- title={task.error}
+ class="truncate font-medium text-base-content"
+ title={task.label}
>
- {task.error}
+ {task.label}
</div>
- </Show>
+ <Show when={task.context}>
+ <div
+ class="truncate text-muted"
+ title={task.context ?? undefined}
+ >
+ {task.context}
+ </div>
+ </Show>
+ <Show when={task.error}>
+ <div
+ class="truncate text-rose-700 dark:text-rose-300"
+ title={task.error}
+ >
+ {task.error}
+ </div>
+ </Show>
+ </div>
+ <span class="shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 font-medium text-emerald-700 dark:border-emerald-700 dark:bg-emerald-950/40 dark:text-emerald-300">
+ {task.statusLabel}
+ </span>
</div>
- <span class="shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 font-medium text-emerald-700 dark:border-emerald-700 dark:bg-emerald-950/40 dark:text-emerald-300">
- {task.statusLabel}
- </span>
- </div>
- )}
- </For>
- </div>
- </div>
- </Show>
- <Show when={pbsJobHealthEvidence().evidenceCount > 0}>
- <div
- data-testid="pbs-job-health-evidence"
- class="rounded border border-indigo-200 bg-surface px-2 py-1.5 dark:border-indigo-700"
- >
- <div class="flex flex-wrap items-center justify-between gap-2">
- <span class="text-[10px] font-medium uppercase tracking-wide text-muted">
- Job health evidence
- </span>
- <span class="text-[10px] font-semibold text-indigo-700 dark:text-indigo-300">
- {pbsJobHealthEvidence().countLabel}
- </span>
+ )}
+ </For>
+ </div>
</div>
- <div class="mt-2 space-y-2 border-t border-indigo-200 pt-2 dark:border-indigo-700">
- <For each={pbsJobHealthEvidence().entries}>
- {(entry) => (
- <div class="min-w-0 rounded border border-border bg-surface-hover px-2 py-1.5 text-[10px]">
- <div class="flex flex-wrap items-start justify-between gap-2">
- <div class="min-w-0">
- <div
- class="truncate font-medium text-base-content"
- title={entry.label}
- >
- {entry.label}
+ </Show>
+ <Show when={pbsJobHealthEvidence().evidenceCount > 0}>
+ <div
+ data-testid="pbs-job-health-evidence"
+ class="rounded border border-indigo-200 bg-surface px-2 py-1.5 dark:border-indigo-700"
+ >
+ <div class="flex flex-wrap items-center justify-between gap-2">
+ <span class="text-[10px] font-medium uppercase tracking-wide text-muted">
+ Job health evidence
+ </span>
+ <span class="text-[10px] font-semibold text-indigo-700 dark:text-indigo-300">
+ {pbsJobHealthEvidence().countLabel}
+ </span>
+ </div>
+ <div class="mt-2 space-y-2 border-t border-indigo-200 pt-2 dark:border-indigo-700">
+ <For each={pbsJobHealthEvidence().entries}>
+ {(entry) => (
+ <div class="min-w-0 rounded border border-border bg-surface-hover px-2 py-1.5 text-[10px]">
+ <div class="flex flex-wrap items-start justify-between gap-2">
+ <div class="min-w-0">
+ <div
+ class="truncate font-medium text-base-content"
+ title={entry.label}
+ >
+ {entry.label}
+ </div>
+ <div
+ class="truncate text-muted"
+ title={entry.sourceLabel}
+ >
+ {entry.sourceLabel}
+ </div>
</div>
- <div
- class="truncate text-muted"
- title={entry.sourceLabel}
- >
- {entry.sourceLabel}
+ <div class="flex max-w-full flex-wrap justify-end gap-1">
+ <For each={entry.badges}>
+ {(badge) => (
+ <span
+ class={`shrink-0 rounded-full border px-2 py-0.5 font-medium ${pbsEvidenceBadgeClass(
+ badge.tone,
+ )}`}
+ >
+ {badge.label}
+ </span>
+ )}
+ </For>
</div>
</div>
- <div class="flex max-w-full flex-wrap justify-end gap-1">
- <For each={entry.badges}>
- {(badge) => (
- <span
- class={`shrink-0 rounded-full border px-2 py-0.5 font-medium ${pbsEvidenceBadgeClass(
- badge.tone,
- )}`}
- >
- {badge.label}
+ <div class="mt-1 grid gap-1 text-muted sm:grid-cols-2">
+ <Show when={entry.context}>
+ <span
+ class="truncate"
+ title={entry.context ?? undefined}
+ >
+ {entry.context}
+ </span>
+ </Show>
+ <Show when={entry.stateLabel}>
+ <span
+ class="truncate"
+ title={entry.stateLabel ?? undefined}
+ >
+ State:{' '}
+ <span class="font-medium text-base-content">
+ {entry.stateLabel}
</span>
- )}
- </For>
- </div>
- </div>
- <div class="mt-1 grid gap-1 text-muted sm:grid-cols-2">
- <Show when={entry.context}>
- <span
- class="truncate"
- title={entry.context ?? undefined}
- >
- {entry.context}
- </span>
- </Show>
- <Show when={entry.stateLabel}>
- <span
- class="truncate"
- title={entry.stateLabel ?? undefined}
- >
- State:{' '}
- <span class="font-medium text-base-content">
- {entry.stateLabel}
</span>
- </span>
- </Show>
- <Show when={entry.freshnessLabel}>
- <span
- class="truncate"
- title={entry.freshnessLabel ?? undefined}
- >
- {entry.freshnessLabel}
- </span>
- </Show>
- <Show when={entry.postureReason}>
- <span
- class="truncate text-amber-700 dark:text-amber-300"
- title={entry.postureReason ?? undefined}
- >
- {entry.postureReason}
- </span>
- </Show>
- <Show when={entry.error}>
- <span
- class="truncate text-rose-700 dark:text-rose-300"
- title={entry.error ?? undefined}
- >
- {entry.error}
- </span>
- </Show>
+ </Show>
+ <Show when={entry.freshnessLabel}>
+ <span
+ class="truncate"
+ title={entry.freshnessLabel ?? undefined}
+ >
+ {entry.freshnessLabel}
+ </span>
+ </Show>
+ <Show when={entry.postureReason}>
+ <span
+ class="truncate text-amber-700 dark:text-amber-300"
+ title={entry.postureReason ?? undefined}
+ >
+ {entry.postureReason}
+ </span>
+ </Show>
+ <Show when={entry.error}>
+ <span
+ class="truncate text-rose-700 dark:text-rose-300"
+ title={entry.error ?? undefined}
+ >
+ {entry.error}
+ </span>
+ </Show>
+ </div>
</div>
- </div>
+ )}
+ </For>
+ </div>
+ </div>
+ </Show>
+ <details class="rounded border border-indigo-200 bg-surface px-2 py-1.5 dark:border-indigo-700">
+ <summary class="flex cursor-pointer list-none items-center justify-between text-[10px] font-medium text-muted">
+ <span>Types</span>
+ <span class="text-muted">
+ {drawer.pbsVisibleJobBreakdown().length}
+ </span>
+ </summary>
+ <div class="mt-2 grid grid-cols-2 gap-x-3 gap-y-1 border-t border-indigo-200 pt-2 text-[10px] dark:border-indigo-700">
+ <For each={drawer.pbsVisibleJobBreakdown()}>
+ {(entry) => (
+ <span class="text-muted">
+ {entry.label}:{' '}
+ <span class="font-medium text-base-content">
+ {formatInteger(entry.value)}
+ </span>
+ </span>
)}
</For>
</div>
- </div>
- </Show>
- <details class="rounded border border-indigo-200 bg-surface px-2 py-1.5 dark:border-indigo-700">
- <summary class="flex cursor-pointer list-none items-center justify-between text-[10px] font-medium text-muted">
- <span>Types</span>
- <span class="text-muted">
- {drawer.pbsVisibleJobBreakdown().length}
- </span>
- </summary>
- <div class="mt-2 grid grid-cols-2 gap-x-3 gap-y-1 border-t border-indigo-200 pt-2 text-[10px] dark:border-indigo-700">
- <For each={drawer.pbsVisibleJobBreakdown()}>
- {(entry) => (
- <span class="text-muted">
- {entry.label}:{' '}
- <span class="font-medium text-base-content">
- {formatInteger(entry.value)}
- </span>
- </span>
- )}
- </For>
- </div>
- </details>
- </div>
- </Show>
- <button
- type="button"
- onClick={() => drawer.setShowPbsJobDetail((value) => !value)}
- class="inline-flex items-center rounded-md border border-indigo-200 bg-surface px-2.5 py-1 text-[10px] font-medium text-indigo-700 transition-colors hover:bg-base dark:border-indigo-700 dark:text-indigo-300"
- >
- {drawer.showPbsJobDetail() ? 'Hide jobs' : 'Show jobs'}
- </button>
- </div>
- </div>
- );
- }}
- </Show>
-
- <Show when={drawer.pmgData()}>
- {(pmg) => {
- const connection = getServiceHealthPresentation(
- resource.status,
- pmg().connectionHealth,
- );
- return (
- <div class="rounded border border-rose-200 bg-rose-50 p-3 dark:border-rose-700 dark:bg-rose-900">
- <div class="mb-2 flex items-center justify-between gap-2">
- <div class="text-[11px] font-medium uppercase tracking-wide text-rose-700 dark:text-rose-300">
- PMG
- </div>
- <Show when={pmg().hostname}>
- <span
- class="max-w-[55%] truncate text-[10px] text-rose-700 dark:text-rose-300"
- title={pmg().hostname}
+ </details>
+ </div>
+ </Show>
+ <button
+ type="button"
+ onClick={() => drawer.setShowPbsJobDetail((value) => !value)}
+ class="inline-flex items-center rounded-md border border-indigo-200 bg-surface px-2.5 py-1 text-[10px] font-medium text-indigo-700 transition-colors hover:bg-base dark:border-indigo-700 dark:text-indigo-300"
>
- {pmg().hostname}
- </span>
- </Show>
- </div>
- <div class="space-y-1.5 text-[11px]">
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">State</span>
- <span class={`font-medium ${connection.text}`}>{connection.label}</span>
+ {drawer.showPbsJobDetail() ? 'Hide jobs' : 'Show jobs'}
+ </button>
</div>
- <Show when={pmg().version}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Version</span>
- <span class="font-medium text-base-content">{pmg().version}</span>
+ </div>
+ );
+ }}
+ </Show>
+
+ <Show when={drawer.pmgData()}>
+ {(pmg) => {
+ const connection = getServiceHealthPresentation(
+ resource.status,
+ pmg().connectionHealth,
+ );
+ return (
+ <div class="rounded border border-rose-200 bg-rose-50 p-3 dark:border-rose-700 dark:bg-rose-900">
+ <div class="mb-2 flex items-center justify-between gap-2">
+ <div class="text-[11px] font-medium uppercase tracking-wide text-rose-700 dark:text-rose-300">
+ PMG
</div>
- </Show>
- <Show when={pmg().uptimeSeconds || resource.uptime}>
+ <Show when={pmg().hostname}>
+ <span
+ class="max-w-[55%] truncate text-[10px] text-rose-700 dark:text-rose-300"
+ title={pmg().hostname}
+ >
+ {pmg().hostname}
+ </span>
+ </Show>
+ </div>
+ <div class="space-y-1.5 text-[11px]">
<div class="flex items-center justify-between gap-2">
- <span class="text-muted">Uptime</span>
- <span class="font-medium text-base-content">
- {formatUptime(pmg().uptimeSeconds ?? resource.uptime ?? 0)}
+ <span class="text-muted">State</span>
+ <span class={`font-medium ${connection.text}`}>
+ {connection.label}
</span>
</div>
- </Show>
- <Show when={drawer.showPmgMailFlowDetail()}>
- <div class="space-y-1.5 border-t border-rose-200 pt-2 dark:border-rose-700">
- <div class="grid grid-cols-2 gap-2">
- <div class="rounded border border-rose-200 bg-surface px-2 py-1.5 dark:border-rose-700">
- <div class="text-[10px] text-muted">Queue</div>
- <div
- class={`text-sm font-semibold ${drawer.pmgQueueBacklog() > 0 ? 'text-amber-600 dark:text-amber-400' : 'text-base-content'}`}
- >
- {formatInteger(pmg().queueTotal)}
- </div>
- </div>
- <div class="rounded border border-rose-200 bg-surface px-2 py-1.5 dark:border-rose-700">
- <div class="text-[10px] text-muted">Backlog</div>
- <div
- class={`text-sm font-semibold ${drawer.pmgQueueBacklog() > 0 ? 'text-amber-600 dark:text-amber-400' : 'text-base-content'}`}
- >
- {formatInteger(drawer.pmgQueueBacklog())}
- </div>
- </div>
+ <Show when={pmg().version}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Version</span>
+ <span class="font-medium text-base-content">{pmg().version}</span>
</div>
- <Show when={pmg().nodeCount || drawer.pmgUpdatedRelative()}>
- <div
- data-testid="pmg-support-context"
- class="space-y-1.5 rounded border border-dashed border-rose-200 bg-surface px-2 py-1.5 text-[10px] dark:border-rose-700"
- >
- <Show when={pmg().nodeCount}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Nodes</span>
- <span class="font-medium text-base-content">
- {formatInteger(pmg().nodeCount)}
- </span>
+ </Show>
+ <Show when={pmg().uptimeSeconds || resource.uptime}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Uptime</span>
+ <span class="font-medium text-base-content">
+ {formatUptime(pmg().uptimeSeconds ?? resource.uptime ?? 0)}
+ </span>
+ </div>
+ </Show>
+ <Show when={drawer.showPmgMailFlowDetail()}>
+ <div class="space-y-1.5 border-t border-rose-200 pt-2 dark:border-rose-700">
+ <div class="grid grid-cols-2 gap-2">
+ <div class="rounded border border-rose-200 bg-surface px-2 py-1.5 dark:border-rose-700">
+ <div class="text-[10px] text-muted">Queue</div>
+ <div
+ class={`text-sm font-semibold ${drawer.pmgQueueBacklog() > 0 ? 'text-amber-600 dark:text-amber-400' : 'text-base-content'}`}
+ >
+ {formatInteger(pmg().queueTotal)}
</div>
- </Show>
- <Show when={drawer.pmgUpdatedRelative()}>
+ </div>
+ <div class="rounded border border-rose-200 bg-surface px-2 py-1.5 dark:border-rose-700">
+ <div class="text-[10px] text-muted">Backlog</div>
<div
- class={`flex items-center justify-between gap-2 ${pmg().nodeCount ? 'border-t border-rose-200 pt-1.5 dark:border-rose-700' : ''}`}
+ class={`text-sm font-semibold ${drawer.pmgQueueBacklog() > 0 ? 'text-amber-600 dark:text-amber-400' : 'text-base-content'}`}
>
- <span class="text-muted">Updated</span>
- <span class="font-medium text-base-content">
- {drawer.pmgUpdatedRelative()}
- </span>
+ {formatInteger(drawer.pmgQueueBacklog())}
</div>
- </Show>
+ </div>
</div>
- </Show>
- <details class="rounded border border-rose-200 bg-surface px-2 py-1.5 dark:border-rose-700">
- <summary class="cursor-pointer list-none text-[10px] font-medium text-muted">
- Queue detail
- </summary>
- <div class="mt-2 space-y-1.5 border-t border-rose-200 pt-2 text-[10px] dark:border-rose-700">
- <For each={drawer.pmgVisibleQueueBreakdown()}>
- {(entry) => (
- <div class="flex items-center justify-between gap-2 text-muted">
- <span>{entry.label}</span>
- <span
- class={`font-medium ${entry.warn ? 'text-amber-600 dark:text-amber-400' : 'text-base-content'}`}
- >
- {formatInteger(entry.value)}
+ <Show when={pmg().nodeCount || drawer.pmgUpdatedRelative()}>
+ <div
+ data-testid="pmg-support-context"
+ class="space-y-1.5 rounded border border-dashed border-rose-200 bg-surface px-2 py-1.5 text-[10px] dark:border-rose-700"
+ >
+ <Show when={pmg().nodeCount}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Nodes</span>
+ <span class="font-medium text-base-content">
+ {formatInteger(pmg().nodeCount)}
</span>
</div>
- )}
- </For>
- </div>
- </details>
- <details class="rounded border border-rose-200 bg-surface px-2 py-1.5 dark:border-rose-700">
- <summary class="cursor-pointer list-none text-[10px] font-medium text-muted">
- Mail detail
- </summary>
- <div class="mt-2 space-y-1.5 border-t border-rose-200 pt-2 text-[10px] dark:border-rose-700">
- <For each={drawer.pmgVisibleMailBreakdown()}>
- {(entry) => (
- <div class="flex items-center justify-between gap-2 text-muted">
- <span>{entry.label}</span>
+ </Show>
+ <Show when={drawer.pmgUpdatedRelative()}>
+ <div
+ class={`flex items-center justify-between gap-2 ${pmg().nodeCount ? 'border-t border-rose-200 pt-1.5 dark:border-rose-700' : ''}`}
+ >
+ <span class="text-muted">Updated</span>
<span class="font-medium text-base-content">
- {formatInteger(entry.value)}
+ {drawer.pmgUpdatedRelative()}
</span>
</div>
- )}
- </For>
- </div>
- </details>
- </div>
- </Show>
- <button
- type="button"
- onClick={() => drawer.setShowPmgMailFlowDetail((value) => !value)}
- class="inline-flex items-center rounded-md border border-rose-200 bg-surface px-2.5 py-1 text-[10px] font-medium text-rose-700 transition-colors hover:bg-base dark:border-rose-700 dark:text-rose-300"
- >
- {drawer.showPmgMailFlowDetail() ? 'Hide mail flow' : 'Show mail flow'}
- </button>
+ </Show>
+ </div>
+ </Show>
+ <details class="rounded border border-rose-200 bg-surface px-2 py-1.5 dark:border-rose-700">
+ <summary class="cursor-pointer list-none text-[10px] font-medium text-muted">
+ Queue detail
+ </summary>
+ <div class="mt-2 space-y-1.5 border-t border-rose-200 pt-2 text-[10px] dark:border-rose-700">
+ <For each={drawer.pmgVisibleQueueBreakdown()}>
+ {(entry) => (
+ <div class="flex items-center justify-between gap-2 text-muted">
+ <span>{entry.label}</span>
+ <span
+ class={`font-medium ${entry.warn ? 'text-amber-600 dark:text-amber-400' : 'text-base-content'}`}
+ >
+ {formatInteger(entry.value)}
+ </span>
+ </div>
+ )}
+ </For>
+ </div>
+ </details>
+ <details class="rounded border border-rose-200 bg-surface px-2 py-1.5 dark:border-rose-700">
+ <summary class="cursor-pointer list-none text-[10px] font-medium text-muted">
+ Mail detail
+ </summary>
+ <div class="mt-2 space-y-1.5 border-t border-rose-200 pt-2 text-[10px] dark:border-rose-700">
+ <For each={drawer.pmgVisibleMailBreakdown()}>
+ {(entry) => (
+ <div class="flex items-center justify-between gap-2 text-muted">
+ <span>{entry.label}</span>
+ <span class="font-medium text-base-content">
+ {formatInteger(entry.value)}
+ </span>
+ </div>
+ )}
+ </For>
+ </div>
+ </details>
+ </div>
+ </Show>
+ <button
+ type="button"
+ onClick={() => drawer.setShowPmgMailFlowDetail((value) => !value)}
+ class="inline-flex items-center rounded-md border border-rose-200 bg-surface px-2.5 py-1 text-[10px] font-medium text-rose-700 transition-colors hover:bg-base dark:border-rose-700 dark:text-rose-300"
+ >
+ {drawer.showPmgMailFlowDetail() ? 'Hide mail flow' : 'Show mail flow'}
+ </button>
+ </div>
</div>
- </div>
- );
- }}
- </Show>
- </SupportDisclosure>
- </Show>
+ );
+ }}
+ </Show>
+ </SupportDisclosure>
+ </Show>
- <Show when={drawer.hasVMwareDetails()}>
- <VMwareDetailsDisclosure drawer={drawer} class="h-full" />
- </Show>
+ <Show when={drawer.hasVMwareDetails()}>
+ <VMwareDetailsDisclosure drawer={drawer} class="h-full" />
+ </Show>
- <Show when={drawer.hasHostDetails() && !shouldPromoteHostDetails()}>
- <HostDetailsDisclosure resource={resource} drawer={drawer} class="h-full" />
- </Show>
- </div>
+ <Show when={drawer.hasHostDetails()}>
+ <HostDetailsDisclosure resource={resource} drawer={drawer} class="h-full" />
+ </Show>
+ </div>
+ </TechnicalDetailsDisclosure>
</Show>
</div>
</div>
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerSupportDisclosure.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerSupportDisclosure.tsx
index 7d0cbbec08..885f826e65 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerSupportDisclosure.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerSupportDisclosure.tsx
@@ -27,15 +27,17 @@ export const ResourceDetailDrawerSupportDisclosure: Component<
return (
<div
data-testid={props.dataTestId}
- class={props.class ?? 'rounded border border-dashed border-border bg-surface-hover p-3'}
+ class={`rounded border border-border bg-surface px-2 py-1.5 ${props.class ?? ''}`}
>
- <div class="flex flex-wrap items-start justify-between gap-3">
- <div>
- <div class="text-[11px] font-medium uppercase tracking-wide text-base-content">
+ <div class="flex min-w-0 items-center justify-between gap-2">
+ <div class="flex min-w-0 flex-1 items-baseline gap-2">
+ <div class="shrink-0 text-[11px] font-medium uppercase tracking-wide text-base-content">
{props.title}
</div>
<Show when={summary()}>
- <div class="mt-1 text-[10px] text-base-content">{summary()}</div>
+ <div class="truncate text-[10px] text-muted" title={summary()}>
+ {summary()}
+ </div>
</Show>
</div>
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx
index eb9b3c3734..054c207645 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailSummary.tsx
@@ -1,7 +1,6 @@
import { For, Show } from 'solid-js';
import type { Component } from 'solid-js';
import type { Resource } from '@/types/resource';
-import { Card } from '@/components/shared/Card';
import { isContainerUpdatePinned } from '@/components/shared/containerUpdateBadgeModel';
import { TagBadges } from '@/components/shared/TagBadges';
import { formatBytes, formatRelativeTime, formatUptime } from '@/utils/format';
@@ -13,6 +12,8 @@ interface ResourceSummaryPresentationProps {
resource: Resource;
drawer: UseResourceDetailDrawerStateResult;
showPlatformId: boolean;
+ content?: 'all' | 'overview' | 'technical';
+ dataTestId?: string;
}
// Docker / Podman containers carry runtime facts (image, restart count,
@@ -319,375 +320,157 @@ const DockerContainerSummarySection: Component<{ docker: NonNullable<Resource['d
export const InlineResourceSummaryTables: Component<ResourceSummaryPresentationProps> = (props) => (
<div
- data-testid="resource-summary-section"
+ data-testid={props.dataTestId ?? 'resource-summary-section'}
class="overflow-hidden rounded border border-border bg-surface"
>
<table class="w-full table-fixed text-[11px]">
- <tbody data-testid="resource-current-state-section" class="divide-y divide-border">
- <tr class="bg-surface-alt">
- <th
- colspan="2"
- class="px-2 py-1 text-left text-[10px] font-semibold uppercase tracking-wide text-muted"
- >
- Current state
- </th>
- </tr>
- <tr>
- <td class="w-[38%] px-2 py-1 text-muted">State</td>
- <td class="px-2 py-1 text-right font-medium capitalize text-base-content">
- {props.resource.status || 'unknown'}
- </td>
- </tr>
- <Show when={props.drawer.healthIssue()}>
- {(issue) => (
- <>
+ <Show when={props.content !== 'technical'}>
+ <tbody data-testid="resource-current-state-section" class="divide-y divide-border">
+ <tr class="bg-surface-alt">
+ <th
+ colspan="2"
+ class="px-2 py-1 text-left text-[10px] font-semibold uppercase tracking-wide text-muted"
+ >
+ Operator context
+ </th>
+ </tr>
+ <Show when={props.drawer.sourceSummary()}>
+ {(source) => (
<tr>
- <td class="px-2 py-1 align-top text-muted">Reason</td>
+ <td class="w-[38%] px-2 py-1 text-muted">Pulse coverage</td>
<td
- class="px-2 py-1 text-right align-top font-medium text-amber-700 dark:text-amber-300"
- title={issue().title}
+ class={`px-2 py-1 text-right font-medium ${source().className}`}
+ title={source().title}
>
- <span class="block truncate">{issue().primary}</span>
+ {source().label}
</td>
</tr>
- <Show when={issue().details.length > 0}>
- <tr>
- <td class="px-2 py-1 align-top text-muted">Also</td>
- <td
- class="px-2 py-1 text-right align-top font-medium text-base-content"
- title={issue().details.join(' · ')}
- >
- <span class="block truncate">{issue().details.slice(0, 2).join(' · ')}</span>
- </td>
- </tr>
- </Show>
- </>
- )}
- </Show>
- <Show when={props.resource.uptime}>
- <tr>
- <td class="px-2 py-1 text-muted">Uptime</td>
- <td class="px-2 py-1 text-right font-medium text-base-content">
- {formatUptime(props.resource.uptime ?? 0)}
- </td>
+ )}
+ </Show>
+ <Show when={props.drawer.identityIpValues()[0]}>
+ {(ip) => (
+ <tr>
+ <td class="w-[38%] px-2 py-1 text-muted">Primary IP</td>
+ <td class="px-2 py-1 text-right font-medium text-base-content" title={ip()}>
+ <span class="block truncate">{ip()}</span>
+ </td>
+ </tr>
+ )}
+ </Show>
+ </tbody>
+ </Show>
+ <Show when={props.content !== 'overview'}>
+ <tbody
+ data-testid="resource-runtime-context-section"
+ class="divide-y divide-border border-t border-border"
+ >
+ <tr class="bg-surface-alt">
+ <th
+ colspan="2"
+ class="px-2 py-1 text-left text-[10px] font-semibold uppercase tracking-wide text-muted"
+ >
+ Runtime context
+ </th>
</tr>
- </Show>
- <Show when={props.resource.lastSeen}>
<tr>
- <td class="px-2 py-1 text-muted">Last Seen</td>
- <td
- class="px-2 py-1 text-right font-medium text-base-content"
- title={props.drawer.lastSeenAbsolute()}
- >
- {props.drawer.lastSeen() || '—'}
+ <td class="w-[38%] px-2 py-1 text-muted">Observed state</td>
+ <td class="px-2 py-1 text-right font-medium capitalize text-base-content">
+ {props.resource.status || 'unknown'}
</td>
</tr>
- </Show>
- <Show when={props.drawer.sourceSummary()}>
- {(source) => (
+ <Show when={props.resource.uptime}>
+ <tr>
+ <td class="px-2 py-1 text-muted">Uptime</td>
+ <td class="px-2 py-1 text-right font-medium text-base-content">
+ {formatUptime(props.resource.uptime ?? 0)}
+ </td>
+ </tr>
+ </Show>
+ <Show when={props.resource.lastSeen}>
<tr>
- <td class="px-2 py-1 text-muted">Sources</td>
+ <td class="px-2 py-1 text-muted">Last seen</td>
<td
- class={`px-2 py-1 text-right font-medium ${source().className}`}
- title={source().title}
+ class="px-2 py-1 text-right font-medium text-base-content"
+ title={props.drawer.lastSeenAbsolute()}
>
- {source().label}
+ {props.drawer.lastSeen() || '—'}
</td>
</tr>
- )}
- </Show>
- <Show when={(props.resource.alerts?.length || 0) > 0}>
- <tr>
- <td class="px-2 py-1 text-muted">Alerts</td>
- <td class="px-2 py-1 text-right font-medium text-amber-600 dark:text-amber-400">
- {formatInteger(props.resource.alerts?.length)}
- </td>
- </tr>
- </Show>
- <Show when={props.showPlatformId && !props.drawer.hasRuntimeOperationalContext()}>
- <tr>
- <td class="px-2 py-1 text-muted">Platform ID</td>
- <td
- class="px-2 py-1 text-right font-medium text-base-content"
- title={props.resource.platformId}
- >
- <span class="block truncate">{props.resource.platformId}</span>
- </td>
- </tr>
- </Show>
- </tbody>
- <Show when={dockerContainerMeta(props.resource)}>
+ </Show>
+ </tbody>
+ </Show>
+ <Show when={props.content !== 'overview' && dockerContainerMeta(props.resource)}>
{(docker) => <DockerContainerSummarySection docker={docker()} />}
</Show>
- <tbody
- data-testid="resource-identity-section"
- class="divide-y divide-border border-t border-border"
- >
- <tr class="bg-surface-alt">
- <th
- colspan="2"
- class="px-2 py-1 text-left text-[10px] font-semibold uppercase tracking-wide text-muted"
- >
- Identity
- </th>
- </tr>
- <For each={props.drawer.primaryIdentityRows()}>
- {(row) => (
- <tr>
- <td class="w-[38%] px-2 py-1 text-muted">{row.label}</td>
- <td class="px-2 py-1 text-right font-medium text-base-content" title={row.value}>
- <span class="block truncate">{row.value}</span>
- </td>
- </tr>
- )}
- </For>
- <Show when={props.drawer.identityIpValues().length > 0}>
- <tr>
- <td class="px-2 py-1 align-top text-muted">IP Addresses</td>
- <td class="px-2 py-1">
- <div class="flex flex-wrap justify-end gap-1">
- <For each={props.drawer.identityIpValues()}>
- {(ip) => (
- <span
- class="inline-flex items-center rounded bg-blue-100 px-1.5 py-0.5 text-[10px] text-blue-700 dark:bg-blue-900 dark:text-blue-200"
- title={ip}
- >
- {ip}
- </span>
- )}
- </For>
- </div>
- </td>
- </tr>
- </Show>
- <Show when={props.resource.tags && props.resource.tags.length > 0}>
- <tr>
- <td class="px-2 py-1 align-top text-muted">Tags</td>
- <td class="px-2 py-1">
- <div class="flex justify-end">
- <TagBadges tags={props.resource.tags} maxVisible={6} />
- </div>
- </td>
- </tr>
- </Show>
- <Show when={props.drawer.identityAliasValues().length > 0}>
- <tr>
- <td class="px-2 py-1 align-top text-muted">Aliases</td>
- <td class="px-2 py-1">
- <div class="flex flex-wrap justify-end gap-1">
- <For each={props.drawer.aliasPreviewValues()}>
- {(value) => (
- <span
- class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px]"
- title={value}
- >
- {value}
- </span>
- )}
- </For>
- <Show when={props.drawer.hasAliasOverflow()}>
- <span class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px] text-muted">
- +
- {props.drawer.identityAliasValues().length -
- props.drawer.aliasPreviewValues().length}
- </span>
- </Show>
- </div>
- </td>
- </tr>
- </Show>
- <Show when={!props.drawer.identityCardHasRichData()}>
- <tr>
- <td colspan="2" class="px-2 py-1 text-muted">
- No identity metadata yet.
- </td>
+ <Show when={props.content !== 'overview'}>
+ <tbody
+ data-testid="resource-identity-section"
+ class="divide-y divide-border border-t border-border"
+ >
+ <tr class="bg-surface-alt">
+ <th
+ colspan="2"
+ class="px-2 py-1 text-left text-[10px] font-semibold uppercase tracking-wide text-muted"
+ >
+ Identity
+ </th>
</tr>
- </Show>
- </tbody>
- </table>
- </div>
-);
-
-export const ResourceSummaryCards: Component<ResourceSummaryPresentationProps> = (props) => {
- const { resource, drawer, showPlatformId } = props;
-
- return (
- <div data-testid="resource-summary-section" class="grid gap-3 sm:grid-cols-2">
- <Card data-testid="resource-current-state-section" padding="sm" class="h-full shadow-sm">
- <div class="mb-2 text-[10px] font-medium uppercase tracking-wide text-base-content">
- Current state
- </div>
- <div class="space-y-1.5 text-[11px]">
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">State</span>
- <span class="font-medium text-base-content capitalize">
- {resource.status || 'unknown'}
- </span>
- </div>
- <Show when={drawer.healthIssue()}>
- {(issue) => (
- <>
- <div class="flex items-start justify-between gap-2">
- <span class="shrink-0 text-muted">Reason</span>
- <span
- class="max-w-[68%] text-right font-medium text-amber-700 dark:text-amber-300"
- title={issue().title}
- >
- {issue().primary}
- </span>
- </div>
- <Show when={issue().details.length > 0}>
- <div class="flex items-start justify-between gap-2">
- <span class="shrink-0 text-muted">Also</span>
- <span
- class="max-w-[68%] text-right font-medium text-base-content"
- title={issue().details.join(' · ')}
- >
- {issue().details.slice(0, 2).join(' · ')}
- </span>
- </div>
- </Show>
- </>
- )}
- </Show>
- <Show when={resource.uptime}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Uptime</span>
- <span class="font-medium text-base-content">
- {formatUptime(resource.uptime ?? 0)}
- </span>
- </div>
- </Show>
- <Show when={resource.lastSeen}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Last Seen</span>
- <span class="font-medium text-base-content" title={drawer.lastSeenAbsolute()}>
- {drawer.lastSeen() || '—'}
- </span>
- </div>
- </Show>
- <Show when={drawer.sourceSummary()}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Sources</span>
- <span
- class={`font-medium ${drawer.sourceSummary()!.className}`}
- title={drawer.sourceSummary()!.title}
- >
- {drawer.sourceSummary()!.label}
- </span>
- </div>
- </Show>
- <Show when={(resource.alerts?.length || 0) > 0}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Alerts</span>
- <span class="font-medium text-amber-600 dark:text-amber-400">
- {formatInteger(resource.alerts?.length)}
- </span>
- </div>
- </Show>
- <Show when={showPlatformId && !drawer.hasRuntimeOperationalContext()}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Platform ID</span>
- <span class="font-medium text-base-content truncate" title={resource.platformId}>
- {resource.platformId}
- </span>
- </div>
- </Show>
- <Show when={drawer.hasRuntimeOperationalContext()}>
- <div class="mt-2 space-y-1.5">
- <Show when={showPlatformId}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Platform ID</span>
- <span class="font-medium text-base-content truncate" title={resource.platformId}>
- {resource.platformId}
- </span>
- </div>
- </Show>
- <Show when={drawer.kubernetesCapabilityBadges().length > 0}>
- <div class="flex flex-col gap-1">
- <span class="text-muted">Platform signals</span>
- <div class="flex flex-wrap gap-1">
- <For each={drawer.kubernetesCapabilityBadges()}>
- {(badge) => (
- <span class={badge.classes} title={badge.title}>
- {badge.label}
- </span>
- )}
- </For>
- </div>
- </div>
- </Show>
- </div>
- </Show>
- </div>
- </Card>
-
- <Card data-testid="resource-identity-section" padding="sm" class="h-full shadow-sm">
- <div class="mb-2 text-[10px] font-medium uppercase tracking-wide text-base-content">
- Identity
- </div>
- <div class="space-y-1.5 text-[11px]">
- <For each={drawer.primaryIdentityRows()}>
+ <For each={props.drawer.primaryIdentityRows()}>
{(row) => (
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">{row.label}</span>
- <span class="font-medium text-base-content truncate" title={row.value}>
- {row.value}
- </span>
- </div>
+ <tr>
+ <td class="w-[38%] px-2 py-1 text-muted">{row.label}</td>
+ <td class="px-2 py-1 text-right font-medium text-base-content" title={row.value}>
+ <span class="block truncate">{row.value}</span>
+ </td>
+ </tr>
)}
</For>
- <Show when={drawer.identityIpValues().length > 0}>
- <div class="flex flex-col gap-1">
- <span class="text-muted">IP Addresses</span>
- <div class="flex flex-wrap gap-1">
- <For each={drawer.identityIpValues()}>
- {(ip) => (
- <span
- class="inline-flex items-center rounded bg-blue-100 px-1.5 py-0.5 text-[10px] text-blue-700 dark:bg-blue-900 dark:text-blue-200"
- title={ip}
- >
- {ip}
- </span>
- )}
- </For>
- </div>
- </div>
+ <Show when={props.showPlatformId}>
+ <tr>
+ <td class="w-[38%] px-2 py-1 text-muted">Platform ID</td>
+ <td
+ class="px-2 py-1 text-right font-medium text-base-content"
+ title={props.resource.platformId}
+ >
+ <span class="block truncate">{props.resource.platformId}</span>
+ </td>
+ </tr>
</Show>
- <Show when={resource.tags && resource.tags.length > 0}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Tags</span>
- <TagBadges tags={resource.tags} maxVisible={6} />
- </div>
+ <Show when={props.drawer.identityIpValues().length > 0}>
+ <tr>
+ <td class="px-2 py-1 align-top text-muted">IP Addresses</td>
+ <td class="px-2 py-1">
+ <div class="flex flex-wrap justify-end gap-1">
+ <For each={props.drawer.identityIpValues()}>
+ {(ip) => (
+ <span
+ class="inline-flex items-center rounded bg-blue-100 px-1.5 py-0.5 text-[10px] text-blue-700 dark:bg-blue-900 dark:text-blue-200"
+ title={ip}
+ >
+ {ip}
+ </span>
+ )}
+ </For>
+ </div>
+ </td>
+ </tr>
</Show>
- <Show when={drawer.identityAliasValues().length > 0}>
- <Show
- when={drawer.hasAliasOverflow()}
- fallback={
- <div class="flex flex-col gap-1">
- <span class="text-muted">Aliases</span>
- <div class="flex flex-wrap gap-1">
- <For each={drawer.aliasPreviewValues()}>
- {(value) => (
- <span
- class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px]"
- title={value}
- >
- {value}
- </span>
- )}
- </For>
- </div>
+ <Show when={props.resource.tags && props.resource.tags.length > 0}>
+ <tr>
+ <td class="px-2 py-1 align-top text-muted">Tags</td>
+ <td class="px-2 py-1">
+ <div class="flex justify-end">
+ <TagBadges tags={props.resource.tags} maxVisible={6} />
</div>
- }
- >
- <details class="rounded border border-border bg-surface px-2 py-1.5">
- <summary class="flex cursor-pointer list-none items-center justify-between text-[10px] font-medium text-muted">
- <span>Aliases</span>
- <span class="text-muted">{drawer.identityAliasValues().length}</span>
- </summary>
- <div class="mt-2 flex flex-wrap gap-1 border-t border-border pt-2">
- <For each={drawer.identityAliasValues()}>
+ </td>
+ </tr>
+ </Show>
+ <Show when={props.drawer.identityAliasValues().length > 0}>
+ <tr>
+ <td class="px-2 py-1 align-top text-muted">Aliases</td>
+ <td class="px-2 py-1">
+ <div class="flex flex-wrap justify-end gap-1">
+ <For each={props.drawer.aliasPreviewValues()}>
{(value) => (
<span
class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px]"
@@ -697,17 +480,26 @@ export const ResourceSummaryCards: Component<ResourceSummaryPresentationProps> =
</span>
)}
</For>
+ <Show when={props.drawer.hasAliasOverflow()}>
+ <span class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px] text-muted">
+ +
+ {props.drawer.identityAliasValues().length -
+ props.drawer.aliasPreviewValues().length}
+ </span>
+ </Show>
</div>
- </details>
- </Show>
+ </td>
+ </tr>
</Show>
- <Show when={!drawer.identityCardHasRichData()}>
- <div class="rounded border border-dashed bg-surface-hover px-2 py-1.5 text-[10px] ">
- No identity metadata yet.
- </div>
+ <Show when={!props.drawer.identityCardHasRichData()}>
+ <tr>
+ <td colspan="2" class="px-2 py-1 text-muted">
+ No identity metadata yet.
+ </td>
+ </tr>
</Show>
- </div>
- </Card>
- </div>
- );
-};
+ </tbody>
+ </Show>
+ </table>
+ </div>
+);
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
index 679de240fa..e709240025 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
-import { fireEvent, render, screen, within } from '@solidjs/testing-library';
+import { fireEvent, render as solidRender, screen, within } from '@solidjs/testing-library';
import { Suspense } from 'solid-js';
import discoveryTabSource from '@/components/Discovery/DiscoveryTab.tsx?raw';
@@ -26,6 +26,25 @@ import actionAuditPresentationSource from '@/utils/actionAuditPresentation.ts?ra
import type { Resource } from '@/types/resource';
import { ResourceDetailDrawer } from '@/components/Infrastructure/ResourceDetailDrawer';
+const render = (...args: Parameters<typeof solidRender>): ReturnType<typeof solidRender> => {
+ const result = solidRender(...args);
+ const details = result.container.querySelector<HTMLDetailsElement>(
+ '[data-testid="resource-technical-details"]',
+ );
+ if (details) {
+ details.open = true;
+ fireEvent(details, new Event('toggle'));
+ }
+ const platformDetails = result.container.querySelector<HTMLDetailsElement>(
+ '[data-testid="resource-platform-details"]',
+ );
+ if (platformDetails) {
+ platformDetails.open = true;
+ fireEvent(platformDetails, new Event('toggle'));
+ }
+ return result;
+};
+
const facetBundleMock = vi.hoisted(() => ({
getFacetBundle: vi.fn(),
}));
@@ -202,7 +221,8 @@ describe('ResourceDetailDrawer change history section', () => {
expect(resourceDetailDrawerHistoryStateSource).toContain('ResourceAPI.getFacetBundle');
expect(resourceDetailDrawerHistoryStateSource).toContain('AIAPI.getResourceIntelligence');
expect(resourceDetailDrawerHistoryStateSource).toContain('ActionAuditAPI.listActionAudits');
- expect(resourceDetailDrawerOverviewSource).toContain("from './ResourceActionHistory'");
+ expect(resourceDetailDrawerOverviewSource).not.toContain("from './ResourceActionHistory'");
+ expect(resourceDetailDrawerShellSource).toContain("from './ResourceActionHistory'");
expect(resourceDetailDrawerOverviewSource).toContain(
'dataTestId="resource-relationship-map-section"',
);
@@ -346,7 +366,7 @@ describe('ResourceDetailDrawer change history section', () => {
await Promise.resolve();
expect(screen.queryByText('Loading view...')).not.toBeInTheDocument();
- expect(screen.getByText('Current state')).toBeInTheDocument();
+ expect(screen.getByText('Technical details')).toBeInTheDocument();
});
it('keeps table-row presentation focused on local resource details', async () => {
@@ -370,12 +390,11 @@ describe('ResourceDetailDrawer change history section', () => {
await Promise.resolve();
- expect(screen.getByText('Current state')).toBeInTheDocument();
+ expect(screen.queryByText('Operator context')).not.toBeInTheDocument();
expect(screen.getByText('Identity')).toBeInTheDocument();
expect(screen.queryByText('Change history')).not.toBeInTheDocument();
- // Operator overrides render in every presentation (issue #1622) —
- // intentionally-offline and never-auto-remediate must stay reachable
- // even for resources with no auto-authorizable capabilities.
+ expect(screen.queryByText('Operator overrides')).not.toBeInTheDocument();
+ fireEvent.click(screen.getByRole('tab', { name: 'Manage' }));
expect(screen.getByText('Operator overrides')).toBeInTheDocument();
expect(screen.queryByText('Maintenance verification')).not.toBeInTheDocument();
expect(screen.queryByText('Action history')).not.toBeInTheDocument();
@@ -494,46 +513,24 @@ describe('ResourceDetailDrawer change history section', () => {
const changeHistorySection = screen.getByTestId('resource-change-history-section');
expect(screen.queryByRole('button', { name: 'Discovery' })).toBeNull();
expect(screen.queryByText('Summary')).toBeNull();
- expect(screen.getByText('Current state')).toBeInTheDocument();
+ expect(screen.queryByText('Operator context')).not.toBeInTheDocument();
expect(screen.queryByText('Runtime')).toBeNull();
expect(screen.getByText('Change history')).toBeInTheDocument();
expect(screen.getByTestId('resource-secondary-sections').classList.contains('space-y-3')).toBe(
true,
);
- expect(screen.getByTestId('resource-support-sections').classList.contains('flex')).toBe(true);
- expect(screen.getByTestId('resource-support-sections').classList.contains('flex-wrap')).toBe(
- true,
- );
expect(
- screen.getByTestId('resource-summary-section').querySelectorAll('.bg-surface-hover.px-2.py-2')
- .length,
+ screen
+ .getByTestId('resource-technical-summary-section')
+ .querySelectorAll('.bg-surface-hover.px-2.py-2').length,
).toBe(0);
- const summarySection = screen.getByTestId('resource-summary-section');
- expect(summarySection.classList.contains('grid')).toBe(true);
- expect(summarySection.classList.contains('gap-3')).toBe(true);
- expect(summarySection.classList.contains('sm:grid-cols-2')).toBe(true);
- expect(
- screen.getByTestId('resource-current-state-section').classList.contains('rounded-md'),
- ).toBe(true);
- expect(
- screen.getByTestId('resource-current-state-section').classList.contains('bg-surface'),
- ).toBe(true);
- expect(
- screen.getByTestId('resource-current-state-section').classList.contains('shadow-sm'),
- ).toBe(true);
- expect(screen.getByTestId('resource-identity-section').classList.contains('rounded-md')).toBe(
- true,
- );
- expect(screen.getByTestId('resource-identity-section').classList.contains('bg-surface')).toBe(
- true,
- );
- expect(screen.getByTestId('resource-identity-section').classList.contains('shadow-sm')).toBe(
- true,
- );
+ const summarySection = screen.getByTestId('resource-technical-summary-section');
+ expect(summarySection.classList.contains('overflow-hidden')).toBe(true);
+ expect(summarySection.querySelector('table')).toBeTruthy();
+ expect(screen.getByTestId('resource-identity-section').tagName).toBe('TBODY');
expect(
screen.getByTestId('resource-change-history-section').querySelector('.mt-3.grid.gap-2'),
).toBeNull();
- const currentStateSection = screen.getByTestId('resource-current-state-section');
const identitySection = screen.getByTestId('resource-identity-section');
expect(screen.queryByText('Host')).toBeNull();
expect(screen.queryByText('Service')).toBeNull();
@@ -553,34 +550,23 @@ describe('ResourceDetailDrawer change history section', () => {
expect(screen.queryByText('Container Updates')).toBeNull();
expect(screen.queryByText('Check Updates')).toBeNull();
expect(screen.queryByText('Show update controls')).toBeNull();
- expect(screen.getByText('Access')).toBeInTheDocument();
+ expect(screen.queryByText('Access')).toBeNull();
expect(screen.queryByText('Analysis')).toBeNull();
expect(
screen.queryByText('Supporting metadata only. The web interface path above stays primary.'),
).toBeNull();
- expect(screen.getByRole('button', { name: 'Show access' })).toBeInTheDocument();
- expect(
- screen
- .getByTestId('resource-access-section')
- .querySelector('.mt-3.rounded.border.border-border.bg-surface.p-2\\.5'),
- ).toBeNull();
+ expect(screen.queryByRole('button', { name: 'Show access' })).toBeNull();
expect(screen.queryByText('Details')).toBeNull();
expect(screen.queryByRole('button', { name: 'Show details' })).toBeNull();
expect(screen.queryByText('Platform ID')).toBeNull();
- expect(currentStateSection.querySelector('.border-dashed')).toBeNull();
expect(within(identitySection).getByText('Tags')).toBeInTheDocument();
- expect(within(currentStateSection).queryByText('Tags')).toBeNull();
+ expect(within(identitySection).getByText('Tags')).toBeInTheDocument();
expect(
within(changeHistorySection).queryByText('Filterable event history for this resource.'),
).toBeNull();
expect(within(changeHistorySection).queryByText('Recent activity')).toBeNull();
expect(screen.queryByText('Events')).toBeNull();
expect(screen.getAllByText('Timeline 3')).toHaveLength(1);
- expect(
- Array.from(screen.getByTestId('resource-support-sections').children).map((node) =>
- node.getAttribute('data-testid'),
- ),
- ).toEqual(['resource-access-section', 'resource-investigation-context']);
expect(screen.getAllByText('Restart 2')).toHaveLength(1);
expect(screen.getAllByText('Anomaly 1')).toHaveLength(1);
expect(screen.getAllByText('Platform event 1')).toHaveLength(1);
@@ -602,15 +588,15 @@ describe('ResourceDetailDrawer change history section', () => {
expect(screen.getByText('Correlations')).toBeInTheDocument();
expect(screen.getByText('Storage 1 alias')).toBeInTheDocument();
expect(screen.getByText('VM Child')).toBeInTheDocument();
+ await screen.findByText('Platform details');
+ const platformDetails = screen.getByTestId('resource-platform-details') as HTMLDetailsElement;
+ platformDetails.open = true;
+ fireEvent(platformDetails, new Event('toggle'));
expect(screen.getByText('Context')).toBeInTheDocument();
expect(screen.queryByText('Capabilities 1')).toBeNull();
expect(screen.queryByText('Relationships 1')).toBeNull();
expect(screen.queryByText('Analysis')).toBeNull();
- fireEvent.click(screen.getByRole('button', { name: 'Show access' }));
- expect(screen.getByText('Analysis')).toBeInTheDocument();
- expect(screen.getByRole('button', { name: 'Open analysis' })).toBeInTheDocument();
-
fireEvent.click(screen.getByRole('button', { name: 'Show context' }));
const contextSection = screen.getByTestId('resource-investigation-context');
await within(contextSection).findByText('Analysis');
@@ -627,6 +613,14 @@ describe('ResourceDetailDrawer change history section', () => {
expect(screen.getByText('3')).toBeInTheDocument();
expect(screen.queryByTestId('resource-correlation-context')).toBeNull();
expect(screen.queryByRole('button', { name: 'Show correlations' })).toBeNull();
+
+ fireEvent.click(screen.getByRole('tab', { name: 'Manage' }));
+ expect(screen.getByText('Access')).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: 'Show access' })).toBeInTheDocument();
+ fireEvent.click(screen.getByRole('button', { name: 'Show access' }));
+ const accessSection = within(screen.getByTestId('resource-access-section'));
+ expect(accessSection.getByText('Analysis')).toBeInTheDocument();
+ expect(accessSection.getByRole('button', { name: 'Open analysis' })).toBeInTheDocument();
});
it('keeps default internal cloud-summary posture out of the investigation context drawer block', async () => {
@@ -661,7 +655,7 @@ describe('ResourceDetailDrawer change history section', () => {
render(() => <ResourceDetailDrawer resource={resource} />);
- await screen.findByText('Current state');
+ await screen.findByText('Technical details');
expect(screen.queryByText('Context')).toBeNull();
expect(screen.queryByText('Governance')).toBeNull();
expect(screen.queryByText('Safe Summary')).toBeNull();
@@ -699,9 +693,7 @@ describe('ResourceDetailDrawer change history section', () => {
expect(
within(screen.getByTestId('resource-identity-section')).getByText('Aliases'),
).toBeInTheDocument();
- expect(
- within(screen.getByTestId('resource-current-state-section')).queryByText('Aliases'),
- ).toBeNull();
+ expect(screen.queryByTestId('resource-current-state-section')).toBeNull();
});
it('renders timeline history without surfacing unsupported capability or relationship facets', async () => {
@@ -918,6 +910,8 @@ describe('ResourceDetailDrawer change history section', () => {
/>
));
+ fireEvent.click(screen.getByRole('tab', { name: 'Manage' }));
+
const actionHistoryNode = await screen.findByTestId('resource-action-history-section');
const actionHistory = within(actionHistoryNode);
@@ -1031,7 +1025,7 @@ describe('ResourceDetailDrawer change history section', () => {
Array.from(screen.getByTestId('resource-support-sections').children).map((node) =>
node.getAttribute('data-testid'),
),
- ).toEqual(['resource-access-section', 'resource-service-details-section']);
+ ).toEqual(['resource-service-details-section']);
fireEvent.click(screen.getByRole('button', { name: 'Show service' }));
const serviceDetails = within(screen.getByTestId('resource-service-details-section'));
expect(
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx
index 5116de80a7..e4054b6d12 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx
@@ -1,5 +1,5 @@
import { afterEach, describe, expect, it, vi } from 'vitest';
-import { fireEvent, render, waitFor, within } from '@solidjs/testing-library';
+import { fireEvent, render as solidRender, waitFor, within } from '@solidjs/testing-library';
import type { Resource } from '@/types/resource';
import { aiChatStore } from '@/stores/aiChat';
@@ -8,6 +8,25 @@ import {
getSpecializedTabAvailabilityMessage,
} from '@/components/Infrastructure/ResourceDetailDrawer';
+const render = (...args: Parameters<typeof solidRender>): ReturnType<typeof solidRender> => {
+ const result = solidRender(...args);
+ const details = result.container.querySelector<HTMLDetailsElement>(
+ '[data-testid="resource-technical-details"]',
+ );
+ if (details) {
+ details.open = true;
+ fireEvent(details, new Event('toggle'));
+ }
+ const platformDetails = result.container.querySelector<HTMLDetailsElement>(
+ '[data-testid="resource-platform-details"]',
+ );
+ if (platformDetails) {
+ platformDetails.open = true;
+ fireEvent(platformDetails, new Event('toggle'));
+ }
+ return result;
+};
+
const wsState = vi.hoisted(() => ({ pmg: [] as any[] }));
const reconnectSpy = vi.hoisted(() => vi.fn());
const getResourceContextMock = vi.hoisted(() => vi.fn());
@@ -207,7 +226,7 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
});
});
- it('renders a unified summary shell without repeating healthy source status', () => {
+ it('omits empty operator context without repeating healthy source status', () => {
const resource = baseResource({
platformData: {
sources: ['agent', 'proxmox'],
@@ -223,15 +242,13 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
));
expect(() => getByText('Summary')).toThrow();
- expect(getByText('Current state')).toBeInTheDocument();
- expect(() => getByText('Sources')).toThrow();
+ expect(() => getByText('Operator context')).toThrow();
+ expect(() => getByText('Pulse coverage')).toThrow();
expect(queryByRole('link', { name: 'Open related workloads for host-1' })).toBeNull();
expect(() => getByText('Mode')).toThrow();
expect(() => getByText('Hybrid')).toThrow();
expect(() => getByText('Platform ID')).toThrow();
- expect(
- getByTestId('resource-current-state-section').querySelector('.border-dashed'),
- ).toBeNull();
+ expect(() => getByTestId('resource-current-state-section')).toThrow();
expect(queryByRole('button', { name: 'Show details' })).toBeNull();
expect(() => getByText('Runtime')).toThrow();
expect(container.querySelector('.text-\\[11px\\].text-muted.truncate')).toBeNull();
@@ -251,8 +268,7 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
const { getByText } = render(() => <ResourceDetailDrawer resource={resource} />);
- expect(getByText('No parity')).toBeInTheDocument();
- expect(getByText('Reason')).toBeInTheDocument();
+ expect(getByText('Needs attention')).toBeInTheDocument();
expect(getByText('Unraid array is running without parity protection')).toBeInTheDocument();
expect(getByText('Unraid array is running check')).toBeInTheDocument();
});
@@ -285,6 +301,8 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
);
expect(queryByRole('button', { name: 'Analysis' })).toBeNull();
+ expect(queryByText('Access')).toBeNull();
+ fireEvent.click(getByRole('tab', { name: 'Manage' }));
expect(getByText('Access')).toBeInTheDocument();
expect(queryByText('Analysis')).toBeNull();
expect(queryByText('Host analysis via host-1')).toBeNull();
@@ -373,7 +391,7 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
Array.from(getByTestId('resource-support-sections').children).map((node) =>
node.getAttribute('data-testid'),
),
- ).toEqual(['resource-access-section', 'resource-host-details-section']);
+ ).toEqual(['resource-host-details-section']);
expect(
getByTestId('resource-host-details-section').querySelector('.mt-3.flex.flex-wrap'),
).toBeTruthy();
@@ -686,7 +704,7 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
const { getByTestId, queryByText } = render(() => <ResourceDetailDrawer resource={resource} />);
- expect(queryByText('Sources')).toBeNull();
+ expect(queryByText('Pulse coverage')).toBeNull();
expect(within(getByTestId('resource-header-badges')).getByText('PMG')).toBeInTheDocument();
expect(queryByText('Mode')).toBeNull();
expect(queryByText('Platform ID')).toBeNull();
@@ -707,7 +725,7 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
const { getByText } = render(() => <ResourceDetailDrawer resource={resource} />);
- expect(getByText('Sources')).toBeInTheDocument();
+ expect(getByText('Pulse coverage')).toBeInTheDocument();
expect(getByText('1/2 degraded')).toBeInTheDocument();
});
@@ -720,9 +738,9 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
},
});
- const { getByText, queryByText } = render(() => <ResourceDetailDrawer resource={resource} />);
+ const { queryByText } = render(() => <ResourceDetailDrawer resource={resource} />);
- expect(getByText('Current state')).toBeInTheDocument();
+ expect(queryByText('Operator context')).toBeNull();
expect(queryByText('Mode')).toBeNull();
expect(queryByText('Unknown')).toBeNull();
});
@@ -857,7 +875,7 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
const inlineAliases = inlineRender.getByText('Aliases');
expect(inlineAliases).toBeInTheDocument();
expect(inlineAliases.closest('summary')).toBeNull();
- expect(inlineRender.container.querySelectorAll('details')).toHaveLength(1);
+ expect(inlineRender.container.querySelectorAll('details')).toHaveLength(2);
expect(inlineRender.getByText('agent-inline-1')).toBeInTheDocument();
expect(inlineRender.getAllByText('inline-host.local').length).toBeGreaterThan(0);
@@ -887,7 +905,8 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
const overflowRender = render(() => <ResourceDetailDrawer resource={overflowResource} />);
const overflowAliases = overflowRender.getByText('Aliases');
expect(overflowAliases).toBeInTheDocument();
- expect(overflowAliases.closest('summary')).toBeTruthy();
+ expect(overflowAliases.closest('summary')).toBeNull();
+ expect(overflowRender.getByText(/^\+\d+$/)).toBeInTheDocument();
});
it('surfaces policy governance details and the safe summary', () => {
@@ -959,9 +978,11 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
<ResourceDetailDrawer resource={resource} />
));
- await waitFor(() => {
- expect(getByText('Context')).toBeInTheDocument();
- });
+ await waitFor(() => expect(getByTestId('resource-platform-details')).toBeInTheDocument());
+ const platformDetails = getByTestId('resource-platform-details') as HTMLDetailsElement;
+ platformDetails.open = true;
+ fireEvent(platformDetails, new Event('toggle'));
+ await waitFor(() => expect(getByText('Context')).toBeInTheDocument());
expect(queryByText('Analysis')).toBeNull();
fireEvent.click(getByRole('button', { name: 'Show context' }));
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.truenas-details.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.truenas-details.test.tsx
index 87ba0d9113..0629c704c9 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.truenas-details.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.truenas-details.test.tsx
@@ -64,6 +64,12 @@ const baseResource = (overrides: Partial<Resource>): Resource =>
...overrides,
}) as Resource;
+const expandPlatformDetails = (getByTestId: (id: string) => HTMLElement): void => {
+ const details = getByTestId('resource-platform-details') as HTMLDetailsElement;
+ details.open = true;
+ fireEvent(details, new Event('toggle'));
+};
+
describe('ResourceDetailDrawer TrueNAS details', () => {
it('opens native TrueNAS system detail immediately for inline platform rows', () => {
const resource = baseResource({
@@ -95,12 +101,13 @@ describe('ResourceDetailDrawer TrueNAS details', () => {
initialShowTrueNASDetails
/>
));
+ expandPlatformDetails(getByTestId);
expect(getByRole('button', { name: 'Hide TrueNAS' })).toBeInTheDocument();
const trueNASSection = getByTestId('resource-truenas-details-section');
- const summary = getByTestId('resource-summary-section');
+ const summary = getByTestId('resource-technical-details');
expect(
- trueNASSection.compareDocumentPosition(summary) & Node.DOCUMENT_POSITION_FOLLOWING,
+ trueNASSection.compareDocumentPosition(summary) & Node.DOCUMENT_POSITION_PRECEDING,
).toBeTruthy();
const section = within(trueNASSection);
expect(section.getByText('System')).toBeInTheDocument();
@@ -137,6 +144,7 @@ describe('ResourceDetailDrawer TrueNAS details', () => {
const { getByText, getByRole, getByTestId, getAllByText, queryByText } = render(() => (
<ResourceDetailDrawer resource={resource} />
));
+ expandPlatformDetails(getByTestId);
expect(getAllByText('TrueNAS').length).toBeGreaterThan(0);
expect(getByText('Running, 4 vCPU, 8.00 GB, 3 devices')).toBeInTheDocument();
@@ -186,6 +194,7 @@ describe('ResourceDetailDrawer TrueNAS details', () => {
const { getByText, getByRole, getByTestId, queryByText } = render(() => (
<ResourceDetailDrawer resource={resource} />
));
+ expandPlatformDetails(getByTestId);
expect(getByText('Running, 2 containers, 1 port, 1 update')).toBeInTheDocument();
expect(queryByText('Docker runtime')).toBeNull();
@@ -232,16 +241,20 @@ describe('ResourceDetailDrawer TrueNAS details', () => {
initialShowTrueNASDetails
/>
));
+ expandPlatformDetails(getByTestId);
- const summary = getByTestId('resource-summary-section');
- expect(summary.querySelector('table')).toBeTruthy();
- expect(getByTestId('resource-current-state-section').tagName).toBe('TBODY');
+ const summary = getByTestId('resource-technical-details');
+ const technicalDetails = getByTestId('resource-technical-details') as HTMLDetailsElement;
+ technicalDetails.open = true;
+ fireEvent(technicalDetails, new Event('toggle'));
+ expect(getByTestId('resource-technical-summary-section').querySelector('table')).toBeTruthy();
+ expect(() => getByTestId('resource-current-state-section')).toThrow();
expect(getByTestId('resource-identity-section').tagName).toBe('TBODY');
expect(summary.querySelector('[class*="shadow-sm"]')).toBeNull();
expect(getByRole('button', { name: 'Hide TrueNAS' })).toBeInTheDocument();
const trueNASSection = getByTestId('resource-truenas-details-section');
expect(
- trueNASSection.compareDocumentPosition(summary) & Node.DOCUMENT_POSITION_FOLLOWING,
+ trueNASSection.compareDocumentPosition(summary) & Node.DOCUMENT_POSITION_PRECEDING,
).toBeTruthy();
const section = within(trueNASSection);
expect(trueNASSection.querySelector('table')).toBeTruthy();
@@ -277,6 +290,7 @@ describe('ResourceDetailDrawer TrueNAS details', () => {
const { getByText, getByRole, getByTestId } = render(() => (
<ResourceDetailDrawer resource={resource} />
));
+ expandPlatformDetails(getByTestId);
expect(getByText('SMB, Enabled, tank/media, Read/write')).toBeInTheDocument();
@@ -333,6 +347,7 @@ describe('ResourceDetailDrawer TrueNAS details', () => {
initialShowTrueNASDetails
/>
));
+ expandPlatformDetails(getByTestId);
expect(getByRole('button', { name: 'Hide TrueNAS' })).toBeInTheDocument();
const section = within(getByTestId('resource-truenas-details-section'));
diff --git a/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts b/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts
index ecf6f8a313..ccf41c2207 100644
--- a/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts
+++ b/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts
@@ -88,7 +88,15 @@ import {
import { getResourceHealthIssuePresentation } from './resourceHealthPresentation';
type DrawerTab =
- 'overview' | 'history' | 'discovery' | 'mail' | 'namespaces' | 'deployments' | 'swarm' | 'debug';
+ | 'overview'
+ | 'history'
+ | 'manage'
+ | 'discovery'
+ | 'mail'
+ | 'namespaces'
+ | 'deployments'
+ | 'swarm'
+ | 'debug';
interface ResourceDrawerDiscoverySourceKey {
type: DiscoveryResourceType;
@@ -383,6 +391,7 @@ export const useResourceDetailDrawerDerivedState = (
const base = [
{ id: 'overview' as DrawerTab, label: 'Overview' },
...(hasMetricsHistory() ? [{ id: 'history' as DrawerTab, label: 'History' }] : []),
+ { id: 'manage' as DrawerTab, label: 'Manage' },
...(hasDiscoveryTab() ? [{ id: 'discovery' as DrawerTab, label: 'Discovery' }] : []),
...(resource.type === 'pmg' ? [{ id: 'mail' as DrawerTab, label: 'Mail' }] : []),
...(resource.type === 'k8s-cluster'
diff --git a/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts b/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts
index 9905933fa1..3af13ae8eb 100644
--- a/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts
+++ b/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts
@@ -6,8 +6,6 @@ import { GUEST_DRAWER_HISTORY_DEFAULT_RANGE } from '@/components/Workloads/guest
import { aiChatStore } from '@/stores/aiChat';
import { notificationStore } from '@/stores/notifications';
import { createLocalStorageBooleanSignal, STORAGE_KEYS } from '@/utils/localStorage';
-import { hasKubernetesDetailSections } from './resourceDetailDrawerKubernetesModel';
-import { isPulseAgentPlatformResource } from '@/utils/agentResources';
import { copyToClipboard } from '@/utils/clipboard';
import { formatAgentResourceContextForClipboard } from '@/utils/agentContextPresentation';
import { useResourceDetailDrawerDockerActionsState } from './useResourceDetailDrawerDockerActionsState';
@@ -17,7 +15,15 @@ import { buildResourceAssistantContext } from '@/utils/resourceAssistantContextM
import type { ResourceDetailDrawerPresentation } from './resourceDetailDrawerPresentation';
type DrawerTab =
- 'overview' | 'history' | 'discovery' | 'mail' | 'namespaces' | 'deployments' | 'swarm' | 'debug';
+ | 'overview'
+ | 'history'
+ | 'manage'
+ | 'discovery'
+ | 'mail'
+ | 'namespaces'
+ | 'deployments'
+ | 'swarm'
+ | 'debug';
export interface UseResourceDetailDrawerStateOptions {
resource: Resource;
@@ -46,17 +52,14 @@ export const useResourceDetailDrawerState = (options: UseResourceDetailDrawerSta
const [showInvestigationContext, setShowInvestigationContext] = createSignal(false);
const [showDiscoveryContext, setShowDiscoveryContext] = createSignal(false);
const [showHostDetails, setShowHostDetails] = createSignal(
- options.initialShowHostDetails ??
- (options.presentation === 'table-row' && isPulseAgentPlatformResource(resource)),
+ options.initialShowHostDetails === true,
);
const [showServiceDetails, setShowServiceDetails] = createSignal(false);
const [showVMwareDetails, setShowVMwareDetails] = createSignal(false);
const [showTrueNASDetails, setShowTrueNASDetails] = createSignal(
options.initialShowTrueNASDetails === true,
);
- const [showKubernetesDetails, setShowKubernetesDetails] = createSignal(
- hasKubernetesDetailSections(resource),
- );
+ const [showKubernetesDetails, setShowKubernetesDetails] = createSignal(false);
const [showPbsJobDetail, setShowPbsJobDetail] = createSignal(false);
const [showPmgMailFlowDetail, setShowPmgMailFlowDetail] = createSignal(false);
const [k8sDeploymentsPrefillNamespace, setK8sDeploymentsPrefillNamespace] = createSignal('');
diff --git a/frontend-modern/src/components/Workloads/GuestDrawer.test.tsx b/frontend-modern/src/components/Workloads/GuestDrawer.test.tsx
index 58f43f6f8b..0e2d4b65e7 100644
--- a/frontend-modern/src/components/Workloads/GuestDrawer.test.tsx
+++ b/frontend-modern/src/components/Workloads/GuestDrawer.test.tsx
@@ -1,5 +1,12 @@
import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest';
-import { render, screen, fireEvent, cleanup, waitFor, within } from '@solidjs/testing-library';
+import {
+ render as solidRender,
+ screen,
+ fireEvent,
+ cleanup,
+ waitFor,
+ within,
+} from '@solidjs/testing-library';
import { Suspense } from 'solid-js';
import type { WorkloadGuest } from '@/types/workloads';
import type { Memory, Disk, GuestNetworkInterface } from '@/types/api';
@@ -8,6 +15,7 @@ import { aiChatStore } from '@/stores/aiChat';
import { getCanonicalWorkloadId, getWorkloadMetadataId } from '@/utils/workloads';
import { getDiscoveryProvenanceTitle } from '@/utils/discoveryPresentation';
import guestDrawerSource from './GuestDrawer.tsx?raw';
+import guestDrawerManageSource from './GuestDrawerManage.tsx?raw';
import guestDrawerOverviewSource from './GuestDrawerOverview.tsx?raw';
// ── Mocks ──────────────────────────────────────────────────────────────
@@ -114,6 +122,20 @@ vi.mock('@/components/shared/WebInterfaceUrlField', () => ({
// After mocks, import the component under test
import { GuestDrawer } from './GuestDrawer';
+const render = (...args: Parameters<typeof solidRender>): ReturnType<typeof solidRender> => {
+ const result = solidRender(...args);
+ const details = result.container.querySelector<HTMLDetailsElement>(
+ '[data-testid="guest-technical-details"]',
+ );
+ if (details) {
+ details.open = true;
+ fireEvent(details, new Event('toggle'));
+ }
+ const manageTab = screen.queryByRole('tab', { name: 'Manage' });
+ if (manageTab) fireEvent.click(manageTab);
+ return result;
+};
+
// ── Helpers ────────────────────────────────────────────────────────────
/** Build a minimal WorkloadGuest with required fields, overridable via partial. */
@@ -163,6 +185,8 @@ function getDiscoveryPanel(): HTMLElement {
return panel;
}
+const technicalDetails = () => within(screen.getByTestId('guest-technical-details'));
+
const makeHistoryPoints = (base: number) => [
{ timestamp: 1, value: base, min: base, max: base },
{ timestamp: 2, value: base + 5, min: base + 5, max: base + 5 },
@@ -208,10 +232,49 @@ describe('GuestDrawer', () => {
);
});
- it('mounts canonical resource policy only in the selected guest overview', () => {
- expect(guestDrawerOverviewSource).toContain('<ResourceOperatorStateSection');
- expect(guestDrawerOverviewSource).toContain('resourceId={props.guestId}');
- expect(guestDrawerOverviewSource).toContain('platformType="proxmox"');
+ it('keeps canonical resource policy out of Overview and mounts it on demand in Manage', () => {
+ expect(guestDrawerOverviewSource).not.toContain('<ResourceOperatorStateSection');
+ expect(guestDrawerManageSource).toContain('<ResourceOperatorStateSection');
+ expect(guestDrawerSource).toContain("activeTab() === 'manage'");
+ expect(guestDrawerManageSource).toContain('data-testid="guest-manage-tab"');
+ });
+
+ it('opens with additive context and the active problem before technical inventory', () => {
+ const { container } = solidRender(() => (
+ <GuestDrawer
+ guest={makeGuest({
+ osName: 'Debian',
+ osVersion: '12',
+ ipAddresses: ['192.0.2.25'],
+ })}
+ alerts={[
+ {
+ id: 'alert-memory',
+ type: 'memory',
+ level: 'critical',
+ resourceId: 'inst1-node1-100',
+ resourceName: 'test-vm',
+ node: 'node1',
+ instance: 'inst1',
+ message: 'Memory usage has remained above 95%',
+ value: 96,
+ threshold: 95,
+ startTime: new Date().toISOString(),
+ acknowledged: false,
+ },
+ ]}
+ onClose={vi.fn()}
+ />
+ ));
+
+ expect(screen.getByText('Needs attention')).toBeInTheDocument();
+ expect(screen.getByText('Memory usage has remained above 95%')).toBeInTheDocument();
+ expect(screen.getByText(/Debian.*12/)).toBeInTheDocument();
+ expect(screen.getByText('192.0.2.25')).toBeInTheDocument();
+ expect(container.querySelector('[data-testid="guest-technical-details"]')).not.toHaveAttribute(
+ 'open',
+ );
+ expect(screen.queryByTestId('guest-manage-tab')).not.toBeInTheDocument();
});
describe('Assistant context actions', () => {
@@ -341,7 +404,7 @@ describe('GuestDrawer', () => {
});
it('starts on the Overview tab (discovery content hidden)', () => {
- const { container } = render(() => (
+ const { container } = solidRender(() => (
<GuestDrawer guest={makeGuestWithDiscoveryTarget()} onClose={vi.fn()} />
));
const panels = container.querySelectorAll('[style*="overflow-anchor"]');
@@ -645,7 +708,7 @@ describe('GuestDrawer', () => {
<GuestDrawer guest={makeGuest({ agentVersion: '5.2.0', type: 'qemu' })} onClose={vi.fn()} />
));
expect(screen.getByText('Guest agent')).toBeInTheDocument();
- expect(screen.getByText('QEMU 5.2.0')).toBeInTheDocument();
+ expect(technicalDetails().getByText('QEMU 5.2.0')).toBeInTheDocument();
});
it('identifies an API-mapped in-guest Pulse Agent without calling it QEMU', () => {
@@ -657,7 +720,10 @@ describe('GuestDrawer', () => {
));
expect(screen.getByText('Pulse Agent')).toBeInTheDocument();
- expect(screen.getByText('Pulse 6.2.0')).toHaveAttribute('title', 'Pulse Agent 6.2.0');
+ expect(technicalDetails().getByText('Pulse 6.2.0')).toHaveAttribute(
+ 'title',
+ 'Pulse Agent 6.2.0',
+ );
expect(screen.queryByText(/QEMU/)).toBeNull();
});
@@ -666,7 +732,7 @@ describe('GuestDrawer', () => {
<GuestDrawer guest={makeGuest({ agentVersion: '1.0.0', type: 'lxc' })} onClose={vi.fn()} />
));
expect(screen.getByText('Guest agent')).toBeInTheDocument();
- expect(screen.getByText('1.0.0')).toBeInTheDocument();
+ expect(technicalDetails().getByText('1.0.0')).toBeInTheDocument();
});
it('surfaces the install path when a running VM has no Pulse agent', () => {
@@ -699,7 +765,7 @@ describe('GuestDrawer', () => {
));
expect(screen.getByText('Actions')).toBeInTheDocument();
- expect(screen.getByText('Node agent connected')).toHaveAttribute(
+ expect(technicalDetails().getByText('Node agent connected')).toHaveAttribute(
'title',
'Discovery and governed actions use the Pulse Agent connected to delly.',
);
@@ -755,7 +821,7 @@ describe('GuestDrawer', () => {
onClose={vi.fn()}
/>
));
- expect(screen.getByText('Debian')).toBeInTheDocument();
+ expect(technicalDetails().getByText('Debian')).toBeInTheDocument();
});
it('shows OS version only when name is missing', () => {
@@ -766,7 +832,7 @@ describe('GuestDrawer', () => {
/>
));
expect(screen.getByText('Guest Info')).toBeInTheDocument();
- expect(screen.getByText('11.0')).toBeInTheDocument();
+ expect(technicalDetails().getByText('11.0')).toBeInTheDocument();
});
it('shows IP addresses', () => {
@@ -776,7 +842,7 @@ describe('GuestDrawer', () => {
onClose={vi.fn()}
/>
));
- expect(screen.getByText('192.168.1.10')).toBeInTheDocument();
+ expect(technicalDetails().getByText('192.168.1.10')).toBeInTheDocument();
expect(screen.getByText('10.0.0.5')).toBeInTheDocument();
});
@@ -861,13 +927,13 @@ describe('GuestDrawer', () => {
const now = new Date('2026-03-02T10:00:00Z').getTime();
render(() => <GuestDrawer guest={makeGuest({ lastBackup: now })} onClose={vi.fn()} />);
expect(screen.getByText('Backup')).toBeInTheDocument();
- expect(screen.getByText('Today')).toBeInTheDocument();
+ expect(technicalDetails().getByText('Today')).toBeInTheDocument();
});
it('shows "Yesterday" for a 1-day-old backup', () => {
const yesterday = new Date('2026-03-01T12:00:00Z').getTime();
render(() => <GuestDrawer guest={makeGuest({ lastBackup: yesterday })} onClose={vi.fn()} />);
- expect(screen.getByText('Yesterday')).toBeInTheDocument();
+ expect(technicalDetails().getByText('Yesterday')).toBeInTheDocument();
});
it('shows "Xd ago" for older backups', () => {
@@ -875,14 +941,14 @@ describe('GuestDrawer', () => {
render(() => (
<GuestDrawer guest={makeGuest({ lastBackup: fiveDaysAgo })} onClose={vi.fn()} />
));
- expect(screen.getByText('5d ago')).toBeInTheDocument();
+ expect(technicalDetails().getByText('5d ago')).toBeInTheDocument();
});
it('applies the caution color for an aging backup', () => {
const tenDaysAgo = new Date('2026-02-20T12:00:00Z').getTime();
render(() => <GuestDrawer guest={makeGuest({ lastBackup: tenDaysAgo })} onClose={vi.fn()} />);
- expect(screen.getByText('10d ago')).toBeInTheDocument();
- const ageEl = screen.getByText('10d ago');
+ expect(technicalDetails().getByText('10d ago')).toBeInTheDocument();
+ const ageEl = technicalDetails().getByText('10d ago');
expect(ageEl.className).toContain('yellow');
});
@@ -891,8 +957,8 @@ describe('GuestDrawer', () => {
render(() => (
<GuestDrawer guest={makeGuest({ lastBackup: fortyDaysAgo })} onClose={vi.fn()} />
));
- expect(screen.getByText('40d ago')).toBeInTheDocument();
- const ageEl = screen.getByText('40d ago');
+ expect(technicalDetails().getByText('40d ago')).toBeInTheDocument();
+ const ageEl = technicalDetails().getByText('40d ago');
expect(ageEl.className).toContain('yellow');
expect(ageEl.className).not.toContain('red');
});
@@ -900,7 +966,7 @@ describe('GuestDrawer', () => {
it('applies green color for recent backups', () => {
const now = new Date('2026-03-02T10:00:00Z').getTime();
render(() => <GuestDrawer guest={makeGuest({ lastBackup: now })} onClose={vi.fn()} />);
- const ageEl = screen.getByText('Today');
+ const ageEl = technicalDetails().getByText('Today');
expect(ageEl.className).toContain('green');
});
diff --git a/frontend-modern/src/components/Workloads/GuestDrawer.tsx b/frontend-modern/src/components/Workloads/GuestDrawer.tsx
index d147879445..db9c5d21d1 100644
--- a/frontend-modern/src/components/Workloads/GuestDrawer.tsx
+++ b/frontend-modern/src/components/Workloads/GuestDrawer.tsx
@@ -17,6 +17,7 @@ import { getGuestDrawerCurrentMetrics, type GuestDrawerProps } from './guestDraw
import { useGuestDrawerState } from './useGuestDrawerState';
import { GuestDrawerHistory, GuestDrawerHistoryRangeSelect } from './GuestDrawerHistory';
import { GuestDrawerOverview } from './GuestDrawerOverview';
+import { GuestDrawerManage } from './GuestDrawerManage';
export const GuestDrawer: Component<GuestDrawerProps> = (props) => {
const {
@@ -117,6 +118,7 @@ export const GuestDrawer: Component<GuestDrawerProps> = (props) => {
...(hasHistorySupport()
? [{ value: 'history', label: 'History' } satisfies SubtabOption]
: []),
+ { value: 'manage', label: 'Manage' },
...(hasDiscoverySupport()
? [{ value: 'discovery', label: 'Discovery' } satisfies SubtabOption]
: []),
@@ -133,7 +135,6 @@ export const GuestDrawer: Component<GuestDrawerProps> = (props) => {
<div class={activeTab() === 'overview' ? '' : 'hidden'} style={{ 'overflow-anchor': 'none' }}>
<GuestDrawerOverview
guest={props.guest}
- guestId={guestId()}
guestOsSummary={guestOsSummary()}
agentHeading={agentHeading()}
agentLabel={agentLabel()}
@@ -146,16 +147,13 @@ export const GuestDrawer: Component<GuestDrawerProps> = (props) => {
networkInterfaces={networkInterfaces()}
nestedWorkloadContext={props.nestedWorkloadContext}
normalizedTags={normalizedTags()}
- onCustomUrlChange={props.onCustomUrlChange}
- customUrl={props.customUrl}
backupPresentation={backupPresentation()}
diskThresholds={diskThresholds()}
discoveryIdentifiedSummary={discoveryIdentifiedSummary()}
hasWorkloadActionAgent={hasWorkloadActionAgent()}
showInGuestAgentInstallCue={showInGuestAgentInstallCue()}
- webInterfaceMetadataId={webInterfaceMetadataId()}
- webInterfaceTargetLabel={webInterfaceTargetLabel()}
workloadActionAgentTitle={workloadActionAgentTitle()}
+ alerts={props.alerts}
/>
</div>
@@ -188,6 +186,20 @@ export const GuestDrawer: Component<GuestDrawerProps> = (props) => {
</Suspense>
</div>
)}
+
+ <div class={activeTab() === 'manage' ? '' : 'hidden'} style={{ 'overflow-anchor': 'none' }}>
+ <Show when={activeTab() === 'manage'}>
+ <GuestDrawerManage
+ guest={props.guest}
+ resourceId={guestId()}
+ metadataId={webInterfaceMetadataId()}
+ targetLabel={webInterfaceTargetLabel()}
+ customUrl={props.customUrl}
+ onCustomUrlChange={props.onCustomUrlChange}
+ suggestion={discoveryIdentifiedSummary() ?? undefined}
+ />
+ </Show>
+ </div>
</section>
);
};
diff --git a/frontend-modern/src/components/Workloads/GuestDrawerManage.tsx b/frontend-modern/src/components/Workloads/GuestDrawerManage.tsx
new file mode 100644
index 0000000000..868a8d9423
--- /dev/null
+++ b/frontend-modern/src/components/Workloads/GuestDrawerManage.tsx
@@ -0,0 +1,45 @@
+import type { Component } from 'solid-js';
+
+import { ResourceOperatorStateSection } from '@/components/Infrastructure/ResourceOperatorStateSection';
+import {
+ WebInterfaceUrlField,
+ type WebInterfaceUrlFieldProps,
+} from '@/components/shared/WebInterfaceUrlField';
+import type { WorkloadGuest } from '@/types/workloads';
+import { isGuestDrawerVM, type GuestDrawerProps } from './guestDrawerModel';
+
+type GuestWebInterfaceSuggestion = Pick<
+ WebInterfaceUrlFieldProps,
+ 'suggestedUrl' | 'suggestedUrlReasonText' | 'suggestedUrlReasonTitle' | 'suggestedUrlDiagnostic'
+>;
+
+interface GuestDrawerManageProps {
+ guest: WorkloadGuest;
+ resourceId: string;
+ metadataId: string;
+ targetLabel: string;
+ customUrl?: string;
+ onCustomUrlChange?: GuestDrawerProps['onCustomUrlChange'];
+ suggestion?: GuestWebInterfaceSuggestion;
+}
+
+export const GuestDrawerManage: Component<GuestDrawerManageProps> = (props) => (
+ <div class="space-y-3" data-testid="guest-manage-tab">
+ <ResourceOperatorStateSection
+ resourceId={props.resourceId}
+ resourceType={isGuestDrawerVM(props.guest) ? 'vm' : 'system-container'}
+ platformType={props.guest.platformType || 'proxmox'}
+ />
+ <WebInterfaceUrlField
+ metadataKind="guest"
+ metadataId={props.metadataId}
+ targetLabel={props.targetLabel}
+ customUrl={props.customUrl}
+ onCustomUrlChange={(url) => props.onCustomUrlChange?.(props.metadataId, url)}
+ suggestedUrl={props.suggestion?.suggestedUrl}
+ suggestedUrlReasonText={props.suggestion?.suggestedUrlReasonText}
+ suggestedUrlReasonTitle={props.suggestion?.suggestedUrlReasonTitle}
+ suggestedUrlDiagnostic={props.suggestion?.suggestedUrlDiagnostic}
+ />
+ </div>
+);
diff --git a/frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx b/frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx
index 6f061ecb70..93456032fd 100644
--- a/frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx
+++ b/frontend-modern/src/components/Workloads/GuestDrawerOverview.tsx
@@ -5,13 +5,21 @@ import BoxIcon from 'lucide-solid/icons/box';
import { formatDiscoveryAge } from '@/api/discovery';
import { buildInfrastructureOnboardingPath } from '@/components/Settings/infrastructureWorkspaceModel';
import { DiscoveryProvenanceMarker } from '@/components/shared/DiscoveryProvenanceMarker';
+import {
+ DetailSectionTable,
+ compactDetailRows,
+ compactDetailSections,
+ makeDetailRow,
+} from '@/components/shared/DetailSectionTable';
import { InfoCardFrame } from '@/components/shared/InfoCardFrame';
-import { WebInterfaceUrlField } from '@/components/shared/WebInterfaceUrlField';
+import { TechnicalDetailsDisclosure } from '@/components/shared/TechnicalDetailsDisclosure';
+import { DrawerAttentionSection } from '@/components/shared/DrawerAttentionSection';
+import type { Alert } from '@/types/api';
import { AvailabilityProbeStatusCards } from '@/components/Infrastructure/AvailabilityProbeStatusCard';
-import { ResourceOperatorStateSection } from '@/components/Infrastructure/ResourceOperatorStateSection';
import type { DiscoveryIdentifiedSummary } from '@/utils/discoveryPresentation';
import { formatBytes, formatUptime } from '@/utils/format';
import type { MetricDisplayThresholds } from '@/utils/metricThresholds';
+import { getWorkloadsGuestProtectionPresentation } from '@/utils/workloadGuestPresentation';
import { AvailabilityProbeSuggestionCard } from './AvailabilityProbeSuggestionCard';
import { DiskList } from './DiskList';
@@ -27,7 +35,6 @@ import type { GuestDrawerProps } from './guestDrawerModel';
interface GuestDrawerOverviewProps {
guest: GuestDrawerProps['guest'];
- guestId: string;
guestOsSummary: string;
agentHeading: string;
agentLabel: string;
@@ -42,8 +49,6 @@ interface GuestDrawerOverviewProps {
networkInterfaces: NonNullable<GuestDrawerProps['guest']['networkInterfaces']>;
nestedWorkloadContext?: NestedWorkloadContext;
normalizedTags: string[];
- onCustomUrlChange?: GuestDrawerProps['onCustomUrlChange'];
- customUrl?: GuestDrawerProps['customUrl'];
backupPresentation: {
ageClass: string;
ageLabel: string;
@@ -51,443 +56,482 @@ interface GuestDrawerOverviewProps {
} | null;
diskThresholds?: MetricDisplayThresholds | null;
discoveryIdentifiedSummary?: DiscoveryIdentifiedSummary | null;
- webInterfaceMetadataId: string;
- webInterfaceTargetLabel: string;
workloadActionAgentTitle: string;
+ alerts?: Alert[];
}
export function GuestDrawerOverview(props: GuestDrawerOverviewProps) {
+ const protectionPresentation = () =>
+ getWorkloadsGuestProtectionPresentation({
+ backupInProgress: props.guest.backupInProgress,
+ ageLabel: props.backupPresentation?.ageLabel,
+ ageClass: props.backupPresentation?.ageClass,
+ });
+ const coverageLabel = () => {
+ if (props.hasWorkloadActionAgent) return WORKLOAD_ACTION_AGENT_LABEL;
+ if (props.hasAgentInfo) return props.agentLabel;
+ if (props.showInGuestAgentInstallCue) return 'Agent recommended';
+ return null;
+ };
+ const overviewSections = () =>
+ compactDetailSections([
+ {
+ label: 'Operator context',
+ rows: compactDetailRows([
+ makeDetailRow('System', props.hasOsInfo ? props.guestOsSummary : null),
+ makeDetailRow('Pulse coverage', coverageLabel()),
+ makeDetailRow('Primary IP', props.ipAddresses[0]),
+ makeDetailRow('Protection', protectionPresentation().label, {
+ tone: protectionPresentation().tone,
+ }),
+ makeDetailRow(
+ 'Identified service',
+ props.discoveryIdentifiedSummary
+ ? [
+ props.discoveryIdentifiedSummary.serviceName,
+ props.discoveryIdentifiedSummary.category,
+ ]
+ .filter(Boolean)
+ .join(' · ')
+ : null,
+ ),
+ ]),
+ },
+ ]);
+
return (
- <div>
- <div class="flex flex-wrap gap-3 [&>*]:flex-1 [&>*]:basis-[calc(25%-0.75rem)] [&>*]:min-w-[200px] [&>*]:max-w-full [&>*]:overflow-hidden">
- <Show when={props.discoveryIdentifiedSummary}>
- {(summary) => (
- <InfoCardFrame>
- <div class="flex items-center justify-between gap-2 mb-2">
- <div class="flex min-w-0 items-center gap-1.5">
- <h3 class="truncate text-[11px] font-medium uppercase tracking-wide text-base-content">
- Identified Service
- </h3>
- <DiscoveryProvenanceMarker />
- </div>
- </div>
- <div class="space-y-1.5 text-[11px]">
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Service</span>
- <span
- class="font-medium text-base-content truncate ml-2"
- title={summary().serviceName}
- >
- {summary().serviceName}
- </span>
- </div>
- <Show when={summary().category}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Category</span>
- <span class="font-medium text-base-content truncate ml-2">
- {summary().category}
- </span>
- </div>
- </Show>
- <Show when={summary().serviceVersion}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Version</span>
- <span
- class="font-medium text-base-content truncate ml-2"
- title={summary().serviceVersion}
- >
- {summary().serviceVersion}
- </span>
+ <div class="space-y-3">
+ <DrawerAttentionSection
+ items={(props.alerts ?? []).map((alert) => ({
+ id: alert.id,
+ message: alert.message,
+ severity: alert.level,
+ acknowledged: alert.acknowledged,
+ }))}
+ />
+ <DetailSectionTable sections={overviewSections()} />
+
+ <TechnicalDetailsDisclosure
+ dataTestId="guest-technical-details"
+ subtitle="Hardware, identity, and interfaces"
+ >
+ <div class="flex flex-wrap gap-2 [&>*]:flex-1 [&>*]:basis-[calc(25%-0.5rem)] [&>*]:min-w-[200px] [&>*]:max-w-full [&>*]:overflow-hidden">
+ <Show when={props.discoveryIdentifiedSummary}>
+ {(summary) => (
+ <InfoCardFrame>
+ <div class="flex items-center justify-between gap-2 mb-2">
+ <div class="flex min-w-0 items-center gap-1.5">
+ <h3 class="truncate text-[11px] font-medium uppercase tracking-wide text-base-content">
+ Identified Service
+ </h3>
+ <DiscoveryProvenanceMarker />
</div>
- </Show>
- <Show when={summary().suggestedUrl}>
+ </div>
+ <div class="space-y-1.5 text-[11px]">
<div class="flex items-center justify-between gap-2">
- <span class="text-muted">Endpoint</span>
+ <span class="text-muted">Service</span>
<span
class="font-medium text-base-content truncate ml-2"
- title={summary().suggestedUrl}
+ title={summary().serviceName}
>
- {summary().suggestedUrl}
+ {summary().serviceName}
</span>
</div>
- </Show>
- <Show when={summary().portCount > 0}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Ports</span>
- <span class="font-medium text-base-content">{summary().portCount}</span>
- </div>
- </Show>
- <div class="flex flex-wrap gap-1 pt-1 text-[10px] text-muted">
- <span>{summary().sourceLabel}</span>
- <Show when={summary().observedAt}>
- <span>· {formatDiscoveryAge(summary().observedAt!)}</span>
+ <Show when={summary().category}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Category</span>
+ <span class="font-medium text-base-content truncate ml-2">
+ {summary().category}
+ </span>
+ </div>
</Show>
- </div>
- </div>
- </InfoCardFrame>
- )}
- </Show>
- <InfoCardFrame>
- <h3 class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">
- System
- </h3>
- <div class="space-y-1.5 text-[11px]">
- <Show when={props.guest.cpus}>
- <div class="flex items-center justify-between">
- <span class="text-muted">CPUs</span>
- <span class="font-medium text-base-content">{props.guest.cpus}</span>
- </div>
- </Show>
- <Show
- when={
- props.guest.telemetryAvailability
- ? props.guest.telemetryAvailability.uptime
- : props.guest.uptime > 0
- }
- >
- <div class="flex items-center justify-between">
- <span class="text-muted">Uptime</span>
- <span class="font-medium text-base-content">
- {formatUptime(props.guest.uptime)}
- </span>
- </div>
- </Show>
- <Show when={props.guest.node}>
- <div class="flex items-center justify-between">
- <span class="text-muted">Node</span>
- <span class="font-medium text-base-content">{props.guest.node}</span>
- </div>
- </Show>
- <Show when={props.hasAgentInfo}>
- <div class="flex items-center justify-between">
- <span class="text-muted">{props.agentHeading}</span>
- <span class="font-medium text-base-content truncate ml-2" title={props.agentTitle}>
- {props.agentLabel}
- </span>
- </div>
- </Show>
- <Show when={props.hasWorkloadActionAgent}>
- <div class="flex items-center justify-between">
- <span class="text-muted">Actions</span>
- <span
- class="font-medium text-base-content truncate ml-2"
- title={props.workloadActionAgentTitle}
- >
- {WORKLOAD_ACTION_AGENT_LABEL}
- </span>
- </div>
- </Show>
- <Show when={props.showInGuestAgentInstallCue}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Actions</span>
- <a
- href={buildInfrastructureOnboardingPath('agent')}
- class="inline-flex items-center gap-1 text-right text-[11px] font-semibold text-amber-700 underline-offset-2 hover:underline dark:text-amber-300"
- title={IN_GUEST_AGENT_INSTALL_TITLE}
- >
- <TerminalSquare class="h-3.5 w-3.5" aria-hidden="true" />
- <span>{IN_GUEST_AGENT_INSTALL_ACTION_LABEL}</span>
- </a>
- </div>
- </Show>
- </div>
- </InfoCardFrame>
-
- <Show when={props.nestedWorkloadContext}>
- {(context) => {
- const visibleItems = () => context().items.slice(0, 4);
- const hiddenCount = () => Math.max(0, context().count - visibleItems().length);
- return (
- <InfoCardFrame data-testid="nested-workload-context-card">
- <div class="mb-2 flex items-center justify-between gap-2">
- <h3 class="truncate text-[11px] font-medium uppercase tracking-wide text-base-content">
- {context().title}
- </h3>
- <a
- href={context().href}
- class="inline-flex shrink-0 items-center gap-1 text-[10px] font-semibold text-blue-600 underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:text-blue-300"
- aria-label={`Open ${context().label} page for ${props.guest.name}`}
- >
- <BoxIcon class="h-3 w-3" aria-hidden="true" />
- <span>Open Docker</span>
- </a>
- </div>
- <div class="space-y-1.5 text-[11px]">
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">Containers</span>
- <span class="font-medium text-base-content">{context().count}</span>
- </div>
- <For each={visibleItems()}>
- {(item) => (
- <div class="grid grid-cols-[minmax(0,1fr)_auto] items-center gap-2">
- <span class="truncate font-medium text-base-content" title={item.name}>
- {item.name}
- </span>
- <span class="rounded bg-surface-alt px-1.5 py-0.5 text-[10px] font-medium text-muted">
- {item.status}
- </span>
- </div>
- )}
- </For>
- <Show when={hiddenCount() > 0}>
- <div class="text-[10px] font-medium text-muted">+{hiddenCount()} more</div>
+ <Show when={summary().serviceVersion}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Version</span>
+ <span
+ class="font-medium text-base-content truncate ml-2"
+ title={summary().serviceVersion}
+ >
+ {summary().serviceVersion}
+ </span>
+ </div>
</Show>
+ <Show when={summary().suggestedUrl}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Endpoint</span>
+ <span
+ class="font-medium text-base-content truncate ml-2"
+ title={summary().suggestedUrl}
+ >
+ {summary().suggestedUrl}
+ </span>
+ </div>
+ </Show>
+ <Show when={summary().portCount > 0}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Ports</span>
+ <span class="font-medium text-base-content">{summary().portCount}</span>
+ </div>
+ </Show>
+ <div class="flex flex-wrap gap-1 pt-1 text-[10px] text-muted">
+ <span>{summary().sourceLabel}</span>
+ <Show when={summary().observedAt}>
+ <span>· {formatDiscoveryAge(summary().observedAt!)}</span>
+ </Show>
+ </div>
</div>
</InfoCardFrame>
- );
- }}
- </Show>
-
- {/* vSphere placement card: vCenter / Datacenter / Cluster live on
- WorkloadGuest.vmware and aren't surfaced by System (Node already
- shows the runtime host). Render only when the workload is a
- vSphere VM and at least one of these fields is populated. */}
- <Show
- when={
- (props.guest.platformScopes?.includes('vmware-vsphere') ?? false) &&
- (props.guest.vmware?.connectionName ||
- props.guest.vmware?.vcenterHost ||
- props.guest.vmware?.datacenterName ||
- props.guest.vmware?.clusterName)
- }
- >
+ )}
+ </Show>
<InfoCardFrame>
<h3 class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">
- vSphere
+ System
</h3>
<div class="space-y-1.5 text-[11px]">
- <Show when={props.guest.vmware?.connectionName || props.guest.vmware?.vcenterHost}>
- <div class="flex items-center justify-between gap-2 min-w-0">
- <span class="text-muted shrink-0">vCenter</span>
- <span
- class="font-medium text-base-content truncate"
- title={
- props.guest.vmware?.vcenterHost || props.guest.vmware?.connectionName || ''
- }
- >
- {props.guest.vmware?.connectionName || props.guest.vmware?.vcenterHost}
+ <Show when={props.guest.cpus}>
+ <div class="flex items-center justify-between">
+ <span class="text-muted">CPUs</span>
+ <span class="font-medium text-base-content">{props.guest.cpus}</span>
+ </div>
+ </Show>
+ <Show
+ when={
+ props.guest.telemetryAvailability
+ ? props.guest.telemetryAvailability.uptime
+ : props.guest.uptime > 0
+ }
+ >
+ <div class="flex items-center justify-between">
+ <span class="text-muted">Uptime</span>
+ <span class="font-medium text-base-content">
+ {formatUptime(props.guest.uptime)}
</span>
</div>
</Show>
- <Show when={props.guest.vmware?.datacenterName}>
- <div class="flex items-center justify-between gap-2 min-w-0">
- <span class="text-muted shrink-0">Datacenter</span>
+ <Show when={props.guest.node}>
+ <div class="flex items-center justify-between">
+ <span class="text-muted">Node</span>
+ <span class="font-medium text-base-content">{props.guest.node}</span>
+ </div>
+ </Show>
+ <Show when={props.hasAgentInfo}>
+ <div class="flex items-center justify-between">
+ <span class="text-muted">{props.agentHeading}</span>
<span
- class="font-medium text-base-content truncate"
- title={props.guest.vmware?.datacenterName || ''}
+ class="font-medium text-base-content truncate ml-2"
+ title={props.agentTitle}
>
- {props.guest.vmware?.datacenterName}
+ {props.agentLabel}
</span>
</div>
</Show>
- <Show when={props.guest.vmware?.clusterName}>
- <div class="flex items-center justify-between gap-2 min-w-0">
- <span class="text-muted shrink-0">Cluster</span>
+ <Show when={props.hasWorkloadActionAgent}>
+ <div class="flex items-center justify-between">
+ <span class="text-muted">Actions</span>
<span
- class="font-medium text-base-content truncate"
- title={props.guest.vmware?.clusterName || ''}
+ class="font-medium text-base-content truncate ml-2"
+ title={props.workloadActionAgentTitle}
>
- {props.guest.vmware?.clusterName}
+ {WORKLOAD_ACTION_AGENT_LABEL}
</span>
</div>
</Show>
- </div>
- </InfoCardFrame>
- </Show>
-
- <Show when={props.hasOsInfo || props.ipAddresses.length > 0}>
- <InfoCardFrame>
- <h3 class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">
- Guest Info
- </h3>
- <div class="space-y-2">
- <Show when={props.hasOsInfo}>
- <div class="text-[11px] text-muted truncate" title={props.guestOsSummary}>
- <Show when={(props.guest.osName?.length ?? 0) > 0}>
- <span class="font-medium">{props.guest.osName}</span>
- </Show>
- <Show
- when={
- (props.guest.osName?.length ?? 0) > 0 &&
- (props.guest.osVersion?.length ?? 0) > 0
- }
+ <Show when={props.showInGuestAgentInstallCue}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Actions</span>
+ <a
+ href={buildInfrastructureOnboardingPath('agent')}
+ class="inline-flex items-center gap-1 text-right text-[11px] font-semibold text-amber-700 underline-offset-2 hover:underline dark:text-amber-300"
+ title={IN_GUEST_AGENT_INSTALL_TITLE}
>
- <span class="text-muted mx-1">•</span>
- </Show>
- <Show when={(props.guest.osVersion?.length ?? 0) > 0}>
- <span>{props.guest.osVersion}</span>
- </Show>
- </div>
- </Show>
- <Show when={props.ipAddresses.length > 0}>
- <div class="flex flex-wrap gap-1">
- <For each={props.ipAddresses}>
- {(ip) => (
- <span
- class="inline-block rounded bg-blue-100 px-1.5 py-0.5 text-[10px] text-blue-700 dark:bg-blue-900 dark:text-blue-200 max-w-full truncate"
- title={ip}
- >
- {ip}
- </span>
- )}
- </For>
+ <TerminalSquare class="h-3.5 w-3.5" aria-hidden="true" />
+ <span>{IN_GUEST_AGENT_INSTALL_ACTION_LABEL}</span>
+ </a>
</div>
</Show>
</div>
</InfoCardFrame>
- </Show>
- <Show when={getGuestDrawerMemoryRows(props.guest).length > 0}>
- <InfoCardFrame>
- <h3 class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">
- Memory
- </h3>
- <div class="space-y-1.5 text-[11px]">
- <For each={getGuestDrawerMemoryRows(props.guest)}>
- {(row) => (
+ <Show when={props.nestedWorkloadContext}>
+ {(context) => {
+ const visibleItems = () => context().items.slice(0, 4);
+ const hiddenCount = () => Math.max(0, context().count - visibleItems().length);
+ return (
+ <InfoCardFrame data-testid="nested-workload-context-card">
+ <div class="mb-2 flex items-center justify-between gap-2">
+ <h3 class="truncate text-[11px] font-medium uppercase tracking-wide text-base-content">
+ {context().title}
+ </h3>
+ <a
+ href={context().href}
+ class="inline-flex shrink-0 items-center gap-1 text-[10px] font-semibold text-blue-600 underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 dark:text-blue-300"
+ aria-label={`Open ${context().label} page for ${props.guest.name}`}
+ >
+ <BoxIcon class="h-3 w-3" aria-hidden="true" />
+ <span>Open Docker</span>
+ </a>
+ </div>
+ <div class="space-y-1.5 text-[11px]">
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Containers</span>
+ <span class="font-medium text-base-content">{context().count}</span>
+ </div>
+ <For each={visibleItems()}>
+ {(item) => (
+ <div class="grid grid-cols-[minmax(0,1fr)_auto] items-center gap-2">
+ <span class="truncate font-medium text-base-content" title={item.name}>
+ {item.name}
+ </span>
+ <span class="rounded bg-surface-alt px-1.5 py-0.5 text-[10px] font-medium text-muted">
+ {item.status}
+ </span>
+ </div>
+ )}
+ </For>
+ <Show when={hiddenCount() > 0}>
+ <div class="text-[10px] font-medium text-muted">+{hiddenCount()} more</div>
+ </Show>
+ </div>
+ </InfoCardFrame>
+ );
+ }}
+ </Show>
+
+ {/* vSphere placement card: vCenter / Datacenter / Cluster live on
+ WorkloadGuest.vmware and aren't surfaced by System (Node already
+ shows the runtime host). Render only when the workload is a
+ vSphere VM and at least one of these fields is populated. */}
+ <Show
+ when={
+ (props.guest.platformScopes?.includes('vmware-vsphere') ?? false) &&
+ (props.guest.vmware?.connectionName ||
+ props.guest.vmware?.vcenterHost ||
+ props.guest.vmware?.datacenterName ||
+ props.guest.vmware?.clusterName)
+ }
+ >
+ <InfoCardFrame>
+ <h3 class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">
+ vSphere
+ </h3>
+ <div class="space-y-1.5 text-[11px]">
+ <Show when={props.guest.vmware?.connectionName || props.guest.vmware?.vcenterHost}>
<div class="flex items-center justify-between gap-2 min-w-0">
- <span class="shrink-0 text-muted">{row.label}</span>
+ <span class="text-muted shrink-0">vCenter</span>
<span
- class="truncate text-right font-medium text-base-content"
- title={row.value}
+ class="font-medium text-base-content truncate"
+ title={
+ props.guest.vmware?.vcenterHost || props.guest.vmware?.connectionName || ''
+ }
>
- {row.value}
+ {props.guest.vmware?.connectionName || props.guest.vmware?.vcenterHost}
</span>
</div>
- )}
- </For>
- </div>
- </InfoCardFrame>
- </Show>
+ </Show>
+ <Show when={props.guest.vmware?.datacenterName}>
+ <div class="flex items-center justify-between gap-2 min-w-0">
+ <span class="text-muted shrink-0">Datacenter</span>
+ <span
+ class="font-medium text-base-content truncate"
+ title={props.guest.vmware?.datacenterName || ''}
+ >
+ {props.guest.vmware?.datacenterName}
+ </span>
+ </div>
+ </Show>
+ <Show when={props.guest.vmware?.clusterName}>
+ <div class="flex items-center justify-between gap-2 min-w-0">
+ <span class="text-muted shrink-0">Cluster</span>
+ <span
+ class="font-medium text-base-content truncate"
+ title={props.guest.vmware?.clusterName || ''}
+ >
+ {props.guest.vmware?.clusterName}
+ </span>
+ </div>
+ </Show>
+ </div>
+ </InfoCardFrame>
+ </Show>
- <Show when={props.guest.lastBackup}>
- <InfoCardFrame>
- <h3 class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">
- Backup
- </h3>
- <div class="space-y-1 text-[11px]">
- <Show when={props.backupPresentation}>
- {(presentation) => (
- <>
- <div class="flex items-center justify-between">
- <span class="text-muted">Last Backup</span>
- <span class={`font-medium ${presentation().ageClass}`}>
- {presentation().ageLabel}
+ <Show when={props.hasOsInfo || props.ipAddresses.length > 0}>
+ <InfoCardFrame>
+ <h3 class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">
+ Guest Info
+ </h3>
+ <div class="space-y-2">
+ <Show when={props.hasOsInfo}>
+ <div class="text-[11px] text-muted truncate" title={props.guestOsSummary}>
+ <Show when={(props.guest.osName?.length ?? 0) > 0}>
+ <span class="font-medium">{props.guest.osName}</span>
+ </Show>
+ <Show
+ when={
+ (props.guest.osName?.length ?? 0) > 0 &&
+ (props.guest.osVersion?.length ?? 0) > 0
+ }
+ >
+ <span class="text-muted mx-1">•</span>
+ </Show>
+ <Show when={(props.guest.osVersion?.length ?? 0) > 0}>
+ <span>{props.guest.osVersion}</span>
+ </Show>
+ </div>
+ </Show>
+ <Show when={props.ipAddresses.length > 0}>
+ <div class="flex flex-wrap gap-1">
+ <For each={props.ipAddresses}>
+ {(ip) => (
+ <span
+ class="inline-block rounded bg-blue-100 px-1.5 py-0.5 text-[10px] text-blue-700 dark:bg-blue-900 dark:text-blue-200 max-w-full truncate"
+ title={ip}
+ >
+ {ip}
+ </span>
+ )}
+ </For>
+ </div>
+ </Show>
+ </div>
+ </InfoCardFrame>
+ </Show>
+
+ <Show when={getGuestDrawerMemoryRows(props.guest).length > 0}>
+ <InfoCardFrame>
+ <h3 class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">
+ Memory
+ </h3>
+ <div class="space-y-1.5 text-[11px]">
+ <For each={getGuestDrawerMemoryRows(props.guest)}>
+ {(row) => (
+ <div class="flex items-center justify-between gap-2 min-w-0">
+ <span class="shrink-0 text-muted">{row.label}</span>
+ <span
+ class="truncate text-right font-medium text-base-content"
+ title={row.value}
+ >
+ {row.value}
</span>
</div>
- <div class="text-[10px] text-muted">{presentation().dateLabel}</div>
- </>
- )}
- </Show>
- </div>
- </InfoCardFrame>
- </Show>
+ )}
+ </For>
+ </div>
+ </InfoCardFrame>
+ </Show>
- <Show when={props.normalizedTags.length > 0}>
- <InfoCardFrame>
- <h3 class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">
- Tags
- </h3>
- <div class="flex flex-wrap gap-1">
- <For each={props.normalizedTags}>
- {(tag) => (
- <span class="inline-block rounded bg-surface-alt px-1.5 py-0.5 text-[10px]">
- {tag}
- </span>
- )}
- </For>
- </div>
- </InfoCardFrame>
- </Show>
+ <Show when={props.guest.lastBackup}>
+ <InfoCardFrame>
+ <h3 class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">
+ Backup
+ </h3>
+ <div class="space-y-1 text-[11px]">
+ <Show when={props.backupPresentation}>
+ {(presentation) => (
+ <>
+ <div class="flex items-center justify-between">
+ <span class="text-muted">Last Backup</span>
+ <span class={`font-medium ${presentation().ageClass}`}>
+ {presentation().ageLabel}
+ </span>
+ </div>
+ <div class="text-[10px] text-muted">{presentation().dateLabel}</div>
+ </>
+ )}
+ </Show>
+ </div>
+ </InfoCardFrame>
+ </Show>
- <Show
- when={props.hasFilesystemDetails && props.guest.disks && props.guest.disks.length > 0}
- >
- <InfoCardFrame>
- <h3 class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">
- Filesystems
- </h3>
- <div class="text-[11px] text-muted">
- <DiskList
- disks={props.guest.disks || []}
- diskStatusReason={
- isGuestDrawerVM(props.guest) ? props.guest.diskStatusReason : undefined
- }
- thresholds={props.diskThresholds}
- />
- </div>
- </InfoCardFrame>
- </Show>
+ <Show when={props.normalizedTags.length > 0}>
+ <InfoCardFrame>
+ <h3 class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">
+ Tags
+ </h3>
+ <div class="flex flex-wrap gap-1">
+ <For each={props.normalizedTags}>
+ {(tag) => (
+ <span class="inline-block rounded bg-surface-alt px-1.5 py-0.5 text-[10px]">
+ {tag}
+ </span>
+ )}
+ </For>
+ </div>
+ </InfoCardFrame>
+ </Show>
- <Show when={props.hasNetworkInterfaces}>
- <InfoCardFrame>
- <h3 class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">
- Network
- </h3>
- <div class="space-y-2">
- <For each={props.networkInterfaces.slice(0, 4)}>
- {(iface) => {
- const addresses = iface.addresses ?? [];
- const hasTraffic = (iface.rxBytes ?? 0) > 0 || (iface.txBytes ?? 0) > 0;
- return (
- <div class="rounded border border-dashed border-border p-2 overflow-hidden">
- <div class="flex items-center gap-2 text-[11px] font-medium text-base-content min-w-0">
- <span class="truncate min-w-0">{iface.name || 'interface'}</span>
- <Show when={iface.mac}>
- <span
- class="text-[9px] text-muted font-normal truncate shrink-0 max-w-[100px]"
- title={iface.mac}
- >
- {iface.mac}
- </span>
+ <Show
+ when={props.hasFilesystemDetails && props.guest.disks && props.guest.disks.length > 0}
+ >
+ <InfoCardFrame>
+ <h3 class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">
+ Filesystems
+ </h3>
+ <div class="text-[11px] text-muted">
+ <DiskList
+ disks={props.guest.disks || []}
+ diskStatusReason={
+ isGuestDrawerVM(props.guest) ? props.guest.diskStatusReason : undefined
+ }
+ thresholds={props.diskThresholds}
+ />
+ </div>
+ </InfoCardFrame>
+ </Show>
+
+ <Show when={props.hasNetworkInterfaces}>
+ <InfoCardFrame>
+ <h3 class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">
+ Network
+ </h3>
+ <div class="space-y-2">
+ <For each={props.networkInterfaces.slice(0, 4)}>
+ {(iface) => {
+ const addresses = iface.addresses ?? [];
+ const hasTraffic = (iface.rxBytes ?? 0) > 0 || (iface.txBytes ?? 0) > 0;
+ return (
+ <div class="rounded border border-dashed border-border p-2 overflow-hidden">
+ <div class="flex items-center gap-2 text-[11px] font-medium text-base-content min-w-0">
+ <span class="truncate min-w-0">{iface.name || 'interface'}</span>
+ <Show when={iface.mac}>
+ <span
+ class="text-[9px] text-muted font-normal truncate shrink-0 max-w-[100px]"
+ title={iface.mac}
+ >
+ {iface.mac}
+ </span>
+ </Show>
+ </div>
+ <Show when={addresses.length > 0}>
+ <div class="flex flex-wrap gap-1 mt-1">
+ <For each={addresses}>
+ {(ip) => (
+ <span
+ class="inline-block rounded bg-blue-100 px-1.5 py-0.5 text-[10px] text-blue-700 dark:bg-blue-900 dark:text-blue-200 max-w-full truncate"
+ title={ip}
+ >
+ {ip}
+ </span>
+ )}
+ </For>
+ </div>
+ </Show>
+ <Show when={hasTraffic}>
+ <div class="flex gap-3 mt-1 text-[10px] text-muted">
+ <span>RX {formatBytes(iface.rxBytes ?? 0)}</span>
+ <span>TX {formatBytes(iface.txBytes ?? 0)}</span>
+ </div>
</Show>
</div>
- <Show when={addresses.length > 0}>
- <div class="flex flex-wrap gap-1 mt-1">
- <For each={addresses}>
- {(ip) => (
- <span
- class="inline-block rounded bg-blue-100 px-1.5 py-0.5 text-[10px] text-blue-700 dark:bg-blue-900 dark:text-blue-200 max-w-full truncate"
- title={ip}
- >
- {ip}
- </span>
- )}
- </For>
- </div>
- </Show>
- <Show when={hasTraffic}>
- <div class="flex gap-3 mt-1 text-[10px] text-muted">
- <span>RX {formatBytes(iface.rxBytes ?? 0)}</span>
- <span>TX {formatBytes(iface.txBytes ?? 0)}</span>
- </div>
- </Show>
- </div>
- );
- }}
- </For>
- </div>
- </InfoCardFrame>
- </Show>
- </div>
+ );
+ }}
+ </For>
+ </div>
+ </InfoCardFrame>
+ </Show>
+ </div>
+ </TechnicalDetailsDisclosure>
- <div class="mt-3 space-y-3">
- <ResourceOperatorStateSection
- resourceId={props.guestId}
- resourceType={isGuestDrawerVM(props.guest) ? 'vm' : 'system-container'}
- platformType="proxmox"
- />
- <WebInterfaceUrlField
- metadataKind="guest"
- metadataId={props.webInterfaceMetadataId}
- targetLabel={props.webInterfaceTargetLabel}
- customUrl={props.customUrl}
- onCustomUrlChange={(url) => props.onCustomUrlChange?.(props.webInterfaceMetadataId, url)}
- suggestedUrl={props.discoveryIdentifiedSummary?.suggestedUrl}
- suggestedUrlReasonText={props.discoveryIdentifiedSummary?.suggestedUrlReasonText}
- suggestedUrlReasonTitle={props.discoveryIdentifiedSummary?.suggestedUrlReasonTitle}
- suggestedUrlDiagnostic={props.discoveryIdentifiedSummary?.suggestedUrlDiagnostic}
- />
+ <div class="space-y-3">
<Show when={props.guest.availability || props.guest.availabilityChecks?.length}>
<div class="mt-3 max-w-sm">
<div class="space-y-3">
diff --git a/frontend-modern/src/components/Workloads/NodeDrawer.test.tsx b/frontend-modern/src/components/Workloads/NodeDrawer.test.tsx
index 6830f1139e..114bc8f054 100644
--- a/frontend-modern/src/components/Workloads/NodeDrawer.test.tsx
+++ b/frontend-modern/src/components/Workloads/NodeDrawer.test.tsx
@@ -25,6 +25,13 @@ vi.mock('@/stores/license', () => ({
import { NodeDrawer } from './NodeDrawer';
+const openTechnicalDetails = () => {
+ const details = screen.getByTestId('node-technical-details') as HTMLDetailsElement;
+ details.open = true;
+ fireEvent(details, new Event('toggle'));
+ return within(details);
+};
+
const makeHistoryPoints = (base: number) => [
{ timestamp: 1, value: base, min: base, max: base },
{ timestamp: 2, value: base + 5, min: base + 5, max: base + 5 },
@@ -98,19 +105,21 @@ afterEach(() => {
describe('NodeDrawer', () => {
it('shows a guest-drawer style Proxmox node overview with detailed node context', () => {
render(() => <NodeDrawer node={makeNode()} />);
+ const technical = openTechnicalDetails();
expect(screen.getByText('Overview')).toBeInTheDocument();
expect(screen.getByText('History')).toBeInTheDocument();
- expect(screen.getByText('System')).toBeInTheDocument();
- expect(screen.getByText('Platform')).toBeInTheDocument();
- expect(screen.getByText('Hardware')).toBeInTheDocument();
- expect(screen.getByText('Telemetry')).toBeInTheDocument();
- expect(screen.getByText('Ryzen')).toBeInTheDocument();
- expect(screen.getByText('6.8.0')).toBeInTheDocument();
- expect(screen.getByText('8')).toBeInTheDocument();
- expect(screen.getByText('PVE 9.1.9')).toBeInTheDocument();
- expect(screen.getAllByText('65°C').length).toBeGreaterThan(0);
- expect(screen.getByText('Temp monitor')).toBeInTheDocument();
+ expect(screen.getByText('Manage')).toBeInTheDocument();
+ expect(technical.getByText('System')).toBeInTheDocument();
+ expect(technical.getByText('Platform')).toBeInTheDocument();
+ expect(technical.getByText('Hardware')).toBeInTheDocument();
+ expect(technical.getByText('Telemetry')).toBeInTheDocument();
+ expect(technical.getByText('Ryzen')).toBeInTheDocument();
+ expect(technical.getByText('6.8.0')).toBeInTheDocument();
+ expect(technical.getByText('8')).toBeInTheDocument();
+ expect(screen.getAllByText('PVE 9.1.9').length).toBeGreaterThan(0);
+ expect(technical.getAllByText('65°C').length).toBeGreaterThan(0);
+ expect(technical.getByText('Temp monitor')).toBeInTheDocument();
});
it('colors overview thermal rows from configured thresholds', () => {
@@ -131,7 +140,36 @@ describe('NodeDrawer', () => {
/>
));
- expect(screen.getAllByText('76°C')[0]).toHaveClass('text-green-600');
+ expect(openTechnicalDetails().getAllByText('76°C')[0]).toHaveClass('text-green-600');
+ });
+
+ it('puts the active alert problem before context and collapsed inventory', () => {
+ render(() => (
+ <NodeDrawer
+ node={makeNode()}
+ alerts={[
+ {
+ id: 'alert-disk',
+ type: 'disk',
+ level: 'warning',
+ resourceId: 'agent:pve-node-1',
+ resourceName: 'pve-node-1',
+ node: 'pve-node-1',
+ instance: 'homelab',
+ message: 'Root disk usage is above 85%',
+ value: 88,
+ threshold: 85,
+ startTime: new Date().toISOString(),
+ acknowledged: false,
+ },
+ ]}
+ />
+ ));
+
+ expect(screen.getByText('Needs attention')).toBeInTheDocument();
+ expect(screen.getByText('Root disk usage is above 85%')).toBeInTheDocument();
+ expect(screen.getByText('PVE 9.1.9')).toBeInTheDocument();
+ expect(screen.getByTestId('node-technical-details')).not.toHaveAttribute('open');
});
it('renders node-only thermal history without requiring a table temperature column', async () => {
diff --git a/frontend-modern/src/components/Workloads/NodeDrawer.tsx b/frontend-modern/src/components/Workloads/NodeDrawer.tsx
index a33fc72a41..ce2a23e851 100644
--- a/frontend-modern/src/components/Workloads/NodeDrawer.tsx
+++ b/frontend-modern/src/components/Workloads/NodeDrawer.tsx
@@ -3,11 +3,12 @@ import { Show, Suspense, createMemo, createSignal, type Component } from 'solid-
import type { HistoryTimeRange } from '@/api/charts';
import { DiscoveryTab } from '@/components/Discovery/DiscoveryTab';
import { DiscoveryLoadingFallback } from '@/components/shared/DiscoveryLoadingFallback';
+import { ResourceOperatorStateSection } from '@/components/Infrastructure/ResourceOperatorStateSection';
import { DrawerSubjectHeading } from '@/components/shared/DrawerSubjectHeading';
import { Subtabs, type SubtabOption } from '@/components/shared/Subtabs';
import { nodeOverrideIdCandidates } from '@/features/alerts/alertOverridesModel';
import { useAlertsActivation } from '@/stores/alertsActivation';
-import type { Disk, Node } from '@/types/api';
+import type { Alert, Disk, Node } from '@/types/api';
import type { MetricDisplayThresholds } from '@/utils/metricThresholds';
import { getNodeDisplayName } from '@/utils/nodes';
import { getSimpleStatusIndicator } from '@/utils/status';
@@ -31,9 +32,10 @@ interface NodeDrawerProps {
disks?: Disk[];
discoveryTarget?: NodeDrawerDiscoveryTarget;
temperatureThresholds?: MetricDisplayThresholds | null;
+ alerts?: Alert[];
}
-type NodeDrawerTab = 'overview' | 'history' | 'discovery';
+type NodeDrawerTab = 'overview' | 'history' | 'manage' | 'discovery';
export const NodeDrawer: Component<NodeDrawerProps> = (props) => {
const [activeTab, setActiveTab] = createSignal<NodeDrawerTab>('overview');
@@ -74,6 +76,7 @@ export const NodeDrawer: Component<NodeDrawerProps> = (props) => {
tabs={[
{ value: 'overview', label: 'Overview' },
{ value: 'history', label: 'History' },
+ { value: 'manage', label: 'Manage' },
...(props.discoveryTarget?.agentId
? [{ value: 'discovery', label: 'Discovery' } satisfies SubtabOption]
: []),
@@ -92,6 +95,7 @@ export const NodeDrawer: Component<NodeDrawerProps> = (props) => {
node={props.node}
disks={props.disks}
temperatureThresholds={temperatureThresholds()}
+ alerts={props.alerts}
/>
</div>
@@ -104,6 +108,18 @@ export const NodeDrawer: Component<NodeDrawerProps> = (props) => {
/>
</div>
+ <div class={activeTab() === 'manage' ? '' : 'hidden'} style={{ 'overflow-anchor': 'none' }}>
+ <Show when={activeTab() === 'manage'}>
+ <div data-testid="node-manage-tab">
+ <ResourceOperatorStateSection
+ resourceId={props.node.id}
+ resourceType="node"
+ platformType="proxmox"
+ />
+ </div>
+ </Show>
+ </div>
+
{props.discoveryTarget?.agentId && (
<div
class={activeTab() === 'discovery' ? '' : 'hidden'}
diff --git a/frontend-modern/src/components/Workloads/NodeDrawerOverview.tsx b/frontend-modern/src/components/Workloads/NodeDrawerOverview.tsx
index b297bed740..0d4e792041 100644
--- a/frontend-modern/src/components/Workloads/NodeDrawerOverview.tsx
+++ b/frontend-modern/src/components/Workloads/NodeDrawerOverview.tsx
@@ -1,7 +1,15 @@
import { For, Show } from 'solid-js';
import { InfoCardFrame } from '@/components/shared/InfoCardFrame';
-import type { Disk, Node, Temperature } from '@/types/api';
+import { TechnicalDetailsDisclosure } from '@/components/shared/TechnicalDetailsDisclosure';
+import { DrawerAttentionSection } from '@/components/shared/DrawerAttentionSection';
+import {
+ DetailSectionTable,
+ compactDetailRows,
+ compactDetailSections,
+ makeDetailRow,
+} from '@/components/shared/DetailSectionTable';
+import type { Alert, Disk, Node, Temperature } from '@/types/api';
import {
formatBytes,
formatRelativeTime,
@@ -19,6 +27,7 @@ interface NodeDrawerOverviewProps {
node: Node;
disks?: Disk[];
temperatureThresholds?: MetricDisplayThresholds | null;
+ alerts?: Alert[];
}
interface NodeOverviewRow {
@@ -323,23 +332,67 @@ export function NodeDrawerOverview(props: NodeDrawerOverviewProps) {
return buildDrawerDiskListItems(disks);
};
+ const overviewSections = () => {
+ const primaryTemperature = getCpuTemperature(props.node.temperature);
+ const temperatureClass =
+ typeof primaryTemperature === 'number'
+ ? getTemperatureTextClass(primaryTemperature, props.temperatureThresholds)
+ : '';
+ return compactDetailSections([
+ {
+ label: 'Operator context',
+ rows: compactDetailRows([
+ makeDetailRow('Platform', versionLabel() ? `PVE ${versionLabel()}` : null),
+ makeDetailRow(
+ 'Pulse coverage',
+ linkedAgentId() ? `Agent ${stripAgentPrefix(linkedAgentId())}` : 'PVE API only',
+ ),
+ typeof props.node.pendingUpdates === 'number' && props.node.pendingUpdates > 0
+ ? makeDetailRow('Updates', `${props.node.pendingUpdates} pending`, { tone: 'warning' })
+ : null,
+ typeof primaryTemperature === 'number' &&
+ (temperatureClass.includes('yellow') || temperatureClass.includes('red'))
+ ? makeDetailRow('Temperature', formatTemperature(primaryTemperature), {
+ tone: temperatureClass.includes('red') ? 'danger' : 'warning',
+ })
+ : null,
+ ]),
+ },
+ ]);
+ };
+
return (
- <div class="flex flex-wrap gap-3 [&>*]:flex-1 [&>*]:basis-[calc(25%-0.75rem)] [&>*]:min-w-[200px] [&>*]:max-w-full [&>*]:overflow-hidden">
- <DetailCard title="System" rows={systemRows()} />
- <DetailCard title="Platform" rows={platformRows()} />
- <DetailCard title="Hardware" rows={hardwareRows()} />
- <DetailCard title="Memory" rows={memoryRows()} />
- <Show
- when={perDiskItems().length > 0}
- fallback={<DetailCard title="Storage" rows={storageRows()} />}
- >
- <DrawerDiskListCard disks={perDiskItems()} testId="node-drawer-disks" />
- </Show>
- <DetailCard title="Telemetry" rows={telemetryRows()} />
- <DetailCard
- title="Thermals"
- rows={getThermalRows(props.node.temperature, props.temperatureThresholds)}
+ <div class="space-y-3">
+ <DrawerAttentionSection
+ items={(props.alerts ?? []).map((alert) => ({
+ id: alert.id,
+ message: alert.message,
+ severity: alert.level,
+ acknowledged: alert.acknowledged,
+ }))}
/>
+ <DetailSectionTable sections={overviewSections()} />
+ <TechnicalDetailsDisclosure
+ dataTestId="node-technical-details"
+ subtitle="Hardware, telemetry, and storage"
+ contentClass="mt-2 flex flex-wrap gap-2 border-t border-border pt-2 [&>*]:flex-1 [&>*]:basis-[calc(25%-0.5rem)] [&>*]:min-w-[200px] [&>*]:max-w-full [&>*]:overflow-hidden"
+ >
+ <DetailCard title="System" rows={systemRows()} />
+ <DetailCard title="Platform" rows={platformRows()} />
+ <DetailCard title="Hardware" rows={hardwareRows()} />
+ <DetailCard title="Memory" rows={memoryRows()} />
+ <Show
+ when={perDiskItems().length > 0}
+ fallback={<DetailCard title="Storage" rows={storageRows()} />}
+ >
+ <DrawerDiskListCard disks={perDiskItems()} testId="node-drawer-disks" />
+ </Show>
+ <DetailCard title="Telemetry" rows={telemetryRows()} />
+ <DetailCard
+ title="Thermals"
+ rows={getThermalRows(props.node.temperature, props.temperatureThresholds)}
+ />
+ </TechnicalDetailsDisclosure>
</div>
);
}
diff --git a/frontend-modern/src/components/Workloads/WorkloadPanel.tsx b/frontend-modern/src/components/Workloads/WorkloadPanel.tsx
index 7f66e02c6d..78806a4cc8 100644
--- a/frontend-modern/src/components/Workloads/WorkloadPanel.tsx
+++ b/frontend-modern/src/components/Workloads/WorkloadPanel.tsx
@@ -17,7 +17,8 @@ import { createSummaryInteractiveRowPreviewHandlers } from '@/components/shared/
import { buildSummaryDisclosureControlsId } from '@/components/shared/summaryInteractionA11y';
import { TableBody, TableCell, TableRow } from '@/components/shared/Table';
import type { Node } from '@/types/api';
-import { getAlertStyles } from '@/utils/alerts';
+import { getAlertsForResource, getAlertStyles } from '@/utils/alerts';
+import { guestOverrideIdCandidates } from '@/features/alerts/guestOverrideIdentity';
import { formatSpeed, formatUptime } from '@/utils/format';
import { isNodeOnline } from '@/utils/status';
import { formatTemperature, getCpuTemperature, getTemperatureTextClass } from '@/utils/temperature';
@@ -522,6 +523,12 @@ export function WorkloadPanel(props: WorkloadPanelProps) {
<NodeDrawer
node={node()!}
temperatureThresholds={props.getNodeTemperatureThresholds(node()!)}
+ alerts={getAlertsForResource(
+ [node()!.id],
+ props.activeAlerts,
+ props.alertsEnabled(),
+ node()!.name,
+ )}
/>
</InlineDetailTableRow>
</Show>
@@ -558,7 +565,7 @@ export function WorkloadPanel(props: WorkloadPanelProps) {
<GuestRow
guest={guest()}
alertStyles={getAlertStyles(
- guestId(),
+ [guestId(), ...(guest().alertResourceIds ?? [])],
props.activeAlerts,
props.alertsEnabled(),
)}
@@ -605,6 +612,15 @@ export function WorkloadPanel(props: WorkloadPanelProps) {
nestedWorkloadContext={nestedWorkloadContext()}
onCustomUrlChange={props.handleCustomUrlUpdate}
parentNodeOnline={parentNodeOnline()}
+ alerts={getAlertsForResource(
+ [
+ guestId(),
+ ...(guest().alertResourceIds ?? []),
+ ...guestOverrideIdCandidates(guest()),
+ ],
+ props.activeAlerts,
+ props.alertsEnabled(),
+ )}
/>
</InlineDetailTableRow>
</Show>
diff --git a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
index f30210a79a..a0153bb4cb 100644
--- a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
@@ -48,6 +48,7 @@ import metricBarSource from '../MetricBar.tsx?raw';
import metricBarModelSource from '../metricBarModel.ts?raw';
import metricBarStateSource from '../useMetricBarState.ts?raw';
import guestDrawerSource from '../GuestDrawer.tsx?raw';
+import guestDrawerManageSource from '../GuestDrawerManage.tsx?raw';
import guestDrawerHistorySource from '../GuestDrawerHistory.tsx?raw';
import guestDrawerOverviewSource from '../GuestDrawerOverview.tsx?raw';
import guestDrawerModelSource from '../guestDrawerModel.ts?raw';
@@ -1616,7 +1617,9 @@ describe('Workloads performance contract', () => {
expect(guestDrawerStateSource).toContain('guestOsSummary');
expect(guestDrawerModelSource).toContain('export const getGuestDrawerBackupPresentation');
expect(guestDrawerModelSource).toContain('export const normalizeGuestDrawerTags');
- expect(guestDrawerOverviewSource).toContain('WebInterfaceUrlField');
+ expect(guestDrawerOverviewSource).not.toContain('WebInterfaceUrlField');
+ expect(guestDrawerManageSource).toContain('WebInterfaceUrlField');
+ expect(guestDrawerManageSource).toContain('ResourceOperatorStateSection');
expect(guestDrawerOverviewSource).toContain('DiskList');
expect(guestDrawerOverviewSource).toContain('Filesystems');
expect(guestDrawerOverviewSource).toContain('InfoCardFrame');
diff --git a/frontend-modern/src/components/Workloads/guestDrawerModel.ts b/frontend-modern/src/components/Workloads/guestDrawerModel.ts
index 4013490913..7f9aa85955 100644
--- a/frontend-modern/src/components/Workloads/guestDrawerModel.ts
+++ b/frontend-modern/src/components/Workloads/guestDrawerModel.ts
@@ -1,5 +1,5 @@
import type { WorkloadGuest } from '@/types/workloads';
-import type { VM } from '@/types/api';
+import type { Alert, VM } from '@/types/api';
import type {
AggregatedMetricPoint,
HistoryTimeRange,
@@ -26,9 +26,10 @@ export interface GuestDrawerProps {
onCustomUrlChange?: (guestId: string, url: string) => void;
parentNodeOnline?: boolean;
nestedWorkloadContext?: NestedWorkloadContext;
+ alerts?: Alert[];
}
-export type GuestDrawerTab = 'overview' | 'history' | 'discovery';
+export type GuestDrawerTab = 'overview' | 'history' | 'discovery' | 'manage';
export interface GuestDrawerHistoryTarget {
resourceType: HistoryResourceType;
diff --git a/frontend-modern/src/components/shared/DetailSectionTable.tsx b/frontend-modern/src/components/shared/DetailSectionTable.tsx
index d7878d4203..fed96d1c01 100644
--- a/frontend-modern/src/components/shared/DetailSectionTable.tsx
+++ b/frontend-modern/src/components/shared/DetailSectionTable.tsx
@@ -54,7 +54,15 @@ export const DetailSectionTable: Component<{
)}`}
title={row.title ?? row.value}
>
- <span class="block truncate">{row.value}</span>
+ <span
+ class={
+ row.wrap
+ ? 'block whitespace-normal break-words text-left leading-snug'
+ : 'block truncate'
+ }
+ >
+ {row.value}
+ </span>
</TableCell>
</TableRow>
)}
diff --git a/frontend-modern/src/components/shared/DrawerAttentionSection.tsx b/frontend-modern/src/components/shared/DrawerAttentionSection.tsx
new file mode 100644
index 0000000000..2e3263badc
--- /dev/null
+++ b/frontend-modern/src/components/shared/DrawerAttentionSection.tsx
@@ -0,0 +1,59 @@
+import { Show, type Component } from 'solid-js';
+
+import {
+ DetailSectionTable,
+ compactDetailRows,
+ compactDetailSections,
+ makeDetailRow,
+} from './DetailSectionTable';
+
+export interface DrawerAttentionItem {
+ id: string;
+ message: string;
+ severity?: string;
+ acknowledged?: boolean;
+}
+
+interface DrawerAttentionSectionProps {
+ items: DrawerAttentionItem[];
+}
+
+const severityLabel = (item: DrawerAttentionItem): string => {
+ if (item.acknowledged) return 'Acknowledged';
+ return item.severity?.toLowerCase() === 'critical' ? 'Critical' : 'Warning';
+};
+
+export const DrawerAttentionSection: Component<DrawerAttentionSectionProps> = (props) => {
+ const visibleItems = () => props.items.slice(0, 3);
+ const remainingCount = () => Math.max(0, props.items.length - visibleItems().length);
+ const sections = () =>
+ compactDetailSections([
+ {
+ label: 'Needs attention',
+ rows: compactDetailRows([
+ ...visibleItems().map((item) =>
+ makeDetailRow(severityLabel(item), item.message, {
+ tone: item.acknowledged
+ ? 'muted'
+ : item.severity?.toLowerCase() === 'critical'
+ ? 'danger'
+ : 'warning',
+ title: item.message,
+ wrap: true,
+ }),
+ ),
+ remainingCount() > 0
+ ? makeDetailRow('Also', `${remainingCount()} more active`, { tone: 'warning' })
+ : null,
+ ]),
+ },
+ ]);
+
+ return (
+ <Show when={props.items.length > 0}>
+ <div data-testid="drawer-attention-section">
+ <DetailSectionTable sections={sections()} />
+ </div>
+ </Show>
+ );
+};
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 60447163ba..5de184c668 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -8471,4 +8471,59 @@ describe('shared primitive guardrails', () => {
expect(filterToolbarSource).toContain('min-h-11');
expect(inlineDetailTableRowSource).toContain('max-w-[calc(100vw-3.5rem)]');
});
+
+ it('keeps object drawers operator-first across platform implementations', () => {
+ const overviewConsumers = [
+ 'src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx',
+ 'src/components/Workloads/GuestDrawerOverview.tsx',
+ 'src/components/Workloads/NodeDrawerOverview.tsx',
+ 'src/features/docker/DockerHostDrawerOverview.tsx',
+ ];
+ const manageConsumers = [
+ 'src/components/Infrastructure/ResourceDetailDrawer.tsx',
+ 'src/components/Workloads/GuestDrawer.tsx',
+ 'src/components/Workloads/NodeDrawer.tsx',
+ 'src/features/docker/DockerHostDrawer.tsx',
+ ];
+ const manageContentOwners = [
+ 'src/components/Infrastructure/ResourceDetailDrawer.tsx',
+ 'src/components/Workloads/GuestDrawerManage.tsx',
+ 'src/components/Workloads/NodeDrawer.tsx',
+ 'src/features/docker/DockerHostDrawer.tsx',
+ ];
+
+ for (const consumerPath of overviewConsumers) {
+ const source = readFrontendSource(consumerPath);
+ expect(source).toContain('DrawerAttentionSection');
+ expect(source).toContain('TechnicalDetailsDisclosure');
+ expect(source).not.toContain('ResourceOperatorStateSection');
+ }
+
+ for (const consumerPath of manageConsumers) {
+ const source = readFrontendSource(consumerPath);
+ expect(source).toContain("'manage'");
+ }
+
+ for (const ownerPath of manageContentOwners) {
+ const source = readFrontendSource(ownerPath);
+ expect(source).toContain('ResourceOperatorStateSection');
+ }
+
+ const disclosureSource = readFrontendSource(
+ 'src/components/shared/TechnicalDetailsDisclosure.tsx',
+ );
+ expect(disclosureSource).toContain('onToggle');
+ expect(disclosureSource).toContain('<Show when={expanded()}>');
+
+ const registry = JSON.parse(readFrontendSource('scripts/shared-template-registry.json')) as {
+ rules?: Array<{ id: string; requiredConsumers?: Array<{ path: string }> }>;
+ };
+ for (const ruleId of [
+ 'operator-first-drawer-attention',
+ 'operator-first-technical-disclosure',
+ ]) {
+ const rule = registry.rules?.find((candidate) => candidate.id === ruleId);
+ expect(rule?.requiredConsumers?.map((consumer) => consumer.path)).toEqual(overviewConsumers);
+ }
+ });
});
diff --git a/frontend-modern/src/components/shared/TechnicalDetailsDisclosure.tsx b/frontend-modern/src/components/shared/TechnicalDetailsDisclosure.tsx
new file mode 100644
index 0000000000..9d298e4d75
--- /dev/null
+++ b/frontend-modern/src/components/shared/TechnicalDetailsDisclosure.tsx
@@ -0,0 +1,30 @@
+import { Show, createSignal, type Component, type JSX } from 'solid-js';
+
+interface TechnicalDetailsDisclosureProps {
+ children: JSX.Element;
+ title?: string;
+ subtitle: string;
+ dataTestId: string;
+ class?: string;
+ contentClass?: string;
+}
+
+export const TechnicalDetailsDisclosure: Component<TechnicalDetailsDisclosureProps> = (props) => {
+ const [expanded, setExpanded] = createSignal(false);
+
+ return (
+ <details
+ data-testid={props.dataTestId}
+ class={props.class ?? 'rounded border border-border bg-surface px-2 py-1.5'}
+ onToggle={(event) => setExpanded(event.currentTarget.open)}
+ >
+ <summary class="cursor-pointer list-none text-[11px] font-medium text-base-content">
+ {props.title ?? 'Technical details'}
+ <span class="ml-2 font-normal text-muted">{props.subtitle}</span>
+ </summary>
+ <Show when={expanded()}>
+ <div class={props.contentClass ?? 'mt-2 border-t border-border pt-2'}>{props.children}</div>
+ </Show>
+ </details>
+ );
+};
diff --git a/frontend-modern/src/components/shared/detailSectionModel.ts b/frontend-modern/src/components/shared/detailSectionModel.ts
index c0148e466c..8d1e55126f 100644
--- a/frontend-modern/src/components/shared/detailSectionModel.ts
+++ b/frontend-modern/src/components/shared/detailSectionModel.ts
@@ -7,6 +7,7 @@ export type DetailRow = {
value: string;
title?: string;
tone?: DetailValueTone;
+ wrap?: boolean;
};
export type DetailSection = {
@@ -17,7 +18,7 @@ export type DetailSection = {
export const makeDetailRow = (
label: string,
value?: string | null,
- options: Pick<DetailRow, 'title' | 'tone'> = {},
+ options: Pick<DetailRow, 'title' | 'tone' | 'wrap'> = {},
): DetailRow | null => {
const trimmed = value?.trim();
if (!trimmed || trimmed === '-') return null;
diff --git a/frontend-modern/src/features/alerts/__tests__/alertOverridesModel.projected.test.ts b/frontend-modern/src/features/alerts/__tests__/alertOverridesModel.projected.test.ts
index d5199355c1..7ee8e5f3ef 100644
--- a/frontend-modern/src/features/alerts/__tests__/alertOverridesModel.projected.test.ts
+++ b/frontend-modern/src/features/alerts/__tests__/alertOverridesModel.projected.test.ts
@@ -103,6 +103,30 @@ describe('hostOverrideIdCandidates', () => {
),
).toEqual(['same']);
});
+
+ it('retains provider and canonical identities used by active host alerts', () => {
+ expect(
+ hostOverrideIdCandidates(
+ makeResource({
+ id: 'canonical-host',
+ proxmox: { sourceId: 'provider-host' },
+ metricsTarget: { resourceType: 'agent', resourceId: 'metrics-host' },
+ canonicalIdentity: {
+ primaryId: 'node:provider-host',
+ aliases: ['host-alias'],
+ supersededIds: ['old-host-id'],
+ },
+ }),
+ ),
+ ).toEqual([
+ 'provider-host',
+ 'metrics-host',
+ 'node:provider-host',
+ 'host-alias',
+ 'old-host-id',
+ 'canonical-host',
+ ]);
+ });
});
// ---------------------------------------------------------------------------
diff --git a/frontend-modern/src/features/alerts/__tests__/useAlertOverridesState.test.tsx b/frontend-modern/src/features/alerts/__tests__/useAlertOverridesState.test.tsx
index 23a72f4308..2fb3f002f2 100644
--- a/frontend-modern/src/features/alerts/__tests__/useAlertOverridesState.test.tsx
+++ b/frontend-modern/src/features/alerts/__tests__/useAlertOverridesState.test.tsx
@@ -4,7 +4,10 @@ import { describe, expect, it } from 'vitest';
import type { Resource } from '@/types/resource';
-import { unifiedPlatformOverrideIdCandidates } from '../alertOverridesModel';
+import {
+ hostOverrideIdCandidates,
+ unifiedPlatformOverrideIdCandidates,
+} from '../alertOverridesModel';
import { useAlertOverridesState } from '../useAlertOverridesState';
const makeResource = (overrides: Partial<Resource>): Resource =>
@@ -16,6 +19,30 @@ const makeResource = (overrides: Partial<Resource>): Resource =>
}) as Resource;
describe('useAlertOverridesState', () => {
+ it('retains every bounded host identity used by active alert projections', () => {
+ expect(
+ hostOverrideIdCandidates(
+ makeResource({
+ id: 'canonical-host',
+ proxmox: { sourceId: 'provider-host' },
+ metricsTarget: { resourceType: 'agent', resourceId: 'metrics-host' },
+ canonicalIdentity: {
+ primaryId: 'node:provider-host',
+ aliases: ['host-alias'],
+ supersededIds: ['old-host-id'],
+ },
+ }),
+ ),
+ ).toEqual([
+ 'provider-host',
+ 'metrics-host',
+ 'node:provider-host',
+ 'host-alias',
+ 'old-host-id',
+ 'canonical-host',
+ ]);
+ });
+
it('owns raw override normalization and projected alert override read models outside config transport', async () => {
const [hasUnsavedChanges] = createSignal(false);
const [overviewOverrides, setOverviewOverrides] = createSignal([]);
diff --git a/frontend-modern/src/features/alerts/alertOverridesModel.ts b/frontend-modern/src/features/alerts/alertOverridesModel.ts
index 15dc09a37e..f39cb23a6d 100644
--- a/frontend-modern/src/features/alerts/alertOverridesModel.ts
+++ b/frontend-modern/src/features/alerts/alertOverridesModel.ts
@@ -167,6 +167,11 @@ export const hostOverrideIdCandidates = (resource: Resource): string[] => {
resource.agent?.agentId,
agent?.agentId,
data?.agentId,
+ resource.proxmox?.sourceId,
+ resource.metricsTarget?.resourceId,
+ resource.canonicalIdentity?.primaryId,
+ ...(resource.canonicalIdentity?.aliases ?? []),
+ ...(resource.canonicalIdentity?.supersededIds ?? []),
resource.id,
);
};
diff --git a/frontend-modern/src/features/docker/DockerHostDrawer.tsx b/frontend-modern/src/features/docker/DockerHostDrawer.tsx
index 7a49c85e71..847a219b82 100644
--- a/frontend-modern/src/features/docker/DockerHostDrawer.tsx
+++ b/frontend-modern/src/features/docker/DockerHostDrawer.tsx
@@ -12,10 +12,12 @@ import {
} from '@/components/Workloads/GuestDrawerHistory';
import { GUEST_DRAWER_HISTORY_DEFAULT_RANGE } from '@/components/Workloads/guestDrawerModel';
import { toDiscoveryConfig } from '@/components/Infrastructure/resourceDetailDiscoveryModel';
+import { ResourceOperatorStateSection } from '@/components/Infrastructure/ResourceOperatorStateSection';
+import { WebInterfaceUrlField } from '@/components/shared/WebInterfaceUrlField';
import type { Resource } from '@/types/resource';
import { asTrimmedString } from '@/utils/stringUtils';
-import { DockerHostDrawerOverview } from './DockerHostDrawerOverview';
+import { DockerHostDrawerManagement, DockerHostDrawerOverview } from './DockerHostDrawerOverview';
import {
DOCKER_HOST_DRAWER_HISTORY_GROUPS,
getDockerHostDrawerCurrentMetrics,
@@ -28,7 +30,7 @@ interface DockerHostDrawerProps {
onCustomUrlChange?: (url: string) => void;
}
-type DockerHostDrawerTab = 'overview' | 'history' | 'discovery';
+type DockerHostDrawerTab = 'overview' | 'history' | 'manage' | 'discovery';
export const DockerHostDrawer: Component<DockerHostDrawerProps> = (props) => {
const [activeTab, setActiveTab] = createSignal<DockerHostDrawerTab>('overview');
@@ -42,6 +44,9 @@ export const DockerHostDrawer: Component<DockerHostDrawerProps> = (props) => {
const currentMetrics = createMemo(() => getDockerHostDrawerCurrentMetrics(props.host));
const discoveryConfig = createMemo(() => toDiscoveryConfig(props.host));
const headerIndicator = createMemo(() => getSimpleStatusIndicator(props.host.status));
+ const metadataId = createMemo(
+ () => asTrimmedString(props.host.docker?.hostSourceId) || asTrimmedString(props.host.id),
+ );
return (
<section class="space-y-3" aria-labelledby={headingId()} data-testid="docker-host-drawer">
@@ -60,6 +65,7 @@ export const DockerHostDrawer: Component<DockerHostDrawerProps> = (props) => {
tabs={[
{ value: 'overview', label: 'Overview' },
{ value: 'history', label: 'History' },
+ { value: 'manage', label: 'Manage' },
...(discoveryConfig()
? [{ value: 'discovery', label: 'Discovery' } satisfies SubtabOption]
: []),
@@ -74,11 +80,29 @@ export const DockerHostDrawer: Component<DockerHostDrawerProps> = (props) => {
{/* Use CSS hidden instead of Show to avoid mount/unmount which causes scroll jumps.
overflow-anchor: none prevents browser scroll anchoring from jumping when display toggles. */}
<div class={activeTab() === 'overview' ? '' : 'hidden'} style={{ 'overflow-anchor': 'none' }}>
- <DockerHostDrawerOverview
- host={props.host}
- customUrl={props.customUrl}
- onCustomUrlChange={props.onCustomUrlChange}
- />
+ <DockerHostDrawerOverview host={props.host} />
+ </div>
+
+ <div class={activeTab() === 'manage' ? '' : 'hidden'} style={{ 'overflow-anchor': 'none' }}>
+ <Show when={activeTab() === 'manage'}>
+ <div class="space-y-3" data-testid="docker-host-manage-tab">
+ <DockerHostDrawerManagement host={props.host} />
+ <ResourceOperatorStateSection
+ resourceId={props.host.id}
+ resourceType="docker-host"
+ platformType={props.host.platformType || 'docker'}
+ capabilities={props.host.capabilities}
+ />
+ <WebInterfaceUrlField
+ metadataKind="docker-host"
+ metadataId={metadataId()}
+ targetLabel={displayName()}
+ title="Access"
+ customUrl={props.customUrl ?? props.host.customUrl ?? ''}
+ onCustomUrlChange={props.onCustomUrlChange}
+ />
+ </div>
+ </Show>
</div>
<div class={activeTab() === 'history' ? '' : 'hidden'} style={{ 'overflow-anchor': 'none' }}>
diff --git a/frontend-modern/src/features/docker/DockerHostDrawerOverview.tsx b/frontend-modern/src/features/docker/DockerHostDrawerOverview.tsx
index 7c3cb3ee9f..f91a4aea32 100644
--- a/frontend-modern/src/features/docker/DockerHostDrawerOverview.tsx
+++ b/frontend-modern/src/features/docker/DockerHostDrawerOverview.tsx
@@ -7,7 +7,14 @@ import {
} from '@/components/Workloads/DrawerDiskListCard';
import { AvailabilityProbeStatusCards } from '@/components/Infrastructure/AvailabilityProbeStatusCard';
import { InfoCardFrame } from '@/components/shared/InfoCardFrame';
-import { WebInterfaceUrlField } from '@/components/shared/WebInterfaceUrlField';
+import { TechnicalDetailsDisclosure } from '@/components/shared/TechnicalDetailsDisclosure';
+import { DrawerAttentionSection } from '@/components/shared/DrawerAttentionSection';
+import {
+ DetailSectionTable,
+ compactDetailRows,
+ compactDetailSections,
+ makeDetailRow,
+} from '@/components/shared/DetailSectionTable';
import { useResourceDetailDrawerDockerActionsState } from '@/components/Infrastructure/useResourceDetailDrawerDockerActionsState';
import { hostOverrideIdCandidates } from '@/features/alerts/alertOverridesModel';
import { areSystemSettingsLoaded, shouldHideDockerUpdateActions } from '@/stores/systemSettings';
@@ -22,12 +29,8 @@ import {
} from '@/utils/format';
import { formatTemperature, getTemperatureTextClass } from '@/utils/temperature';
-import { hasDockerSwarmEvidence } from './dockerPageModel';
-
interface DockerHostDrawerOverviewProps {
host: Resource;
- customUrl?: string;
- onCustomUrlChange?: (url: string) => void;
}
interface DockerOverviewRow {
@@ -37,6 +40,13 @@ interface DockerOverviewRow {
title?: string;
}
+type DockerHostCommandMeta = {
+ type?: string;
+ status?: string;
+ message?: string;
+ failureReason?: string;
+};
+
const cleanText = (value: string | null | undefined): string => {
const trimmed = (value || '').trim();
return trimmed && trimmed.toLowerCase() !== 'unknown' ? trimmed : '';
@@ -114,12 +124,113 @@ const DetailCard = (props: { title: string; rows: DockerOverviewRow[] }) => (
</Show>
);
+export function DockerHostDrawerManagement(props: DockerHostDrawerOverviewProps) {
+ const docker = () => props.host.docker;
+ const hostSourceId = createMemo(() => cleanText(docker()?.hostSourceId) || null);
+ const updatesAvailable = createMemo(() => docker()?.updatesAvailableCount ?? 0);
+ const hostCommand = createMemo(() => docker()?.command as DockerHostCommandMeta | undefined);
+ const hostCommandActive = createMemo(() =>
+ ['queued', 'dispatched', 'acknowledged', 'in_progress'].includes(
+ cleanText(hostCommand()?.status).toLowerCase(),
+ ),
+ );
+ const updateActions = useResourceDetailDrawerDockerActionsState({
+ dockerHostSourceId: hostSourceId,
+ dockerUpdatesAvailable: updatesAvailable,
+ });
+ const updateActionsLoading = () => !areSystemSettingsLoaded();
+ const updateAllHidden = () => shouldHideDockerUpdateActions();
+ const checkedAt = () => cleanText(docker()?.updatesLastCheckedAt);
+ const checkedAtMillis = createMemo(() => {
+ const parsed = Date.parse(checkedAt());
+ return Number.isFinite(parsed) ? parsed : null;
+ });
+
+ return (
+ <Show when={hostSourceId()}>
+ <InfoCardFrame data-testid="docker-host-management-actions" class="max-w-md">
+ <h3 class="mb-2 text-[11px] font-medium uppercase tracking-wide text-base-content">
+ Container updates
+ </h3>
+ <div class="space-y-1.5 text-[11px]">
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Available</span>
+ <span class="font-medium text-base-content">{updatesAvailable()}</span>
+ </div>
+ <Show when={checkedAtMillis()} keyed>
+ {(timestamp) => (
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Last checked</span>
+ <span class="font-medium text-base-content">{formatRelativeTime(timestamp)}</span>
+ </div>
+ )}
+ </Show>
+ <Show when={hostCommand()?.type || hostCommand()?.status}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">
+ {titleCase(cleanText(hostCommand()?.type).replace(/_/g, ' ') || 'Command')}
+ </span>
+ <span
+ class={`truncate text-right font-medium ${
+ hostCommandActive() ? 'text-sky-700 dark:text-sky-300' : 'text-base-content'
+ }`}
+ title={hostCommand()?.failureReason || hostCommand()?.message || undefined}
+ >
+ {titleCase(cleanText(hostCommand()?.status).replace(/_/g, ' ') || 'unknown')}
+ </span>
+ </div>
+ </Show>
+ <Show when={updateActions.dockerActionError()}>
+ <div class="rounded border border-red-200 bg-red-50 px-2 py-1.5 text-[10px] text-red-700 dark:border-red-700 dark:bg-red-900 dark:text-red-200">
+ {updateActions.dockerActionError()}
+ </div>
+ </Show>
+ <Show when={updateActions.dockerActionNote()}>
+ <div class="rounded border border-border bg-surface-hover px-2 py-1.5 text-[10px] text-base-content">
+ {updateActions.dockerActionNote()}
+ </div>
+ </Show>
+ <div class="flex flex-wrap items-center gap-2 border-t border-border pt-2">
+ <button
+ type="button"
+ disabled={
+ updateActions.dockerActionBusy() || updateActionsLoading() || hostCommandActive()
+ }
+ onClick={() => void updateActions.queueDockerUpdateCheck()}
+ class="rounded-md border border-border bg-surface px-2.5 py-1 text-[11px] font-semibold text-base-content hover:bg-surface-hover disabled:opacity-60"
+ title={updateActionsLoading() ? 'Loading settings...' : undefined}
+ >
+ Check updates
+ </button>
+ <Show when={!updateAllHidden()}>
+ <button
+ type="button"
+ disabled={
+ updateActions.dockerActionBusy() ||
+ updateActionsLoading() ||
+ hostCommandActive() ||
+ updatesAvailable() <= 0
+ }
+ onClick={() => void updateActions.queueDockerUpdateAll()}
+ class="rounded-md border border-sky-200 bg-sky-600 px-2.5 py-1 text-[11px] font-semibold text-white hover:bg-sky-700 disabled:opacity-60 disabled:hover:bg-sky-600 dark:border-sky-700 dark:bg-sky-600 dark:hover:bg-sky-500 dark:disabled:hover:bg-sky-600"
+ >
+ {updateActions.confirmUpdateAll()
+ ? 'Confirm update'
+ : `Update all${updatesAvailable() > 0 ? ` (${updatesAvailable()})` : ''}`}
+ </button>
+ </Show>
+ </div>
+ </div>
+ </InfoCardFrame>
+ </Show>
+ );
+}
+
export function DockerHostDrawerOverview(props: DockerHostDrawerOverviewProps) {
const alertsActivation = useAlertsActivation();
const docker = () => props.host.docker;
const agent = () => props.host.agent;
const linkedAgentId = () => cleanText(agent()?.agentId);
- const metadataId = () => cleanText(docker()?.hostSourceId) || cleanText(props.host.id);
const temperatureThresholds = createMemo(() =>
alertsActivation.getMetricThresholds(
'node',
@@ -209,64 +320,6 @@ export function DockerHostDrawerOverview(props: DockerHostDrawerOverviewProps) {
: []),
];
- const containerRows = (): DockerOverviewRow[] => {
- const count = docker()?.containerCount;
- const rows: DockerOverviewRow[] = [];
- if (typeof count === 'number') {
- rows.push({ label: 'Containers', value: `${count}` });
- }
- const updates = docker()?.updatesAvailableCount;
- if (typeof updates === 'number') {
- rows.push({
- label: 'Updates',
- value: `${updates}`,
- valueClass: updates > 0 ? 'text-sky-700 dark:text-sky-300' : undefined,
- });
- }
- const checkedAt = cleanText(docker()?.updatesLastCheckedAt);
- if (checkedAt) {
- const parsed = Date.parse(checkedAt);
- if (Number.isFinite(parsed)) {
- rows.push({
- label: 'Checked',
- value: formatRelativeTime(parsed),
- title: new Date(parsed).toLocaleString(),
- });
- }
- }
- if (hasDockerSwarmEvidence(props.host)) {
- const role = cleanText(docker()?.swarm?.nodeRole);
- if (role) rows.push({ label: 'Swarm role', value: titleCase(role) });
- const state = cleanText(docker()?.swarm?.localState);
- if (state) rows.push({ label: 'Swarm state', value: titleCase(state) });
- const cluster = cleanText(docker()?.swarm?.clusterName);
- if (cluster) rows.push({ label: 'Swarm cluster', value: cluster });
- }
- return rows;
- };
-
- type DockerHostCommandMeta = {
- type?: string;
- status?: string;
- message?: string;
- failureReason?: string;
- };
-
- const hostSourceId = createMemo(() => cleanText(docker()?.hostSourceId) || null);
- const updatesAvailable = createMemo(() => docker()?.updatesAvailableCount ?? 0);
- const hostCommand = createMemo(() => docker()?.command as DockerHostCommandMeta | undefined);
- const hostCommandActive = createMemo(() =>
- ['queued', 'dispatched', 'acknowledged', 'in_progress'].includes(
- cleanText(hostCommand()?.status).toLowerCase(),
- ),
- );
- const updateActions = useResourceDetailDrawerDockerActionsState({
- dockerHostSourceId: hostSourceId,
- dockerUpdatesAvailable: updatesAvailable,
- });
- const updateActionsLoading = () => !areSystemSettingsLoaded();
- const updateAllHidden = () => shouldHideDockerUpdateActions();
-
const memoryRows = (): DockerOverviewRow[] => {
const memory = memorySource();
if (!memory) return [];
@@ -358,113 +411,64 @@ export function DockerHostDrawerOverview(props: DockerHostDrawerOverviewProps) {
return buildDrawerDiskListItems(disks);
};
+ const overviewSections = () => {
+ const swarm = cleanText(docker()?.swarm?.localState);
+ return compactDetailSections([
+ {
+ label: 'Operator context',
+ rows: compactDetailRows([
+ makeDetailRow('Runtime', runtimeLabel()),
+ makeDetailRow('System', osLabel()),
+ makeDetailRow(
+ 'Pulse coverage',
+ linkedAgentId() ? `Agent ${stripAgentPrefix(linkedAgentId())}` : 'Direct API',
+ ),
+ typeof docker()?.updatesAvailableCount === 'number' &&
+ (docker()?.updatesAvailableCount ?? 0) > 0
+ ? makeDetailRow('Updates', `${docker()?.updatesAvailableCount} available`, {
+ tone: 'warning',
+ })
+ : null,
+ makeDetailRow('Swarm', swarm ? titleCase(swarm) : null),
+ ]),
+ },
+ ]);
+ };
+
return (
- <div class="flex flex-wrap gap-3 [&>*]:flex-1 [&>*]:basis-[calc(25%-0.75rem)] [&>*]:min-w-[200px] [&>*]:max-w-full [&>*]:overflow-hidden">
- <DetailCard title="System" rows={systemRows()} />
- <DetailCard title="Runtime" rows={runtimeRows()} />
+ <div class="space-y-3">
+ <DrawerAttentionSection
+ items={(props.host.alerts ?? []).map((alert) => ({
+ id: alert.id,
+ message: alert.message,
+ severity: alert.level,
+ }))}
+ />
+ <DetailSectionTable sections={overviewSections()} />
<Show when={props.host.availability || props.host.availabilityChecks?.length}>
- <AvailabilityProbeStatusCards
- availability={props.host.availability}
- checks={props.host.availabilityChecks}
- />
- </Show>
- <InfoCardFrame data-testid="docker-host-drawer-containers-card">
- <h3 class="mb-2 text-[11px] font-medium uppercase tracking-wide text-base-content">
- Containers
- </h3>
- <div class="space-y-1.5 text-[11px]">
- <For each={containerRows()}>
- {(row) => (
- <div class="flex items-center justify-between gap-2 min-w-0">
- <span class="shrink-0 text-muted">{row.label}</span>
- <span
- class={`truncate text-right font-medium ${row.valueClass ?? 'text-base-content'}`}
- title={row.title ?? row.value}
- >
- {row.value}
- </span>
- </div>
- )}
- </For>
- <Show when={hostSourceId()}>
- <div class="space-y-1.5 border-t border-border pt-2">
- <Show when={hostCommand()?.type || hostCommand()?.status}>
- <div class="flex items-center justify-between gap-2">
- <span class="text-muted">
- {titleCase(cleanText(hostCommand()?.type).replace(/_/g, ' ') || 'Command')}
- </span>
- <span
- class={`truncate text-right font-medium ${
- hostCommandActive() ? 'text-sky-700 dark:text-sky-300' : 'text-base-content'
- }`}
- title={hostCommand()?.failureReason || hostCommand()?.message || undefined}
- >
- {titleCase(cleanText(hostCommand()?.status).replace(/_/g, ' ') || 'unknown')}
- </span>
- </div>
- </Show>
- <Show when={updateActions.dockerActionError()}>
- <div class="rounded border border-red-200 bg-red-50 px-2 py-1.5 text-[10px] text-red-700 dark:border-red-700 dark:bg-red-900 dark:text-red-200">
- {updateActions.dockerActionError()}
- </div>
- </Show>
- <Show when={updateActions.dockerActionNote()}>
- <div class="rounded border border-border bg-surface-hover px-2 py-1.5 text-[10px] text-base-content">
- {updateActions.dockerActionNote()}
- </div>
- </Show>
- <div class="flex flex-wrap items-center gap-2 pt-0.5">
- <button
- type="button"
- disabled={
- updateActions.dockerActionBusy() ||
- updateActionsLoading() ||
- hostCommandActive()
- }
- onClick={() => void updateActions.queueDockerUpdateCheck()}
- class="rounded-md border border-border bg-surface px-2.5 py-1 text-[11px] font-semibold text-base-content hover:bg-surface-hover disabled:opacity-60"
- title={updateActionsLoading() ? 'Loading settings...' : undefined}
- >
- Check updates
- </button>
- <Show when={!updateAllHidden()}>
- <button
- type="button"
- disabled={
- updateActions.dockerActionBusy() ||
- updateActionsLoading() ||
- hostCommandActive() ||
- updatesAvailable() <= 0
- }
- onClick={() => void updateActions.queueDockerUpdateAll()}
- class="rounded-md border border-sky-200 bg-sky-600 px-2.5 py-1 text-[11px] font-semibold text-white hover:bg-sky-700 disabled:opacity-60 disabled:hover:bg-sky-600 dark:border-sky-700 dark:bg-sky-600 dark:hover:bg-sky-500 dark:disabled:hover:bg-sky-600"
- >
- {updateActions.confirmUpdateAll()
- ? 'Confirm update'
- : `Update all${updatesAvailable() > 0 ? ` (${updatesAvailable()})` : ''}`}
- </button>
- </Show>
- </div>
- </div>
- </Show>
+ <div class="max-w-sm">
+ <AvailabilityProbeStatusCards
+ availability={props.host.availability}
+ checks={props.host.availabilityChecks}
+ />
</div>
- </InfoCardFrame>
- <DetailCard title="Memory" rows={memoryRows()} />
- <Show
- when={perDiskItems().length > 0}
- fallback={<DetailCard title="Storage" rows={storageRows()} />}
- >
- <DrawerDiskListCard disks={perDiskItems()} testId="docker-host-drawer-disks" />
</Show>
- <DetailCard title="Telemetry" rows={telemetryRows()} />
- <WebInterfaceUrlField
- metadataKind="docker-host"
- metadataId={metadataId()}
- targetLabel={cleanText(props.host.name) || 'Docker host'}
- title="Access"
- customUrl={props.customUrl ?? props.host.customUrl ?? ''}
- onCustomUrlChange={props.onCustomUrlChange}
- />
+ <TechnicalDetailsDisclosure
+ dataTestId="docker-host-technical-details"
+ subtitle="Runtime, capacity, and storage"
+ contentClass="mt-2 flex flex-wrap gap-2 border-t border-border pt-2 [&>*]:flex-1 [&>*]:basis-[calc(25%-0.5rem)] [&>*]:min-w-[200px] [&>*]:max-w-full [&>*]:overflow-hidden"
+ >
+ <DetailCard title="System" rows={systemRows()} />
+ <DetailCard title="Runtime" rows={runtimeRows()} />
+ <DetailCard title="Memory" rows={memoryRows()} />
+ <Show
+ when={perDiskItems().length > 0}
+ fallback={<DetailCard title="Storage" rows={storageRows()} />}
+ >
+ <DrawerDiskListCard disks={perDiskItems()} testId="docker-host-drawer-disks" />
+ </Show>
+ <DetailCard title="Telemetry" rows={telemetryRows()} />
+ </TechnicalDetailsDisclosure>
</div>
);
}
diff --git a/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx b/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx
index bba9ff75c8..a24266a2a8 100644
--- a/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx
+++ b/frontend-modern/src/features/docker/__tests__/DockerHostsTable.test.tsx
@@ -10,6 +10,15 @@ import dockerHostsTableSource from '../DockerHostsTable.tsx?raw';
const formatThresholds = (thresholds?: MetricDisplayThresholds | null): string =>
thresholds ? `${thresholds.warning}/${thresholds.critical}` : '';
+const expandTechnicalDetails = (drawer: HTMLElement): void => {
+ const details = within(drawer).getByText('Technical details').closest('details');
+ if (!(details instanceof HTMLDetailsElement)) {
+ throw new Error('Expected Docker technical details disclosure');
+ }
+ details.open = true;
+ fireEvent(details, new Event('toggle'));
+};
+
// Row bars must color from the alert-configured thresholds, not the
// hardcoded METRIC_THRESHOLDS display defaults (memory 75/85), so a host
// with a raised memory override stops showing red below its alert point.
@@ -256,8 +265,9 @@ describe('DockerHostsTable', () => {
fireEvent.click(screen.getByText('docker-01').closest('tr')!);
const drawer = screen.getByTestId('docker-host-drawer');
+ fireEvent.click(within(drawer).getByRole('tab', { name: 'Manage' }));
expect(within(drawer).getByText('Access')).toBeInTheDocument();
- const input = within(drawer).getByRole('textbox');
+ const input = within(drawer).getByPlaceholderText('https://198.51.100.100:8080');
fireEvent.input(input, { target: { value: 'https://portainer.example:9443' } });
fireEvent.click(within(drawer).getByRole('button', { name: 'Save' }));
@@ -346,6 +356,7 @@ describe('DockerHostsTable', () => {
fireEvent.click(screen.getByText('docker-01').closest('tr')!);
const drawer = screen.getByTestId('docker-host-drawer');
+ expandTechnicalDetails(drawer);
expect(within(drawer).getByText('76°C')).toHaveClass('text-green-600');
});
@@ -370,9 +381,11 @@ describe('DockerHostsTable', () => {
));
fireEvent.click(screen.getByText('docker-01').closest('tr')!);
+ const drawer = screen.getByTestId('docker-host-drawer');
+ fireEvent.click(within(drawer).getByRole('tab', { name: 'Manage' }));
- expect(screen.getByRole('button', { name: 'Check updates' })).toBeInTheDocument();
- expect(screen.getByRole('button', { name: 'Update all (3)' })).toBeInTheDocument();
+ expect(within(drawer).getByRole('button', { name: 'Check updates' })).toBeInTheDocument();
+ expect(within(drawer).getByRole('button', { name: 'Update all (3)' })).toBeInTheDocument();
});
it('identifies the host system separately from the container runtime', () => {
@@ -520,6 +533,7 @@ describe('DockerHostsTable', () => {
fireEvent.click(screen.getByText('docker-01').closest('tr')!);
const drawer = screen.getByTestId('docker-host-drawer');
+ expandTechnicalDetails(drawer);
expect(within(drawer).getByText('Unavailable')).toBeInTheDocument();
expect(within(drawer).getByText('7.81 KB')).toBeInTheDocument();
});
diff --git a/frontend-modern/src/features/platformPage/PlatformResourceDetailTableRow.tsx b/frontend-modern/src/features/platformPage/PlatformResourceDetailTableRow.tsx
index fd89b08bd2..b0b8ea225a 100644
--- a/frontend-modern/src/features/platformPage/PlatformResourceDetailTableRow.tsx
+++ b/frontend-modern/src/features/platformPage/PlatformResourceDetailTableRow.tsx
@@ -1,6 +1,5 @@
import { Show, createSignal, type Component, type JSX } from 'solid-js';
import { ResourceDetailDrawer } from '@/components/Infrastructure/ResourceDetailDrawer';
-import { hasTrueNASDetailSections } from '@/components/Infrastructure/resourceDetailDrawerTrueNASModel';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
import { SummaryRowActionButton } from '@/components/shared/SummaryRowActionButton';
import type { Resource } from '@/types/resource';
@@ -100,9 +99,6 @@ export const PlatformResourceDetailTableRow: Component<{
onResourceActionSettled?: () => void | Promise<void>;
onClose?: () => void;
}> = (props) => {
- const initialShowTrueNASDetails = () =>
- props.initialShowTrueNASDetails ?? hasTrueNASDetailSections(props.resource);
-
return (
<Show when={props.open}>
<InlineDetailTableRow
@@ -117,7 +113,7 @@ export const PlatformResourceDetailTableRow: Component<{
resolveResourceLabel={props.resolveResourceLabel}
initialShowAccessContext={props.initialShowAccessContext}
initialShowHostDetails={props.initialShowHostDetails}
- initialShowTrueNASDetails={initialShowTrueNASDetails()}
+ initialShowTrueNASDetails={props.initialShowTrueNASDetails}
onResourceActionSettled={props.onResourceActionSettled}
onClose={props.onClose}
/>
diff --git a/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx
index 7e3bccf14e..70c508668e 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx
@@ -9,7 +9,7 @@ import {
} from 'solid-js';
import { useWebSocket } from '@/contexts/appRuntime';
import { useAlertsActivation } from '@/stores/alertsActivation';
-import { getAlertStyles } from '@/utils/alerts';
+import { getAlertsForResource, getAlertStyles } from '@/utils/alerts';
import { StatusDot } from '@/components/shared/StatusDot';
import { ResourceNameWithWebInterfaceLink } from '@/components/shared/WebInterfaceLink';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
@@ -741,6 +741,12 @@ export const ProxmoxNodesTable: Component<{
>
<NodeDrawer
node={selectedNode()}
+ alerts={getAlertsForResource(
+ alertResourceIds(),
+ activeAlerts,
+ alertsEnabled(),
+ node.name,
+ )}
disks={normalizeDiskArray(node.agent?.disks)}
temperatureThresholds={temperatureThresholds()}
discoveryTarget={(() => {
diff --git a/frontend-modern/src/hooks/__tests__/useWorkloads.test.ts b/frontend-modern/src/hooks/__tests__/useWorkloads.test.ts
index 929c0599fc..7a9ee4f4ea 100644
--- a/frontend-modern/src/hooks/__tests__/useWorkloads.test.ts
+++ b/frontend-modern/src/hooks/__tests__/useWorkloads.test.ts
@@ -239,7 +239,17 @@ describe('useWorkloads', () => {
platformType: 'proxmox-pve',
sources: ['proxmox'],
identity: { hostname: 'vm-101', ips: ['192.0.2.101'] },
- proxmox: { vmid: 101, nodeName: 'pve1', instance: 'cluster-a' },
+ metricsTarget: { resourceId: 'cluster-a-pve1-101' },
+ canonicalIdentity: {
+ primaryId: 'vm:cluster-a-pve1-101',
+ aliases: ['legacy-vm-101'],
+ },
+ proxmox: {
+ sourceId: 'cluster-a-pve1-101',
+ vmid: 101,
+ nodeName: 'pve1',
+ instance: 'cluster-a',
+ },
cpu: { current: 25 },
memory: { current: 50, used: 2 * 1024, total: 4 * 1024 },
disk: { current: 20, used: 20 * 1024, total: 100 * 1024 },
@@ -260,7 +270,18 @@ describe('useWorkloads', () => {
await flushAsync();
expect(apiFetchJSONMock).not.toHaveBeenCalled();
- expect(result!.workloads()).toMatchObject([{ name: 'vm-101', vmid: 101, node: 'pve1' }]);
+ expect(result!.workloads()).toMatchObject([
+ {
+ name: 'vm-101',
+ vmid: 101,
+ node: 'pve1',
+ alertResourceIds: expect.arrayContaining([
+ 'cluster-a-pve1-101',
+ 'vm:cluster-a-pve1-101',
+ 'legacy-vm-101',
+ ]),
+ },
+ ]);
await result!.refetch();
expect(refetchSnapshot).toHaveBeenCalledTimes(1);
diff --git a/frontend-modern/src/hooks/useWorkloads.ts b/frontend-modern/src/hooks/useWorkloads.ts
index 69fc883fcd..c6d9debc45 100644
--- a/frontend-modern/src/hooks/useWorkloads.ts
+++ b/frontend-modern/src/hooks/useWorkloads.ts
@@ -71,6 +71,14 @@ type APIResource = {
lastSeen?: string;
sources?: string[];
platformScopes?: string[];
+ metricsTarget?: {
+ resourceId?: string;
+ };
+ canonicalIdentity?: {
+ primaryId?: string;
+ aliases?: string[];
+ supersededIds?: string[];
+ };
identity?: {
machineId?: string;
hostnames?: string[];
@@ -93,6 +101,7 @@ type APIResource = {
node?: string;
instance?: string;
proxmox?: {
+ sourceId?: string;
runtimeStatus?: string;
nodeName?: string;
clusterName?: string;
@@ -175,6 +184,18 @@ type APIResource = {
actionReadiness?: ResourceActionReadiness[];
};
+const buildAlertResourceIds = (resource: APIResource): string[] => {
+ const candidates = [
+ resource.metricsTarget?.resourceId,
+ resource.proxmox?.sourceId,
+ resource.canonicalIdentity?.primaryId,
+ ...(resource.canonicalIdentity?.aliases ?? []),
+ ...(resource.canonicalIdentity?.supersededIds ?? []),
+ resource.id,
+ ];
+ return [...new Set(candidates.map((value) => value?.trim()).filter(Boolean) as string[])];
+};
+
type APIListResponse = {
data?: APIResource[];
resources?: APIResource[];
@@ -473,6 +494,7 @@ const mapResourceToWorkload = (resource: APIResource): WorkloadGuest | null => {
return {
id: guestId,
+ alertResourceIds: buildAlertResourceIds(resource),
vmid: Number.isFinite(vmid) ? vmid : 0,
name: name || resource.id,
node,
@@ -639,6 +661,8 @@ const mapCanonicalResourceToWorkload = (resource: Resource): WorkloadGuest | nul
lastSeen: resource.lastSeen ? new Date(resource.lastSeen).toISOString() : undefined,
sources: resource.sources,
platformScopes: resource.platformScopes,
+ metricsTarget: resource.metricsTarget,
+ canonicalIdentity: resource.canonicalIdentity,
identity: resource.identity
? {
machineId: resource.identity.machineId,
diff --git a/frontend-modern/src/types/workloads.ts b/frontend-modern/src/types/workloads.ts
index 44db5bfa19..2e27d81829 100644
--- a/frontend-modern/src/types/workloads.ts
+++ b/frontend-modern/src/types/workloads.ts
@@ -21,6 +21,8 @@ export interface WorkloadTelemetryAvailability {
export type WorkloadGuest = (VM | Container) & {
workloadType?: WorkloadType;
+ /** Backend identities that may own active alerts for this canonical workload. */
+ alertResourceIds?: string[];
/** Canonical unified-resource health, kept separate from runtime power state in `status`. */
resourceStatus?: string;
displayId?: string;
diff --git a/frontend-modern/src/utils/__tests__/alerts.test.ts b/frontend-modern/src/utils/__tests__/alerts.test.ts
index c19d625538..11896907d7 100644
--- a/frontend-modern/src/utils/__tests__/alerts.test.ts
+++ b/frontend-modern/src/utils/__tests__/alerts.test.ts
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
-import { getAlertStyles } from '@/utils/alerts';
+import { getAlertsForResource, getAlertStyles } from '@/utils/alerts';
import type { Alert } from '@/types/api';
describe('getAlertStyles', () => {
@@ -85,6 +85,16 @@ describe('getAlertStyles', () => {
});
});
+ it('matches alert styles through any canonical resource identity candidate', () => {
+ const alerts = createActiveAlerts(
+ createAlert({ resourceId: 'provider-source-id', level: 'critical' }),
+ );
+
+ expect(getAlertStyles(['canonical-id', 'provider-source-id'], alerts, true).severity).toBe(
+ 'critical',
+ );
+ });
+
describe('alert counts', () => {
it('counts multiple alerts for same resource', () => {
const alerts = createActiveAlerts(
@@ -163,6 +173,21 @@ describe('getAlertStyles', () => {
expect(result.severity).toBe('critical');
});
+ it('returns the matching alert records for canonical drawer presentation', () => {
+ const alerts = createActiveAlerts(
+ createAlert({ id: 'canonical', resourceId: 'resource-1', message: 'CPU is hot' }),
+ createAlert({ id: 'legacy', resourceId: 'legacy-resource', message: 'Disk is full' }),
+ createAlert({ id: 'other', resourceId: 'resource-2' }),
+ );
+
+ expect(
+ getAlertsForResource(['resource-1', 'legacy-resource'], alerts, true).map(
+ (alert) => alert.message,
+ ),
+ ).toEqual(['CPU is hot', 'Disk is full']);
+ expect(getAlertsForResource(['resource-1'], alerts, false)).toEqual([]);
+ });
+
it('returns empty styles when no alerts for resource', () => {
const alerts = createActiveAlerts(createAlert({ id: 'alert-1', resourceId: 'resource-2' }));
const result = getAlertStyles('resource-1', alerts, true);
diff --git a/frontend-modern/src/utils/__tests__/alertsActivation.test.ts b/frontend-modern/src/utils/__tests__/alertsActivation.test.ts
index 5bc58e2577..bc07108301 100644
--- a/frontend-modern/src/utils/__tests__/alertsActivation.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertsActivation.test.ts
@@ -4,6 +4,8 @@ import {
isAlertsDetectionEnabled,
setGlobalAlertsDetectionEnabled,
} from '@/utils/alertsActivation';
+import { getAlertsForResource } from '@/utils/alerts';
+import type { Alert } from '@/types/api';
describe('alerts detection state', () => {
beforeEach(() => {
@@ -50,4 +52,19 @@ describe('alerts detection state', () => {
expect(window.__pulseAlertsDetectionEnabled).toBeNull();
});
});
+
+ it('projects active problems through canonical and provider resource identities', () => {
+ const providerAlert = {
+ id: 'provider-alert',
+ resourceId: 'provider-host',
+ level: 'warning',
+ message: 'Node is offline',
+ } as Alert;
+
+ expect(
+ getAlertsForResource(['canonical-host', 'provider-host'], {
+ [providerAlert.id]: providerAlert,
+ }),
+ ).toEqual([providerAlert]);
+ });
});
diff --git a/frontend-modern/src/utils/__tests__/workloadGuestPresentation.test.ts b/frontend-modern/src/utils/__tests__/workloadGuestPresentation.test.ts
index 578a2432d3..7c7c0bd422 100644
--- a/frontend-modern/src/utils/__tests__/workloadGuestPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/workloadGuestPresentation.test.ts
@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest';
import {
getWorkloadsGuestBackupStatusPresentation,
getWorkloadsGuestBackupTooltip,
+ getWorkloadsGuestProtectionPresentation,
getWorkloadGuestDiskStatusMessage,
getWorkloadsGuestNetworkEmptyState,
} from '@/utils/workloadGuestPresentation';
@@ -30,6 +31,23 @@ describe('workloadGuestPresentation', () => {
expect(getWorkloadsGuestBackupTooltip('stale', '3d')).toBe('Last backup: 3d');
});
+ it('returns canonical compact protection context for object drawers', () => {
+ expect(getWorkloadsGuestProtectionPresentation({ backupInProgress: true })).toEqual({
+ label: 'Backup running',
+ tone: 'success',
+ });
+ expect(getWorkloadsGuestProtectionPresentation({})).toEqual({
+ label: 'No backup found',
+ tone: 'danger',
+ });
+ expect(
+ getWorkloadsGuestProtectionPresentation({
+ ageLabel: '3d ago',
+ ageClass: 'text-yellow-600',
+ }),
+ ).toEqual({ label: '3d ago', tone: 'warning' });
+ });
+
it('presents a running backup as its own state, keeping the completed age', () => {
expect(getWorkloadsGuestBackupStatusPresentation('running')).toEqual({
color: 'text-blue-600 dark:text-blue-400',
diff --git a/frontend-modern/src/utils/alerts.ts b/frontend-modern/src/utils/alerts.ts
index 720110e93c..f270d63d0f 100644
--- a/frontend-modern/src/utils/alerts.ts
+++ b/frontend-modern/src/utils/alerts.ts
@@ -21,7 +21,7 @@ const noAlertStyles = {
// (covers storage/topology/disk alerts that belong to a node but have a
// different resourceId than the node itself).
export const getAlertStyles = (
- resourceId: string,
+ resourceId: string | string[],
activeAlerts: Record<string, Alert>,
alertsEnabled: boolean | undefined = isAlertsDetectionEnabled(),
nodeMatch?: string,
@@ -30,9 +30,11 @@ export const getAlertStyles = (
return noAlertStyles;
}
- const alertsForResource = Object.values(activeAlerts).filter(
- (alert) =>
- alert.resourceId === resourceId || (nodeMatch !== undefined && alert.node === nodeMatch),
+ const alertsForResource = getAlertsForResource(
+ Array.isArray(resourceId) ? resourceId : [resourceId],
+ activeAlerts,
+ alertsEnabled,
+ nodeMatch,
);
const unacknowledgedAlerts = alertsForResource.filter((alert) => !alert.acknowledged);
@@ -114,6 +116,19 @@ export const getAlertStyles = (
};
};
+export function getAlertsForResource(
+ resourceIds: string[],
+ activeAlerts: Record<string, Alert>,
+ alertsEnabled: boolean | undefined = isAlertsDetectionEnabled(),
+ nodeMatch?: string,
+): Alert[] {
+ if (!alertsEnabled) return [];
+ const ids = new Set(resourceIds.filter(Boolean));
+ return Object.values(activeAlerts).filter(
+ (alert) => ids.has(alert.resourceId) || (nodeMatch !== undefined && alert.node === nodeMatch),
+ );
+}
+
// Alert types representing binary or enumerated state conditions rather
// than a metric crossing a threshold. For these, "current value vs
// threshold" is meaningless (both come through as 0 from the backend) and
diff --git a/frontend-modern/src/utils/workloadGuestPresentation.ts b/frontend-modern/src/utils/workloadGuestPresentation.ts
index cf4306c71e..7b68c92052 100644
--- a/frontend-modern/src/utils/workloadGuestPresentation.ts
+++ b/frontend-modern/src/utils/workloadGuestPresentation.ts
@@ -11,6 +11,11 @@ export interface WorkloadsGuestBackupStatusPresentation {
icon: 'check' | 'warning' | 'x' | 'running';
}
+export interface WorkloadsGuestProtectionPresentation {
+ label: string;
+ tone: 'success' | 'warning' | 'danger';
+}
+
const BACKUP_STATUS_PRESENTATION: Record<
WorkloadsGuestBackupDisplayStatus,
WorkloadsGuestBackupStatusPresentation
@@ -64,6 +69,27 @@ export function getWorkloadsGuestBackupTooltip(
return base;
}
+export function getWorkloadsGuestProtectionPresentation(options: {
+ backupInProgress?: boolean;
+ ageLabel?: string | null;
+ ageClass?: string | null;
+}): WorkloadsGuestProtectionPresentation {
+ if (options.backupInProgress) {
+ return { label: 'Backup running', tone: 'success' };
+ }
+ if (!options.ageLabel) {
+ return { label: 'No backup found', tone: 'danger' };
+ }
+ return {
+ label: options.ageLabel,
+ tone: options.ageClass?.includes('green')
+ ? 'success'
+ : options.ageClass?.includes('red')
+ ? 'danger'
+ : 'warning',
+ };
+}
+
export function getWorkloadsGuestNetworkEmptyState(): string {
return 'No IP assigned';
}