@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
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { KagentAgent, KagentRef, KagentWorkspace } from '../../api/kagent'
|
|
2
|
+
export const ref = (kind: string, name: string, namespace = 'agents'): KagentRef => ({ group: 'api.kagent.dev', kind, namespace, name })
|
|
3
|
+
export function workspace(): KagentWorkspace {
|
|
4
|
+
const keys = [
|
|
5
|
+
'agents',
|
|
6
|
+
'agentTemplates',
|
|
7
|
+
'harnesses',
|
|
8
|
+
'models',
|
|
9
|
+
'mcpServers',
|
|
10
|
+
'egressPolicies',
|
|
11
|
+
'modelProviders',
|
|
12
|
+
'sandboxTemplates',
|
|
13
|
+
] as const
|
|
14
|
+
const coverage = Object.fromEntries(keys.map((k) => [k, { state: 'full' }])) as KagentWorkspace['coverage']
|
|
15
|
+
const count = { n: 0, lowerBound: false }
|
|
16
|
+
return {
|
|
17
|
+
context: 'test',
|
|
18
|
+
installed: true,
|
|
19
|
+
namespaces: [],
|
|
20
|
+
coverage,
|
|
21
|
+
referenceCoverage: coverage,
|
|
22
|
+
agents: [],
|
|
23
|
+
models: [],
|
|
24
|
+
mcpServers: [],
|
|
25
|
+
modelProviders: [],
|
|
26
|
+
findings: [],
|
|
27
|
+
groups: [],
|
|
28
|
+
counts: {
|
|
29
|
+
findings: { ...count },
|
|
30
|
+
critical: { ...count },
|
|
31
|
+
agents: { ...count },
|
|
32
|
+
agentsAffected: { ...count },
|
|
33
|
+
mcpServers: { ...count },
|
|
34
|
+
mcpServersFailing: { ...count },
|
|
35
|
+
models: { ...count },
|
|
36
|
+
modelsWithProblems: { ...count },
|
|
37
|
+
groups: { n: 0, incomplete: false },
|
|
38
|
+
agentsByLatestChange: {},
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export function agent(name = 'helper'): KagentAgent {
|
|
43
|
+
return {
|
|
44
|
+
ref: ref('Agent', name),
|
|
45
|
+
reading: { state: 'ready', tone: 'healthy', text: 'Ready', summary: 'Ready to start sessions', condition: 'Ready' },
|
|
46
|
+
latestChange: { state: 'prepared' },
|
|
47
|
+
newSessionsRevision: 'abcdef0123456789',
|
|
48
|
+
inlineTemplate: true,
|
|
49
|
+
description: 'Helps operate the cluster',
|
|
50
|
+
mcpServers: { declared: 0, failing: 0, absent: 0, unread: 0, notPermitted: 0 },
|
|
51
|
+
references: [],
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export function blockedWorkspace(): KagentWorkspace {
|
|
55
|
+
const w = workspace(),
|
|
56
|
+
a = agent('blocked-edit'),
|
|
57
|
+
model = ref('ModelConfig', 'broken-model', 'models')
|
|
58
|
+
a.latestChange = { state: 'blocked', message: 'resolve ModelConfig "models/broken-model": secret missing not found' }
|
|
59
|
+
a.reading = { ...a.reading, tone: 'alert', state: 'blocked', text: 'Blocked', message: a.latestChange.message }
|
|
60
|
+
a.model = {
|
|
61
|
+
ref: model,
|
|
62
|
+
state: 'present',
|
|
63
|
+
reading: { state: 'blocked', tone: 'alert', text: 'Blocked', summary: 'API key Secret missing', reason: 'APIKeySecretNotFound' },
|
|
64
|
+
}
|
|
65
|
+
a.references = [
|
|
66
|
+
{ role: 'model', from: a.ref, target: model, state: 'present', field: 'spec.template.inline.modelConfig', reading: a.model.reading },
|
|
67
|
+
]
|
|
68
|
+
w.agents = [a]
|
|
69
|
+
w.models = [
|
|
70
|
+
{
|
|
71
|
+
ref: model,
|
|
72
|
+
reading: a.model.reading!,
|
|
73
|
+
provider: 'OpenAI',
|
|
74
|
+
model: 'gpt',
|
|
75
|
+
credential: { mode: 'apiKeySecret', secret: { ...ref('Secret', 'missing', 'models'), group: '' }, key: 'OPENAI_API_KEY' },
|
|
76
|
+
usedBy: { count: 1, lowerBound: false, consumers: 'seen', agents: [{ agent: a.ref, effect: 'blocked', roles: ['model'] }] },
|
|
77
|
+
},
|
|
78
|
+
]
|
|
79
|
+
w.findings = [
|
|
80
|
+
{
|
|
81
|
+
id: 'agent',
|
|
82
|
+
subject: a.ref,
|
|
83
|
+
severity: 'warning',
|
|
84
|
+
reason: 'KagentChangeBlocked',
|
|
85
|
+
message: 'Blocked edit',
|
|
86
|
+
action: 'Fix the model.',
|
|
87
|
+
cause: { target: model, form: 'failed', role: 'model' },
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: 'model',
|
|
91
|
+
subject: model,
|
|
92
|
+
severity: 'warning',
|
|
93
|
+
reason: 'KagentAPIKeySecretMissing',
|
|
94
|
+
kagentReason: 'APIKeySecretNotFound',
|
|
95
|
+
message: 'secret missing not found',
|
|
96
|
+
action: 'Create Secret models/missing.',
|
|
97
|
+
affects: w.models[0].usedBy,
|
|
98
|
+
},
|
|
99
|
+
]
|
|
100
|
+
w.groups = [{ id: 'model', severity: 'warning', findings: ['model'], folded: [{ finding: 'agent', under: 'model' }] }]
|
|
101
|
+
w.counts.findings.n = 2
|
|
102
|
+
w.counts.groups.n = 1
|
|
103
|
+
w.counts.agents.n = 1
|
|
104
|
+
w.counts.models.n = 1
|
|
105
|
+
w.counts.modelsWithProblems.n = 1
|
|
106
|
+
w.counts.agentsByLatestChange = { blocked: 1 }
|
|
107
|
+
return w
|
|
108
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { WorkspaceRoute } from '../../integrations/workspaceRoute'
|
|
2
|
+
import { parseKagentRoute } from './routes'
|
|
3
|
+
export const kagentWorkspaceRoute: WorkspaceRoute = {
|
|
4
|
+
id: 'kagent',
|
|
5
|
+
path: '/kagent',
|
|
6
|
+
label: 'kagent',
|
|
7
|
+
navView: 'resources',
|
|
8
|
+
namespaceScope: 'view',
|
|
9
|
+
pageTitle: (path) => {
|
|
10
|
+
const r = parseKagentRoute(path)
|
|
11
|
+
return r.detail?.name ?? `kagent ${r.screen === 'mcpservers' ? 'MCP servers' : r.screen}`
|
|
12
|
+
},
|
|
13
|
+
contextSwitchSearch(path, search) {
|
|
14
|
+
const next = new URLSearchParams()
|
|
15
|
+
if (parseKagentRoute(path).detail && search.has('ctx')) next.set('ctx', search.get('ctx')!)
|
|
16
|
+
return next
|
|
17
|
+
},
|
|
18
|
+
}
|
|
@@ -48,3 +48,31 @@ it('says OpenObserve unavailable once', async () => {
|
|
|
48
48
|
act(() => root.unmount())
|
|
49
49
|
vi.unstubAllGlobals()
|
|
50
50
|
})
|
|
51
|
+
|
|
52
|
+
it('keeps the generic heading when OpenObserve is an option and adds the reason beneath it', async () => {
|
|
53
|
+
const client = new QueryClient()
|
|
54
|
+
const container = document.createElement('div')
|
|
55
|
+
const root = createRoot(container)
|
|
56
|
+
const render = (status: PrometheusStatus) => root.render(
|
|
57
|
+
<QueryClientProvider client={client}><NavCustomizationProvider value={{}}>
|
|
58
|
+
<MetricsNotConnected status={status} isWorkload={false} />
|
|
59
|
+
</NavCustomizationProvider></QueryClientProvider>,
|
|
60
|
+
)
|
|
61
|
+
const lines = () => [...container.querySelectorAll('p')].map((p) => p.textContent)
|
|
62
|
+
const generic = ['No metrics source connected', 'Radar can read metrics from Prometheus or OpenObserve.']
|
|
63
|
+
|
|
64
|
+
await act(async () => render({ available: false, connected: false }))
|
|
65
|
+
expect(lines()[0]).toBe('Prometheus not connected')
|
|
66
|
+
expect(container.textContent).not.toContain('OpenObserve')
|
|
67
|
+
|
|
68
|
+
await act(async () => render({ available: false, connected: false, openobserve: 'local' }))
|
|
69
|
+
expect(lines()).toEqual(generic)
|
|
70
|
+
|
|
71
|
+
const reason = "Couldn't read this cluster's ID to find it in OpenObserve: forbidden"
|
|
72
|
+
await act(async () => render({ available: false, connected: false, openobserve: 'local', source: { kind: 'openobserve', via: 'local', error: reason } }))
|
|
73
|
+
expect(lines().slice(0, 3)).toEqual([...generic, reason])
|
|
74
|
+
|
|
75
|
+
await act(async () => render({ available: false, connected: false, openobserve: 'local', error: 'Prometheus connection failed: no service' }))
|
|
76
|
+
expect(lines().slice(0, 3)).toEqual([...generic, 'Prometheus connection failed: no service'])
|
|
77
|
+
act(() => root.unmount())
|
|
78
|
+
})
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
type PrometheusStatus,
|
|
7
7
|
} from "../../api/client";
|
|
8
8
|
import { useNavCustomization } from "../../context/NavCustomization";
|
|
9
|
-
import { unavailableReason } from '../settings/openobserveStatus';
|
|
9
|
+
import { sourceNote, unavailableReason } from '../settings/openobserveStatus';
|
|
10
10
|
import { previousSettingsNote, usePreviousIntegrationSettings } from '../../hooks/usePreviousIntegrationSettings';
|
|
11
11
|
|
|
12
12
|
const openMetricsSettings = () => window.dispatchEvent(new CustomEvent('radar:open-settings', { detail: { section: 'prometheus' } }));
|
|
@@ -34,18 +34,21 @@ function NotConnected({ status, isWorkload }: MetricsNotConnectedProps) {
|
|
|
34
34
|
const outcome = openObservePath ? discoverMutation.data : undefined;
|
|
35
35
|
const failure = openObservePath ? discoverMutation.error?.message : undefined;
|
|
36
36
|
const notFound = outcome === "none" || outcome === "collector";
|
|
37
|
+
const offersOpenObserve = !!openObservePath || status?.source?.kind === "openobserve";
|
|
38
|
+
const reason = status?.error || sourceNote(status?.source);
|
|
37
39
|
return (
|
|
38
40
|
<div className="flex flex-col items-center justify-center py-12 gap-4">
|
|
39
41
|
<WifiOff className="w-10 h-10 text-theme-text-quaternary" />
|
|
40
42
|
<div className="text-center">
|
|
41
43
|
<p className="text-sm text-theme-text-secondary mb-1">
|
|
42
|
-
{
|
|
43
|
-
</p>
|
|
44
|
-
<p className="text-xs text-theme-text-tertiary mb-4">
|
|
45
|
-
{status?.error || (openObservePath
|
|
46
|
-
? "Radar can read metrics from Prometheus or OpenObserve."
|
|
47
|
-
: "Connect to view historical CPU, memory, and network metrics")}
|
|
44
|
+
{offersOpenObserve ? "No metrics source connected" : "Prometheus not connected"}
|
|
48
45
|
</p>
|
|
46
|
+
{offersOpenObserve ? <>
|
|
47
|
+
<p className={clsx("text-xs text-theme-text-tertiary", !reason && "mb-4")}>Radar can read metrics from Prometheus or OpenObserve.</p>
|
|
48
|
+
{reason && <p className="mt-1 mb-4 text-xs text-theme-text-tertiary">{reason}</p>}
|
|
49
|
+
</> : <p className="text-xs text-theme-text-tertiary mb-4">
|
|
50
|
+
{reason || "Connect to view historical CPU, memory, and network metrics"}
|
|
51
|
+
</p>}
|
|
49
52
|
{(notFound || failure) && <p role="status" className="text-sm text-theme-text-secondary mb-4">
|
|
50
53
|
{failure
|
|
51
54
|
? failure
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { hasPrometheusCharts, metricsSourceUnavailable } from '../../api/prometheusCharts'
|
|
1
|
+
import { hasPrometheusCharts, metricsSourceChecking, metricsSourceUnavailable } from '../../api/prometheusCharts'
|
|
2
2
|
import { useState, useMemo } from 'react'
|
|
3
|
+
import { Loader2 } from 'lucide-react'
|
|
3
4
|
import {
|
|
4
5
|
PrometheusChartsView,
|
|
5
6
|
MetricsSummary as BaseMetricsSummary,
|
|
@@ -119,6 +120,14 @@ export function PrometheusCharts({ kind, namespace, name, showEmptyState = false
|
|
|
119
120
|
|
|
120
121
|
if (showEmptyState && isSupported && status) {
|
|
121
122
|
if (metricsSourceUnavailable(status)) return <OpenObserveUnavailable status={status} />
|
|
123
|
+
if (metricsSourceChecking(status)) {
|
|
124
|
+
return (
|
|
125
|
+
<div className="flex items-center justify-center py-12 text-theme-text-tertiary">
|
|
126
|
+
<Loader2 className="w-5 h-5 animate-spin mr-2" />
|
|
127
|
+
Checking OpenObserve…
|
|
128
|
+
</div>
|
|
129
|
+
)
|
|
130
|
+
}
|
|
122
131
|
if (status.openobserve && !isConnected && !status.discovering) {
|
|
123
132
|
return <MetricsNotConnected status={status} isWorkload={['Deployment', 'StatefulSet', 'DaemonSet'].includes(kind)} />
|
|
124
133
|
}
|
|
@@ -90,6 +90,15 @@ describe('Expanded metrics recovery and scope', () => {
|
|
|
90
90
|
expect(ranges).toEqual([])
|
|
91
91
|
})
|
|
92
92
|
|
|
93
|
+
it('waits while Radar checks OpenObserve instead of offering Prometheus setup', () => {
|
|
94
|
+
openobserve = 'local'
|
|
95
|
+
source = { kind: 'openobserve', via: 'local', pending: true, warning: 'Checking…' }
|
|
96
|
+
const html = render()
|
|
97
|
+
expect(html).toContain('Checking OpenObserve…')
|
|
98
|
+
expect(html).not.toContain('Prometheus not connected')
|
|
99
|
+
expect(ranges).toEqual([])
|
|
100
|
+
})
|
|
101
|
+
|
|
93
102
|
it('offers standalone setup without losing the backend error or retry', () => {
|
|
94
103
|
const html = render()
|
|
95
104
|
expect(html).toContain('Backend query failed')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hasPrometheusCharts, metricsSourceUnavailable } from '../../api/prometheusCharts'
|
|
1
|
+
import { hasPrometheusCharts, metricsSourceChecking, metricsSourceUnavailable } from '../../api/prometheusCharts'
|
|
2
2
|
import { clsx } from "clsx";
|
|
3
3
|
import { useMemo, type ReactNode } from "react";
|
|
4
4
|
import { useSearchParams } from "react-router-dom";
|
|
@@ -164,11 +164,11 @@ export function PrometheusChartsGrid({
|
|
|
164
164
|
);
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
if (!isConnected && status?.discovering) {
|
|
167
|
+
if (!isConnected && (status?.discovering || metricsSourceChecking(status))) {
|
|
168
168
|
return (
|
|
169
169
|
<div className="flex items-center justify-center py-12 text-theme-text-tertiary">
|
|
170
170
|
<Loader2 className="w-5 h-5 animate-spin mr-2" />
|
|
171
|
-
Discovering Prometheus…
|
|
171
|
+
{metricsSourceChecking(status) ? "Checking OpenObserve…" : "Discovering Prometheus…"}
|
|
172
172
|
</div>
|
|
173
173
|
);
|
|
174
174
|
}
|
|
@@ -3,7 +3,7 @@ import { describe, expect, it, vi } from 'vitest'
|
|
|
3
3
|
import type { SubstrateHealth } from '../../api/substrateHealth'
|
|
4
4
|
|
|
5
5
|
let health: { data?: SubstrateHealth; error?: unknown; upgrade?: unknown; blockedReason?: string; support?: string } = {}
|
|
6
|
-
let promStatus: { connected: boolean; discovering?: boolean; error?: string } = { connected: true }
|
|
6
|
+
let promStatus: { connected: boolean; discovering?: boolean; error?: string } | undefined = { connected: true }
|
|
7
7
|
|
|
8
8
|
vi.mock('../../api/client', async (orig) => ({
|
|
9
9
|
...(await orig<typeof import('../../api/client')>()),
|
|
@@ -45,6 +45,17 @@ describe('SubstrateHealthCharts', () => {
|
|
|
45
45
|
promStatus = { connected: true }
|
|
46
46
|
})
|
|
47
47
|
|
|
48
|
+
it('has a standalone state before connection and series data arrive', () => {
|
|
49
|
+
const standalone = () => renderToStaticMarkup(<SubstrateHealthCharts target={pool} standalone collapsible={false} />)
|
|
50
|
+
promStatus = undefined
|
|
51
|
+
health = {}
|
|
52
|
+
expect(standalone()).toContain('Checking Prometheus connection…')
|
|
53
|
+
promStatus = { connected: true }
|
|
54
|
+
health = { support: 'supported' }
|
|
55
|
+
expect(standalone()).toContain('Reading Agent Substrate metrics…')
|
|
56
|
+
expect(render(node)).toBe('')
|
|
57
|
+
})
|
|
58
|
+
|
|
48
59
|
it('says why there are no charts when Radar support could not be checked', () => {
|
|
49
60
|
health = { blockedReason: "Couldn't check this cluster's Radar support. Refresh to try again." }
|
|
50
61
|
expect(render(pool)).toContain('Refresh to try again')
|
|
@@ -85,6 +96,7 @@ describe('SubstrateHealthCharts', () => {
|
|
|
85
96
|
it('shows a denial instead of an empty chart', () => {
|
|
86
97
|
health = { error: new ApiError('forbidden', 403) }
|
|
87
98
|
expect(render(pool)).toContain('You don't have access to these metrics')
|
|
99
|
+
expect(render(pool)).toContain('Requires get on workerpools.ate.dev in namespace agents.')
|
|
88
100
|
})
|
|
89
101
|
|
|
90
102
|
it('keeps unrounded values readable and explains charts it cannot draw', () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Info, LineChart, Loader2, Lock, Wifi } from 'lucide-react'
|
|
2
2
|
import { clsx } from 'clsx'
|
|
3
|
-
import { AlertBanner, RadarUpgradeNote, Section, Tooltip, toneTextClass } from '@skyhook-io/k8s-ui'
|
|
3
|
+
import { AlertBanner, RadarUpgradeNote, Section, Tooltip, WorkspaceCard, toneTextClass } from '@skyhook-io/k8s-ui'
|
|
4
4
|
import { AreaChart, SeriesLegend, formatMetricValue, formatTimestamp, type TimeSeries, type TimeSeriesPoint } from '@skyhook-io/k8s-ui/components/charts'
|
|
5
5
|
import { isForbiddenError, useAutoPromConnect, usePrometheusConnect, usePrometheusStatus } from '../../api/client'
|
|
6
6
|
import { SUBSTRATE_RANGE, useSubstrateHealth, type SubstrateChart, type SubstrateHealth, type SubstrateTarget } from '../../api/substrateHealth'
|
|
@@ -27,17 +27,17 @@ export function SubstrateHealthCharts({ target, standalone = false, collapsible
|
|
|
27
27
|
workerPods?: number
|
|
28
28
|
}) {
|
|
29
29
|
useAutoPromConnect()
|
|
30
|
-
const { data: status } = usePrometheusStatus()
|
|
30
|
+
const { data: status, error: statusError } = usePrometheusStatus()
|
|
31
31
|
const connect = usePrometheusConnect()
|
|
32
32
|
const connected = status?.connected === true
|
|
33
33
|
const { data, error, upgrade, blockedReason, support } = useSubstrateHealth(target, connected && Boolean(target.name))
|
|
34
34
|
|
|
35
35
|
if (!connected) {
|
|
36
|
-
if (!standalone
|
|
36
|
+
if (!standalone) return null
|
|
37
37
|
return (
|
|
38
38
|
<Frame collapsible={collapsible}>
|
|
39
|
-
<Muted>{status.discovering ? 'Discovering Prometheus…' : status.error || 'Connect Prometheus to chart this pool\'s workers, resumes and crashes.'}</Muted>
|
|
40
|
-
{!status.discovering && (
|
|
39
|
+
<Muted>{statusError ? `Couldn’t read Prometheus connection status: ${statusError.message}` : !status ? 'Checking Prometheus connection…' : status.discovering ? 'Discovering Prometheus…' : status.error || 'Connect Prometheus to chart this pool\'s workers, resumes and crashes.'}</Muted>
|
|
40
|
+
{status && !status.discovering && (
|
|
41
41
|
<button type="button" onClick={() => connect.mutate()} disabled={connect.isPending} className="btn-brand mt-3 inline-flex items-center gap-2 rounded-lg px-3 py-1.5 text-xs font-medium">
|
|
42
42
|
{connect.isPending ? <Loader2 className="h-3.5 w-3.5 animate-spin" /> : <Wifi className="h-3.5 w-3.5" />}
|
|
43
43
|
Discover Prometheus
|
|
@@ -61,7 +61,7 @@ export function SubstrateHealthCharts({ target, standalone = false, collapsible
|
|
|
61
61
|
icon={Lock}
|
|
62
62
|
title="You don't have access to these metrics"
|
|
63
63
|
message={target.kind === 'workerpool'
|
|
64
|
-
?
|
|
64
|
+
? `Requires get on workerpools.ate.dev in namespace ${target.namespace}.`
|
|
65
65
|
: 'Agent Substrate charts for a node are available to users who can read Nodes.'}
|
|
66
66
|
/>
|
|
67
67
|
</Frame>
|
|
@@ -70,11 +70,11 @@ export function SubstrateHealthCharts({ target, standalone = false, collapsible
|
|
|
70
70
|
if (error) {
|
|
71
71
|
return <Frame collapsible={collapsible}><Muted tone="warning">Agent Substrate metrics could not be read: {error.message}</Muted></Frame>
|
|
72
72
|
}
|
|
73
|
-
if (!data) return null
|
|
73
|
+
if (!data) return standalone ? <Frame collapsible={collapsible}><Muted>Reading Agent Substrate metrics…</Muted></Frame> : null
|
|
74
74
|
|
|
75
75
|
switch (data.status) {
|
|
76
76
|
case 'notOnNode':
|
|
77
|
-
return null
|
|
77
|
+
return standalone ? <Frame collapsible={collapsible}><Muted>No Agent Substrate series were found.</Muted></Frame> : null
|
|
78
78
|
case 'notFound':
|
|
79
79
|
if (target.kind !== 'workerpool') return null
|
|
80
80
|
return <Frame collapsible={collapsible}><Muted>{workerPods === 0 ? NO_WORKERS : NOT_FOUND.workerpool}</Muted></Frame>
|
|
@@ -95,13 +95,7 @@ function Frame({ children, collapsible }: { children: React.ReactNode; collapsib
|
|
|
95
95
|
{collapsible ? (
|
|
96
96
|
<Section title={title} icon={LineChart}>{children}</Section>
|
|
97
97
|
) : (
|
|
98
|
-
|
|
99
|
-
<h3 className="mb-2 flex items-center gap-2 text-sm font-medium text-theme-text-secondary">
|
|
100
|
-
<LineChart className="h-4 w-4" />
|
|
101
|
-
{title}
|
|
102
|
-
</h3>
|
|
103
|
-
{children}
|
|
104
|
-
</>
|
|
98
|
+
<WorkspaceCard title={title}>{children}</WorkspaceCard>
|
|
105
99
|
)}
|
|
106
100
|
</section>
|
|
107
101
|
)
|
|
@@ -13,10 +13,8 @@ import { useConnection } from '../../context/ConnectionContext'
|
|
|
13
13
|
import { getSecretStoreProviderType } from '@skyhook-io/k8s-ui'
|
|
14
14
|
import { usePinnedKinds } from '../../hooks/useFavorites'
|
|
15
15
|
import { useResourceCounts } from '../../hooks/useResourceCounts'
|
|
16
|
-
import {
|
|
17
|
-
import { useVeleroSidebarWorkspace } from '../velero/useVeleroSidebarWorkspace'
|
|
16
|
+
import { useIntegrationSidebars } from '../../integrations/sidebarWorkspaces'
|
|
18
17
|
import { isVeleroBackupKind } from '../velero/routes'
|
|
19
|
-
import { useMergedSidebarWorkspaces } from '../workspace/sidebar'
|
|
20
18
|
import { renderResourceKindList, resourceKindListMode, useResourceHostFeatures } from '../../integrations/resourceHosts'
|
|
21
19
|
import { useOpenLogs, useOpenWorkloadLogs } from '../dock'
|
|
22
20
|
import {
|
|
@@ -137,9 +135,7 @@ export function ResourcesView({ namespaces, selectedResource, onResourceClick, o
|
|
|
137
135
|
}
|
|
138
136
|
return result
|
|
139
137
|
}, [issuesData])
|
|
140
|
-
const
|
|
141
|
-
const veleroSidebarWorkspace = useVeleroSidebarWorkspace({ apiResources })
|
|
142
|
-
const sidebarCategoryWorkspaces = useMergedSidebarWorkspaces(cnpgSidebarWorkspace, veleroSidebarWorkspace)
|
|
138
|
+
const sidebarCategoryWorkspaces = useIntegrationSidebars({ apiResources, namespaces, cnpg: { withMetrics: selectedKind?.group === 'postgresql.cnpg.io' } })
|
|
143
139
|
const workloadWrites = namespaces.length === 0
|
|
144
140
|
? capabilities?.workloadWrites
|
|
145
141
|
: namespaces.length === 1
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
1
2
|
import { JobRenderer as BaseJobRenderer } from '@skyhook-io/k8s-ui/components/resources/renderers/JobRenderer'
|
|
2
3
|
import { JobSetRenderer as BaseJobSetRenderer } from '@skyhook-io/k8s-ui/components/resources/renderers/JobSetRenderer'
|
|
3
4
|
import type { ResourceRef } from '@skyhook-io/k8s-ui'
|
|
4
5
|
import { KueueAdmission } from '../../execution/JobSetAdmission'
|
|
5
6
|
|
|
6
|
-
type Props = { data: any; onNavigate?: (ref: ResourceRef) => void }
|
|
7
|
+
type Props = { data: any; onNavigate?: (ref: ResourceRef) => void; sourceSection?: ReactNode }
|
|
7
8
|
|
|
8
|
-
export function JobRenderer({ data, onNavigate }: Props) {
|
|
9
|
-
if (data.apiVersion !== 'batch/v1' || data.kind !== 'Job') return <BaseJobRenderer data={data} />
|
|
9
|
+
export function JobRenderer({ data, onNavigate, sourceSection }: Props) {
|
|
10
|
+
if (data.apiVersion !== 'batch/v1' || data.kind !== 'Job') return <BaseJobRenderer data={data} sourceSection={sourceSection} />
|
|
10
11
|
return <KueueAdmission presentation="drawer" resource={data} namespace={data.metadata.namespace} name={data.metadata.name} onNavigate={onNavigate}>
|
|
11
|
-
{(admissionContent, kueueManaged) => <BaseJobRenderer data={data} admissionContent={admissionContent} kueueManaged={kueueManaged} />}
|
|
12
|
+
{(admissionContent, kueueManaged) => <BaseJobRenderer data={data} admissionContent={admissionContent} kueueManaged={kueueManaged} sourceSection={sourceSection} />}
|
|
12
13
|
</KueueAdmission>
|
|
13
14
|
}
|
|
14
15
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { connectionHeaderValue } from '../../../api/connectionBinding'
|
|
2
2
|
import { usePodDetailAccess } from '../PodDebugAction'
|
|
3
3
|
import { getApiBase } from '../../../api/config'
|
|
4
|
+
import { SUBSTRATE_WORKER_POOL_LABEL } from '@skyhook-io/k8s-ui/components/resources/resource-utils-agent-runtimes'
|
|
5
|
+
import { SubstrateWorkerPodContext } from '../../substrate/SubstrateWorkerPodContext'
|
|
4
6
|
import { hasPrometheusCharts } from '../../../api/prometheusCharts'
|
|
5
7
|
import { PodRenderer as BasePodRenderer } from '@skyhook-io/k8s-ui/components/resources/renderers/PodRenderer'
|
|
6
8
|
import type { CopyHandler } from '@skyhook-io/k8s-ui/components/ui/drawer-components'
|
|
@@ -10,7 +12,7 @@ import { useMemo } from 'react'
|
|
|
10
12
|
import { useNavigate } from 'react-router-dom'
|
|
11
13
|
import { useOpenTerminal, useOpenLogs } from '../../dock'
|
|
12
14
|
import { useCapabilitiesContext, useNamespacedCapabilities, useIsLocalDeployment } from '../../../contexts/CapabilitiesContext'
|
|
13
|
-
import { getVisibleLiveMetrics, isLiveMetricsUnavailable, shouldFetchLiveMetrics, usePodEnvironment, usePodMetrics, usePodMetricsHistory, usePrometheusResourceMetrics, usePrometheusStatus, useResourceEvents, useResources, useRevealPodEnvironment } from '../../../api/client'
|
|
15
|
+
import { getVisibleLiveMetrics, isLiveMetricsUnavailable, shouldFetchLiveMetrics, usePodEnvironment, usePodMetrics, usePodMetricsHistory, usePrometheusResourceMetrics, usePrometheusStatus, useRadarFeature, useResourceEvents, useResources, useRevealPodEnvironment } from '../../../api/client'
|
|
14
16
|
import { toSecretsStoreRead } from '../../../api/secretsStore'
|
|
15
17
|
import {
|
|
16
18
|
SECRETS_STORE_GROUP, SECRET_PROVIDER_CLASSES, SECRET_PROVIDER_CLASS_POD_STATUSES, getSecretsStoreVolumes,
|
|
@@ -26,6 +28,7 @@ import { PodFilesystemModal } from '../PodFilesystemModal'
|
|
|
26
28
|
|
|
27
29
|
interface PodRendererProps {
|
|
28
30
|
data: any
|
|
31
|
+
expanded?: boolean
|
|
29
32
|
onCopy: CopyHandler
|
|
30
33
|
copied: string | null
|
|
31
34
|
onNavigate?: (ref: { kind: string; namespace: string; name: string }) => void
|
|
@@ -33,9 +36,11 @@ interface PodRendererProps {
|
|
|
33
36
|
resolvedEnvFrom?: ResolvedEnvFrom
|
|
34
37
|
}
|
|
35
38
|
|
|
36
|
-
export function PodRenderer({ data, onCopy, copied, onNavigate, onOpenLogs, resolvedEnvFrom }: PodRendererProps) {
|
|
39
|
+
export function PodRenderer({ data, expanded, onCopy, copied, onNavigate, onOpenLogs, resolvedEnvFrom }: PodRendererProps) {
|
|
37
40
|
const namespace = data.metadata?.namespace
|
|
38
41
|
const podName = data.metadata?.name
|
|
42
|
+
const { support: substrateWorkspace } = useRadarFeature('substrateWorkspace')
|
|
43
|
+
const substratePool = data.metadata?.labels?.[SUBSTRATE_WORKER_POOL_LABEL]
|
|
39
44
|
const isTerminal = data.status?.phase === 'Succeeded' || data.status?.phase === 'Failed'
|
|
40
45
|
const environmentEnabled = [...(data.spec?.initContainers ?? []), ...(data.spec?.containers ?? [])]
|
|
41
46
|
.some((container: any) => container.env?.length > 0 || container.envFrom?.length > 0)
|
|
@@ -106,6 +111,7 @@ export function PodRenderer({ data, onCopy, copied, onNavigate, onOpenLogs, reso
|
|
|
106
111
|
return (
|
|
107
112
|
<BasePodRenderer
|
|
108
113
|
data={data}
|
|
114
|
+
substrateWorkerContext={substrateWorkspace !== 'unsupported' && substratePool && namespace && podName ? <SubstrateWorkerPodContext namespace={namespace} pool={substratePool} pod={podName} resource={data} framed={expanded} /> : undefined}
|
|
109
115
|
onCopy={onCopy}
|
|
110
116
|
copied={copied}
|
|
111
117
|
onNavigate={onNavigate}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
1
2
|
import { RolloutRenderer as BaseRolloutRenderer } from '@skyhook-io/k8s-ui/components/resources/renderers/RolloutRenderer'
|
|
2
3
|
import {
|
|
3
4
|
useRolloutAction,
|
|
@@ -11,9 +12,10 @@ import {
|
|
|
11
12
|
interface RolloutRendererProps {
|
|
12
13
|
data: any
|
|
13
14
|
onNavigate?: (ref: { kind: string; namespace: string; name: string }) => void
|
|
15
|
+
sourceSection?: ReactNode
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
export function RolloutRenderer({ data, onNavigate }: RolloutRendererProps) {
|
|
18
|
+
export function RolloutRenderer({ data, onNavigate, sourceSection }: RolloutRendererProps) {
|
|
17
19
|
const namespace = data?.metadata?.namespace ?? ''
|
|
18
20
|
const name = data?.metadata?.name ?? ''
|
|
19
21
|
const { data: capabilities } = useRolloutCapabilities(namespace, name)
|
|
@@ -33,6 +35,7 @@ export function RolloutRenderer({ data, onNavigate }: RolloutRendererProps) {
|
|
|
33
35
|
analysisRunHistoryError={analysisRunsError}
|
|
34
36
|
revisions={revisions}
|
|
35
37
|
pods={podsResponse?.pods}
|
|
38
|
+
sourceSection={sourceSection}
|
|
36
39
|
/>
|
|
37
40
|
)
|
|
38
41
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
1
2
|
import { WorkloadRenderer as BaseWorkloadRenderer } from '@skyhook-io/k8s-ui/components/resources/renderers/WorkloadRenderer'
|
|
2
3
|
import { useNavigate } from 'react-router-dom'
|
|
3
4
|
import { useScaleWorkload, fetchJSON } from '../../../api/client'
|
|
@@ -34,9 +35,10 @@ interface WorkloadRendererProps {
|
|
|
34
35
|
relationships?: Relationships
|
|
35
36
|
scaleBlockedBy?: ResourceRef[]
|
|
36
37
|
workloadPods?: WorkloadPodInfo[]
|
|
38
|
+
sourceSection?: ReactNode
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
export function WorkloadRenderer({ kind, data, onNavigate, scaleBlockedBy, workloadPods }: WorkloadRendererProps) {
|
|
41
|
+
export function WorkloadRenderer({ kind, data, onNavigate, scaleBlockedBy, workloadPods, sourceSection }: WorkloadRendererProps) {
|
|
40
42
|
const navigate = useNavigate()
|
|
41
43
|
const queryClient = useQueryClient()
|
|
42
44
|
const scaleMutation = useScaleWorkload()
|
|
@@ -102,6 +104,7 @@ export function WorkloadRenderer({ kind, data, onNavigate, scaleBlockedBy, workl
|
|
|
102
104
|
rbacData={rbacData ?? null}
|
|
103
105
|
rbacLoading={rbacLoading}
|
|
104
106
|
rbacError={rbacError as Error | null}
|
|
107
|
+
sourceSection={sourceSection}
|
|
105
108
|
policyData={policyData ?? null}
|
|
106
109
|
policyLoading={policyLoading}
|
|
107
110
|
policyError={policyError as Error | null}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useOpenCostSummary, usePrometheusStatus, type useArgoStatus } from '../../api/client'
|
|
1
|
+
import { useMetricsRelayChecking, useOpenCostSummary, usePrometheusStatus, type useArgoStatus } from '../../api/client'
|
|
2
2
|
import { costIntegrationUnavailableMessage, costSourceLabel } from '../cost/source'
|
|
3
3
|
import { metricsSourceLine, sourceNote } from './openobserveStatus'
|
|
4
4
|
import type { IntegrationKind, IntegrationProfile } from './LocalConnectionSettings'
|
|
@@ -14,10 +14,11 @@ export function LocalIntegrationStatus({ kind, profile, argo, busy, changedAt }:
|
|
|
14
14
|
}) {
|
|
15
15
|
const prom = usePrometheusStatus(kind === 'metrics')
|
|
16
16
|
const cost = useOpenCostSummary(kind === 'cost')
|
|
17
|
+
const metricsChecking = useMetricsRelayChecking()
|
|
17
18
|
const query = kind === 'metrics' ? prom : kind === 'cost' ? cost : argo
|
|
18
19
|
// Background polls keep the last status; only the first load, or a result
|
|
19
20
|
// older than the latest saved integration change, reads as "Checking…".
|
|
20
|
-
const checking = busy || query.isPlaceholderData || (query.isFetching && !query.data) ||
|
|
21
|
+
const checking = busy || (kind === 'metrics' && metricsChecking) || query.isPlaceholderData || (query.isFetching && !query.data) ||
|
|
21
22
|
Math.max(query.dataUpdatedAt, query.errorUpdatedAt) < changedAt
|
|
22
23
|
let status = 'Checking…'
|
|
23
24
|
let detail: string | undefined
|