@skyhook-io/radar-app 1.22.1 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -8
- package/src/App.tsx +131 -38
- package/src/RadarApp.basename.test.tsx +177 -0
- package/src/RadarApp.settings.test.tsx +33 -0
- package/src/RadarApp.tsx +5 -0
- package/src/api/agentSandbox.ts +259 -0
- package/src/api/client.autoPromConnect.test.tsx +43 -0
- package/src/api/client.metricsRelayCheck.test.tsx +134 -0
- package/src/api/client.ts +128 -25
- package/src/api/cloudInstallDiscover.test.tsx +76 -0
- package/src/api/diagnose.ts +4 -0
- package/src/api/kagent.test.ts +82 -0
- package/src/api/kagent.ts +230 -0
- package/src/api/prometheusCharts.ts +5 -0
- package/src/api/radarFeatures.test.ts +9 -0
- package/src/api/radarFeatures.ts +13 -0
- package/src/api/substrateWorkspace.test.ts +72 -0
- package/src/api/substrateWorkspace.ts +1394 -0
- package/src/api/vulnerabilities.ts +207 -9
- package/src/api/workloadSource.test.tsx +1172 -0
- package/src/api/workloadSource.ts +408 -0
- package/src/components/APIUnreachableBanner.test.tsx +19 -0
- package/src/components/APIUnreachableBanner.tsx +20 -0
- package/src/components/CloudConnectFlow.tsx +46 -7
- package/src/components/CloudFunnelButton.test.tsx +193 -7
- package/src/components/CloudFunnelButton.tsx +127 -32
- package/src/components/ConnectionErrorView.test.tsx +63 -2
- package/src/components/ConnectionErrorView.tsx +88 -68
- package/src/components/SelfManagedStart.tsx +12 -2
- package/src/components/agentsandbox/AgentSandboxKindLists.tsx +41 -0
- package/src/components/agentsandbox/AgentSandboxLists.test.tsx +410 -0
- package/src/components/agentsandbox/AgentSandboxOverview.test.tsx +333 -0
- package/src/components/agentsandbox/AgentSandboxOverview.tsx +555 -0
- package/src/components/agentsandbox/AgentSandboxSidebar.test.tsx +97 -0
- package/src/components/agentsandbox/AgentSandboxSummary.test.tsx +439 -0
- package/src/components/agentsandbox/AgentSandboxSummary.tsx +956 -0
- package/src/components/agentsandbox/AgentSandboxTables.tsx +966 -0
- package/src/components/agentsandbox/AgentSandboxView.tsx +34 -0
- package/src/components/agentsandbox/agentsandbox.fixtures.ts +135 -0
- package/src/components/agentsandbox/data.ts +135 -0
- package/src/components/agentsandbox/host.test.ts +27 -0
- package/src/components/agentsandbox/host.tsx +85 -0
- package/src/components/agentsandbox/labels.test.ts +42 -0
- package/src/components/agentsandbox/labels.ts +146 -0
- package/src/components/agentsandbox/listFilters.ts +85 -0
- package/src/components/agentsandbox/lists.ts +52 -0
- package/src/components/agentsandbox/routes.ts +23 -0
- package/src/components/agentsandbox/shared.tsx +321 -0
- package/src/components/agentsandbox/useAgentSandboxSidebarWorkspace.ts +69 -0
- package/src/components/agentsandbox/workspace.fixtures.ts +125 -0
- package/src/components/agentsandbox/workspace.tsx +258 -0
- package/src/components/agentsandbox/workspaceRoute.ts +18 -0
- package/src/components/applications/ApplicationsView.openResource.test.tsx +248 -3
- package/src/components/applications/ApplicationsView.tsx +156 -3
- package/src/components/audit/VulnerabilitiesColumns.test.tsx +487 -0
- package/src/components/audit/VulnerabilitiesRisk.test.tsx +318 -0
- package/src/components/audit/VulnerabilitiesView.test.tsx +458 -13
- package/src/components/audit/VulnerabilitiesView.tsx +639 -199
- package/src/components/cloudHints/AgentSetupCloudRow.tsx +28 -0
- package/src/components/cloudHints/CloudHintLink.tsx +29 -0
- package/src/components/cloudHints/SharedInstallAiLine.tsx +36 -0
- package/src/components/cloudHints/cloudHints.test.ts +126 -0
- package/src/components/cloudHints/cloudHints.ts +131 -0
- package/src/components/cloudHints/cloudHintsGate.test.tsx +70 -0
- package/src/components/cloudHints/cloudLinks.test.ts +52 -0
- package/src/components/cloudHints/cloudLinks.ts +31 -0
- package/src/components/cloudHints/hintStorage.ts +28 -0
- package/src/components/cnpg/CNPGView.tsx +4 -7
- package/src/components/diagnose/ActivityTurn.tsx +6 -4
- package/src/components/diagnose/AgentSetupNotice.tsx +5 -0
- package/src/components/diagnose/AssessmentCard.tsx +1 -2
- package/src/components/diagnose/ContinueInAgentButton.test.tsx +7 -0
- package/src/components/diagnose/DiagnoseContext.tsx +7 -0
- package/src/components/diagnose/DiagnoseSurface.escape.test.tsx +215 -0
- package/src/components/diagnose/DiagnoseSurface.tsx +57 -1
- package/src/components/diagnose/Home.test.tsx +6 -0
- package/src/components/diagnose/Home.tsx +10 -3
- package/src/components/diagnose/InvestigationEvidencePane.story.test.tsx +1 -1
- package/src/components/diagnose/InvestigationEvidencePane.tsx +19 -2
- package/src/components/diagnose/InvestigationFindingsFooter.test.tsx +413 -0
- package/src/components/diagnose/InvestigationView.tsx +120 -23
- package/src/components/diagnose/investigationEvidence/identity.test.ts +1 -1
- package/src/components/diagnose/investigationEvidence/projection.test.ts +1 -1
- package/src/components/diagnose/investigationState.ts +9 -0
- package/src/components/diagnose/parts.test.tsx +11 -3
- package/src/components/diagnose/toolCallLabel.ts +3 -0
- package/src/components/gitops/RemoteDestinationCloudHint.tsx +6 -14
- package/src/components/home/ActivitySummary.tsx +3 -8
- package/src/components/home/ClusterHealthCard.tsx +91 -17
- package/src/components/home/ClusterHealthCard.utilization.test.tsx +187 -0
- package/src/components/home/HomeAgentBlock.tsx +2 -0
- package/src/components/home/HomeView.tsx +9 -29
- package/src/components/home/MCPSetupDialog.test.tsx +9 -0
- package/src/components/home/MCPSetupDialog.tsx +6 -2
- package/src/components/home/McpCloudLine.test.tsx +162 -0
- package/src/components/home/McpCloudLine.tsx +95 -0
- package/src/components/home/ProblemsPanel.investigate.test.tsx +2 -2
- package/src/components/home/TopologyPreview.test.tsx +31 -30
- package/src/components/home/TopologyPreview.tsx +19 -28
- package/src/components/home/mcpToolCatalog.test.ts +10 -0
- package/src/components/home/mcpToolCatalog.ts +7 -7
- package/src/components/issues/ClusterSchedulingBlockerRow.tsx +35 -0
- package/src/components/issues/IssuesPane.render.test.tsx +36 -1
- package/src/components/issues/IssuesPane.tsx +181 -23
- package/src/components/issues/SinceLastVisitRow.render.test.tsx +302 -0
- package/src/components/issues/SinceLastVisitRow.tsx +71 -0
- package/src/components/issues/sinceLastVisit.test.ts +266 -0
- package/src/components/issues/sinceLastVisit.ts +439 -0
- package/src/components/kagent/KagentAgentRenderer.test.ts +32 -0
- package/src/components/kagent/KagentAgentRenderer.tsx +87 -0
- package/src/components/kagent/KagentAgentSessions.test.tsx +166 -0
- package/src/components/kagent/KagentAgentSessions.tsx +124 -0
- package/src/components/kagent/KagentDetailPage.tsx +106 -0
- package/src/components/kagent/KagentLists.tsx +412 -0
- package/src/components/kagent/KagentOverview.tsx +234 -0
- package/src/components/kagent/KagentPages.tsx +690 -0
- package/src/components/kagent/KagentRuntimeTabs.test.tsx +219 -0
- package/src/components/kagent/KagentRuntimeTabs.tsx +283 -0
- package/src/components/kagent/KagentSidebar.test.tsx +112 -0
- package/src/components/kagent/KagentView.tsx +109 -0
- package/src/components/kagent/KagentWorkspace.test.tsx +876 -0
- package/src/components/kagent/host.tsx +144 -0
- package/src/components/kagent/routes.ts +31 -0
- package/src/components/kagent/shared.tsx +336 -0
- package/src/components/kagent/useKagentRuntime.test.tsx +77 -0
- package/src/components/kagent/useKagentSidebarWorkspace.ts +67 -0
- package/src/components/kagent/workspace.fixtures.ts +108 -0
- package/src/components/kagent/workspaceRoute.ts +18 -0
- package/src/components/resource/MetricsNotConnected.test.tsx +28 -0
- package/src/components/resource/MetricsNotConnected.tsx +10 -7
- package/src/components/resource/PrometheusCharts.tsx +10 -1
- package/src/components/resource/PrometheusChartsGrid.render.test.tsx +9 -0
- package/src/components/resource/PrometheusChartsGrid.tsx +3 -3
- package/src/components/resource/SubstrateHealthCharts.test.tsx +13 -1
- package/src/components/resource/SubstrateHealthCharts.tsx +9 -15
- package/src/components/resources/ResourceDetailDrawer.tsx +1 -0
- package/src/components/resources/ResourcesView.tsx +2 -6
- package/src/components/resources/renderers/JobAdmissionRenderers.tsx +5 -4
- package/src/components/resources/renderers/PodRenderer.tsx +8 -2
- package/src/components/resources/renderers/RolloutRenderer.tsx +4 -1
- package/src/components/resources/renderers/WorkloadRenderer.tsx +4 -1
- package/src/components/settings/LocalIntegrationStatus.test.tsx +1 -0
- package/src/components/settings/LocalIntegrationStatus.tsx +3 -2
- package/src/components/settings/SettingsDialog.tsx +84 -16
- package/src/components/settings/SubstrateSettings.lifecycle.test.tsx +210 -0
- package/src/components/settings/SubstrateSettings.test.tsx +131 -0
- package/src/components/settings/SubstrateSettings.tsx +544 -0
- package/src/components/settings/settings-state.test.ts +21 -3
- package/src/components/settings/settings-state.ts +13 -3
- package/src/components/share/ShareLinkButton.test.tsx +360 -0
- package/src/components/share/ShareLinkButton.tsx +391 -0
- package/src/components/share/openShareInCloud.test.ts +29 -0
- package/src/components/share/openShareInCloud.ts +10 -0
- package/src/components/share/shareLink.test.ts +129 -0
- package/src/components/share/shareLink.ts +175 -0
- package/src/components/substrate/SubstrateActorDrawer.tsx +87 -0
- package/src/components/substrate/SubstrateActorOverview.tsx +489 -0
- package/src/components/substrate/SubstrateActorPage.tsx +384 -0
- package/src/components/substrate/SubstrateActors.test.tsx +1094 -0
- package/src/components/substrate/SubstrateActors.tsx +612 -0
- package/src/components/substrate/SubstrateAttentionList.tsx +441 -0
- package/src/components/substrate/SubstrateConnect.tsx +88 -0
- package/src/components/substrate/SubstrateOverview.test.tsx +396 -0
- package/src/components/substrate/SubstrateOverview.tsx +575 -0
- package/src/components/substrate/SubstratePages.test.tsx +478 -0
- package/src/components/substrate/SubstratePool.test.tsx +462 -0
- package/src/components/substrate/SubstratePoolPage.tsx +95 -0
- package/src/components/substrate/SubstratePoolSummary.tsx +485 -0
- package/src/components/substrate/SubstrateSidebar.test.tsx +101 -0
- package/src/components/substrate/SubstrateStateBar.tsx +63 -0
- package/src/components/substrate/SubstrateTemplates.tsx +376 -0
- package/src/components/substrate/SubstrateView.tsx +173 -0
- package/src/components/substrate/SubstrateWorkerPodContext.tsx +73 -0
- package/src/components/substrate/SubstrateWorkers.tsx +389 -0
- package/src/components/substrate/attention.ts +81 -0
- package/src/components/substrate/contextPin.tsx +69 -0
- package/src/components/substrate/host.tsx +83 -0
- package/src/components/substrate/kubectlTarget.test.tsx +77 -0
- package/src/components/substrate/readings.test.ts +484 -0
- package/src/components/substrate/readings.ts +997 -0
- package/src/components/substrate/routes.ts +103 -0
- package/src/components/substrate/shared.tsx +426 -0
- package/src/components/substrate/substrate.fixtures.ts +325 -0
- package/src/components/substrate/useSubstrateSidebarWorkspace.ts +87 -0
- package/src/components/substrate/workspaceRoute.ts +23 -0
- package/src/components/traffic/TrafficConnectionsTable.test.tsx +9 -0
- package/src/components/traffic/TrafficConnectionsTable.tsx +4 -2
- package/src/components/traffic/TrafficFilterSidebar.tsx +19 -14
- package/src/components/traffic/TrafficFlowList.test.tsx +63 -0
- package/src/components/traffic/TrafficFlowList.tsx +9 -5
- package/src/components/traffic/TrafficGraph.test.tsx +26 -0
- package/src/components/traffic/TrafficGraph.tsx +17 -14
- package/src/components/traffic/TrafficGraphTooLarge.tsx +2 -0
- package/src/components/traffic/TrafficGraphUnavailable.tsx +3 -1
- package/src/components/traffic/TrafficView.tsx +26 -56
- package/src/components/traffic/trafficFilters.test.ts +61 -1
- package/src/components/traffic/trafficFilters.ts +68 -8
- package/src/components/velero/VeleroOverview.tsx +2 -2
- package/src/components/velero/VeleroView.tsx +3 -6
- package/src/components/vulnerabilities/columns.tsx +132 -0
- package/src/components/vulnerabilities/filters.tsx +317 -0
- package/src/components/vulnerabilities/owner.test.ts +54 -0
- package/src/components/vulnerabilities/owner.tsx +163 -0
- package/src/components/vulnerabilities/parts.test.ts +126 -12
- package/src/components/vulnerabilities/parts.tsx +612 -52
- package/src/components/vulnerabilities/traffic.test.tsx +65 -0
- package/src/components/vulnerabilities/traffic.tsx +40 -0
- package/src/components/workload/WorkloadView.substrateVersion.test.tsx +88 -0
- package/src/components/workload/WorkloadView.tsx +119 -14
- package/src/components/workload/WorkloadView.workloadSource.test.tsx +121 -0
- package/src/components/workspace/layout.tsx +13 -7
- package/src/components/workspace/sidebar.test.ts +48 -0
- package/src/components/workspace/sidebar.ts +73 -3
- package/src/components/workspace/table.ts +2 -1
- package/src/context/ConnectionContext.tsx +24 -5
- package/src/context/ConnectionProvider.connectionId.test.tsx +14 -0
- package/src/context/ConnectionProvider.handover.test.tsx +94 -0
- package/src/context/DiagnoseCustomization.tsx +20 -2
- package/src/contexts/RegistryAccessMode.test.tsx +51 -0
- package/src/contexts/RegistryAccessMode.tsx +25 -0
- package/src/hooks/useEventSource.test.tsx +275 -4
- package/src/hooks/useEventSource.ts +278 -51
- package/src/index.ts +1 -0
- package/src/integrations/resourceHost.ts +12 -6
- package/src/integrations/resourceHosts.test.tsx +27 -1
- package/src/integrations/resourceHosts.tsx +15 -7
- package/src/integrations/sidebarWorkspaces.test.tsx +63 -0
- package/src/integrations/sidebarWorkspaces.ts +41 -0
- package/src/integrations/workspaceRoute.ts +1 -1
- package/src/integrations/workspaceRoutes.ts +7 -1
- package/src/integrations/workspaceScreens.tsx +6 -0
- package/src/utils/navigation.test.ts +1 -6
- package/src/utils/navigation.ts +9 -44
- package/src/utils/network-policy-navigation.test.ts +21 -36
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyhook-io/radar-app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.0",
|
|
4
4
|
"description": "Radar's full web UI as a reusable React component. Used by Radar's own binary and by external consumers like Radar Cloud.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"diff": "^9.0.0",
|
|
38
38
|
"monaco-editor": "0.57.0",
|
|
39
39
|
"react-markdown": "^10.1.0",
|
|
40
|
-
"react-virtuoso": "^4.18.
|
|
40
|
+
"react-virtuoso": "^4.18.24",
|
|
41
41
|
"remark-gfm": "^4.0.1",
|
|
42
42
|
"shiki": "^4.6.0",
|
|
43
43
|
"yaml": "^2.9.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@skyhook-io/k8s-ui": ">=1.
|
|
46
|
+
"@skyhook-io/k8s-ui": ">=1.22.3",
|
|
47
47
|
"@tanstack/react-query": ">=5",
|
|
48
48
|
"@xyflow/react": ">=12.0.0",
|
|
49
49
|
"clsx": ">=2",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"@playwright/test": "^1.64.1",
|
|
60
60
|
"@skyhook-io/k8s-ui": "*",
|
|
61
61
|
"@tailwindcss/vite": "^4.3.5",
|
|
62
|
-
"@tanstack/react-query": "^5.
|
|
62
|
+
"@tanstack/react-query": "^5.108.4",
|
|
63
63
|
"@types/node": "^26.6.6",
|
|
64
|
-
"@types/react": "^19.3.
|
|
64
|
+
"@types/react": "^19.3.3",
|
|
65
65
|
"@types/react-dom": "^19.3.0",
|
|
66
66
|
"@vitejs/plugin-react": "^6.3.0",
|
|
67
67
|
"@xyflow/react": "^12.12.0",
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
"eslint-plugin-react-refresh": "^0.5.7",
|
|
73
73
|
"globals": "^17.14.0",
|
|
74
74
|
"lucide-react": "^1.48.0",
|
|
75
|
-
"postcss": "^8.5.
|
|
75
|
+
"postcss": "^8.5.34",
|
|
76
76
|
"prettier": "^3.10.1",
|
|
77
|
-
"react": "^19.3.
|
|
78
|
-
"react-dom": "^19.3.
|
|
77
|
+
"react": "^19.3.1",
|
|
78
|
+
"react-dom": "^19.3.1",
|
|
79
79
|
"react-router-dom": "^7.18.5",
|
|
80
80
|
"tailwind-merge": "^3.7.0",
|
|
81
81
|
"tailwindcss": "^4.3.5",
|
package/src/App.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import { startViewTransitionSafe } from '@skyhook-io/k8s-ui/utils/view-transitio
|
|
|
5
5
|
import { englishPlural } from '@skyhook-io/k8s-ui/utils/pluralize'
|
|
6
6
|
import { useQueryClient } from '@tanstack/react-query'
|
|
7
7
|
import { useNavigate, useLocation, useSearchParams, useNavigationType, NavigationType } from 'react-router-dom'
|
|
8
|
+
import { issueSubjectParams } from './components/share/shareLink'
|
|
8
9
|
import { HomeView } from './components/home/HomeView'
|
|
9
10
|
import { DebugOverlay } from './components/DebugOverlay'
|
|
10
11
|
import { GlobalDiagnoseButton } from './components/diagnose/LocalDiagnoseAction'
|
|
@@ -13,7 +14,7 @@ import { connectionHeaderValue } from './api/connectionBinding'
|
|
|
13
14
|
import { ContextSwitchActions } from './components/ContextSwitchActions'
|
|
14
15
|
import { investigationWorkspaceSearch, isInvestigationWorkspacePath, useDiagnoseLayout } from './components/diagnose/DiagnoseContext'
|
|
15
16
|
import { DiagnoseSurface } from './components/diagnose/DiagnoseSurface'
|
|
16
|
-
import { type IssueTimelineEventTarget, TopologyGraph, TopologySearch, TopologyBreadcrumb, TopologyFilterSidebar, TopologyControls, FreshnessControl, gitOpsRouteForKind, gitOpsRouteForResource, ScopePill, PaneLoader, usePhoneLayout, PHONE_MEDIA_QUERY } from '@skyhook-io/k8s-ui'
|
|
17
|
+
import { type IssueTimelineEventTarget, TopologyGraph, TopologySearch, TopologyBreadcrumb, TopologyFilterSidebar, TopologyControls, FreshnessControl, gitOpsRouteForKind, gitOpsRouteForResource, ScopePill, PaneLoader, usePhoneLayout, PHONE_MEDIA_QUERY, passesKindFilter, isStandaloneReplicaSet } from '@skyhook-io/k8s-ui'
|
|
17
18
|
import { resetNavigationMap } from '@skyhook-io/k8s-ui/utils/navigation'
|
|
18
19
|
import { topologyNodeResourceKind } from '@skyhook-io/k8s-ui/utils/topology-neighborhood'
|
|
19
20
|
import { useAPIResources, findAPIResourceForRoute } from './api/apiResources'
|
|
@@ -57,7 +58,9 @@ import { ConnectionProvider, useConnection, refreshQueriesAfterReconnect } from
|
|
|
57
58
|
import { DisconnectedView, FailedSwitchView } from './components/SwitchAwareConnectionError'
|
|
58
59
|
import { SyncProgressPanel } from './components/SyncProgressPanel'
|
|
59
60
|
import { NoClusterAccessBanner } from './components/NoClusterAccessBanner'
|
|
61
|
+
import { APIUnreachableBanner } from './components/APIUnreachableBanner'
|
|
60
62
|
import { CapabilitiesProvider, useCapabilitiesContext } from './contexts/CapabilitiesContext'
|
|
63
|
+
import { RegistryAccessModeProvider } from './contexts/RegistryAccessMode'
|
|
61
64
|
import { RadarUpgradeProvider } from './context/RadarUpgrade'
|
|
62
65
|
import { UserMenu } from './components/UserMenu'
|
|
63
66
|
import { COMMUNITY_SLACK_URL } from './components/community'
|
|
@@ -74,6 +77,7 @@ import { DiagnosticsOverlay, type DiagnosticsFocus } from './components/ui/Diagn
|
|
|
74
77
|
import { useEventSource } from './hooks/useEventSource'
|
|
75
78
|
import { useResetViewsOnContextChange } from './hooks/useResetViewsOnContextChange'
|
|
76
79
|
import { debugNamespaceLog, refetchOnResourceEvents, resourceEventKey, useNamespaces, useNamespaceScope, useSetActiveNamespace, isAppliedNamespaceSwitch, useAuthMe, useAuditBadges, useClusterInfo, useCapabilities } from './api/client'
|
|
80
|
+
import { createWorkloadSourceInvalidator, type WorkloadSourceInvalidator } from './api/workloadSource'
|
|
77
81
|
import { buildAuditSeverityMap } from './utils/auditBadges'
|
|
78
82
|
import { isInNamespaceScope, scopeNodesToNamespaces } from './utils/topology-namespace'
|
|
79
83
|
import { routePath, apiUrl, getApiBase, getAuthHeaders, getCredentialsMode, stripBasename } from './api/config'
|
|
@@ -87,6 +91,7 @@ import { useTheme } from './context/ThemeContext'
|
|
|
87
91
|
import { Tooltip } from './components/ui/Tooltip'
|
|
88
92
|
import { LargeClusterNamespacePicker } from './components/shared/LargeClusterNamespacePicker'
|
|
89
93
|
import { SettingsDialog, type SettingsSectionId } from './components/settings/SettingsDialog'
|
|
94
|
+
|
|
90
95
|
import type { APIResource, TopologyNode, GroupingMode, MainView, SelectedResource, SelectedHelmRelease, NodeKind, TopologyMode, Topology, K8sEvent } from './types'
|
|
91
96
|
import { createViewMemory } from './utils/viewMemory'
|
|
92
97
|
import { createKindFilterStore } from './utils/kindFilterStore'
|
|
@@ -143,12 +148,12 @@ const FLEET_MODE_KINDS = new Set<NodeKind>([
|
|
|
143
148
|
|
|
144
149
|
// Convert API resource name back to topology node ID prefix
|
|
145
150
|
// Extended MainView type that includes traffic and cost
|
|
146
|
-
type ExtendedMainView = MainView | 'traffic' | 'cost' | 'capacity' | 'cnpg' | 'velero' | 'workload' | 'checks' | 'gitops' | 'compare' | 'helmCompare' | 'issues' | 'applications' | 'investigations'
|
|
151
|
+
type ExtendedMainView = MainView | 'traffic' | 'cost' | 'capacity' | 'cnpg' | 'velero' | 'substrate' | 'agent-sandbox' | 'kagent' | 'workload' | 'checks' | 'gitops' | 'compare' | 'helmCompare' | 'issues' | 'applications' | 'investigations'
|
|
147
152
|
|
|
148
153
|
// Views that have been laid out for phone width (640px and below). The rest
|
|
149
154
|
// keep their desktop width on a phone and scroll sideways; add a view here in
|
|
150
155
|
// the PR that gives it a phone layout.
|
|
151
|
-
const PHONE_READY_VIEWS: ReadonlySet<ExtendedMainView> = new Set<ExtendedMainView>(['issues', 'resources', 'helm', 'home', 'topology', 'capacity'])
|
|
156
|
+
const PHONE_READY_VIEWS: ReadonlySet<ExtendedMainView> = new Set<ExtendedMainView>(['issues', 'resources', 'helm', 'home', 'topology', 'capacity', 'investigations'])
|
|
152
157
|
|
|
153
158
|
// Extract view from URL path
|
|
154
159
|
function getViewFromPath(pathname: string): ExtendedMainView {
|
|
@@ -383,6 +388,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
383
388
|
dismissForNavigation: dismissDiagnoseForNavigation,
|
|
384
389
|
contentGutter,
|
|
385
390
|
maximized: diagnoseMaximized,
|
|
391
|
+
fullWidthForced: diagnoseFillsViewport,
|
|
386
392
|
} = useDiagnoseLayout()
|
|
387
393
|
// Hand off to a host-owned URL. The host's `onHostNavigate` (Radar Cloud's
|
|
388
394
|
// cross-tree swap) navigates same-document so the chrome morphs instead of
|
|
@@ -637,6 +643,10 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
637
643
|
const [showPolicyEffect, setShowPolicyEffect] = useState(false)
|
|
638
644
|
// Topology filter state
|
|
639
645
|
const [visibleKinds, setVisibleKinds] = useState<Set<NodeKind>>(() => new Set(DEFAULT_VISIBLE_KINDS))
|
|
646
|
+
// Whether the user has chosen for ReplicaSets (their toggle, Show all, Hide
|
|
647
|
+
// all). Until then the kind stays off, hiding the ReplicaSets that collapse
|
|
648
|
+
// into a Deployment or Rollout, but standalone ones show.
|
|
649
|
+
const [replicaSetsChosen, setReplicaSetsChosen] = useState(false)
|
|
640
650
|
// Phones start with the filters collapsed to their icon rail: expanded, the
|
|
641
651
|
// panel took two thirds of the width from the graph.
|
|
642
652
|
const [filterSidebarCollapsed, setFilterSidebarCollapsed] = useState(
|
|
@@ -717,6 +727,11 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
717
727
|
// Views with a deliberate phone layout. On a phone every other view keeps
|
|
718
728
|
// its desktop width and scrolls sideways rather than squeezing.
|
|
719
729
|
const phoneScroll = isMobile && !PHONE_READY_VIEWS.has(mainView)
|
|
730
|
+
// Investigations own their responsive panes. A narrow embedded window can
|
|
731
|
+
// have a fine pointer (or a tablet keyboard); the host width is the boundary.
|
|
732
|
+
const investigationFillsHost = embedded && (
|
|
733
|
+
mainView === 'investigations' || (diagnoseOpen && (diagnoseMaximized || diagnoseFillsViewport))
|
|
734
|
+
)
|
|
720
735
|
|
|
721
736
|
// On a history Pop (back/forward) the URL is authoritative. The URL-write
|
|
722
737
|
// effect, running with not-yet-synced state, would otherwise write the stale
|
|
@@ -733,6 +748,12 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
733
748
|
// Owner-key (pathname + ?app) a non-URL-backed peek was opened on; see
|
|
734
749
|
// navigateToResource and peekOwnerKey.
|
|
735
750
|
const peekOwnerKeyRef = useRef<string | null>(null)
|
|
751
|
+
// The router's location, readable from memoized callbacks. Never use
|
|
752
|
+
// window.location for route comparisons: under a host basename (Radar Hub's
|
|
753
|
+
// /c/<id>) it carries the prefix the router strips, and under the memory
|
|
754
|
+
// router it is the host page's URL.
|
|
755
|
+
const locationRef = useRef(location)
|
|
756
|
+
locationRef.current = location
|
|
736
757
|
const currentResourceKindSlug = normalizedResourcesKindSlug.toLowerCase()
|
|
737
758
|
const currentResourceGroup = searchParams.get('apiGroup') ?? ''
|
|
738
759
|
const selectedResourceKindSlug = selectedResource ? kindToPluralWithGroup(selectedResource.kind, selectedResource.group ?? '').toLowerCase() : ''
|
|
@@ -767,6 +788,14 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
767
788
|
? null
|
|
768
789
|
: selectedResource
|
|
769
790
|
|
|
791
|
+
// Clear orphaned peek state after hiding it at render time, so browser
|
|
792
|
+
// Forward back to the old owner URL doesn't revive a dismissed peek drawer.
|
|
793
|
+
useEffect(() => {
|
|
794
|
+
if (!peekRouteOrphaned) return
|
|
795
|
+
peekOwnerKeyRef.current = null
|
|
796
|
+
setSelectedResource(null)
|
|
797
|
+
}, [peekRouteOrphaned])
|
|
798
|
+
|
|
770
799
|
useEffect(() => {
|
|
771
800
|
if (mainView !== 'resources') {
|
|
772
801
|
prevResourcesKindKeyRef.current = null
|
|
@@ -816,10 +845,9 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
816
845
|
// Record the page this peek was opened on. Outside /resources the drawer is
|
|
817
846
|
// not URL-backed, so this ref is what lets the render-time gate below close
|
|
818
847
|
// the peek when the page under it changes (e.g. browser Back off a GitOps
|
|
819
|
-
// detail page, or Applications detail → list via ?app).
|
|
820
|
-
//
|
|
821
|
-
|
|
822
|
-
peekOwnerKeyRef.current = peekOwnerKey(window.location.pathname, window.location.search)
|
|
848
|
+
// detail page, or Applications detail → list via ?app). Read through the
|
|
849
|
+
// ref so the value is current regardless of this callback's memoization.
|
|
850
|
+
peekOwnerKeyRef.current = peekOwnerKey(locationRef.current.pathname, locationRef.current.search)
|
|
823
851
|
const update = () => { setDrawerInitialTab(tab); setSelectedResource(res) }
|
|
824
852
|
// Skip the cross-fade animation entirely on first open (no
|
|
825
853
|
// `selectedResource`); otherwise route through
|
|
@@ -955,7 +983,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
955
983
|
gitops: 'g o', checks: 'g u', cost: 'g c', capacity: 'g p',
|
|
956
984
|
// Non-rail views (reachable via deep links / actions, not the rail) get no
|
|
957
985
|
// dedicated mnemonic — listed for exhaustiveness so the type stays total.
|
|
958
|
-
workload: '', compare: '', helmCompare: '', investigations: '', cnpg: '', velero: '',
|
|
986
|
+
workload: '', compare: '', helmCompare: '', investigations: '', cnpg: '', velero: '', substrate: '', 'agent-sandbox': '', kagent: '',
|
|
959
987
|
}
|
|
960
988
|
const views = Object.keys(VIEW_SHORTCUT_KEYS).filter(
|
|
961
989
|
(v): v is ExtendedMainView => VIEW_SHORTCUT_KEYS[v as ExtendedMainView] !== '',
|
|
@@ -1165,6 +1193,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1165
1193
|
}>({ changedKinds: new Set(), changedObjects: new Set(), structuralKinds: new Set(), environmentNamespaces: new Set(), environmentPods: new Map(), secretsChanged: false, timer: null })
|
|
1166
1194
|
const cnpgInvalidationPendingRef = useRef(false)
|
|
1167
1195
|
const veleroInvalidationPendingRef = useRef(false)
|
|
1196
|
+
const kagentInvalidationPendingRef = useRef(false)
|
|
1168
1197
|
// Traefik route facts scan every visible IngressRoute per request, so an open
|
|
1169
1198
|
// drawer refreshes at most once per batch of this length.
|
|
1170
1199
|
const traefikInvalidationRef = useRef<{ timer: number | null }>({ timer: null })
|
|
@@ -1175,6 +1204,10 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1175
1204
|
timer: number | null
|
|
1176
1205
|
}>({ updatedKinds: new Set(), gitopsRowsChanged: false, gitopsCountsChanged: false, timer: null })
|
|
1177
1206
|
const timelineInvalidationRef = useRef<{ timer: number | null }>({ timer: null })
|
|
1207
|
+
const workloadSourceInvalidatorRef = useRef<WorkloadSourceInvalidator | null>(null)
|
|
1208
|
+
if (!workloadSourceInvalidatorRef.current) {
|
|
1209
|
+
workloadSourceInvalidatorRef.current = createWorkloadSourceInvalidator()
|
|
1210
|
+
}
|
|
1178
1211
|
|
|
1179
1212
|
const handleK8sEvent = useCallback((event: K8sEvent) => {
|
|
1180
1213
|
// The timeline consumes every frame — including the K8s Event kind the
|
|
@@ -1197,12 +1230,15 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1197
1230
|
// Skip K8s Event kind — informational, not resource mutations
|
|
1198
1231
|
if (event.kind === 'Event') return
|
|
1199
1232
|
|
|
1233
|
+
workloadSourceInvalidatorRef.current?.handleEvent(queryClient, event)
|
|
1234
|
+
|
|
1200
1235
|
const kind = kindToPluralWithGroup(event.kind, event.group ?? '')
|
|
1201
1236
|
const structural = event.operation === 'add' || event.operation === 'delete'
|
|
1202
1237
|
const applicationWorkload = ['deployments', 'statefulsets', 'daemonsets', 'rollouts'].includes(kind)
|
|
1203
1238
|
|
|
1204
1239
|
if (event.group?.endsWith('.cnpg.io')) cnpgInvalidationPendingRef.current = true
|
|
1205
1240
|
if (event.group === 'velero.io') veleroInvalidationPendingRef.current = true
|
|
1241
|
+
if (event.group === 'api.kagent.dev' || event.kind === 'Namespace') kagentInvalidationPendingRef.current = true
|
|
1206
1242
|
|
|
1207
1243
|
const fast = fastInvalidationRef.current
|
|
1208
1244
|
fast.changedKinds.add(kind)
|
|
@@ -1265,6 +1301,11 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1265
1301
|
queryClient.invalidateQueries({ queryKey: ['velero', 'workspace'] })
|
|
1266
1302
|
queryClient.invalidateQueries({ queryKey: ['velero', 'schedule-activity'] })
|
|
1267
1303
|
}
|
|
1304
|
+
if (kagentInvalidationPendingRef.current) {
|
|
1305
|
+
kagentInvalidationPendingRef.current = false
|
|
1306
|
+
queryClient.invalidateQueries({ queryKey: ['kagent', 'workspace'] })
|
|
1307
|
+
queryClient.invalidateQueries({ queryKey: ['substrate', getApiBase()], predicate: q => q.queryKey[3] === 'kagent-summary' })
|
|
1308
|
+
}
|
|
1268
1309
|
fastInvalidationRef.current = { changedKinds: new Set(), changedObjects: new Set(), structuralKinds: new Set(), environmentNamespaces: new Set(), environmentPods: new Map(), secretsChanged: false, timer: null }
|
|
1269
1310
|
}, 3000)
|
|
1270
1311
|
}
|
|
@@ -1310,6 +1351,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1310
1351
|
fastInvalidationRef.current = { changedKinds: new Set(), changedObjects: new Set(), structuralKinds: new Set(), environmentNamespaces: new Set(), environmentPods: new Map(), secretsChanged: false, timer: null }
|
|
1311
1352
|
slowInvalidationRef.current = { updatedKinds: new Set(), gitopsRowsChanged: false, gitopsCountsChanged: false, timer: null }
|
|
1312
1353
|
timelineInvalidationRef.current = { timer: null }
|
|
1354
|
+
workloadSourceInvalidatorRef.current?.reset()
|
|
1313
1355
|
}, [])
|
|
1314
1356
|
|
|
1315
1357
|
// SSE connection for real-time updates — no namespace filter for small/medium clusters (frontend filters).
|
|
@@ -1318,7 +1360,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1318
1360
|
const sseMode = topologyMode === 'fleet' ? 'resources' : topologyMode
|
|
1319
1361
|
// The context this tab's views were last reset for.
|
|
1320
1362
|
const shownContextRef = useRef<string | null>(null)
|
|
1321
|
-
const { topology, connected: eventStreamConnected, connecting: eventStreamConnecting, reconnect: reconnectEventStream, applyContextChange } = useEventSource(namespaces, sseMode as 'resources' | 'traffic', {
|
|
1363
|
+
const { topology, topologyStatus, connected: eventStreamConnected, connecting: eventStreamConnecting, reconnect: reconnectEventStream, applyContextChange } = useEventSource(namespaces, sseMode as 'resources' | 'traffic', {
|
|
1322
1364
|
onContextSwitchComplete: endSwitch,
|
|
1323
1365
|
onContextSwitchProgress: updateProgress,
|
|
1324
1366
|
onContextChanged: (context) => {
|
|
@@ -1335,6 +1377,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1335
1377
|
fastInvalidationRef.current = { changedKinds: new Set(), changedObjects: new Set(), structuralKinds: new Set(), environmentNamespaces: new Set(), environmentPods: new Map(), secretsChanged: false, timer: null }
|
|
1336
1378
|
slowInvalidationRef.current = { updatedKinds: new Set(), gitopsRowsChanged: false, gitopsCountsChanged: false, timer: null }
|
|
1337
1379
|
timelineInvalidationRef.current = { timer: null }
|
|
1380
|
+
workloadSourceInvalidatorRef.current?.reset()
|
|
1338
1381
|
|
|
1339
1382
|
// Close any open drawers/overlays — old cluster's resources don't exist on the new one
|
|
1340
1383
|
// (?full=1 is cleared by the URL reset below).
|
|
@@ -1380,11 +1423,13 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1380
1423
|
onConnectionStateChange: updateConnectionFromSSE,
|
|
1381
1424
|
onDeferredReady: () => {
|
|
1382
1425
|
// Deferred informers (secrets, events, configmaps, etc.) have finished syncing.
|
|
1383
|
-
// Refetch dashboard so counts, warning events, and cert health fill in
|
|
1426
|
+
// Refetch dashboard so counts, warning events, and cert health fill in, and
|
|
1427
|
+
// fetched graphs, which only the Topology screen gets streamed.
|
|
1384
1428
|
queryClient.invalidateQueries({ queryKey: ['dashboard'] })
|
|
1429
|
+
queryClient.invalidateQueries({ queryKey: ['topology'] })
|
|
1385
1430
|
},
|
|
1386
1431
|
onK8sEvent: handleK8sEvent,
|
|
1387
|
-
}, forceNamespaceFilter, showPolicyEffect)
|
|
1432
|
+
}, forceNamespaceFilter, showPolicyEffect, mainView === 'topology')
|
|
1388
1433
|
|
|
1389
1434
|
useContextSwitchOutcome(applyContextChange)
|
|
1390
1435
|
useResetViewsOnContextChange(connection.state, connection.context, shownContextRef, applyContextChange)
|
|
@@ -1395,7 +1440,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1395
1440
|
// to a stale namespace while sidebar/topology show a different one. Small
|
|
1396
1441
|
// clusters never set forceNamespaceFilter and skip this path entirely.
|
|
1397
1442
|
useEffect(() => {
|
|
1398
|
-
const isLarge = forceNamespaceFilter !== undefined ||
|
|
1443
|
+
const isLarge = forceNamespaceFilter !== undefined || topologyStatus?.requiresNamespaceFilter === true
|
|
1399
1444
|
if (!isLarge) return
|
|
1400
1445
|
if (namespaces.length === 0) {
|
|
1401
1446
|
setForceNamespaceFilter(prev => (prev === undefined ? prev : undefined))
|
|
@@ -1407,14 +1452,15 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1407
1452
|
if (cur.length === next.length && cur.every((ns, i) => ns === next[i])) return prev
|
|
1408
1453
|
return [...namespaces]
|
|
1409
1454
|
})
|
|
1410
|
-
}, [namespaces, forceNamespaceFilter,
|
|
1455
|
+
}, [namespaces, forceNamespaceFilter, topologyStatus?.requiresNamespaceFilter])
|
|
1411
1456
|
|
|
1412
1457
|
// Apply live topology updates only when not paused. While paused, buffer the
|
|
1413
|
-
// latest snapshot so we can apply it instantly when the user resumes.
|
|
1458
|
+
// latest snapshot so we can apply it instantly when the user resumes. Leaving
|
|
1459
|
+
// the Topology screen clears the stream's graph; a paused one keeps its buffer.
|
|
1414
1460
|
useEffect(() => {
|
|
1415
1461
|
if (!topologyPaused) {
|
|
1416
1462
|
setDisplayedTopology(topology)
|
|
1417
|
-
} else {
|
|
1463
|
+
} else if (topology) {
|
|
1418
1464
|
pendingTopologyRef.current = topology
|
|
1419
1465
|
}
|
|
1420
1466
|
}, [topology, topologyPaused])
|
|
@@ -1430,9 +1476,20 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1430
1476
|
})
|
|
1431
1477
|
}, [])
|
|
1432
1478
|
|
|
1433
|
-
//
|
|
1434
|
-
//
|
|
1435
|
-
const crdDiscoveryStatus =
|
|
1479
|
+
// CRD discovery status arrives with every topology cycle, as topology_status
|
|
1480
|
+
// on screens that don't draw the graph.
|
|
1481
|
+
const crdDiscoveryStatus = topologyStatus?.crdDiscoveryStatus
|
|
1482
|
+
// Finished discovery adds custom resources to fetched graphs (Timeline,
|
|
1483
|
+
// Applications, a workload's page); only the Topology screen gets its graph
|
|
1484
|
+
// pushed.
|
|
1485
|
+
const previousDiscoveryRef = useRef(crdDiscoveryStatus)
|
|
1486
|
+
useEffect(() => {
|
|
1487
|
+
// Starting discovery isn't broadcast, so a tab may see idle go straight to ready.
|
|
1488
|
+
if ((previousDiscoveryRef.current === 'idle' || previousDiscoveryRef.current === 'discovering') && crdDiscoveryStatus === 'ready') {
|
|
1489
|
+
queryClient.invalidateQueries({ queryKey: ['topology'] })
|
|
1490
|
+
}
|
|
1491
|
+
previousDiscoveryRef.current = crdDiscoveryStatus
|
|
1492
|
+
}, [crdDiscoveryStatus, queryClient])
|
|
1436
1493
|
const clusterConnectionState = connection.state
|
|
1437
1494
|
const clusterConnected = clusterConnectionState === 'connected'
|
|
1438
1495
|
const liveUpdatesDisconnected = clusterConnected && !eventStreamConnected && !eventStreamConnecting
|
|
@@ -1442,9 +1499,11 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1442
1499
|
const syncProgressLabel = connection.syncStatus
|
|
1443
1500
|
? `Loading cluster data — ${connection.syncStatus.criticalSynced + connection.syncStatus.deferredSynced} of ${connection.syncStatus.criticalTotal + connection.syncStatus.deferredTotal} ready`
|
|
1444
1501
|
: 'Connecting'
|
|
1502
|
+
const apiUnreachable = clusterConnected && Boolean(connection.apiUnreachableSince)
|
|
1445
1503
|
const headerConnectionLabel =
|
|
1446
1504
|
clusterConnectionState === 'disconnected' ? 'Disconnected' :
|
|
1447
1505
|
clusterConnectionState === 'connecting' ? syncProgressLabel :
|
|
1506
|
+
apiUnreachable ? "Can't reach the API server" :
|
|
1448
1507
|
liveUpdatesDisconnected ? 'Live updates disconnected' :
|
|
1449
1508
|
clusterLoadState.loading ? `Connected — ${clusterLoadState.message}` :
|
|
1450
1509
|
crdDiscoveryStatus === 'discovering' ? 'Connected — discovering Custom Resources...' :
|
|
@@ -1452,6 +1511,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1452
1511
|
const headerConnectionDisplayLabel =
|
|
1453
1512
|
clusterConnectionState === 'disconnected' ? 'Disconnected' :
|
|
1454
1513
|
clusterConnectionState === 'connecting' ? syncProgressLabel :
|
|
1514
|
+
apiUnreachable ? 'API server unreachable' :
|
|
1455
1515
|
liveUpdatesDisconnected ? 'Live updates disconnected' :
|
|
1456
1516
|
showClusterWarmupLabel ? clusterLoadState.message :
|
|
1457
1517
|
crdDiscoveryStatus === 'discovering' ? 'Discovering Custom Resources…' :
|
|
@@ -1826,7 +1886,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1826
1886
|
// Filter by namespace (client-side) and by visible kinds
|
|
1827
1887
|
const nsSet = namespaces.length > 0 ? new Set(namespaces) : null
|
|
1828
1888
|
const filteredNodes = displayedTopology.nodes.filter(node =>
|
|
1829
|
-
effectiveKinds.has(node.kind) && isInNamespaceScope(node, nsSet)
|
|
1889
|
+
(topologyMode === 'fleet' ? effectiveKinds.has(node.kind) : passesKindFilter(node, effectiveKinds, !replicaSetsChosen)) && isInNamespaceScope(node, nsSet)
|
|
1830
1890
|
)
|
|
1831
1891
|
const filteredNodeIds = new Set(filteredNodes.map(n => n.id))
|
|
1832
1892
|
|
|
@@ -1849,7 +1909,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1849
1909
|
nodes: filteredNodes,
|
|
1850
1910
|
edges: filteredEdges,
|
|
1851
1911
|
}
|
|
1852
|
-
}, [displayedTopology, visibleKinds, namespaces, topologyMode])
|
|
1912
|
+
}, [displayedTopology, visibleKinds, namespaces, topologyMode, replicaSetsChosen])
|
|
1853
1913
|
|
|
1854
1914
|
// Namespace-scoped but NOT kind-filtered: the sidebar derives its kind list
|
|
1855
1915
|
// and visible/hidden footer counts from this prop, so handing it the
|
|
@@ -1861,6 +1921,21 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1861
1921
|
return scopeNodesToNamespaces(displayedTopology.nodes, namespaces)
|
|
1862
1922
|
}, [displayedTopology, namespaces])
|
|
1863
1923
|
|
|
1924
|
+
// ReplicaSets are on screen when the kind is on, or by default when some
|
|
1925
|
+
// are standalone. The sidebar's toggle shows that: it reads "on" when every
|
|
1926
|
+
// ReplicaSet in view is standalone and so shown, keeping Show all available
|
|
1927
|
+
// while any other ReplicaSet (a Rollout's during a transition) is hidden.
|
|
1928
|
+
const replicaSetsShown = useMemo(() => {
|
|
1929
|
+
if (visibleKinds.has('ReplicaSet')) return true
|
|
1930
|
+
if (replicaSetsChosen || topologyMode === 'fleet') return false
|
|
1931
|
+
const inView = filterSidebarNodes.filter(n => n.kind === 'ReplicaSet')
|
|
1932
|
+
return inView.length > 0 && inView.every(isStandaloneReplicaSet)
|
|
1933
|
+
}, [visibleKinds, replicaSetsChosen, topologyMode, filterSidebarNodes])
|
|
1934
|
+
const sidebarKinds = useMemo(
|
|
1935
|
+
() => (replicaSetsShown && !visibleKinds.has('ReplicaSet') ? new Set<NodeKind>([...visibleKinds, 'ReplicaSet']) : visibleKinds),
|
|
1936
|
+
[replicaSetsShown, visibleKinds],
|
|
1937
|
+
)
|
|
1938
|
+
|
|
1864
1939
|
// Cluster Audit findings, joined onto topology nodes by the audit key the
|
|
1865
1940
|
// backend stamps on each node (data.auditKey). Only badge-worthy findings
|
|
1866
1941
|
// reach the graph; the raw auditDanger/auditWarning property names remain at
|
|
@@ -1892,12 +1967,24 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1892
1967
|
// collisions — rebuilding the string can't match those reliably.
|
|
1893
1968
|
const selectedNodeId = useMemo(() => {
|
|
1894
1969
|
if (!selectedResource) return undefined
|
|
1895
|
-
const match = findSelectedTopologyNode(
|
|
1970
|
+
const match = findSelectedTopologyNode(displayedTopology, selectedResource)
|
|
1896
1971
|
return match?.id
|
|
1897
|
-
}, [selectedResource,
|
|
1972
|
+
}, [selectedResource, displayedTopology])
|
|
1898
1973
|
|
|
1899
1974
|
// Filter handlers
|
|
1900
1975
|
const handleToggleKind = useCallback((kind: NodeKind) => {
|
|
1976
|
+
if (kind === 'ReplicaSet') {
|
|
1977
|
+
// The toggle shows what's on screen: on while standalone ReplicaSets
|
|
1978
|
+
// show by default, so the first click hides them.
|
|
1979
|
+
setReplicaSetsChosen(true)
|
|
1980
|
+
setVisibleKinds(prev => {
|
|
1981
|
+
const next = new Set(prev)
|
|
1982
|
+
if (replicaSetsShown) next.delete(kind)
|
|
1983
|
+
else next.add(kind)
|
|
1984
|
+
return next
|
|
1985
|
+
})
|
|
1986
|
+
return
|
|
1987
|
+
}
|
|
1901
1988
|
setVisibleKinds(prev => {
|
|
1902
1989
|
const next = new Set(prev)
|
|
1903
1990
|
if (next.has(kind)) {
|
|
@@ -1907,20 +1994,22 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1907
1994
|
}
|
|
1908
1995
|
return next
|
|
1909
1996
|
})
|
|
1910
|
-
}, [])
|
|
1997
|
+
}, [replicaSetsShown])
|
|
1911
1998
|
|
|
1912
1999
|
const handleShowAllKinds = useCallback(() => {
|
|
1913
2000
|
// Include all static kinds plus any dynamic CRD kinds from the topology
|
|
1914
2001
|
const allKinds = new Set<NodeKind>(ALL_NODE_KINDS)
|
|
1915
|
-
if (
|
|
1916
|
-
for (const node of
|
|
2002
|
+
if (displayedTopology?.nodes) {
|
|
2003
|
+
for (const node of displayedTopology.nodes) {
|
|
1917
2004
|
allKinds.add(node.kind)
|
|
1918
2005
|
}
|
|
1919
2006
|
}
|
|
2007
|
+
setReplicaSetsChosen(true)
|
|
1920
2008
|
setVisibleKinds(allKinds)
|
|
1921
|
-
}, [
|
|
2009
|
+
}, [displayedTopology])
|
|
1922
2010
|
|
|
1923
2011
|
const handleHideAllKinds = useCallback(() => {
|
|
2012
|
+
setReplicaSetsChosen(true)
|
|
1924
2013
|
setVisibleKinds(new Set())
|
|
1925
2014
|
}, [])
|
|
1926
2015
|
|
|
@@ -1939,8 +2028,8 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
1939
2028
|
scroll sideways at desktop width instead (see PHONE_READY_VIEWS). */}
|
|
1940
2029
|
<div
|
|
1941
2030
|
className={`relative flex bg-theme-base ${navCustomization.embedded ? 'h-full min-h-0' : 'h-screen'}`}
|
|
1942
|
-
style={{ minWidth: isMobile && mainView === 'issues'
|
|
1943
|
-
? 0 //
|
|
2031
|
+
style={{ minWidth: investigationFillsHost || (isMobile && mainView === 'issues')
|
|
2032
|
+
? 0 // Embedded investigations fill the host; mobile issue rows adapt beside the rail.
|
|
1944
2033
|
: (isMobile ? 360 : 800) + (showNavRail ? (navRailEffectivePinned ? 176 : 56) : 0) }}
|
|
1945
2034
|
>
|
|
1946
2035
|
{showNavRail && (
|
|
@@ -2004,7 +2093,9 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
2004
2093
|
className={`block w-2.5 h-2.5 shrink-0 rounded-full ${
|
|
2005
2094
|
clusterConnectionState === 'disconnected' || liveUpdatesDisconnected
|
|
2006
2095
|
? 'bg-red-500'
|
|
2007
|
-
:
|
|
2096
|
+
: apiUnreachable
|
|
2097
|
+
? 'bg-amber-400'
|
|
2098
|
+
: clusterConnectionState === 'connecting' || crdDiscoveryStatus === 'discovering' || clusterLoadState.loading
|
|
2008
2099
|
? 'bg-amber-400 animate-pulse'
|
|
2009
2100
|
: 'bg-green-500'
|
|
2010
2101
|
}`}
|
|
@@ -2214,6 +2305,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
2214
2305
|
|
|
2215
2306
|
{dismissed && <p className="m-auto text-sm text-theme-text-secondary">{contextSwitch?.phase === 'stopping' ? 'Stopping the switch…' : 'The switch is still running. Resources will appear when the cluster is ready.'}</p>}
|
|
2216
2307
|
{contentReady && <NoClusterAccessBanner />}
|
|
2308
|
+
{contentReady && connection.apiUnreachableSince && <APIUnreachableBanner since={connection.apiUnreachableSince} />}
|
|
2217
2309
|
{/* Main content - only show when connected and authenticated */}
|
|
2218
2310
|
{/* inert while a fullscreen detail overlay covers the views — keeps the
|
|
2219
2311
|
retained background list out of the focus order + a11y tree (the visual
|
|
@@ -2241,10 +2333,9 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
2241
2333
|
{!viewsSyncGated && mainView === 'home' && (
|
|
2242
2334
|
<HomeView
|
|
2243
2335
|
namespaces={namespaces}
|
|
2244
|
-
topology={topology}
|
|
2245
2336
|
fallbackClusterLoadState={showHomeClusterLoadFallback ? clusterLoadState : undefined}
|
|
2246
2337
|
onNavigateToView={setMainView}
|
|
2247
|
-
onNavigateToIssue={takeover.issues ? undefined : (
|
|
2338
|
+
onNavigateToIssue={takeover.issues ? undefined : (issue) => setMainView('issues', { issue: issue.id, ...issueSubjectParams(issue) })}
|
|
2248
2339
|
onNavigateToHelmRelease={navCustomization.embedded ? undefined : navigateToHelmRelease}
|
|
2249
2340
|
onNavigateToManagerPath={navCustomization.embedded || takeover.gitops ? undefined : navigateToPath}
|
|
2250
2341
|
// Upgrade impact lives under /checks, which a Cloud host takes
|
|
@@ -2300,7 +2391,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
2300
2391
|
{/* Topology view */}
|
|
2301
2392
|
{!viewsSyncGated && mainView === 'topology' && (
|
|
2302
2393
|
<>
|
|
2303
|
-
{
|
|
2394
|
+
{topologyStatus?.requiresNamespaceFilter && namespaces.length === 0 ? (
|
|
2304
2395
|
/* Large cluster: prompt user to select a namespace */
|
|
2305
2396
|
<div className="flex-1 flex items-center justify-center">
|
|
2306
2397
|
<div className="max-w-md w-full mx-4 text-center">
|
|
@@ -2339,7 +2430,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
2339
2430
|
<div className={isMobile && !filterSidebarCollapsed ? 'absolute inset-y-0 left-0 z-20 flex shadow-theme-lg' : 'contents'}>
|
|
2340
2431
|
<TopologyFilterSidebar
|
|
2341
2432
|
nodes={filterSidebarNodes}
|
|
2342
|
-
visibleKinds={
|
|
2433
|
+
visibleKinds={sidebarKinds}
|
|
2343
2434
|
onToggleKind={handleToggleKind}
|
|
2344
2435
|
onShowAll={handleShowAllKinds}
|
|
2345
2436
|
onHideAll={handleHideAllKinds}
|
|
@@ -2384,7 +2475,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
2384
2475
|
)}
|
|
2385
2476
|
<TopologySearch
|
|
2386
2477
|
nodes={filteredTopology?.nodes ?? []}
|
|
2387
|
-
allNodes={
|
|
2478
|
+
allNodes={displayedTopology?.nodes}
|
|
2388
2479
|
viewModeLabel={topologyMode === 'fleet' ? 'Fleet' : topologyMode === 'traffic' ? 'Network Flow' : 'Resources'}
|
|
2389
2480
|
onNodeSelect={handleNodeClick}
|
|
2390
2481
|
onZoomToNode={(id) => setTopologyFocus((prev) => ({ id, nonce: (prev?.nonce ?? 0) + 1 }))}
|
|
@@ -2449,7 +2540,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
2449
2540
|
initialViewMode={(searchParams.get('view') as 'list' | 'swimlane') || undefined}
|
|
2450
2541
|
initialFilter={(searchParams.get('filter') as 'all' | 'changes' | 'k8s_events' | 'warnings' | 'unhealthy') || undefined}
|
|
2451
2542
|
initialTimeRange={(searchParams.get('time') as '5m' | '30m' | '1h' | '6h' | '24h' | 'all') || undefined}
|
|
2452
|
-
requiresNamespaceFilter={
|
|
2543
|
+
requiresNamespaceFilter={topologyStatus?.requiresNamespaceFilter && namespaces.length === 0}
|
|
2453
2544
|
availableNamespaces={availableNamespaces}
|
|
2454
2545
|
availableNamespacesError={availableNamespacesError?.message}
|
|
2455
2546
|
onNamespaceSelect={(ns) => {
|
|
@@ -2499,12 +2590,12 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
2499
2590
|
// the inline workload selection so the app graph (not a second
|
|
2500
2591
|
// detail panel) sits behind the peek. Search-only change keeps the
|
|
2501
2592
|
// pathname — and thus the peek's owner-path — intact.
|
|
2502
|
-
const params = new URLSearchParams(
|
|
2593
|
+
const params = new URLSearchParams(locationRef.current.search)
|
|
2503
2594
|
if (params.has('workload') || params.has('tab') || params.has('run')) {
|
|
2504
2595
|
params.delete('workload')
|
|
2505
2596
|
params.delete('tab')
|
|
2506
2597
|
params.delete('run')
|
|
2507
|
-
navigate({ pathname:
|
|
2598
|
+
navigate({ pathname: locationRef.current.pathname, search: params.toString() }, { replace: true })
|
|
2508
2599
|
}
|
|
2509
2600
|
navigateToResource(resource)
|
|
2510
2601
|
}}
|
|
@@ -2602,7 +2693,7 @@ function AppInner({ manageDocumentTitle = false, documentTitleSuffix, onClusterL
|
|
|
2602
2693
|
onNavigate={(res) => navigateToResource(res)}
|
|
2603
2694
|
canCollapseToDrawer={!isMobile}
|
|
2604
2695
|
onExpand={(res, opts) => {
|
|
2605
|
-
const detailPath = resourceExpandedPath(res, connection.context || undefined, opts?.yaml ? 'yaml' : undefined)
|
|
2696
|
+
const detailPath = resourceExpandedPath(res, connection.context || undefined, opts?.yaml ? 'yaml' : undefined, { substrateWorkspace: hostFeatures.substrateWorkspace, kagentWorkspace: hostFeatures.kagentWorkspace })
|
|
2606
2697
|
if (detailPath) {
|
|
2607
2698
|
navigate(
|
|
2608
2699
|
detailPath,
|
|
@@ -2786,6 +2877,7 @@ function App({ manageDocumentTitle = false, documentTitleSuffix, onClusterLoadSt
|
|
|
2786
2877
|
<TerminalPreferences>
|
|
2787
2878
|
<ConnectionProvider>
|
|
2788
2879
|
<CapabilitiesProvider>
|
|
2880
|
+
<RegistryAccessModeProvider>
|
|
2789
2881
|
<RadarUpgradeProvider>
|
|
2790
2882
|
<ContextSwitchProvider>
|
|
2791
2883
|
<DockProvider connectionId={connectionHeaderValue}>
|
|
@@ -2799,6 +2891,7 @@ function App({ manageDocumentTitle = false, documentTitleSuffix, onClusterLoadSt
|
|
|
2799
2891
|
</DockProvider>
|
|
2800
2892
|
</ContextSwitchProvider>
|
|
2801
2893
|
</RadarUpgradeProvider>
|
|
2894
|
+
</RegistryAccessModeProvider>
|
|
2802
2895
|
</CapabilitiesProvider>
|
|
2803
2896
|
</ConnectionProvider>
|
|
2804
2897
|
</TerminalPreferences>
|