@skyhook-io/radar-app 1.22.2 → 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 +35 -10
- 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 +122 -24
- 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 +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 +127 -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/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/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/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/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 +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
|
@@ -6,6 +6,14 @@ import { DialogPortal } from '@skyhook-io/k8s-ui/components/ui/DialogPortal'
|
|
|
6
6
|
import { Tooltip } from './ui/Tooltip'
|
|
7
7
|
import { CloudConnectFlow } from './CloudConnectFlow'
|
|
8
8
|
import { SelfManagedStart } from './SelfManagedStart'
|
|
9
|
+
import {
|
|
10
|
+
type CloudHintEntry,
|
|
11
|
+
type CloudHintSubject,
|
|
12
|
+
OPEN_CLOUD_FUNNEL_EVENT,
|
|
13
|
+
readOpenRequest,
|
|
14
|
+
withCloudHintEntry,
|
|
15
|
+
} from './cloudHints/cloudHints'
|
|
16
|
+
import { cloudResourceUrl } from './cloudHints/cloudLinks'
|
|
9
17
|
import {
|
|
10
18
|
type Handoff,
|
|
11
19
|
exitFor,
|
|
@@ -64,15 +72,8 @@ const DEFAULT_ASSURANCES = [
|
|
|
64
72
|
'SOC 2 Type II · SSO & SCIM on Enterprise',
|
|
65
73
|
'3 clusters free, no card required',
|
|
66
74
|
]
|
|
67
|
-
// Other
|
|
68
|
-
|
|
69
|
-
// is one pitch and one flow. The button is mounted whenever Radar runs
|
|
70
|
-
// standalone; embedded hosts never mount it and never dispatch this.
|
|
71
|
-
const OPEN_EVENT = 'radar:open-cloud-funnel'
|
|
72
|
-
|
|
73
|
-
export function openCloudFunnel() {
|
|
74
|
-
window.dispatchEvent(new Event(OPEN_EVENT))
|
|
75
|
-
}
|
|
75
|
+
// Other surfaces open this dialog through openCloudFunnel (see cloudHints).
|
|
76
|
+
export { openCloudFunnel } from './cloudHints/cloudHints'
|
|
76
77
|
const ABOUT_URL = 'https://radarhq.io/about'
|
|
77
78
|
const BENCHMARK_URL = 'https://radarhq.io/benchmark'
|
|
78
79
|
const PRICING_URL = 'https://radarhq.io/pricing'
|
|
@@ -126,6 +127,11 @@ export function CloudFunnelButton() {
|
|
|
126
127
|
// and is reset below when the kubeconfig context changes — it must never
|
|
127
128
|
// describe a cluster the user has switched away from.
|
|
128
129
|
const [handoff, setHandoff] = useState<Handoff | null>(null)
|
|
130
|
+
// Which in-context hint opened the dialog, and for a share the resource it
|
|
131
|
+
// was about. Both last for one open: the globe button, or the next hint,
|
|
132
|
+
// starts clean.
|
|
133
|
+
const [entry, setEntry] = useState<CloudHintEntry | null>(null)
|
|
134
|
+
const [subject, setSubject] = useState<CloudHintSubject | null>(null)
|
|
129
135
|
const prepareFailed = handoff?.retryable ?? false
|
|
130
136
|
|
|
131
137
|
const capabilities = useCapabilities()
|
|
@@ -138,7 +144,8 @@ export function CloudFunnelButton() {
|
|
|
138
144
|
// the user opens; Radar sends nothing on its own. Only the blocked card may
|
|
139
145
|
// deep-link the install page (see exitFor); the pitch buttons and the
|
|
140
146
|
// footer link go to signup.
|
|
141
|
-
const
|
|
147
|
+
const tag = (url: string) => withCloudHintEntry(url, entry)
|
|
148
|
+
const signupUrl = tag(buildSignupUrl(appUrl, 'wizard-signup-button'))
|
|
142
149
|
|
|
143
150
|
// Only while the dialog is open — never on the capabilities poll. The Hub
|
|
144
151
|
// learns that someone opened it, which is congruent with what the dialog is
|
|
@@ -146,6 +153,7 @@ export function CloudFunnelButton() {
|
|
|
146
153
|
const connectInfo = useCloudConnectInfo(capabilities.data?.cloudConnect?.apiUrl, open, {
|
|
147
154
|
lane: pitchLane,
|
|
148
155
|
mode: capabilities.data?.deployment?.mode,
|
|
156
|
+
entry,
|
|
149
157
|
})
|
|
150
158
|
|
|
151
159
|
// In-cluster Radar can't install its own connection, but it knows exactly
|
|
@@ -225,9 +233,12 @@ export function CloudFunnelButton() {
|
|
|
225
233
|
// a running install. Toast explicitly on the paths that are failures.
|
|
226
234
|
})
|
|
227
235
|
|
|
228
|
-
const openModal = () => {
|
|
236
|
+
const openModal = (event?: Event) => {
|
|
237
|
+
const request = event ? readOpenRequest(event) : { entry: null, subject: null, view: 'pitch' }
|
|
238
|
+
setEntry(request.entry)
|
|
239
|
+
setSubject(request.subject)
|
|
229
240
|
setOpen(true)
|
|
230
|
-
setSelfManaged(
|
|
241
|
+
setSelfManaged(request.view === 'self-managed')
|
|
231
242
|
setSeen(true)
|
|
232
243
|
markSeen()
|
|
233
244
|
// Re-open lands on a live flow if one is running.
|
|
@@ -284,8 +295,8 @@ export function CloudFunnelButton() {
|
|
|
284
295
|
}
|
|
285
296
|
|
|
286
297
|
useEffect(() => {
|
|
287
|
-
window.addEventListener(
|
|
288
|
-
return () => window.removeEventListener(
|
|
298
|
+
window.addEventListener(OPEN_CLOUD_FUNNEL_EVENT, openModal)
|
|
299
|
+
return () => window.removeEventListener(OPEN_CLOUD_FUNNEL_EVENT, openModal)
|
|
289
300
|
})
|
|
290
301
|
|
|
291
302
|
// Re-attach to a server-owned flow whenever one is observed while the modal
|
|
@@ -312,6 +323,28 @@ export function CloudFunnelButton() {
|
|
|
312
323
|
// flashing at a connected cluster's operator before that answer arrives.
|
|
313
324
|
if (!capabilities.data?.cloudConnect) return null
|
|
314
325
|
|
|
326
|
+
const tagExit = (exit: ReturnType<typeof exitFor>) => ({ ...exit, href: tag(exit.href) })
|
|
327
|
+
// Opened to share one resource: once Radar knows the Radar Cloud cluster
|
|
328
|
+
// (already connected, or connected just now), the main action goes straight
|
|
329
|
+
// to that resource in Cloud instead of the cluster's front page. Only when
|
|
330
|
+
// that Cloud cluster is the subject's own: the same name on another cluster
|
|
331
|
+
// is a different resource. clusterContext is where clusterUrl came from:
|
|
332
|
+
// discovery runs on the current context, but an install flow keeps the
|
|
333
|
+
// context it started on across a switch.
|
|
334
|
+
const intentAction = (
|
|
335
|
+
clusterUrl: string | undefined,
|
|
336
|
+
clusterContext: string | undefined,
|
|
337
|
+
): { label: string; href: string } | null => {
|
|
338
|
+
if (!subject || !clusterUrl || !clusterContext) return null
|
|
339
|
+
if (subject.context !== clusterContext) return null
|
|
340
|
+
const href = cloudResourceUrl(clusterUrl, subject)
|
|
341
|
+
return href ? { label: `Open ${subject.name} in Radar Cloud`, href: tag(href) } : null
|
|
342
|
+
}
|
|
343
|
+
const connectedIntent = intentAction(alreadyConnected?.clusterUrl, contextName)
|
|
344
|
+
// The share body describes the subject's cluster while the footer connects
|
|
345
|
+
// the current one, so after a switch the dialog falls back to the pitch.
|
|
346
|
+
const shareSubject = subject && subject.context === contextName ? subject : null
|
|
347
|
+
|
|
315
348
|
const showFlow = inFlowView && (blocked !== null || prepare.isPending || flowLive)
|
|
316
349
|
// The prepare POST can take tens of seconds (chart download + preflight);
|
|
317
350
|
// until the status poll observes the server-side flow, synthesize the
|
|
@@ -340,7 +373,7 @@ export function CloudFunnelButton() {
|
|
|
340
373
|
disabled={open}
|
|
341
374
|
>
|
|
342
375
|
<button
|
|
343
|
-
onClick={openModal}
|
|
376
|
+
onClick={() => openModal()}
|
|
344
377
|
aria-label="Radar Cloud"
|
|
345
378
|
aria-haspopup="dialog"
|
|
346
379
|
className="relative p-1.5 rounded-md bg-theme-elevated hover:bg-theme-hover text-theme-text-secondary hover:text-theme-text-primary transition-colors"
|
|
@@ -375,7 +408,9 @@ export function CloudFunnelButton() {
|
|
|
375
408
|
{/* Only the body scrolls on short viewports — the close control and
|
|
376
409
|
the footer CTA stay pinned so they never scroll away. This matters
|
|
377
410
|
more with the connect flow, whose plan card is the tallest state. */}
|
|
378
|
-
{
|
|
411
|
+
{/* A request for the Self-Managed view wins over a hosted install in
|
|
412
|
+
progress; that install continues, and Back returns to it. */}
|
|
413
|
+
{!selfManaged && showFlow && flowForView ? (
|
|
379
414
|
<div className="min-h-0 overflow-y-auto">
|
|
380
415
|
<div className="px-8 pt-7">
|
|
381
416
|
<Eyebrow />
|
|
@@ -383,7 +418,9 @@ export function CloudFunnelButton() {
|
|
|
383
418
|
<CloudConnectFlow
|
|
384
419
|
status={flowForView}
|
|
385
420
|
blocked={blocked}
|
|
386
|
-
exit={exitFor(appUrl, 'driver-blocked-card-browser-link', outcomeOf(flowForView), clusterInfo.data?.context)}
|
|
421
|
+
exit={tagExit(exitFor(appUrl, 'driver-blocked-card-browser-link', outcomeOf(flowForView), clusterInfo.data?.context))}
|
|
422
|
+
tagUrl={tag}
|
|
423
|
+
connectedAction={(connected) => intentAction(connected.clusterUrl, flowForView.plan?.contextName)}
|
|
387
424
|
where={{ context: clusterInfo.data?.context, cluster: clusterInfo.data?.cluster }}
|
|
388
425
|
onStatus={applyStatus}
|
|
389
426
|
onExit={() => exitFlow(outcomeOf(flowForView))}
|
|
@@ -394,12 +431,16 @@ export function CloudFunnelButton() {
|
|
|
394
431
|
<div className="shrink-0 px-8 pt-7">
|
|
395
432
|
<Eyebrow />
|
|
396
433
|
</div>
|
|
397
|
-
<SelfManagedStart appUrl={appUrl} onBack={() => setSelfManaged(false)} />
|
|
434
|
+
<SelfManagedStart appUrl={appUrl} tagUrl={tag} onBack={() => setSelfManaged(false)} />
|
|
398
435
|
</>
|
|
399
436
|
) : (
|
|
400
437
|
<>
|
|
401
438
|
<div className="min-h-0 overflow-y-auto">
|
|
402
|
-
|
|
439
|
+
{shareSubject ? (
|
|
440
|
+
<ShareBody subject={shareSubject} connected={lane === 'driver' && !!alreadyConnected} />
|
|
441
|
+
) : (
|
|
442
|
+
<PitchBody lane={pitchLane} freeTier={connectInfo.data?.freeTier} />
|
|
443
|
+
)}
|
|
403
444
|
</div>
|
|
404
445
|
<ModalFooter
|
|
405
446
|
lane={lane}
|
|
@@ -407,18 +448,20 @@ export function CloudFunnelButton() {
|
|
|
407
448
|
signupUrl={signupUrl}
|
|
408
449
|
// One link name whether or not an attempt preceded the click; the
|
|
409
450
|
// outcome, when present, is what says an attempt happened.
|
|
410
|
-
driverBrowserUrl={buildSignupUrl(appUrl, 'driver-footer-browser-link', handoff)}
|
|
451
|
+
driverBrowserUrl={tag(buildSignupUrl(appUrl, 'driver-footer-browser-link', handoff))}
|
|
411
452
|
prepareFailed={prepareFailed}
|
|
412
453
|
// A prepare error's reason, kept on the pitch after its toast is gone.
|
|
413
454
|
prepareError={handoff?.detail}
|
|
414
455
|
assurances={connectInfo.data?.assurances}
|
|
415
456
|
notice={connectInfo.data?.notice}
|
|
416
|
-
self={inCluster ? self.data : undefined}
|
|
457
|
+
self={inCluster && self.data ? { ...self.data, wizardUrl: self.data.wizardUrl && tag(self.data.wizardUrl) } : undefined}
|
|
417
458
|
clusterName={clusterInfo.data?.context}
|
|
418
|
-
alreadyConnected={alreadyConnected}
|
|
459
|
+
alreadyConnected={alreadyConnected && { ...alreadyConnected, clusterUrl: alreadyConnected.clusterUrl && tag(alreadyConnected.clusterUrl) }}
|
|
460
|
+
connectedIntent={connectedIntent}
|
|
461
|
+
quiet={!!shareSubject}
|
|
419
462
|
connectedCount={alreadyConnected ? (discovered.data?.connected.length ?? 0) : 0}
|
|
420
463
|
discoverPending={discoverPending}
|
|
421
|
-
clustersUrl={`${appUrl}/clusters`}
|
|
464
|
+
clustersUrl={tag(`${appUrl}/clusters`)}
|
|
422
465
|
// Also covers the capabilities query: until it resolves, lane
|
|
423
466
|
// defaults to wizard and Radar does not yet know it is
|
|
424
467
|
// in-cluster, so the CTA would escape before classification.
|
|
@@ -481,6 +524,8 @@ function ModalFooter({
|
|
|
481
524
|
connectedCount = 0,
|
|
482
525
|
discoverPending = false,
|
|
483
526
|
clustersUrl,
|
|
527
|
+
connectedIntent,
|
|
528
|
+
quiet = false,
|
|
484
529
|
onConnect,
|
|
485
530
|
onSelfManaged,
|
|
486
531
|
onLater,
|
|
@@ -514,6 +559,12 @@ function ModalFooter({
|
|
|
514
559
|
// The configured Hub's clusters list — where to look when an install's
|
|
515
560
|
// settings say it is connected but not where.
|
|
516
561
|
clustersUrl?: string
|
|
562
|
+
// Opened to share a resource and this cluster is already in Radar Cloud: go
|
|
563
|
+
// straight to that resource there.
|
|
564
|
+
connectedIntent?: { label: string; href: string } | null
|
|
565
|
+
// Opened to share one resource: the dialog stays about that, so it carries
|
|
566
|
+
// no assurance ticks.
|
|
567
|
+
quiet?: boolean
|
|
517
568
|
onConnect: () => void
|
|
518
569
|
onSelfManaged: () => void
|
|
519
570
|
onLater: () => void
|
|
@@ -606,12 +657,12 @@ function ModalFooter({
|
|
|
606
657
|
// Another Hub is named, not linked: the link would open ours.
|
|
607
658
|
!alreadyConnected.hubHost && (
|
|
608
659
|
<a
|
|
609
|
-
href={alreadyConnected.clusterUrl || clustersUrl}
|
|
660
|
+
href={connectedIntent?.href ?? (alreadyConnected.clusterUrl || clustersUrl)}
|
|
610
661
|
target="_blank"
|
|
611
662
|
rel="noopener noreferrer"
|
|
612
663
|
className="whitespace-nowrap px-6 py-2.5 rounded-[10px] bg-emerald-500 hover:bg-emerald-400 text-emerald-950 text-[14px] font-bold shadow-[0_0_22px_rgba(16,185,129,0.35)] hover:shadow-[0_0_30px_rgba(16,185,129,0.5)] hover:-translate-y-px transition-all"
|
|
613
664
|
>
|
|
614
|
-
{alreadyConnected.clusterUrl ? 'Open in Radar Cloud' : 'Open Radar Cloud'}
|
|
665
|
+
{connectedIntent?.label ?? (alreadyConnected.clusterUrl ? 'Open in Radar Cloud' : 'Open Radar Cloud')}
|
|
615
666
|
</a>
|
|
616
667
|
)
|
|
617
668
|
) : lane === 'driver' && clusterConnected ? (
|
|
@@ -688,14 +739,58 @@ function ModalFooter({
|
|
|
688
739
|
share a single row with the other three at this width, and flex
|
|
689
740
|
wrapping strands it as a 3+1 orphan. Two balanced columns read as a
|
|
690
741
|
designed layout at any chip length the Hub sends. */}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
<
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
742
|
+
{!quiet && (
|
|
743
|
+
<div className="mt-5 grid grid-cols-2 gap-x-3 gap-y-2 text-[11px] text-theme-text-tertiary">
|
|
744
|
+
{assuranceItems(assurances).map((item) => (
|
|
745
|
+
<span key={item} className="flex items-center gap-1">
|
|
746
|
+
<Check className="w-3 h-3 shrink-0 text-emerald-600 dark:text-emerald-400" />
|
|
747
|
+
{item}
|
|
748
|
+
</span>
|
|
749
|
+
))}
|
|
750
|
+
</div>
|
|
751
|
+
)}
|
|
752
|
+
</div>
|
|
753
|
+
)
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
// Opened to share one resource: the same dialog and footer, with a body about
|
|
757
|
+
// sharing it instead of the general pitch. It says where the link works and
|
|
758
|
+
// for whom, and nothing about how the connection works; the footer carries
|
|
759
|
+
// that for the lane.
|
|
760
|
+
function ShareBody({ subject, connected }: { subject: CloudHintSubject; connected: boolean }) {
|
|
761
|
+
const chips = [
|
|
762
|
+
`${subject.kind} ${subject.name}`,
|
|
763
|
+
subject.namespace ? `namespace ${subject.namespace}` : undefined,
|
|
764
|
+
subject.context,
|
|
765
|
+
].filter((c): c is string => !!c)
|
|
766
|
+
return (
|
|
767
|
+
<div className="px-8 pt-7 pb-4">
|
|
768
|
+
<Eyebrow />
|
|
769
|
+
<h3 className="flex items-center gap-2.5 text-[20px] font-semibold leading-tight tracking-tight text-theme-text-primary mb-4">
|
|
770
|
+
<Users className="w-5 h-5 shrink-0 text-emerald-600 dark:text-emerald-400" />
|
|
771
|
+
{`Share ${subject.name} with your team`}
|
|
772
|
+
</h3>
|
|
773
|
+
<div className="card-inner p-3 mb-4">
|
|
774
|
+
<div className="text-[10.5px] font-semibold uppercase tracking-[0.08em] text-theme-text-tertiary mb-2">Resource</div>
|
|
775
|
+
<div className="flex flex-wrap gap-1.5">
|
|
776
|
+
{chips.map((chip) => (
|
|
777
|
+
<span key={chip} className="rounded-md bg-theme-elevated px-2 py-0.5 text-[12px] text-theme-text-primary">
|
|
778
|
+
{chip}
|
|
779
|
+
</span>
|
|
780
|
+
))}
|
|
781
|
+
</div>
|
|
698
782
|
</div>
|
|
783
|
+
<p className="text-[13.5px] leading-relaxed text-theme-text-secondary">
|
|
784
|
+
In <b className="font-semibold text-theme-text-primary">Radar Cloud</b>, anyone on your team can open this link. They see what
|
|
785
|
+
their RBAC allows.
|
|
786
|
+
</p>
|
|
787
|
+
{/* Sharing starts by connecting the whole cluster, so say what that keeps,
|
|
788
|
+
as the general pitch does. */}
|
|
789
|
+
{!connected && (
|
|
790
|
+
<p className="mt-2.5 text-[12.5px] leading-relaxed text-theme-text-tertiary">
|
|
791
|
+
Connecting the cluster lets Radar Cloud store its event history, changes and investigation results.
|
|
792
|
+
</p>
|
|
793
|
+
)}
|
|
699
794
|
</div>
|
|
700
795
|
)
|
|
701
796
|
}
|
|
@@ -8,8 +8,18 @@ import { SELF_HOSTED_DOCS_URL, signupUrlFor } from './cloudConnectHandoff'
|
|
|
8
8
|
// it themselves. The link carries intent=self-hosting: the Hub's sign-in page
|
|
9
9
|
// repeats the steps and, after sign-up or sign-in, continues on its
|
|
10
10
|
// Self-hosting page, where the trial, the license and the install command are.
|
|
11
|
-
export function SelfManagedStart({
|
|
12
|
-
|
|
11
|
+
export function SelfManagedStart({
|
|
12
|
+
appUrl,
|
|
13
|
+
tagUrl = (url) => url,
|
|
14
|
+
onBack,
|
|
15
|
+
}: {
|
|
16
|
+
appUrl: string
|
|
17
|
+
// The dialog's own link tagging (which hint opened it), so this link says
|
|
18
|
+
// the same as the pitch's.
|
|
19
|
+
tagUrl?: (url: string) => string
|
|
20
|
+
onBack: () => void
|
|
21
|
+
}) {
|
|
22
|
+
const signupUrl = tagUrl(`${signupUrlFor(appUrl, 'self-managed-signup')}&intent=self-hosting`)
|
|
13
23
|
const steps = [
|
|
14
24
|
{
|
|
15
25
|
title: 'Create your Radar Cloud account',
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useMemo, type ComponentType } from 'react'
|
|
2
|
+
import type { HostKind, KindListProps } from '../../integrations/resourceHost'
|
|
3
|
+
import { useAPIResources } from '../../api/apiResources'
|
|
4
|
+
import { useRadarFeature } from '../../api/client'
|
|
5
|
+
import { useAgentSandboxWorkspace } from '../../api/agentSandbox'
|
|
6
|
+
import { serverReadings, type ServerReadings } from './labels'
|
|
7
|
+
import { agentSandboxDiscovered, useAgentSandboxLists, type AgentSandboxListKey } from './data'
|
|
8
|
+
import { SANDBOX_CLAIM_KIND, SANDBOX_KIND, SANDBOX_WARM_POOL_KIND } from './routes'
|
|
9
|
+
import { AgentSandboxGate, type AgentSandboxScreenProps } from './shared'
|
|
10
|
+
import { ClaimsScreen, SandboxesScreen, WarmPoolsScreen } from './AgentSandboxTables'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* An Agent Sandbox kind's list on its Resources route, as Radar reads it
|
|
14
|
+
* rather than as a bare table, with the namespace filter applied. Rows open
|
|
15
|
+
* the Resources page's drawer.
|
|
16
|
+
*/
|
|
17
|
+
function kindList(Screen: ComponentType<AgentSandboxScreenProps & { onCreate?: () => void; server?: ServerReadings }>, kind: HostKind, keys: readonly AgentSandboxListKey[]) {
|
|
18
|
+
return function AgentSandboxKindList({ namespaces, inspected, onInspect, onClearNamespaces, onCreate }: KindListProps) {
|
|
19
|
+
const { data: apiResources, isPending, isError } = useAPIResources()
|
|
20
|
+
const discovered = agentSandboxDiscovered(apiResources) || isError
|
|
21
|
+
const query = useAgentSandboxLists({ namespaces, apiResources, enabled: discovered })
|
|
22
|
+
// The server's summary (shared with the sidebar's badges) colors each row
|
|
23
|
+
// as its Needs attention row does and says which warm pools can't schedule
|
|
24
|
+
// their sandboxes; an older Radar has none, and the readings stand.
|
|
25
|
+
const { support } = useRadarFeature('agentSandboxWorkspace')
|
|
26
|
+
const summary = useAgentSandboxWorkspace(namespaces, { enabled: discovered && support !== 'unsupported' })
|
|
27
|
+
const attentionPending = support !== 'unsupported' && summary.isPending
|
|
28
|
+
const server = useMemo(() => serverReadings(summary.data), [summary.data])
|
|
29
|
+
return (
|
|
30
|
+
<div className="flex min-h-0 min-w-0 flex-1 flex-col bg-theme-base">
|
|
31
|
+
<AgentSandboxGate data={query.data} keys={keys} discoveryPending={isPending} discovered={discovered} isFetching={query.isFetching} refetch={query.refetch} refreshQueries={query.refreshQueries}>
|
|
32
|
+
<Screen data={query.data} namespaces={namespaces} onClearNamespaces={onClearNamespaces} onInspect={onInspect} inspected={inspected} onCreate={() => onCreate(kind)} server={server} attentionPending={attentionPending} />
|
|
33
|
+
</AgentSandboxGate>
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const SandboxesKindList = kindList(SandboxesScreen, SANDBOX_KIND, ['sandboxes'])
|
|
40
|
+
export const SandboxClaimsKindList = kindList(ClaimsScreen, SANDBOX_CLAIM_KIND, ['claims'])
|
|
41
|
+
export const SandboxWarmPoolsKindList = kindList(WarmPoolsScreen, SANDBOX_WARM_POOL_KIND, ['warmPools'])
|