@skyhook-io/radar-app 1.22.2 → 1.23.1
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 +49 -13
- package/src/RadarApp.basename.test.tsx +177 -0
- package/src/RadarApp.settings.test.tsx +33 -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 +151 -27
- package/src/api/client.updateResource.secretExpiry.test.tsx +47 -0
- 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/poll.ts +78 -0
- package/src/api/prometheusCharts.ts +5 -0
- package/src/api/radarFeatures.test.ts +9 -0
- package/src/api/radarFeatures.ts +16 -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 +315 -0
- package/src/api/workloadSource.ts +128 -12
- package/src/components/CloudConnectFlow.tsx +46 -7
- package/src/components/CloudFunnelButton.test.tsx +193 -7
- package/src/components/CloudFunnelButton.tsx +128 -32
- 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/AgentSetupNotice.tsx +5 -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/gitops/RemoteDestinationCloudHint.tsx +6 -14
- package/src/components/helm/HelmDrawerRouting.test.tsx +34 -1
- package/src/components/helm/HelmReleaseDrawer.tsx +6 -4
- package/src/components/helm/HelmView.tsx +4 -3
- package/src/components/helm/ObservedHelmNotice.tsx +39 -17
- package/src/components/helm/ObservedHelmRelease.test.tsx +62 -3
- package/src/components/helm/ObservedHelmReleaseDrawer.test.tsx +18 -0
- package/src/components/helm/ObservedHelmReleaseDrawer.tsx +4 -2
- package/src/components/home/HomeAgentBlock.tsx +2 -0
- package/src/components/home/HomeView.tsx +3 -3
- 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/mcpToolCatalog.test.ts +10 -0
- package/src/components/home/mcpToolCatalog.ts +4 -4
- 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/issues/uncheckedSources.test.ts +8 -0
- package/src/components/issues/uncheckedSources.ts +3 -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/nudges/activeNudges.test.ts +39 -0
- package/src/components/nudges/activeNudges.ts +76 -0
- package/src/components/poll/OssPoll.tsx +871 -0
- package/src/components/poll/mount.test.ts +12 -0
- package/src/components/poll/pollCloud.test.ts +23 -0
- package/src/components/poll/pollCloud.ts +6 -0
- package/src/components/poll/pollDefinition.ts +93 -0
- package/src/components/poll/pollFlow.test.ts +140 -0
- package/src/components/poll/pollFlow.ts +137 -0
- package/src/components/poll/pollSender.test.ts +137 -0
- package/src/components/poll/pollSender.ts +76 -0
- package/src/components/poll/pollStorage.test.ts +53 -0
- package/src/components/poll/pollStorage.ts +77 -0
- package/src/components/poll/round.json +350 -0
- package/src/components/product-hunt/ProductHuntNotice.tsx +2 -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/ImageFilesystemModal.test.tsx +21 -1
- package/src/components/resources/ImageFilesystemModal.tsx +42 -3
- package/src/components/resources/ResourceDetailDrawer.tsx +1 -0
- package/src/components/resources/ResourcesView.tsx +24 -11
- package/src/components/resources/renderers/PodRenderer.tsx +8 -2
- 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/ui/UpdateNotification.tsx +2 -0
- package/src/components/usage-data/UsageDataPrompt.tsx +2 -0
- 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/whats-new/WhatsNew.tsx +2 -0
- package/src/components/whats-new/releaseNotes.ts +75 -1
- package/src/components/workload/WorkloadView.substrateVersion.test.tsx +88 -0
- package/src/components/workload/WorkloadView.tsx +52 -13
- 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/contexts/RegistryAccessMode.test.tsx +51 -0
- package/src/contexts/RegistryAccessMode.tsx +25 -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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { COOLDOWN_MS, MIN_ACTIVE_DAYS, browserAllows, mergePollState, readPollState, recordActiveDay, writePollState } from './pollStorage'
|
|
3
|
+
|
|
4
|
+
function memoryStorage() {
|
|
5
|
+
const data = new Map<string, string>()
|
|
6
|
+
return { getItem: (k: string) => data.get(k) ?? null, setItem: (k: string, v: string) => void data.set(k, v), data }
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const DAY = 24 * 60 * 60 * 1000
|
|
10
|
+
|
|
11
|
+
describe('browser poll state', () => {
|
|
12
|
+
it('is scoped by API base', () => {
|
|
13
|
+
const s = memoryStorage()
|
|
14
|
+
writePollState(s, '/api', { activeDays: 3 })
|
|
15
|
+
expect(readPollState(s, '/api')?.activeDays).toBe(3)
|
|
16
|
+
expect(readPollState(s, 'https://other/api')?.activeDays).toBe(0)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('treats unavailable storage as "never show"', () => {
|
|
20
|
+
const broken = { getItem: () => { throw new Error('denied') }, setItem: () => { throw new Error('denied') } }
|
|
21
|
+
const state = readPollState(broken, '/api')
|
|
22
|
+
expect(state).toBeNull()
|
|
23
|
+
expect(browserAllows(state, 'r', Date.now())).toBe(false)
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
it('counts days of use, not launches', () => {
|
|
27
|
+
const morning = new Date(2026, 9, 5, 9).getTime()
|
|
28
|
+
let st = recordActiveDay({ activeDays: 0 }, morning)
|
|
29
|
+
st = recordActiveDay(st, morning + 3 * 60 * 60 * 1000)
|
|
30
|
+
expect(st.activeDays).toBe(1)
|
|
31
|
+
st = recordActiveDay(st, morning + DAY)
|
|
32
|
+
expect(st.activeDays).toBe(2)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('never lets a stale tab erase "Don\'t ask again"', () => {
|
|
36
|
+
const s = memoryStorage()
|
|
37
|
+
writePollState(s, '/api', { activeDays: 6, never: true })
|
|
38
|
+
const merged = mergePollState(s, '/api', { submittedRound: 'r', never: false })
|
|
39
|
+
expect(merged?.never).toBe(true)
|
|
40
|
+
expect(readPollState(s, '/api')?.never).toBe(true)
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it('applies never, submitted, cooldown and the days-of-use minimum', () => {
|
|
44
|
+
const now = 10 * COOLDOWN_MS
|
|
45
|
+
const used = { activeDays: MIN_ACTIVE_DAYS }
|
|
46
|
+
expect(browserAllows(used, 'r', now)).toBe(true)
|
|
47
|
+
expect(browserAllows({ ...used, never: true }, 'r', now)).toBe(false)
|
|
48
|
+
expect(browserAllows({ ...used, submittedRound: 'r' }, 'r', now)).toBe(false)
|
|
49
|
+
expect(browserAllows({ ...used, submittedRound: 'old' }, 'r', now)).toBe(true)
|
|
50
|
+
expect(browserAllows({ ...used, lastShownAt: now - COOLDOWN_MS + 1 }, 'r', now)).toBe(false)
|
|
51
|
+
expect(browserAllows({ activeDays: MIN_ACTIVE_DAYS - 1 }, 'r', now)).toBe(false)
|
|
52
|
+
})
|
|
53
|
+
})
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// What one browser remembers about the poll. A Radar one person uses also
|
|
2
|
+
// keeps state on the server; for a shared Radar this is the only place, so one
|
|
3
|
+
// viewer's answer or dismissal never decides for the others.
|
|
4
|
+
|
|
5
|
+
export const COOLDOWN_MS = 90 * 24 * 60 * 60 * 1000
|
|
6
|
+
// Separate days on which Radar was opened in this browser. Mileage, not a
|
|
7
|
+
// launch count: five launches can happen in one afternoon.
|
|
8
|
+
export const MIN_ACTIVE_DAYS = 5
|
|
9
|
+
|
|
10
|
+
export interface BrowserPollState {
|
|
11
|
+
activeDays: number
|
|
12
|
+
lastActiveDay?: string
|
|
13
|
+
lastShownAt?: number
|
|
14
|
+
never?: boolean
|
|
15
|
+
submittedRound?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type StorageLike = Pick<Storage, 'getItem' | 'setItem'>
|
|
19
|
+
|
|
20
|
+
const KEY_PREFIX = 'radar.poll'
|
|
21
|
+
|
|
22
|
+
function keyFor(apiBase: string) {
|
|
23
|
+
return `${KEY_PREFIX}:${apiBase}`
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function readPollState(storage: StorageLike, apiBase: string): BrowserPollState | null {
|
|
27
|
+
try {
|
|
28
|
+
const raw = storage.getItem(keyFor(apiBase))
|
|
29
|
+
if (!raw) return { activeDays: 0 }
|
|
30
|
+
const parsed = JSON.parse(raw)
|
|
31
|
+
return typeof parsed === 'object' && parsed ? { activeDays: 0, ...parsed } : { activeDays: 0 }
|
|
32
|
+
} catch {
|
|
33
|
+
return null
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function writePollState(storage: StorageLike, apiBase: string, state: BrowserPollState): void {
|
|
38
|
+
try {
|
|
39
|
+
storage.setItem(keyFor(apiBase), JSON.stringify(state))
|
|
40
|
+
} catch {
|
|
41
|
+
// Storage denied: the poll simply never shows here.
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function localDay(now: number): string {
|
|
46
|
+
const d = new Date(now)
|
|
47
|
+
return `${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}`
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Counts today as a day of use, once. */
|
|
51
|
+
export function recordActiveDay(state: BrowserPollState, now: number): BrowserPollState {
|
|
52
|
+
const day = localDay(now)
|
|
53
|
+
if (state.lastActiveDay === day) return state
|
|
54
|
+
return { ...state, activeDays: state.activeDays + 1, lastActiveDay: day }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Applies a change on top of what storage holds now, not on top of what this
|
|
59
|
+
* tab read when it loaded. Another tab may have recorded "Don't ask again" in
|
|
60
|
+
* the meantime, and a stale write must not erase it.
|
|
61
|
+
*/
|
|
62
|
+
export function mergePollState(storage: StorageLike, apiBase: string, patch: Partial<BrowserPollState>): BrowserPollState | null {
|
|
63
|
+
const fresh = readPollState(storage, apiBase)
|
|
64
|
+
if (!fresh) return null
|
|
65
|
+
const next = { ...fresh, ...patch, never: fresh.never || patch.never }
|
|
66
|
+
writePollState(storage, apiBase, next)
|
|
67
|
+
return next
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function browserAllows(state: BrowserPollState | null, roundId: string, now: number): boolean {
|
|
71
|
+
if (!state) return false
|
|
72
|
+
if (state.never) return false
|
|
73
|
+
if (state.submittedRound === roundId) return false
|
|
74
|
+
if (state.lastShownAt && now - state.lastShownAt < COOLDOWN_MS) return false
|
|
75
|
+
if (state.activeDays < MIN_ACTIVE_DAYS) return false
|
|
76
|
+
return true
|
|
77
|
+
}
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "2026-12",
|
|
3
|
+
"endsAt": "2027-03-01T00:00:00Z",
|
|
4
|
+
"questions": [
|
|
5
|
+
{
|
|
6
|
+
"id": "q1",
|
|
7
|
+
"kind": "multi",
|
|
8
|
+
"title": "What do you mostly use Radar for?",
|
|
9
|
+
"hint": "Pick any.",
|
|
10
|
+
"textOption": "other",
|
|
11
|
+
"options": [
|
|
12
|
+
{
|
|
13
|
+
"id": "debug",
|
|
14
|
+
"label": "Debugging incidents and broken workloads"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "browse",
|
|
18
|
+
"label": "Day-to-day browsing and editing resources"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "understand",
|
|
22
|
+
"label": "Understanding a cluster I don't know well"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "helm_gitops",
|
|
26
|
+
"label": "Helm and GitOps operations: upgrades, syncs, rollbacks"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "ai_context",
|
|
30
|
+
"label": "Giving AI agents cluster context (MCP, investigations)"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "security",
|
|
34
|
+
"label": "Security checks and vulnerabilities"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "cost",
|
|
38
|
+
"label": "Cost and rightsizing"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "other",
|
|
42
|
+
"label": "Something else"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "role",
|
|
48
|
+
"kind": "single",
|
|
49
|
+
"screen": "about_you",
|
|
50
|
+
"screenTitle": "A bit about you",
|
|
51
|
+
"title": "Your role",
|
|
52
|
+
"options": [
|
|
53
|
+
{
|
|
54
|
+
"id": "developer",
|
|
55
|
+
"label": "Developer"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": "devops_sre",
|
|
59
|
+
"label": "DevOps or SRE"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"id": "platform",
|
|
63
|
+
"label": "Platform engineering"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "manager",
|
|
67
|
+
"label": "Engineering manager or lead"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": "student",
|
|
71
|
+
"label": "Student or hobbyist"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": "other",
|
|
75
|
+
"label": "Other"
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "clusters",
|
|
81
|
+
"kind": "single",
|
|
82
|
+
"screen": "about_you",
|
|
83
|
+
"title": "How many clusters do you work with in a typical week?",
|
|
84
|
+
"options": [
|
|
85
|
+
{
|
|
86
|
+
"id": "one",
|
|
87
|
+
"label": "One"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"id": "two_three",
|
|
91
|
+
"label": "Two or three"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"id": "four_ten",
|
|
95
|
+
"label": "Four to ten"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "more_ten",
|
|
99
|
+
"label": "More than ten"
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "company",
|
|
105
|
+
"kind": "single",
|
|
106
|
+
"screen": "work",
|
|
107
|
+
"screenTitle": "About where you work",
|
|
108
|
+
"title": "How many engineers work at your company?",
|
|
109
|
+
"options": [
|
|
110
|
+
{
|
|
111
|
+
"id": "just_me",
|
|
112
|
+
"label": "Just me"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "2_10",
|
|
116
|
+
"label": "2 to 10"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id": "11_50",
|
|
120
|
+
"label": "11 to 50"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"id": "51_200",
|
|
124
|
+
"label": "51 to 200"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "201_1000",
|
|
128
|
+
"label": "201 to 1,000"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": "1000_plus",
|
|
132
|
+
"label": "More than 1,000"
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"id": "others",
|
|
138
|
+
"kind": "single",
|
|
139
|
+
"screen": "work",
|
|
140
|
+
"title": "Who else at work uses Radar?",
|
|
141
|
+
"options": [
|
|
142
|
+
{
|
|
143
|
+
"id": "just_me",
|
|
144
|
+
"label": "Just me"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "few",
|
|
148
|
+
"label": "A few teammates"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"id": "most_team",
|
|
152
|
+
"label": "Most of my team"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"id": "other_teams",
|
|
156
|
+
"label": "Other teams too"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"id": "not_sure",
|
|
160
|
+
"label": "I'm not sure"
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": "better",
|
|
166
|
+
"kind": "text",
|
|
167
|
+
"title": "What would make Radar better for you?",
|
|
168
|
+
"textPlaceholder": "A missing integration, a slow screen, something you keep going back to kubectl for…",
|
|
169
|
+
"options": []
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"id": "pains",
|
|
173
|
+
"kind": "multi",
|
|
174
|
+
"title": "Which of these happened to you in the past month?",
|
|
175
|
+
"hint": "Pick any.",
|
|
176
|
+
"exclusive": "none",
|
|
177
|
+
"shuffle": true,
|
|
178
|
+
"options": [
|
|
179
|
+
{
|
|
180
|
+
"id": "dig",
|
|
181
|
+
"label": "I dug through pods, events and logs to find why something failed"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"id": "kubectl",
|
|
185
|
+
"label": "I switched to kubectl for something Radar couldn't do"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"id": "slow",
|
|
189
|
+
"label": "Pages loaded slowly on a large cluster"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"id": "found_late",
|
|
193
|
+
"label": "I found out something broke only because someone looked"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"id": "events_gone",
|
|
197
|
+
"label": "The events I needed were gone by the time I looked"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"id": "screenshots",
|
|
201
|
+
"label": "I sent screenshots to show a teammate what I saw"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"id": "kubeconfig",
|
|
205
|
+
"label": "I shared a kubeconfig so someone could take a look"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"id": "one_by_one",
|
|
209
|
+
"label": "I checked clusters one by one to find where something was running"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"id": "none",
|
|
213
|
+
"label": "None of these"
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"id": "discover",
|
|
219
|
+
"kind": "multi",
|
|
220
|
+
"title": "Anything here you didn't know Radar could do?",
|
|
221
|
+
"hint": "Pick any.",
|
|
222
|
+
"exclusive": "knew_all",
|
|
223
|
+
"shuffle": true,
|
|
224
|
+
"options": [
|
|
225
|
+
{
|
|
226
|
+
"id": "mcp",
|
|
227
|
+
"label": "A built-in MCP server to connect your AI agents"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"id": "investigations",
|
|
231
|
+
"label": "AI investigations that find why something broke, run by your local agent CLI (Claude Code, Codex or OpenCode)"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"id": "reachability",
|
|
235
|
+
"label": "Find where traffic to a service breaks"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"id": "upgrade",
|
|
239
|
+
"label": "See what breaks before a Kubernetes upgrade"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"id": "compare",
|
|
243
|
+
"label": "Compare two resources, like staging and prod"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"id": "image_files",
|
|
247
|
+
"label": "Browse files inside a container image"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"id": "audit",
|
|
251
|
+
"label": "Scan the cluster for security and reliability problems"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"id": "rbac",
|
|
255
|
+
"label": "See what a service account can do"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"id": "drain",
|
|
259
|
+
"label": "Preview what a node drain will evict or block"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"id": "gitops_revert",
|
|
263
|
+
"label": "See whether Argo CD or Flux would revert your edit"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"id": "knew_all",
|
|
267
|
+
"label": "I knew all of these"
|
|
268
|
+
}
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"id": "cloud",
|
|
273
|
+
"kind": "single",
|
|
274
|
+
"screen": "cloud",
|
|
275
|
+
"title": "Last one. Have you heard of Radar Cloud, our hosted service for teams?",
|
|
276
|
+
"options": [
|
|
277
|
+
{
|
|
278
|
+
"id": "first_heard",
|
|
279
|
+
"label": "No, this is the first I've heard of it"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"id": "heard",
|
|
283
|
+
"label": "Heard of it, haven't looked"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"id": "looked",
|
|
287
|
+
"label": "Looked into it, haven't tried it"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"id": "tried",
|
|
291
|
+
"label": "Tried it, don't use it now"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"id": "use",
|
|
295
|
+
"label": "We use it"
|
|
296
|
+
}
|
|
297
|
+
]
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"id": "cloud_blocker",
|
|
301
|
+
"kind": "multi",
|
|
302
|
+
"screen": "cloud",
|
|
303
|
+
"title": "What's held you back?",
|
|
304
|
+
"hint": "Pick any.",
|
|
305
|
+
"textOption": "missing",
|
|
306
|
+
"showIf": {
|
|
307
|
+
"question": "cloud",
|
|
308
|
+
"anyOf": [
|
|
309
|
+
"heard",
|
|
310
|
+
"looked",
|
|
311
|
+
"tried"
|
|
312
|
+
]
|
|
313
|
+
},
|
|
314
|
+
"options": [
|
|
315
|
+
{
|
|
316
|
+
"id": "oss_enough",
|
|
317
|
+
"label": "Open-source Radar covers what I need"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"id": "not_relevant",
|
|
321
|
+
"label": "Didn't seem relevant to me"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"id": "cant_connect",
|
|
325
|
+
"label": "Our clusters can't connect to a hosted service (policy, security or air-gapped)"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"id": "not_comfortable",
|
|
329
|
+
"label": "I'm not comfortable connecting our clusters to a hosted service"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"id": "price",
|
|
333
|
+
"label": "The price"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"id": "no_time",
|
|
337
|
+
"label": "Haven't had time"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"id": "buy_in",
|
|
341
|
+
"label": "Needs buy-in from my team or manager"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"id": "missing",
|
|
345
|
+
"label": "Something's missing (tell us)"
|
|
346
|
+
}
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
]
|
|
350
|
+
}
|
|
@@ -7,6 +7,7 @@ import type { UsageDataStatus } from '../../api/usage-data'
|
|
|
7
7
|
import { USAGE_PROMPT_VISIBILITY_EVENT, updateNoticeVisible, usagePromptOnScreen } from '../usage-data/UsageDataPrompt'
|
|
8
8
|
import { useAnimatedUnmount } from '../../hooks/useAnimatedUnmount'
|
|
9
9
|
import { TRANSITION_MENU } from '../../utils/animation'
|
|
10
|
+
import { useNudgeVisible } from '../nudges/activeNudges'
|
|
10
11
|
import { LAUNCH_NOTICE_REOPEN_EVENT, LAUNCH_RAIL_ITEM_ID, isPhaseDismissed, launchDayLabel, launchPhase, launchShownIn, markPhaseDismissed, resolveLaunch, type LaunchPhase, type ProductHuntLaunch } from './launchWindow'
|
|
11
12
|
|
|
12
13
|
// The same tag for every install: it says the click came from inside Radar,
|
|
@@ -95,6 +96,7 @@ export function ProductHuntNotice({ usageData, usageDataPending }: { usageData:
|
|
|
95
96
|
updateNoticeVisible(versionInfo?.latestVersion, versionInfo?.updateAvailable) || usageDataPending || !!usageData?.firstRunPrompt
|
|
96
97
|
))),
|
|
97
98
|
})
|
|
99
|
+
useNudgeVisible('product-hunt', show)
|
|
98
100
|
const { shouldRender, isOpen } = useAnimatedUnmount(show, EXIT_MS)
|
|
99
101
|
// Beside the sidebar's Product Hunt item, growing out of it; the bottom-right
|
|
100
102
|
// corner when the sidebar isn't there (narrow windows, embedded).
|
|
@@ -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', () => {
|