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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Split infrastructure drawer render owners
rcourtman6f3741dbfbc7
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.jsonindex 6ccb7b8c4c..cf5d4c0350 100644--- a/docs/release-control/v6/internal/subsystems/registry.json+++ b/docs/release-control/v6/internal/subsystems/registry.json@@ -3105,6 +3105,9 @@"frontend-modern/src/components/Discovery/useDiscoveryTabState.ts","frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts","frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx",+ "frontend-modern/src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx",+ "frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx",+ "frontend-modern/src/components/Infrastructure/ResourceDetailDrawerSupportDisclosure.tsx","frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts","frontend-modern/src/components/Infrastructure/ResourceFacetSummary.tsx","frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx",@@ -3179,6 +3182,9 @@"frontend-modern/src/components/Discovery/useDiscoveryTabState.ts","frontend-modern/src/components/Infrastructure/infrastructureSelectors.ts","frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx",+ "frontend-modern/src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx",+ "frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx",+ "frontend-modern/src/components/Infrastructure/ResourceDetailDrawerSupportDisclosure.tsx","frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts","frontend-modern/src/components/Infrastructure/ResourceFacetSummary.tsx","frontend-modern/src/components/Infrastructure/UnifiedResourceTable.tsx",diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.mdindex 484e4a3b74..17e59d0b53 100644--- a/docs/release-control/v6/internal/subsystems/unified-resources.md+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md@@ -44,13 +44,16 @@ cross-source deduplication.22. `internal/unifiedresources/privacy.go`23. `internal/unifiedresources/actions.go`24. `frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx`-25. `frontend-modern/src/components/Infrastructure/ResourceFacetSummary.tsx`-26. `frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts`-27. `frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts`-28. `frontend-modern/src/components/Discovery/DiscoveryTab.tsx`-29. `frontend-modern/src/components/Discovery/useDiscoveryTabState.ts`-30. `frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx`-31. `frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts`+25. `frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx`+26. `frontend-modern/src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx`+27. `frontend-modern/src/components/Infrastructure/ResourceDetailDrawerSupportDisclosure.tsx`+28. `frontend-modern/src/components/Infrastructure/ResourceFacetSummary.tsx`+29. `frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts`+30. `frontend-modern/src/components/Infrastructure/useUnifiedResourceTableState.ts`+31. `frontend-modern/src/components/Discovery/DiscoveryTab.tsx`+32. `frontend-modern/src/components/Discovery/useDiscoveryTabState.ts`+33. `frontend-modern/src/features/infrastructure/InfrastructurePageSurface.tsx`+34. `frontend-modern/src/features/infrastructure/useInfrastructurePageState.ts`## Shared Boundaries@@ -77,7 +80,7 @@ assembly branch.4. Add metrics-target normalization or synthetic metrics support through `internal/unifiedresources/metrics_targets.go` and `internal/unifiedresources/metrics.go`5. Add platform registry, resolution, or host-dedup behavior through `internal/unifiedresources/registry.go`, `internal/unifiedresources/resolve.go`, `internal/unifiedresources/resolved_host_set.go`, `internal/unifiedresources/snapshot_source_filter.go`, `internal/unifiedresources/store.go`, `internal/unifiedresources/kubernetes_capabilities.go`, and `internal/unifiedresources/pbs_rollups.go`6. Add canonical governed name-resolution or policy-aware resource lookup behavior through `internal/unifiedresources/resolve.go` and `internal/unifiedresources/resolve_context.go`-7. Add or change resource drawer timeline/facet presentation through `frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx`, `frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts`, `frontend-modern/src/components/Infrastructure/ResourceFacetSummary.tsx`, `frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts`, and the governed `internal/api/resources.go` facet/timeline contract together+7. Add or change resource drawer timeline/facet presentation through `frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx`, `frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx`, `frontend-modern/src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx`, `frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts`, `frontend-modern/src/components/Infrastructure/ResourceFacetSummary.tsx`, `frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts`, and the governed `internal/api/resources.go` facet/timeline contract together8. Add or change discovery-support runtime under the resource drawer through `frontend-modern/src/components/Discovery/DiscoveryTab.tsx` for shell/presentation ownership and `frontend-modern/src/components/Discovery/useDiscoveryTabState.ts` for fetch, websocket-progress, and notes-mutation ownership## Forbidden Paths@@ -131,6 +134,11 @@ hints.Those same relationship changes now summarize the actual edge(s) in `from` and`to`, so the canonical timeline keeps the relationship transition readable withoutneeding the drawer to reconstruct an edge summary from raw endpoints.+The infrastructure resource drawer now follows the explicit shell/state/render+split used elsewhere in v6: `ResourceDetailDrawer.tsx` owns composition,+`useResourceDetailDrawerState.ts` owns runtime state and fetch orchestration,+and the overview/debug render-heavy surfaces live in dedicated drawer-local+owners instead of staying inline in the shell.The backend AI and Patrol context renderers now derive their canonical changekind, source type, source adapter, actor, reason, and related-resourcefragments from `internal/unifiedresources/change_presentation.go`, so thediff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsxindex 9189a2b0cd..0f1e9a4d67 100644--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx@@ -1,51 +1,14 @@-import { Show, Suspense, For } from 'solid-js';-import type { Component, JSX } from 'solid-js';-import type {- Resource,- ResourceChangeKind,- ResourceChangeSourceAdapter,- ResourceChangeSourceType,-} from '@/types/resource';-import { formatUptime, formatRelativeTime } from '@/utils/format';+import { Show, For } from 'solid-js';+import type { Component } from 'solid-js';+import type { Resource } from '@/types/resource';import { StatusDot } from '@/components/shared/StatusDot';-import { Card } from '@/components/shared/Card';-import { TagBadges } from '@/components/shared/TagBadges';-import { SystemInfoCard } from '@/components/shared/cards/SystemInfoCard';-import { HardwareCard } from '@/components/shared/cards/HardwareCard';-import { RootDiskCard } from '@/components/shared/cards/RootDiskCard';-import { NetworkInterfacesCard } from '@/components/shared/cards/NetworkInterfacesCard';-import { DisksCard } from '@/components/shared/cards/DisksCard';-import { TemperaturesCard } from '@/components/shared/cards/TemperaturesCard';-import { RaidCard } from '@/components/shared/cards/RaidCard';-import { getDiscoveryLoadingState } from '@/utils/discoveryPresentation';import { ReportMergeModal } from './ReportMergeModal';-import { DiscoveryTab } from '@/components/Discovery/DiscoveryTab';import { PMGInstanceDrawer } from '@/components/PMG/PMGInstanceDrawer';import { K8sDeploymentsDrawer } from '@/components/Kubernetes/K8sDeploymentsDrawer';import { K8sNamespacesDrawer } from '@/components/Kubernetes/K8sNamespacesDrawer';-import { MonitoringAPI } from '@/api/monitoring';import { SwarmServicesDrawer } from '@/components/Docker/SwarmServicesDrawer';-import { WebInterfaceUrlField } from '@/components/shared/WebInterfaceUrlField';-import { getServiceHealthPresentation } from '@/utils/serviceHealthPresentation';-import {- getResourceRoutingScopeLabel,- getResourceSensitivityLabel,-} from '@/utils/resourcePolicyPresentation';-import { ResourceCorrelationSummary } from './ResourceCorrelationSummary';-import { ResourceChangeSummary } from './ResourceChangeSummary';-import { ResourceFacetSummary } from './ResourceFacetSummary';-import {- RESOURCE_CHANGE_KIND_ORDER,- RESOURCE_CHANGE_SOURCE_ADAPTER_ORDER,- RESOURCE_CHANGE_SOURCE_TYPE_ORDER,- getResourceChangeKindPresentation,- getResourceChangeSourceAdapterPresentation,- getResourceChangeSourceTypePresentation,-} from '@/utils/resourceChangePresentation';-import { formatConfidenceLabel } from '@/utils/confidencePresentation';-import { formatIdentifierLabel } from '@/utils/textPresentation';-import { buildInfrastructureResourceHref } from '@/routing/resourceLinks';-import { formatInteger, formatSourceType } from './resourceDetailMappers';+import { ResourceDetailDrawerDebugTab } from './ResourceDetailDrawerDebugTab';+import { ResourceDetailDrawerOverviewTab } from './ResourceDetailDrawerOverviewTab';import { useResourceDetailDrawerState } from './useResourceDetailDrawerState';interface ResourceDetailDrawerProps {@@ -54,60 +17,6 @@ interface ResourceDetailDrawerProps {resolveResourceLabel?: (resourceId: string) => string | null | undefined;}-const hasMetadataEntries = (value?: Record<string, unknown> | null): boolean =>- Boolean(value && Object.keys(value).length > 0);--interface SupportDisclosureProps {- title: string;- summary?: string | null;- expanded: boolean;- onToggle: () => void;- showLabel: string;- hideLabel: string;- children: JSX.Element;- class?: string;- buttonClass?: string;- contentClass?: string;- dataTestId?: string;-}--const SupportDisclosure: Component<SupportDisclosureProps> = (props) => {- const summary = () => props.summary?.trim() ?? '';-- return (- <div- data-testid={props.dataTestId}- class={props.class ?? 'rounded border border-dashed border-border bg-surface-hover p-3'}- >- <div class="flex flex-wrap items-start justify-between gap-3">- <div>- <div class="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>- </Show>- </div>-- <button- type="button"- onClick={props.onToggle}- class={- props.buttonClass ??- 'inline-flex items-center rounded-md border border-border bg-surface px-2.5 py-1 text-[10px] font-medium text-base-content transition-colors hover:bg-base'- }- >- {props.expanded ? props.hideLabel : props.showLabel}- </button>- </div>-- <Show when={props.expanded}>- <div class={props.contentClass ?? 'mt-3'}>{props.children}</div>- </Show>- </div>- );-};-const TabAvailabilityNotice: Component<{ message: string }> = (props) => (<div class="rounded border border-dashed border-border bg-surface-hover p-4 text-sm text-muted">{props.message}@@ -128,149 +37,8 @@ export const getSpecializedTabAvailabilityMessage = (tab: SpecializedDrawerTab):}};-const timelineKindOptions: Array<{ label: string; value: ResourceChangeKind | '' }> = [- { label: 'All kinds', value: '' },- ...RESOURCE_CHANGE_KIND_ORDER.map((kind) => ({- label: getResourceChangeKindPresentation(kind).label,- value: kind,- })),-];--const timelineSourceTypeOptions: Array<{ label: string; value: ResourceChangeSourceType | '' }> = [- { label: 'All sources', value: '' },- ...RESOURCE_CHANGE_SOURCE_TYPE_ORDER.map((sourceType) => ({- label: getResourceChangeSourceTypePresentation(sourceType).label,- value: sourceType,- })),-];--const timelineSourceAdapterOptions: Array<{- label: string;- value: ResourceChangeSourceAdapter | '';-}> = [- { label: 'All adapters', value: '' },- ...RESOURCE_CHANGE_SOURCE_ADAPTER_ORDER.map((sourceAdapter) => ({- label: getResourceChangeSourceAdapterPresentation(sourceAdapter).label,- value: sourceAdapter,- })),-];-const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {- const {- activeTab,- setActiveTab,- debugEnabled,- copied,- showReportModal,- setShowReportModal,- showInvestigationContext,- setShowInvestigationContext,- showCorrelationContext,- setShowCorrelationContext,- showDiscoveryContext,- setShowDiscoveryContext,- showHostDetails,- setShowHostDetails,- showServiceDetails,- setShowServiceDetails,- showDockerUpdateControls,- setShowDockerUpdateControls,- showPbsJobDetail,- setShowPbsJobDetail,- showPmgMailFlowDetail,- setShowPmgMailFlowDetail,- displayName,- kubernetesClusterName,- resolveResourceLabel,- statusIndicator,- lastSeen,- lastSeenAbsolute,- platformBadge,- sourceBadge,- typeBadge,- unifiedSourceBadges,- hasUnifiedSources,- policyRedactions,- governanceSummary,- hasGovernanceData,- agentMeta,- kubernetesCapabilityBadges,- proxmoxNode,- agentInfo,- temperatureRows,- dockerHostData,- dockerHostSourceId,- dockerUpdatesAvailable,- dockerContainerCount,- dockerUpdatesCheckedRelative,- dockerHostCommand,- dockerHostCommandActive,- dockerUpdateActionsDisabled,- dockerUpdateActionsLoading,- dockerActionError,- setDockerActionError,- dockerActionNote,- setDockerActionNote,- confirmUpdateAll,- setConfirmUpdateAll,- dockerActionBusy,- setDockerActionBusy,- dockerSwarmInfo,- dockerSwarmClusterKey,- k8sDeploymentsPrefillNamespace,- setK8sDeploymentsPrefillNamespace,- timelineKindFilter,- setTimelineKindFilter,- timelineSourceTypeFilter,- setTimelineSourceTypeFilter,- timelineSourceAdapterFilter,- setTimelineSourceAdapterFilter,- resourceIntelligence,- resourceDependencies,- resourceDependents,- resourceCorrelations,- hasCorrelationContext,- hasInvestigationContext,- investigationContextSummary,- pbsData,- pmgData,- pbsJobTotal,- pmgQueueBacklog,- pmgUpdatedRelative,- pbsVisibleJobBreakdown,- pmgVisibleQueueBreakdown,- pmgVisibleMailBreakdown,- historyFacetCounts,- historyRecentChanges,- hasTimelineFilters,- historyLoadingLabel,- resourceTimelineCount,- sortedResourceTimeline,- facetBundleError,- refetchHistoryFacets,- mergedSources,- sourceSummary,- identityAliasValues,- primaryIdentityRows,- identityCardHasRichData,- aliasPreviewValues,- hasAliasOverflow,- hasIdentitySupportContext,- hasMergedSources,- discoveryConfig,- discoveryContextSummary,- hasHostDetails,- hostDetailSummary,- hasServiceDetails,- serviceDetailsSummary,- headerIdentity,- relatedLinks,- hasRuntimeOperationalContext,- sourceSections,- identityMatchInfo,- tabs,- handleCopyJson,- } = useResourceDetailDrawerState({+ const drawer = useResourceDetailDrawerState({resource: props.resource,resolveResourceLabel: props.resolveResourceLabel,});@@ -281,20 +49,23 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {<div class="space-y-1 min-w-0"><div class="flex items-center gap-2"><StatusDot- variant={statusIndicator().variant}- title={statusIndicator().label}- ariaLabel={statusIndicator().label}+ variant={drawer.statusIndicator().variant}+ title={drawer.statusIndicator().label}+ ariaLabel={drawer.statusIndicator().label}size="sm"/>- <div class="text-sm font-semibold text-base-content truncate" title={displayName()}>- {displayName()}+ <div+ class="text-sm font-semibold text-base-content truncate"+ title={drawer.displayName()}+ >+ {drawer.displayName()}</div></div>- <div class="text-[11px] text-muted truncate" title={headerIdentity()}>- {headerIdentity()}+ <div class="text-[11px] text-muted truncate" title={drawer.headerIdentity()}>+ {drawer.headerIdentity()}</div><div class="flex flex-wrap gap-1.5">- <Show when={typeBadge()}>+ <Show when={drawer.typeBadge()}>{(badge) => (<span class={badge().classes} title={badge().title}>{badge().label}@@ -302,17 +73,17 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {)}</Show><Show- when={hasUnifiedSources()}+ when={drawer.hasUnifiedSources()}fallback={<>- <Show when={platformBadge()}>+ <Show when={drawer.platformBadge()}>{(badge) => (<span class={badge().classes} title={badge().title}>{badge().label}</span>)}</Show>- <Show when={sourceBadge()}>+ <Show when={drawer.sourceBadge()}>{(badge) => (<span class={badge().classes} title={badge().title}>{badge().label}@@ -322,7 +93,7 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {</>}>- <For each={unifiedSourceBadges()}>+ <For each={drawer.unifiedSourceBadges()}>{(badge) => (<span class={badge.classes} title={badge.title}>{badge.label}@@ -353,16 +124,18 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {</div><div class="flex items-center gap-6 border-b border-border px-1 mb-1">- <For each={tabs()}>+ <For each={drawer.tabs()}>{(tab) => (<button- onClick={() => setActiveTab(tab.id)}+ onClick={() => drawer.setActiveTab(tab.id)}class={`pb-2 text-sm font-medium transition-colors relative ${- activeTab() === tab.id ? 'text-blue-600 dark:text-blue-400' : ' hover:text-muted'+ drawer.activeTab() === tab.id+ ? 'text-blue-600 dark:text-blue-400'+ : ' hover:text-muted'}`}>{tab.label}- <Show when={activeTab() === tab.id}>+ <Show when={drawer.activeTab() === tab.id}><div class="absolute bottom-0 left-0 right-0 h-0.5 bg-blue-600 dark:bg-blue-400 rounded-t-full" /></Show></button>@@ -370,1106 +143,20 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {</For></div>- {/* Overview Tab */}- <div class={activeTab() === 'overview' ? '' : 'hidden'} style={{ 'overflow-anchor': 'none' }}>- <div class="space-y-3">- <div data-testid="resource-summary-section">- <div class="text-[11px] font-medium uppercase tracking-wide text-base-content">- Summary- </div>- <div class="mt-3 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">- {props.resource.status || 'unknown'}- </span>- </div>- <Show when={props.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(props.resource.uptime ?? 0)}- </span>- </div>- </Show>- <Show when={props.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={lastSeenAbsolute()}>- {lastSeen() || '—'}- </span>- </div>- </Show>- <Show when={sourceSummary()}>- <div class="flex items-center justify-between gap-2">- <span class="text-muted">Sources</span>- <span- class={`font-medium ${sourceSummary()!.className}`}- title={sourceSummary()!.title}- >- {sourceSummary()!.label}- </span>- </div>- </Show>- <div class="flex items-center justify-between gap-2">- <span class="text-muted">Mode</span>- <span class="font-medium text-base-content">- {formatSourceType(props.resource.sourceType)}- </span>- </div>- <Show when={(props.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(props.resource.alerts?.length)}- </span>- </div>- </Show>- <Show when={props.resource.platformId && !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={props.resource.platformId}- >- {props.resource.platformId}- </span>- </div>- </Show>- <Show when={hasRuntimeOperationalContext() || hasIdentitySupportContext()}>- <div class="mt-2 rounded border border-dashed border-border bg-surface-hover p-3">- <div class="space-y-2.5">- <Show when={hasRuntimeOperationalContext()}>- <div class="space-y-1.5">- <Show when={props.resource.platformId}>- <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={props.resource.platformId}- >- {props.resource.platformId}- </span>- </div>- </Show>- <Show when={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={kubernetesCapabilityBadges()}>- {(badge) => (- <span class={badge.classes} title={badge.title}>- {badge.label}- </span>- )}- </For>- </div>- </div>- </Show>- <Show when={relatedLinks().length > 0}>- <div class="flex flex-col gap-1">- <span class="text-muted">Quick links</span>- <div class="flex flex-wrap gap-2">- <For each={relatedLinks()}>- {(link) => (- <a- href={link.href}- aria-label={link.ariaLabel}- class="inline-flex items-center rounded border border-blue-200 bg-blue-50 px-2.5 py-1 text-[11px] font-medium text-blue-700 transition-colors hover:bg-blue-100 dark:border-blue-700 dark:bg-blue-900 dark:text-blue-200 dark:hover:bg-blue-900"- >- {link.compactLabel}- </a>- )}- </For>- </div>- </div>- </Show>- </div>- </Show>- <Show when={hasIdentitySupportContext()}>- <div class="space-y-1.5">- <Show- when={- props.resource.identity?.ips &&- props.resource.identity.ips.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={props.resource.identity?.ips ?? []}>- {(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>- <Show when={props.resource.tags && props.resource.tags.length > 0}>- <div class="flex items-center justify-between gap-2">- <span class="text-muted">Tags</span>- <TagBadges tags={props.resource.tags} maxVisible={6} />- </div>- </Show>- <Show when={identityAliasValues().length > 0}>- <Show- when={hasAliasOverflow()}- fallback={- <div class="flex flex-col gap-1">- <span class="text-muted">Aliases</span>- <div class="flex flex-wrap gap-1">- <For each={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>- </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">{identityAliasValues().length}</span>- </summary>- <div class="mt-2 flex flex-wrap gap-1 border-t border-border pt-2">- <For each={identityAliasValues()}>- {(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>- </details>- </Show>- </Show>- </div>- </Show>- </div>- </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={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>- )}- </For>- <Show when={!identityCardHasRichData()}>- <div class="rounded border border-dashed bg-surface-hover px-2 py-1.5 text-[10px] ">- No identity metadata yet.- </div>- </Show>- </div>- </Card>- </div>- </div>-- <div- data-testid="resource-secondary-sections"- class="flex flex-wrap gap-3 [&>*]:flex-1 [&>*]:basis-[calc(50%-0.375rem)] [&>*]:min-w-[260px] [&>*]:max-w-full [&>*]:overflow-hidden"- >- <div- data-testid="resource-change-history-section"- class="h-full rounded border border-border bg-surface p-3 shadow-sm"- >- <div class="flex items-center justify-between gap-3">- <div>- <div class="text-[11px] font-medium uppercase tracking-wide text-base-content">- Change history- </div>- <Show when={resourceTimelineCount() > 0}>- <div class="mt-1">- <ResourceFacetSummary- recentChanges={historyRecentChanges()}- counts={historyFacetCounts()}- />- </div>- </Show>- </div>- <div class="text-right text-[10px] text-muted">- <div>{historyLoadingLabel()}</div>- <Show when={hasTimelineFilters()}>- <div class="mt-0.5 text-blue-700 dark:text-blue-300">Change filters active</div>- </Show>- </div>- </div>- <div class="mt-3 space-y-2">- <label class="space-y-1 text-[10px]">- <span class="text-muted">Change kind</span>- <select- class="w-full rounded border border-border bg-base px-2 py-1 text-[11px] text-base-content"- value={timelineKindFilter()}- onChange={(event) =>- setTimelineKindFilter(- (event.currentTarget.value || '') as ResourceChangeKind | '',- )- }- >- <For each={timelineKindOptions}>- {(option) => <option value={option.value}>{option.label}</option>}- </For>- </select>- </label>- <label class="space-y-1 text-[10px]">- <span class="text-muted">Source type</span>- <select- class="w-full rounded border border-border bg-base px-2 py-1 text-[11px] text-base-content"- value={timelineSourceTypeFilter()}- onChange={(event) =>- setTimelineSourceTypeFilter(- (event.currentTarget.value || '') as ResourceChangeSourceType | '',- )- }- >- <For each={timelineSourceTypeOptions}>- {(option) => <option value={option.value}>{option.label}</option>}- </For>- </select>- </label>- <label class="space-y-1 text-[10px]">- <span class="text-muted">Source adapter</span>- <select- class="w-full rounded border border-border bg-base px-2 py-1 text-[11px] text-base-content"- value={timelineSourceAdapterFilter()}- onChange={(event) =>- setTimelineSourceAdapterFilter(- (event.currentTarget.value || '') as ResourceChangeSourceAdapter | '',- )- }- >- <For each={timelineSourceAdapterOptions}>- {(option) => <option value={option.value}>{option.label}</option>}- </For>- </select>- </label>- </div>-- <Show when={hasTimelineFilters()}>- <div class="mt-2 flex justify-end">- <button- type="button"- class="rounded-md border border-border bg-surface-hover px-2.5 py-1 text-[10px] font-semibold text-base-content hover:bg-surface"- onClick={() => {- setTimelineKindFilter('');- setTimelineSourceTypeFilter('');- setTimelineSourceAdapterFilter('');- }}- >- Clear filters- </button>- </div>- </Show>-- <Show when={facetBundleError()}>- <div class="mt-2 rounded border border-amber-200 bg-amber-50 px-2 py-1.5 text-[10px] text-amber-700 dark:border-amber-700 dark:bg-amber-900 dark:text-amber-200">- <div class="flex items-start justify-between gap-2">- <span>{facetBundleError()}</span>- <button- type="button"- class="shrink-0 font-medium text-amber-700 underline dark:text-amber-200"- onClick={() => refetchHistoryFacets()}- >- Retry- </button>- </div>- </div>- </Show>-- <div class="mt-3 rounded border border-border bg-surface p-3">- <div class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">- Event log- </div>- <Show- when={sortedResourceTimeline().length > 0}- fallback={- <div class="rounded border border-dashed border-border bg-surface-hover px-2 py-2 text-[10px] text-muted">- No events yet.- </div>- }- >- <div class="space-y-2">- <For each={sortedResourceTimeline()}>- {(change) => {- const kindPresentation = getResourceChangeKindPresentation(change.kind);- const sourceTypePresentation = getResourceChangeSourceTypePresentation(- change.sourceType,- );- const sourceAdapterPresentation = change.sourceAdapter- ? getResourceChangeSourceAdapterPresentation(change.sourceAdapter)- : null;-- return (- <div class="rounded border border-border bg-surface-hover px-2 py-1.5 text-[10px]">- <div class="flex items-start justify-between gap-3">- <div class="min-w-0">- <div class="font-medium text-base-content">- {kindPresentation.label}- </div>- <div class="mt-0.5 text-muted">- {formatRelativeTime(change.observedAt)}- <Show when={change.occurredAt}>- <span class="mx-1">•</span>- <span>Occurred {formatRelativeTime(change.occurredAt)}</span>- </Show>- </div>- </div>- <span class="text-muted">{sourceTypePresentation.label}</span>- </div>- <div class="mt-1 space-y-1">- <div class="flex items-center justify-between gap-2">- <span class="text-muted">Confidence</span>- <span class="font-medium text-base-content">- {formatConfidenceLabel(change.confidence)}- </span>- </div>- <div class="flex items-center justify-between gap-2">- <span class="text-muted">Adapter</span>- <span class="font-medium text-base-content">- {sourceAdapterPresentation?.label || '—'}- </span>- </div>- <Show when={change.actor}>- <div class="flex items-center justify-between gap-2">- <span class="text-muted">Actor</span>- <span class="font-medium text-base-content">{change.actor}</span>- </div>- </Show>- <Show when={change.from || change.to}>- <div class="flex items-center justify-between gap-2">- <span class="text-muted">Transition</span>- <span class="font-medium text-base-content">- {change.from || '—'} → {change.to || '—'}- </span>- </div>- </Show>- </div>- <Show when={change.reason}>- <div class="mt-1 rounded border border-border bg-base px-2 py-1 text-[10px] text-base-content">- {change.reason}- </div>- </Show>- <Show when={hasMetadataEntries(change.metadata)}>- <details class="mt-1 rounded border border-border bg-base px-2 py-1">- <summary class="cursor-pointer list-none text-[10px] font-medium text-muted">- Metadata- </summary>- <pre class="mt-2 overflow-auto whitespace-pre-wrap break-words text-[10px] text-base-content">- {JSON.stringify(change.metadata ?? {}, null, 2)}- </pre>- </details>- </Show>- <Show- when={change.relatedResources && change.relatedResources.length > 0}- >- <div class="mt-1 flex flex-wrap items-center gap-1 text-muted">- <span>Related:</span>- <For each={change.relatedResources ?? []}>- {(relatedResource) => {- const label = resolveResourceLabel(relatedResource);- const href = buildInfrastructureResourceHref(relatedResource);- return href ? (- <a- class="inline-flex rounded bg-surface px-1.5 py-0.5 text-[10px] text-blue-700 hover:underline dark:text-blue-300"- href={href}- aria-label={`Open related resource ${label} in Infrastructure`}- >- {label}- </a>- ) : (- <span class="inline-flex rounded bg-surface px-1.5 py-0.5 text-[10px] text-base-content">- {label}- </span>- );- }}- </For>- </div>- </Show>- </div>- );- }}- </For>- </div>- </Show>- </div>- </div>-- <Show when={hasServiceDetails()}>- <SupportDisclosure- title="Service details"- summary={serviceDetailsSummary()}- expanded={showServiceDetails()}- onToggle={() => setShowServiceDetails((value) => !value)}- showLabel="Show service details"- hideLabel="Hide service details"- class="h-full"- contentClass="mt-3 space-y-3"- dataTestId="resource-service-details-section"- >- <Show when={props.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={dockerHostData()?.runtime}>- <span- class="max-w-[55%] truncate text-[10px] text-sky-700 dark:text-sky-300"- title={dockerHostData()?.runtime}- >- {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(dockerContainerCount())}- </span>- </div>- <div class="flex items-center justify-between gap-2">- <span class="text-muted">Updates</span>- <span- class={`font-medium ${dockerUpdatesAvailable() > 0 ? 'text-sky-700 dark:text-sky-300' : 'text-base-content'}`}- >- {formatInteger(dockerUpdatesAvailable())}- </span>- </div>- <Show when={dockerUpdatesCheckedRelative()}>- <div class="flex items-center justify-between gap-2">- <span class="text-muted">Checked</span>- <span class="font-medium text-base-content">- {dockerUpdatesCheckedRelative()}- </span>- </div>- </Show>-- <Show when={showDockerUpdateControls()}>- <div class="space-y-1.5 border-t border-sky-200 pt-2 dark:border-sky-700">- <Show when={dockerHostCommand()?.type || 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(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 ${dockerHostCommandActive() ? 'text-sky-700 dark:text-sky-300' : 'text-base-content'}`}- >- {formatIdentifierLabel(dockerHostCommand()?.status, {- fallback: 'unknown',- })}- </span>- </div>- <Show when={dockerHostCommand()?.message}>- <div- class="mt-1 text-muted truncate"- title={dockerHostCommand()?.message}- >- {dockerHostCommand()?.message}- </div>- </Show>- <Show when={dockerHostCommand()?.failureReason}>- <div- class="mt-1 text-red-700 dark:text-red-300 truncate"- title={dockerHostCommand()?.failureReason}- >- {dockerHostCommand()?.failureReason}- </div>- </Show>- </div>- </Show>-- <Show when={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">- {dockerActionError()}- </div>- </Show>- <Show when={dockerActionNote()}>- <div class="rounded border border-sky-200 bg-surface px-2 py-1.5 text-[10px] text-base-content dark:border-sky-700">- {dockerActionNote()}- </div>- </Show>-- <div class="flex flex-wrap items-center gap-2">- <button- type="button"- disabled={- dockerActionBusy() ||- dockerUpdateActionsLoading() ||- dockerHostCommandActive() ||- dockerHostSourceId() === null- }- onClick={async () => {- setDockerActionError('');- setDockerActionNote('');- setConfirmUpdateAll(false);- const hostId = dockerHostSourceId();- if (!hostId) return;- try {- setDockerActionBusy(true);- await MonitoringAPI.checkDockerUpdates(hostId);- setDockerActionNote('Check queued.');- } catch (err) {- setDockerActionError(- (err as Error)?.message || 'Failed to queue check',- );- } finally {- setDockerActionBusy(false);- }- }}- 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={- dockerUpdateActionsLoading() ? 'Loading settings...' : undefined- }- >- Check now- </button>-- <button- type="button"- disabled={- dockerActionBusy() ||- dockerUpdateActionsLoading() ||- dockerUpdateActionsDisabled() ||- dockerHostCommandActive() ||- dockerHostSourceId() === null ||- dockerUpdatesAvailable() <= 0- }- onClick={async () => {- setDockerActionError('');- setDockerActionNote('');- const hostId = dockerHostSourceId();- if (!hostId) return;-- if (!confirmUpdateAll()) {- setConfirmUpdateAll(true);- setDockerActionNote(- `Click again to update ${dockerUpdatesAvailable()} containers.`,- );- return;- }-- try {- setDockerActionBusy(true);- await MonitoringAPI.updateAllDockerContainers(hostId);- setDockerActionNote('Update queued.');- } catch (err) {- setDockerActionError(- (err as Error)?.message || 'Failed to queue update',- );- } finally {- setDockerActionBusy(false);- setConfirmUpdateAll(false);- }- }}- 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={- dockerUpdateActionsDisabled()- ? 'Updates disabled by server settings.'- : undefined- }- >- {confirmUpdateAll()- ? 'Confirm update'- : `Update all${dockerUpdatesAvailable() > 0 ? ` (${dockerUpdatesAvailable()})` : ''}`}- </button>- </div>- </div>- </Show>-- <button- type="button"- onClick={() => setShowDockerUpdateControls((value) => !value)}- 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"- >- {showDockerUpdateControls() ? 'Hide actions' : 'Show actions'}- </button>- </div>- </div>- </Show>-- <Show when={pbsData()}>- {(pbs) => {- const connection = getServiceHealthPresentation(- props.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>- </div>- </Show>- <Show when={pbs().uptimeSeconds || props.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 ?? props.resource.uptime ?? 0)}- </span>- </div>- </Show>- <Show when={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">- <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 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(pbsJobTotal())}- </div>- </div>- </div>- <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">{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={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={() => 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"- >- {showPbsJobDetail() ? 'Hide jobs' : 'Show jobs'}- </button>- </div>- </div>- );- }}- </Show>-- <Show when={pmgData()}>- {(pmg) => {- const connection = getServiceHealthPresentation(- props.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}- >- {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>- </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={pmg().uptimeSeconds || props.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 ?? props.resource.uptime ?? 0)}- </span>- </div>- </Show>- <Show when={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 ${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 ${pmgQueueBacklog() > 0 ? 'text-amber-600 dark:text-amber-400' : 'text-base-content'}`}- >- {formatInteger(pmgQueueBacklog())}- </div>- </div>- </div>- <Show when={pmg().nodeCount || 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>- </Show>- <Show when={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">- {pmgUpdatedRelative()}- </span>- </div>- </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={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={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={() => 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"- >- {showPmgMailFlowDetail() ? 'Hide mail flow' : 'Show mail flow'}- </button>- </div>- </div>- );- }}- </Show>- </SupportDisclosure>- </Show>-- <Show when={hasHostDetails()}>- <SupportDisclosure- title="Host details"- summary={hostDetailSummary()}- expanded={showHostDetails()}- onToggle={() => setShowHostDetails((value) => !value)}- showLabel="Show host details"- hideLabel="Hide host details"- class="h-full"- contentClass="mt-3 flex flex-wrap gap-3 [&>*]:flex-1 [&>*]:basis-[calc(50%-0.375rem)] [&>*]:min-w-[220px] [&>*]:max-w-full [&>*]:overflow-hidden"- dataTestId="resource-host-details-section"- >- <Show when={proxmoxNode()}>- {(node) => (- <>- <SystemInfoCard variant="node" node={node()} />- <HardwareCard variant="node" node={node()} />- <RootDiskCard node={node()} />- </>- )}- </Show>- <Show when={agentInfo()}>- {(agent) => (- <>- <SystemInfoCard variant="agent" agent={agent()} />- <HardwareCard variant="agent" agent={agent()} />- <NetworkInterfacesCard interfaces={agent().networkInterfaces} />- <DisksCard disks={agent().disks} />- <RaidCard arrays={agentMeta()?.raid} />- <TemperaturesCard rows={temperatureRows()} />- </>- )}- </Show>- </SupportDisclosure>- </Show>-- <Show when={hasInvestigationContext()}>- <SupportDisclosure- title="Investigation context"- summary={investigationContextSummary()}- expanded={showInvestigationContext()}- onToggle={() => setShowInvestigationContext((value) => !value)}- showLabel="Show context"- hideLabel="Hide context"- class="h-full"- contentClass="mt-3 space-y-3"- dataTestId="resource-investigation-context"- >- <Show when={resourceIntelligence()}>- {(intel) => (- <div class="space-y-1.5 text-[11px]">- <div class="flex items-center justify-between gap-2">- <span class="text-muted uppercase tracking-wide">AI Intelligence</span>- </div>- <div class="flex items-center justify-between gap-2">- <span class="text-muted">Health</span>- <span class="font-semibold text-base-content">- {intel().health.grade} · {Math.round(intel().health.score)}/100- </span>- </div>- <div class="flex items-center justify-between gap-2">- <span class="text-muted">Trend</span>- <span class="font-semibold capitalize text-base-content">- {intel().health.trend}- </span>- </div>- <div class="flex items-center justify-between gap-2">- <span class="text-muted">Notes</span>- <span class="font-semibold text-base-content">{intel().note_count}</span>- </div>- <ResourceChangeSummary- class="space-y-0"- title="Latest canonical change"- changes={intel().recent_changes}- resolveResourceLabel={resolveResourceLabel}- maxChanges={1}- compact- />- <Show when={hasCorrelationContext()}>- <div data-testid="resource-correlation-context" class="space-y-1.5">- <div class="flex flex-wrap items-center justify-between gap-2">- <span class="text-[10px] font-medium uppercase tracking-wide text-base-content">- Correlation context- </span>- <button- type="button"- onClick={() => setShowCorrelationContext((value) => !value)}- class="inline-flex items-center rounded-md border border-border bg-surface px-2.5 py-1 text-[10px] font-medium text-base-content transition-colors hover:bg-surface-hover"- >- {showCorrelationContext() ? 'Hide correlations' : 'Show correlations'}- </button>- </div>-- <Show when={showCorrelationContext()}>- <div class="pt-1">- <ResourceCorrelationSummary- title="Correlation context"- dependencies={resourceDependencies()}- dependents={resourceDependents()}- correlations={resourceCorrelations()}- resolveResourceLabel={resolveResourceLabel}- showLastSeen- />- </div>- </Show>- </div>- </Show>- </div>- )}- </Show>-- <Show when={hasGovernanceData()}>- <div class="space-y-1.5 text-[11px]">- <div class="flex items-center justify-between gap-2">- <span class="text-muted uppercase tracking-wide">Data Governance</span>- </div>- <Show when={props.resource.policy}>- <div class="flex items-center justify-between gap-2">- <span class="text-muted">Sensitivity</span>- <span class="font-semibold text-base-content">- {getResourceSensitivityLabel(props.resource.policy?.sensitivity)}- </span>- </div>- <div class="flex items-center justify-between gap-2">- <span class="text-muted">Routing</span>- <span class="font-semibold text-base-content">- {getResourceRoutingScopeLabel(props.resource.policy?.routing.scope)}- </span>- </div>- </Show>- <Show when={policyRedactions().length > 0 || governanceSummary()}>- <div class="flex items-center justify-between gap-2">- <span class="text-muted">Redactions</span>- <span class="font-semibold text-base-content">- {policyRedactions().length}- </span>- </div>- </Show>- <Show when={policyRedactions().length > 0}>- <div class="flex flex-col gap-1">- <span class="text-muted">Redaction labels</span>- <div class="flex flex-wrap gap-1">- <For each={policyRedactions()}>- {(label) => (- <span class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px]">- {label}- </span>- )}- </For>- </div>- </div>- </Show>- <Show when={governanceSummary()}>- <div class="flex flex-col gap-1">- <span class="text-muted">AI-Safe Summary</span>- <div class="rounded border border-border bg-surface-hover px-2 py-1.5 text-[10px] text-base-content">- {governanceSummary()}- </div>- </div>- </Show>- </div>- </Show>- </SupportDisclosure>- </Show>- </div>-- <Show when={discoveryConfig()}>- {(config) => (- <div class="space-y-2">- <WebInterfaceUrlField- metadataKind={config().metadataKind}- metadataId={config().metadataId}- targetLabel={config().targetLabel}- />-- <SupportDisclosure- title="Discovery context"- summary={discoveryContextSummary()}- expanded={showDiscoveryContext()}- onToggle={() => setShowDiscoveryContext((value) => !value)}- showLabel="Show metadata"- hideLabel="Hide metadata"- class="h-full"- dataTestId="resource-discovery-context"- >- <Suspense- fallback={- <div class="flex items-center justify-center py-8">- <div class="animate-spin h-6 w-6 border-2 border-blue-500 border-t-transparent rounded-full" />- <span class="ml-2 text-sm text-muted">- {getDiscoveryLoadingState().text}- </span>- </div>- }- >- <DiscoveryTab- resourceType={config().resourceType}- agentId={config().agentId}- resourceId={config().resourceId}- hostname={config().hostname}- />- </Suspense>- </SupportDisclosure>- </div>- )}- </Show>- </div>+ <div+ class={drawer.activeTab() === 'overview' ? '' : 'hidden'}+ style={{ 'overflow-anchor': 'none' }}+ >+ <ResourceDetailDrawerOverviewTab resource={props.resource} drawer={drawer} /></div>{/* PMG Mail Tab */}- <div class={activeTab() === 'mail' ? '' : 'hidden'} style={{ 'overflow-anchor': 'none' }}>+ <div+ class={drawer.activeTab() === 'mail' ? '' : 'hidden'}+ style={{ 'overflow-anchor': 'none' }}+ >{/* Mount on-demand to avoid background fetching when the tab isn't open. */}- <Show when={activeTab() === 'mail'}>+ <Show when={drawer.activeTab() === 'mail'}><Showwhen={props.resource.type === 'pmg'}fallback={@@ -1478,7 +165,7 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {><PMGInstanceDrawerresourceId={props.resource.id}- resourceName={displayName() || props.resource.id}+ resourceName={drawer.displayName() || props.resource.id}/></Show></Show>@@ -1486,11 +173,11 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {{/* Kubernetes Namespaces Tab */}<div- class={activeTab() === 'namespaces' ? '' : 'hidden'}+ class={drawer.activeTab() === 'namespaces' ? '' : 'hidden'}style={{ 'overflow-anchor': 'none' }}>{/* Mount on-demand to avoid background fetching when the tab isn't open. */}- <Show when={activeTab() === 'namespaces'}>+ <Show when={drawer.activeTab() === 'namespaces'}><Showwhen={props.resource.type === 'k8s-cluster'}fallback={@@ -1498,10 +185,10 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {}><K8sNamespacesDrawer- cluster={kubernetesClusterName()}+ cluster={drawer.kubernetesClusterName()}onOpenDeployments={(ns) => {- setK8sDeploymentsPrefillNamespace((ns || '').trim());- setActiveTab('deployments');+ drawer.setK8sDeploymentsPrefillNamespace((ns || '').trim());+ drawer.setActiveTab('deployments');}}/></Show>@@ -1510,11 +197,11 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {{/* Kubernetes Deployments Tab */}<div- class={activeTab() === 'deployments' ? '' : 'hidden'}+ class={drawer.activeTab() === 'deployments' ? '' : 'hidden'}style={{ 'overflow-anchor': 'none' }}>{/* Mount on-demand to avoid background fetching when the tab isn't open. */}- <Show when={activeTab() === 'deployments'}>+ <Show when={drawer.activeTab() === 'deployments'}><Showwhen={props.resource.type === 'k8s-cluster'}fallback={@@ -1524,111 +211,49 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {}><K8sDeploymentsDrawer- cluster={kubernetesClusterName()}- initialNamespace={k8sDeploymentsPrefillNamespace() || null}+ cluster={drawer.kubernetesClusterName()}+ initialNamespace={drawer.k8sDeploymentsPrefillNamespace() || null}/></Show></Show></div>{/* Docker Swarm Tab */}- <div class={activeTab() === 'swarm' ? '' : 'hidden'} style={{ 'overflow-anchor': 'none' }}>+ <div+ class={drawer.activeTab() === 'swarm' ? '' : 'hidden'}+ style={{ 'overflow-anchor': 'none' }}+ >{/* Mount on-demand to avoid background fetching when the tab isn't open. */}- <Show when={activeTab() === 'swarm'}>+ <Show when={drawer.activeTab() === 'swarm'}><Show- when={props.resource.type === 'docker-host' && dockerSwarmClusterKey()}+ when={props.resource.type === 'docker-host' && drawer.dockerSwarmClusterKey()}fallback={<TabAvailabilityNotice message={getSpecializedTabAvailabilityMessage('swarm')} />}>- <SwarmServicesDrawer cluster={dockerSwarmClusterKey()} swarm={dockerSwarmInfo()} />+ <SwarmServicesDrawer+ cluster={drawer.dockerSwarmClusterKey()}+ swarm={drawer.dockerSwarmInfo()}+ /></Show></Show></div>{/* Debug Tab */}- <Show when={debugEnabled()}>- <div class={activeTab() === 'debug' ? '' : 'hidden'} style={{ 'overflow-anchor': 'none' }}>- <div class="flex items-center justify-between gap-3">- <div class="text-xs text-muted">- Debug mode is enabled via localStorage (<code>pulse_debug_mode</code>).- </div>- <button- type="button"- onClick={handleCopyJson}- class="rounded-md border border-border bg-surface px-3 py-1.5 text-xs font-medium text-base-content transition-colors hover:bg-surface-hover"- >- {copied() ? 'Copied' : 'Copy JSON'}- </button>- </div>-- <div class="mt-3 space-y-4">- <div>- <div class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">- Unified Resource- </div>- <pre class="max-h-[280px] overflow-auto rounded-md bg-base p-3 text-[11px] text-base-content">- {JSON.stringify(props.resource, null, 2)}- </pre>- </div>-- <div>- <div class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">- Identity Matching- </div>- <pre class="max-h-[220px] overflow-auto rounded-md bg-base p-3 text-[11px] text-base-content">- {JSON.stringify(- {- identity: props.resource.identity,- matchInfo: identityMatchInfo(),- },- null,- 2,- )}- </pre>- </div>-- <div>- <div class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">- Sources- </div>- <div class="space-y-2">- <For each={sourceSections()}>- {(section) => {- const status = sourceStatus()[section.id];- const lastSeenText = formatRelativeTime(status?.lastSeen);- return (- <details class="rounded-md border border-border bg-surface p-3">- <summary class="flex cursor-pointer list-none items-center justify-between text-sm font-medium text-base-content">- <span>{section.label}</span>- <span class="text-[11px] text-muted">- {status?.status ?? 'unknown'}- {lastSeenText ? ` • ${lastSeenText}` : ''}- </span>- </summary>- <Show when={status?.error}>- <div class="mt-2 text-[11px] text-amber-600 dark:text-amber-300">- {status?.error}- </div>- </Show>- <pre class="mt-3 max-h-[220px] overflow-auto rounded-md bg-base p-3 text-[11px] text-base-content">- {JSON.stringify(section.payload ?? {}, null, 2)}- </pre>- </details>- );- }}- </For>- </div>- </div>- </div>+ <Show when={drawer.debugEnabled()}>+ <div+ class={drawer.activeTab() === 'debug' ? '' : 'hidden'}+ style={{ 'overflow-anchor': 'none' }}+ >+ <ResourceDetailDrawerDebugTab resource={props.resource} drawer={drawer} /></div></Show>- <Show when={hasMergedSources()}>+ <Show when={drawer.hasMergedSources()}><div class="flex items-center justify-end"><buttontype="button"- onClick={() => setShowReportModal(true)}+ onClick={() => drawer.setShowReportModal(true)}class="text-xs font-medium transition-colors hover:text-muted">Split merged resource@@ -1637,11 +262,11 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {</Show><ReportMergeModal- isOpen={showReportModal()}+ isOpen={drawer.showReportModal()}resourceId={props.resource.id}- resourceName={displayName()}- sources={mergedSources()}- onClose={() => setShowReportModal(false)}+ resourceName={drawer.displayName()}+ sources={drawer.mergedSources()}+ onClose={() => drawer.setShowReportModal(false)}/></div>);diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsxnew file mode 100644index 0000000000..c716fc7b6c--- /dev/null+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx@@ -0,0 +1,93 @@+import { For, Show } from 'solid-js';+import type { Component } from 'solid-js';+import type { Resource } from '@/types/resource';+import { formatRelativeTime } from '@/utils/format';+import type { UseResourceDetailDrawerStateResult } from './useResourceDetailDrawerState';++interface ResourceDetailDrawerDebugTabProps {+ resource: Resource;+ drawer: UseResourceDetailDrawerStateResult;+}++export const ResourceDetailDrawerDebugTab: Component<ResourceDetailDrawerDebugTabProps> = (+ props,+) => {+ const { drawer } = props;++ return (+ <div class="space-y-3">+ <div class="flex items-center justify-between gap-3">+ <div class="text-xs text-muted">+ Debug mode is enabled via localStorage (<code>pulse_debug_mode</code>).+ </div>+ <button+ type="button"+ onClick={drawer.handleCopyJson}+ class="rounded-md border border-border bg-surface px-3 py-1.5 text-xs font-medium text-base-content transition-colors hover:bg-surface-hover"+ >+ {drawer.copied() ? 'Copied' : 'Copy JSON'}+ </button>+ </div>++ <div class="mt-3 space-y-4">+ <div>+ <div class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">+ Unified Resource+ </div>+ <pre class="max-h-[280px] overflow-auto rounded-md bg-base p-3 text-[11px] text-base-content">+ {JSON.stringify(props.resource, null, 2)}+ </pre>+ </div>++ <div>+ <div class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">+ Identity Matching+ </div>+ <pre class="max-h-[220px] overflow-auto rounded-md bg-base p-3 text-[11px] text-base-content">+ {JSON.stringify(+ {+ identity: props.resource.identity,+ matchInfo: drawer.identityMatchInfo(),+ },+ null,+ 2,+ )}+ </pre>+ </div>++ <div>+ <div class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">+ Sources+ </div>+ <div class="space-y-2">+ <For each={drawer.sourceSections()}>+ {(section) => {+ const status = drawer.sourceStatus()[section.id];+ const lastSeenText = formatRelativeTime(status?.lastSeen);+ return (+ <details class="rounded-md border border-border bg-surface p-3">+ <summary class="flex cursor-pointer list-none items-center justify-between text-sm font-medium text-base-content">+ <span>{section.label}</span>+ <span class="text-[11px] text-muted">+ {status?.status ?? 'unknown'}+ {lastSeenText ? ` • ${lastSeenText}` : ''}+ </span>+ </summary>+ <Show when={status?.error}>+ <div class="mt-2 text-[11px] text-amber-600 dark:text-amber-300">+ {status?.error}+ </div>+ </Show>+ <pre class="mt-3 max-h-[220px] overflow-auto rounded-md bg-base p-3 text-[11px] text-base-content">+ {JSON.stringify(section.payload ?? {}, null, 2)}+ </pre>+ </details>+ );+ }}+ </For>+ </div>+ </div>+ </div>+ </div>+ );+};diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsxnew file mode 100644index 0000000000..f764a35ce5--- /dev/null+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx@@ -0,0 +1,1158 @@+import { For, Show, Suspense } from 'solid-js';+import type { Component } from 'solid-js';+import type {+ Resource,+ ResourceChangeKind,+ ResourceChangeSourceAdapter,+ ResourceChangeSourceType,+} from '@/types/resource';+import { formatUptime, formatRelativeTime } from '@/utils/format';+import { Card } from '@/components/shared/Card';+import { TagBadges } from '@/components/shared/TagBadges';+import { SystemInfoCard } from '@/components/shared/cards/SystemInfoCard';+import { HardwareCard } from '@/components/shared/cards/HardwareCard';+import { RootDiskCard } from '@/components/shared/cards/RootDiskCard';+import { NetworkInterfacesCard } from '@/components/shared/cards/NetworkInterfacesCard';+import { DisksCard } from '@/components/shared/cards/DisksCard';+import { TemperaturesCard } from '@/components/shared/cards/TemperaturesCard';+import { RaidCard } from '@/components/shared/cards/RaidCard';+import { DiscoveryTab } from '@/components/Discovery/DiscoveryTab';+import { MonitoringAPI } from '@/api/monitoring';+import { WebInterfaceUrlField } from '@/components/shared/WebInterfaceUrlField';+import { getServiceHealthPresentation } from '@/utils/serviceHealthPresentation';+import {+ getResourceRoutingScopeLabel,+ getResourceSensitivityLabel,+} from '@/utils/resourcePolicyPresentation';+import { ResourceCorrelationSummary } from './ResourceCorrelationSummary';+import { ResourceChangeSummary } from './ResourceChangeSummary';+import { ResourceFacetSummary } from './ResourceFacetSummary';+import {+ RESOURCE_CHANGE_KIND_ORDER,+ RESOURCE_CHANGE_SOURCE_ADAPTER_ORDER,+ RESOURCE_CHANGE_SOURCE_TYPE_ORDER,+ getResourceChangeKindPresentation,+ getResourceChangeSourceAdapterPresentation,+ getResourceChangeSourceTypePresentation,+} from '@/utils/resourceChangePresentation';+import { formatConfidenceLabel } from '@/utils/confidencePresentation';+import { formatIdentifierLabel } from '@/utils/textPresentation';+import { buildInfrastructureResourceHref } from '@/routing/resourceLinks';+import { getDiscoveryLoadingState } from '@/utils/discoveryPresentation';+import { formatInteger, formatSourceType } from './resourceDetailMappers';+import {+ ResourceDetailDrawerSupportDisclosure as SupportDisclosure,+} from './ResourceDetailDrawerSupportDisclosure';+import type { UseResourceDetailDrawerStateResult } from './useResourceDetailDrawerState';++interface ResourceDetailDrawerOverviewTabProps {+ resource: Resource;+ drawer: UseResourceDetailDrawerStateResult;+}++const hasMetadataEntries = (value?: Record<string, unknown> | null): boolean =>+ Boolean(value && Object.keys(value).length > 0);++const timelineKindOptions: Array<{ label: string; value: ResourceChangeKind | '' }> = [+ { label: 'All kinds', value: '' },+ ...RESOURCE_CHANGE_KIND_ORDER.map((kind) => ({+ label: getResourceChangeKindPresentation(kind).label,+ value: kind,+ })),+];++const timelineSourceTypeOptions: Array<{ label: string; value: ResourceChangeSourceType | '' }> = [+ { label: 'All sources', value: '' },+ ...RESOURCE_CHANGE_SOURCE_TYPE_ORDER.map((sourceType) => ({+ label: getResourceChangeSourceTypePresentation(sourceType).label,+ value: sourceType,+ })),+];++const timelineSourceAdapterOptions: Array<{+ label: string;+ value: ResourceChangeSourceAdapter | '';+}> = [+ { label: 'All adapters', value: '' },+ ...RESOURCE_CHANGE_SOURCE_ADAPTER_ORDER.map((sourceAdapter) => ({+ label: getResourceChangeSourceAdapterPresentation(sourceAdapter).label,+ value: sourceAdapter,+ })),+];++export const ResourceDetailDrawerOverviewTab: Component<ResourceDetailDrawerOverviewTabProps> = (+ props,+) => {+ const { resource, drawer } = props;++ return (+ <div class="space-y-3">+ <div data-testid="resource-summary-section">+ <div class="text-[11px] font-medium uppercase tracking-wide text-base-content">Summary</div>+ <div class="mt-3 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={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>+ <div class="flex items-center justify-between gap-2">+ <span class="text-muted">Mode</span>+ <span class="font-medium text-base-content">+ {formatSourceType(resource.sourceType)}+ </span>+ </div>+ <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={resource.platformId && !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() || drawer.hasIdentitySupportContext()}>+ <div class="mt-2 rounded border border-dashed border-border bg-surface-hover p-3">+ <div class="space-y-2.5">+ <Show when={drawer.hasRuntimeOperationalContext()}>+ <div class="space-y-1.5">+ <Show when={resource.platformId}>+ <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>+ <Show when={drawer.relatedLinks().length > 0}>+ <div class="flex flex-col gap-1">+ <span class="text-muted">Quick links</span>+ <div class="flex flex-wrap gap-2">+ <For each={drawer.relatedLinks()}>+ {(link) => (+ <a+ href={link.href}+ aria-label={link.ariaLabel}+ class="inline-flex items-center rounded border border-blue-200 bg-blue-50 px-2.5 py-1 text-[11px] font-medium text-blue-700 transition-colors hover:bg-blue-100 dark:border-blue-700 dark:bg-blue-900 dark:text-blue-200 dark:hover:bg-blue-900"+ >+ {link.compactLabel}+ </a>+ )}+ </For>+ </div>+ </div>+ </Show>+ </div>+ </Show>+ <Show when={drawer.hasIdentitySupportContext()}>+ <div class="space-y-1.5">+ <Show when={resource.identity?.ips && resource.identity.ips.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={resource.identity?.ips ?? []}>+ {(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>+ <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>+ <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>+ </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()}>+ {(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>+ </details>+ </Show>+ </Show>+ </div>+ </Show>+ </div>+ </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()}>+ {(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>+ )}+ </For>+ <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>+ </div>+ </Card>+ </div>+ </div>++ <div+ data-testid="resource-secondary-sections"+ class="flex flex-wrap gap-3 [&>*]:flex-1 [&>*]:basis-[calc(50%-0.375rem)] [&>*]:min-w-[260px] [&>*]:max-w-full [&>*]:overflow-hidden"+ >+ <div+ data-testid="resource-change-history-section"+ class="h-full rounded border border-border bg-surface p-3 shadow-sm"+ >+ <div class="flex items-center justify-between gap-3">+ <div>+ <div class="text-[11px] font-medium uppercase tracking-wide text-base-content">+ Change history+ </div>+ <Show when={drawer.resourceTimelineCount() > 0}>+ <div class="mt-1">+ <ResourceFacetSummary+ recentChanges={drawer.historyRecentChanges()}+ counts={drawer.historyFacetCounts()}+ />+ </div>+ </Show>+ </div>+ <div class="text-right text-[10px] text-muted">+ <div>{drawer.historyLoadingLabel()}</div>+ <Show when={drawer.hasTimelineFilters()}>+ <div class="mt-0.5 text-blue-700 dark:text-blue-300">Change filters active</div>+ </Show>+ </div>+ </div>+ <div class="mt-3 space-y-2">+ <label class="space-y-1 text-[10px]">+ <span class="text-muted">Change kind</span>+ <select+ class="w-full rounded border border-border bg-base px-2 py-1 text-[11px] text-base-content"+ value={drawer.timelineKindFilter()}+ onChange={(event) =>+ drawer.setTimelineKindFilter(+ (event.currentTarget.value || '') as ResourceChangeKind | '',+ )+ }+ >+ <For each={timelineKindOptions}>+ {(option) => <option value={option.value}>{option.label}</option>}+ </For>+ </select>+ </label>+ <label class="space-y-1 text-[10px]">+ <span class="text-muted">Source type</span>+ <select+ class="w-full rounded border border-border bg-base px-2 py-1 text-[11px] text-base-content"+ value={drawer.timelineSourceTypeFilter()}+ onChange={(event) =>+ drawer.setTimelineSourceTypeFilter(+ (event.currentTarget.value || '') as ResourceChangeSourceType | '',+ )+ }+ >+ <For each={timelineSourceTypeOptions}>+ {(option) => <option value={option.value}>{option.label}</option>}+ </For>+ </select>+ </label>+ <label class="space-y-1 text-[10px]">+ <span class="text-muted">Source adapter</span>+ <select+ class="w-full rounded border border-border bg-base px-2 py-1 text-[11px] text-base-content"+ value={drawer.timelineSourceAdapterFilter()}+ onChange={(event) =>+ drawer.setTimelineSourceAdapterFilter(+ (event.currentTarget.value || '') as ResourceChangeSourceAdapter | '',+ )+ }+ >+ <For each={timelineSourceAdapterOptions}>+ {(option) => <option value={option.value}>{option.label}</option>}+ </For>+ </select>+ </label>+ </div>++ <Show when={drawer.hasTimelineFilters()}>+ <div class="mt-2 flex justify-end">+ <button+ type="button"+ class="rounded-md border border-border bg-surface-hover px-2.5 py-1 text-[10px] font-semibold text-base-content hover:bg-surface"+ onClick={() => {+ drawer.setTimelineKindFilter('');+ drawer.setTimelineSourceTypeFilter('');+ drawer.setTimelineSourceAdapterFilter('');+ }}+ >+ Clear filters+ </button>+ </div>+ </Show>++ <Show when={drawer.facetBundleError()}>+ <div class="mt-2 rounded border border-amber-200 bg-amber-50 px-2 py-1.5 text-[10px] text-amber-700 dark:border-amber-700 dark:bg-amber-900 dark:text-amber-200">+ <div class="flex items-start justify-between gap-2">+ <span>{drawer.facetBundleError()}</span>+ <button+ type="button"+ class="shrink-0 font-medium text-amber-700 underline dark:text-amber-200"+ onClick={() => drawer.refetchHistoryFacets()}+ >+ Retry+ </button>+ </div>+ </div>+ </Show>++ <div class="mt-3 rounded border border-border bg-surface p-3">+ <div class="text-[11px] font-medium uppercase tracking-wide text-base-content mb-2">+ Event log+ </div>+ <Show+ when={drawer.sortedResourceTimeline().length > 0}+ fallback={+ <div class="rounded border border-dashed border-border bg-surface-hover px-2 py-2 text-[10px] text-muted">+ No events yet.+ </div>+ }+ >+ <div class="space-y-2">+ <For each={drawer.sortedResourceTimeline()}>+ {(change) => {+ const kindPresentation = getResourceChangeKindPresentation(change.kind);+ const sourceTypePresentation = getResourceChangeSourceTypePresentation(+ change.sourceType,+ );+ const sourceAdapterPresentation = change.sourceAdapter+ ? getResourceChangeSourceAdapterPresentation(change.sourceAdapter)+ : null;++ return (+ <div class="rounded border border-border bg-surface-hover px-2 py-1.5 text-[10px]">+ <div class="flex items-start justify-between gap-3">+ <div class="min-w-0">+ <div class="font-medium text-base-content">+ {kindPresentation.label}+ </div>+ <div class="mt-0.5 text-muted">+ {formatRelativeTime(change.observedAt)}+ <Show when={change.occurredAt}>+ <span class="mx-1">•</span>+ <span>Occurred {formatRelativeTime(change.occurredAt)}</span>+ </Show>+ </div>+ </div>+ <span class="text-muted">{sourceTypePresentation.label}</span>+ </div>+ <div class="mt-1 space-y-1">+ <div class="flex items-center justify-between gap-2">+ <span class="text-muted">Confidence</span>+ <span class="font-medium text-base-content">+ {formatConfidenceLabel(change.confidence)}+ </span>+ </div>+ <div class="flex items-center justify-between gap-2">+ <span class="text-muted">Adapter</span>+ <span class="font-medium text-base-content">+ {sourceAdapterPresentation?.label || '—'}+ </span>+ </div>+ <Show when={change.actor}>+ <div class="flex items-center justify-between gap-2">+ <span class="text-muted">Actor</span>+ <span class="font-medium text-base-content">{change.actor}</span>+ </div>+ </Show>+ <Show when={change.from || change.to}>+ <div class="flex items-center justify-between gap-2">+ <span class="text-muted">Transition</span>+ <span class="font-medium text-base-content">+ {change.from || '—'} → {change.to || '—'}+ </span>+ </div>+ </Show>+ </div>+ <Show when={change.reason}>+ <div class="mt-1 rounded border border-border bg-base px-2 py-1 text-[10px] text-base-content">+ {change.reason}+ </div>+ </Show>+ <Show when={hasMetadataEntries(change.metadata)}>+ <details class="mt-1 rounded border border-border bg-base px-2 py-1">+ <summary class="cursor-pointer list-none text-[10px] font-medium text-muted">+ Metadata+ </summary>+ <pre class="mt-2 overflow-auto whitespace-pre-wrap break-words text-[10px] text-base-content">+ {JSON.stringify(change.metadata ?? {}, null, 2)}+ </pre>+ </details>+ </Show>+ <Show when={change.relatedResources && change.relatedResources.length > 0}>+ <div class="mt-1 flex flex-wrap items-center gap-1 text-muted">+ <span>Related:</span>+ <For each={change.relatedResources ?? []}>+ {(relatedResource) => {+ const label = drawer.resolveResourceLabel(relatedResource);+ const href = buildInfrastructureResourceHref(relatedResource);+ return href ? (+ <a+ class="inline-flex rounded bg-surface px-1.5 py-0.5 text-[10px] text-blue-700 hover:underline dark:text-blue-300"+ href={href}+ aria-label={`Open related resource ${label} in Infrastructure`}+ >+ {label}+ </a>+ ) : (+ <span class="inline-flex rounded bg-surface px-1.5 py-0.5 text-[10px] text-base-content">+ {label}+ </span>+ );+ }}+ </For>+ </div>+ </Show>+ </div>+ );+ }}+ </For>+ </div>+ </Show>+ </div>+ </div>++ <Show when={drawer.hasServiceDetails()}>+ <SupportDisclosure+ title="Service details"+ summary={drawer.serviceDetailsSummary()}+ expanded={drawer.showServiceDetails()}+ onToggle={() => drawer.setShowServiceDetails((value) => !value)}+ showLabel="Show service details"+ hideLabel="Hide service details"+ 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>++ <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="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>+ <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}+ </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>++ <div class="flex flex-wrap items-center gap-2">+ <button+ type="button"+ disabled={+ drawer.dockerActionBusy() ||+ drawer.dockerUpdateActionsLoading() ||+ drawer.dockerHostCommandActive() ||+ drawer.dockerHostSourceId() === null+ }+ onClick={async () => {+ drawer.setDockerActionError('');+ drawer.setDockerActionNote('');+ drawer.setConfirmUpdateAll(false);+ const hostId = drawer.dockerHostSourceId();+ if (!hostId) return;+ try {+ drawer.setDockerActionBusy(true);+ await MonitoringAPI.checkDockerUpdates(hostId);+ drawer.setDockerActionNote('Check queued.');+ } catch (err) {+ drawer.setDockerActionError(+ (err as Error)?.message || 'Failed to queue check',+ );+ } finally {+ drawer.setDockerActionBusy(false);+ }+ }}+ 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={async () => {+ drawer.setDockerActionError('');+ drawer.setDockerActionNote('');+ const hostId = drawer.dockerHostSourceId();+ if (!hostId) return;++ if (!drawer.confirmUpdateAll()) {+ drawer.setConfirmUpdateAll(true);+ drawer.setDockerActionNote(+ `Click again to update ${drawer.dockerUpdatesAvailable()} containers.`,+ );+ return;+ }++ try {+ drawer.setDockerActionBusy(true);+ await MonitoringAPI.updateAllDockerContainers(hostId);+ drawer.setDockerActionNote('Update queued.');+ } catch (err) {+ drawer.setDockerActionError(+ (err as Error)?.message || 'Failed to queue update',+ );+ } finally {+ drawer.setDockerActionBusy(false);+ drawer.setConfirmUpdateAll(false);+ }+ }}+ 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>+ </Show>++ <button+ type="button"+ onClick={() => drawer.setShowDockerUpdateControls((value) => !value)}+ 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>+ </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>+ </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.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">+ <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 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>+ </div>+ <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}+ >+ {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>+ </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={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>+ </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>+ </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>+ </div>+ </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">+ {drawer.pmgUpdatedRelative()}+ </span>+ </div>+ </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>+ );+ }}+ </Show>+ </SupportDisclosure>+ </Show>++ <Show when={drawer.hasHostDetails()}>+ <SupportDisclosure+ title="Host details"+ summary={drawer.hostDetailSummary()}+ expanded={drawer.showHostDetails()}+ onToggle={() => drawer.setShowHostDetails((value) => !value)}+ showLabel="Show host details"+ hideLabel="Hide host details"+ class="h-full"+ contentClass="mt-3 flex flex-wrap gap-3 [&>*]:flex-1 [&>*]:basis-[calc(50%-0.375rem)] [&>*]:min-w-[220px] [&>*]:max-w-full [&>*]:overflow-hidden"+ dataTestId="resource-host-details-section"+ >+ <Show when={drawer.proxmoxNode()}>+ {(node) => (+ <>+ <SystemInfoCard variant="node" node={node()} />+ <HardwareCard variant="node" node={node()} />+ <RootDiskCard node={node()} />+ </>+ )}+ </Show>+ <Show when={drawer.agentInfo()}>+ {(agent) => (+ <>+ <SystemInfoCard variant="agent" agent={agent()} />+ <HardwareCard variant="agent" agent={agent()} />+ <NetworkInterfacesCard interfaces={agent().networkInterfaces} />+ <DisksCard disks={agent().disks} />+ <RaidCard arrays={drawer.agentMeta()?.raid} />+ <TemperaturesCard rows={drawer.temperatureRows()} />+ </>+ )}+ </Show>+ </SupportDisclosure>+ </Show>++ <Show when={drawer.hasInvestigationContext()}>+ <SupportDisclosure+ title="Investigation 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"+ >+ <Show when={drawer.resourceIntelligence()}>+ {(intel) => (+ <div class="space-y-1.5 text-[11px]">+ <div class="flex items-center justify-between gap-2">+ <span class="text-muted uppercase tracking-wide">AI Intelligence</span>+ </div>+ <div class="flex items-center justify-between gap-2">+ <span class="text-muted">Health</span>+ <span class="font-semibold text-base-content">+ {intel().health.grade} · {Math.round(intel().health.score)}/100+ </span>+ </div>+ <div class="flex items-center justify-between gap-2">+ <span class="text-muted">Trend</span>+ <span class="font-semibold capitalize text-base-content">+ {intel().health.trend}+ </span>+ </div>+ <div class="flex items-center justify-between gap-2">+ <span class="text-muted">Notes</span>+ <span class="font-semibold text-base-content">{intel().note_count}</span>+ </div>+ <ResourceChangeSummary+ class="space-y-0"+ title="Latest canonical change"+ changes={intel().recent_changes}+ resolveResourceLabel={drawer.resolveResourceLabel}+ maxChanges={1}+ compact+ />+ <Show when={drawer.hasCorrelationContext()}>+ <div data-testid="resource-correlation-context" class="space-y-1.5">+ <div class="flex flex-wrap items-center justify-between gap-2">+ <span class="text-[10px] font-medium uppercase tracking-wide text-base-content">+ Correlation context+ </span>+ <button+ type="button"+ onClick={() => drawer.setShowCorrelationContext((value) => !value)}+ class="inline-flex items-center rounded-md border border-border bg-surface px-2.5 py-1 text-[10px] font-medium text-base-content transition-colors hover:bg-surface-hover"+ >+ {drawer.showCorrelationContext() ? 'Hide correlations' : 'Show correlations'}+ </button>+ </div>++ <Show when={drawer.showCorrelationContext()}>+ <div class="pt-1">+ <ResourceCorrelationSummary+ title="Correlation context"+ dependencies={drawer.resourceDependencies()}+ dependents={drawer.resourceDependents()}+ correlations={drawer.resourceCorrelations()}+ resolveResourceLabel={drawer.resolveResourceLabel}+ showLastSeen+ />+ </div>+ </Show>+ </div>+ </Show>+ </div>+ )}+ </Show>++ <Show when={drawer.hasGovernanceData()}>+ <div class="space-y-1.5 text-[11px]">+ <div class="flex items-center justify-between gap-2">+ <span class="text-muted uppercase tracking-wide">Data Governance</span>+ </div>+ <Show when={resource.policy}>+ <div class="flex items-center justify-between gap-2">+ <span class="text-muted">Sensitivity</span>+ <span class="font-semibold text-base-content">+ {getResourceSensitivityLabel(resource.policy?.sensitivity)}+ </span>+ </div>+ <div class="flex items-center justify-between gap-2">+ <span class="text-muted">Routing</span>+ <span class="font-semibold text-base-content">+ {getResourceRoutingScopeLabel(resource.policy?.routing.scope)}+ </span>+ </div>+ </Show>+ <Show when={drawer.policyRedactions().length > 0 || drawer.governanceSummary()}>+ <div class="flex items-center justify-between gap-2">+ <span class="text-muted">Redactions</span>+ <span class="font-semibold text-base-content">+ {drawer.policyRedactions().length}+ </span>+ </div>+ </Show>+ <Show when={drawer.policyRedactions().length > 0}>+ <div class="flex flex-col gap-1">+ <span class="text-muted">Redaction labels</span>+ <div class="flex flex-wrap gap-1">+ <For each={drawer.policyRedactions()}>+ {(label) => (+ <span class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px]">+ {label}+ </span>+ )}+ </For>+ </div>+ </div>+ </Show>+ <Show when={drawer.governanceSummary()}>+ <div class="flex flex-col gap-1">+ <span class="text-muted">AI-Safe Summary</span>+ <div class="rounded border border-border bg-surface-hover px-2 py-1.5 text-[10px] text-base-content">+ {drawer.governanceSummary()}+ </div>+ </div>+ </Show>+ </div>+ </Show>+ </SupportDisclosure>+ </Show>+ </div>++ <Show when={drawer.discoveryConfig()}>+ {(config) => (+ <div class="space-y-2">+ <WebInterfaceUrlField+ metadataKind={config().metadataKind}+ metadataId={config().metadataId}+ targetLabel={config().targetLabel}+ />++ <SupportDisclosure+ title="Discovery context"+ summary={drawer.discoveryContextSummary()}+ expanded={drawer.showDiscoveryContext()}+ onToggle={() => drawer.setShowDiscoveryContext((value) => !value)}+ showLabel="Show metadata"+ hideLabel="Hide metadata"+ class="h-full"+ dataTestId="resource-discovery-context"+ >+ <Suspense+ fallback={+ <div class="flex items-center justify-center py-8">+ <div class="animate-spin h-6 w-6 border-2 border-blue-500 border-t-transparent rounded-full" />+ <span class="ml-2 text-sm text-muted">{getDiscoveryLoadingState().text}</span>+ </div>+ }+ >+ <DiscoveryTab+ resourceType={config().resourceType}+ agentId={config().agentId}+ resourceId={config().resourceId}+ hostname={config().hostname}+ />+ </Suspense>+ </SupportDisclosure>+ </div>+ )}+ </Show>+ </div>+ );+};diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerSupportDisclosure.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerSupportDisclosure.tsxnew file mode 100644index 0000000000..d87e2f8fd4--- /dev/null+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerSupportDisclosure.tsx@@ -0,0 +1,55 @@+import { Show } from 'solid-js';+import type { Component, JSX } from 'solid-js';++interface ResourceDetailDrawerSupportDisclosureProps {+ title: string;+ summary?: string | null;+ expanded: boolean;+ onToggle: () => void;+ showLabel: string;+ hideLabel: string;+ children: JSX.Element;+ class?: string;+ buttonClass?: string;+ contentClass?: string;+ dataTestId?: string;+}++export const ResourceDetailDrawerSupportDisclosure: Component<+ ResourceDetailDrawerSupportDisclosureProps+> = (props) => {+ const summary = () => props.summary?.trim() ?? '';++ return (+ <div+ data-testid={props.dataTestId}+ class={props.class ?? 'rounded border border-dashed border-border bg-surface-hover p-3'}+ >+ <div class="flex flex-wrap items-start justify-between gap-3">+ <div>+ <div class="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>+ </Show>+ </div>++ <button+ type="button"+ onClick={props.onToggle}+ class={+ props.buttonClass ??+ 'inline-flex items-center rounded-md border border-border bg-surface px-2.5 py-1 text-[10px] font-medium text-base-content transition-colors hover:bg-base'+ }+ >+ {props.expanded ? props.hideLabel : props.showLabel}+ </button>+ </div>++ <Show when={props.expanded}>+ <div class={props.contentClass ?? 'mt-3'}>{props.children}</div>+ </Show>+ </div>+ );+};diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsxindex e27ff067e4..88e4a0f959 100644--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx@@ -3,7 +3,8 @@ import { fireEvent, render, screen, within } from '@solidjs/testing-library';import discoveryTabSource from '@/components/Discovery/DiscoveryTab.tsx?raw';import discoveryTabStateSource from '@/components/Discovery/useDiscoveryTabState.ts?raw';-import resourceDetailDrawerSource from '@/components/Infrastructure/ResourceDetailDrawer.tsx?raw';+import resourceDetailDrawerShellSource from '@/components/Infrastructure/ResourceDetailDrawer.tsx?raw';+import resourceDetailDrawerOverviewSource from '@/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx?raw';import type { Resource } from '@/types/resource';import { ResourceDetailDrawer } from '@/components/Infrastructure/ResourceDetailDrawer';@@ -109,10 +110,15 @@ describe('ResourceDetailDrawer change history section', () => {expect(discoveryTabSource).not.toContain('getConnectedAgents(');expect(discoveryTabSource).not.toContain('triggerDiscovery(');expect(discoveryTabSource).not.toContain('updateDiscoveryNotes(');- expect(resourceDetailDrawerSource).toContain("from '@/components/shared/TagBadges'");- expect(resourceDetailDrawerSource).not.toContain(+ expect(resourceDetailDrawerOverviewSource).toContain("from '@/components/shared/TagBadges'");+ expect(resourceDetailDrawerOverviewSource).not.toContain("from '@/components/Dashboard/TagBadges'",);+ expect(resourceDetailDrawerShellSource).toContain(+ "from './ResourceDetailDrawerOverviewTab'",+ );+ expect(resourceDetailDrawerShellSource).toContain("from './ResourceDetailDrawerDebugTab'");+ expect(resourceDetailDrawerShellSource).not.toContain('Change history');});it('keeps compact timeline summary chips in overview while showing one embedded change history section', async () => {diff --git a/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts b/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.tsindex 522839e5d2..c72d9174a8 100644--- a/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts+++ b/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerState.ts@@ -181,6 +181,7 @@ export interface UseResourceDetailDrawerStateResult {>;hasRuntimeOperationalContext: Accessor<boolean>;sourceSections: Accessor<Array<{ id: string; label: string; payload: unknown }>>;+ sourceStatus: Accessor<NonNullable<PlatformData['sourceStatus']>>;identityMatchInfo: Accessor<unknown>;debugJson: Accessor<string>;tabs: Accessor<Array<{ id: DrawerTab; label: string }>>;@@ -910,6 +911,7 @@ export const useResourceDetailDrawerState = (relatedLinks,hasRuntimeOperationalContext,sourceSections,+ sourceStatus,identityMatchInfo,debugJson,tabs,diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.tsindex d4f2108ca7..18caecea7c 100644--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts@@ -5,7 +5,7 @@ import monitoredSystemLimitWarningBannerSource from '@/components/shared/Monitorimport selectionCardGroupSource from '@/components/shared/SelectionCardGroup.tsx?raw';import tagBadgesSource from '@/components/shared/TagBadges.tsx?raw';import guestRowSource from '@/components/Dashboard/GuestRow.tsx?raw';-import resourceDetailDrawerSource from '@/components/Infrastructure/ResourceDetailDrawer.tsx?raw';+import resourceDetailDrawerOverviewSource from '@/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx?raw';import aiSettingsDialogsSource from '@/components/Settings/AISettingsDialogs.tsx?raw';import generalSettingsPanelSource from '@/components/Settings/GeneralSettingsPanel.tsx?raw';import proxmoxSettingsPanelSource from '@/components/Settings/ProxmoxSettingsPanel.tsx?raw';@@ -100,8 +100,8 @@ describe('shared primitive guardrails', () => {expect(tagBadgesSource).toContain("from '@/components/shared/Tooltip'");expect(guestRowSource).toContain("from '@/components/shared/TagBadges'");expect(guestRowSource).not.toContain("from './TagBadges'");- expect(resourceDetailDrawerSource).toContain("from '@/components/shared/TagBadges'");- expect(resourceDetailDrawerSource).not.toContain(+ expect(resourceDetailDrawerOverviewSource).toContain("from '@/components/shared/TagBadges'");+ expect(resourceDetailDrawerOverviewSource).not.toContain("from '@/components/Dashboard/TagBadges'",);});diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.tsindex 7793a1f160..e8d7bbf74d 100644--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts@@ -243,6 +243,8 @@ import licensePresentationSource from '@/utils/licensePresentation.ts?raw';import securityScorePresentationSource from '@/utils/securityScorePresentation.ts?raw';import securityAuthPresentationSource from '@/utils/securityAuthPresentation.ts?raw';import resourceDetailDrawerShellSource from '@/components/Infrastructure/ResourceDetailDrawer.tsx?raw';+import resourceDetailDrawerOverviewSource from '@/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx?raw';+import resourceDetailDrawerDebugSource from '@/components/Infrastructure/ResourceDetailDrawerDebugTab.tsx?raw';import infrastructureSummarySource from '@/components/Infrastructure/InfrastructureSummary.tsx?raw';import resourceDetailMappersSource from '@/components/Infrastructure/resourceDetailMappers.ts?raw';import resourceDetailDrawerStateSource from '@/components/Infrastructure/useResourceDetailDrawerState.ts?raw';@@ -518,6 +520,8 @@ const aiSettingsSource = [const resourceDetailDrawerSource = [resourceDetailDrawerShellSource,+ resourceDetailDrawerOverviewSource,+ resourceDetailDrawerDebugSource,resourceDetailDrawerStateSource,].join('\n');@@ -861,10 +865,14 @@ describe('frontend resource type boundaries', () => {expect(guestRowCellsSource).toContain('useTooltip');expect(guestRowSource).not.toContain('buildGuestId');expect(tagBadgesSource).toContain("from '@/components/shared/Tooltip'");- expect(resourceDetailDrawerShellSource).toContain("from '@/components/shared/TagBadges'");- expect(resourceDetailDrawerShellSource).not.toContain(+ expect(resourceDetailDrawerOverviewSource).toContain("from '@/components/shared/TagBadges'");+ expect(resourceDetailDrawerOverviewSource).not.toContain("from '@/components/Dashboard/TagBadges'",);+ expect(resourceDetailDrawerShellSource).toContain(+ "from './ResourceDetailDrawerOverviewTab'",+ );+ expect(resourceDetailDrawerShellSource).toContain("from './ResourceDetailDrawerDebugTab'");expect(guestDrawerSource).toContain('useGuestDrawerState');expect(guestDrawerSource).toContain('GuestDrawerOverview');expect(guestDrawerStateSource).toContain('getCanonicalWorkloadId');