@skyhook-io/radar-app 1.9.4 → 1.9.5
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 +1 -1
- package/src/App.tsx +10 -2
- package/src/api/client.ts +184 -0
- package/src/api/config.test.ts +19 -0
- package/src/components/CloudConnectFlow.tsx +605 -0
- package/src/components/CloudFunnelButton.tsx +499 -0
- package/src/components/ConnectionErrorView.tsx +2 -1
- package/src/components/UserMenu.tsx +3 -2
- package/src/components/diagnose/DiagnoseSurface.tsx +2 -1
- package/src/components/home/ClusterHealthCard.tsx +10 -5
- package/src/components/nav/PrimaryNavRail.tsx +4 -1
- package/src/components/resources/ImageFilesystemModal.tsx +4 -1
- package/src/components/settings/SettingsDialog.tsx +11 -4
- package/src/components/traffic/TrafficWizard.tsx +4 -2
- package/src/main.tsx +7 -1
- package/src/vite-env.d.ts +8 -0
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { clsx } from 'clsx'
|
|
10
10
|
import { useAnimatedUnmount } from '../../hooks/useAnimatedUnmount'
|
|
11
11
|
import { TRANSITION_BACKDROP, TRANSITION_PANEL } from '../../utils/animation'
|
|
12
|
-
import { apiUrl, getAuthHeaders, getCredentialsMode } from '../../api/config'
|
|
12
|
+
import { apiUrl, getAuthHeaders, getCredentialsMode, routePath } from '../../api/config'
|
|
13
13
|
import {
|
|
14
14
|
useCloudRole, useVersionCheck, useClusterInfo, usePrometheusStatus, useArgoStatus,
|
|
15
15
|
} from '../../api/client'
|
|
@@ -20,6 +20,14 @@ import { AISettingsSection, type AIDraft } from '../diagnose/AISettings'
|
|
|
20
20
|
import { MyPermissionsContent } from './MyPermissionsDialog'
|
|
21
21
|
import { useDiagnose } from '../diagnose/DiagnoseContext'
|
|
22
22
|
|
|
23
|
+
// The loopback URL an MCP client is told to connect to. Shared by the overview
|
|
24
|
+
// row and the MCP section: both must carry the base path, or the URL they
|
|
25
|
+
// advertise 404s under a subpath deployment.
|
|
26
|
+
function mcpLoopbackUrl(): string {
|
|
27
|
+
const port = Number(window.location.port) || 80
|
|
28
|
+
return `http://localhost:${port}${routePath('/mcp')}`
|
|
29
|
+
}
|
|
30
|
+
|
|
23
31
|
interface Config {
|
|
24
32
|
kubeconfig?: string
|
|
25
33
|
kubeconfigDirs?: string[]
|
|
@@ -842,8 +850,7 @@ function OverviewPanel({ active, onNavigate }: { active: boolean; onNavigate: (s
|
|
|
842
850
|
const agentLabel =
|
|
843
851
|
diag.agents.find((a) => a.name === diag.selectedAgent)?.label ?? diag.agents[0]?.label
|
|
844
852
|
const mcpOn = capabilities.mcpEnabled
|
|
845
|
-
const
|
|
846
|
-
const mcpUrl = `http://localhost:${port}/mcp`
|
|
853
|
+
const mcpUrl = mcpLoopbackUrl()
|
|
847
854
|
|
|
848
855
|
const rows: OverviewRow[] = [
|
|
849
856
|
{
|
|
@@ -1119,7 +1126,7 @@ function MCPSection({
|
|
|
1119
1126
|
const [copied, setCopied] = useState(false)
|
|
1120
1127
|
|
|
1121
1128
|
const currentPort = Number(window.location.port) || 80
|
|
1122
|
-
const mcpUrl =
|
|
1129
|
+
const mcpUrl = mcpLoopbackUrl()
|
|
1123
1130
|
|
|
1124
1131
|
const handleCopy = () => {
|
|
1125
1132
|
navigator.clipboard.writeText(mcpUrl)
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react'
|
|
2
2
|
import type { TrafficSourcesResponse, TrafficWizardState } from '../../types'
|
|
3
3
|
import { CheckCircle2, XCircle, AlertTriangle, Copy, ExternalLink, ArrowRight, ArrowLeft, Package } from 'lucide-react'
|
|
4
|
-
import { PaneLoader } from '@skyhook-io/k8s-ui'
|
|
4
|
+
import { assetUrl, PaneLoader } from '@skyhook-io/k8s-ui'
|
|
5
5
|
import radarLoadingIcon from '@skyhook-io/k8s-ui/assets/radar/radar-icon-loading.svg'
|
|
6
6
|
import { InstallWizard } from '../helm/InstallWizard'
|
|
7
7
|
|
|
8
|
+
const radarLoadingIconUrl = assetUrl(radarLoadingIcon)
|
|
9
|
+
|
|
8
10
|
interface TrafficWizardProps {
|
|
9
11
|
state: TrafficWizardState
|
|
10
12
|
setState: (state: TrafficWizardState) => void
|
|
@@ -100,7 +102,7 @@ export function TrafficWizard({
|
|
|
100
102
|
<div className="flex items-center justify-center h-full w-full">
|
|
101
103
|
<div className="max-w-md w-full p-6 space-y-6">
|
|
102
104
|
<div className="flex flex-col items-center gap-3">
|
|
103
|
-
<img src={
|
|
105
|
+
<img src={radarLoadingIconUrl} alt="" aria-hidden className="h-11 w-11" />
|
|
104
106
|
<h2 className="text-lg font-medium text-theme-text-primary">Waiting for traffic source…</h2>
|
|
105
107
|
<p className="text-sm text-theme-text-secondary">
|
|
106
108
|
Checking for availability
|
package/src/main.tsx
CHANGED
|
@@ -153,8 +153,14 @@ window.addEventListener('mouseup', (e: MouseEvent) => {
|
|
|
153
153
|
// tab, so it opts into per-view document.title. Library consumers (e.g.
|
|
154
154
|
// radar-hub-web) render <RadarApp apiBase="..." basename="..." /> WITHOUT this
|
|
155
155
|
// flag, keeping their own tab title.
|
|
156
|
+
const runtimeConfig = window.__RADAR_RUNTIME_CONFIG__
|
|
157
|
+
|
|
156
158
|
ReactDOM.createRoot(document.getElementById('radar')!).render(
|
|
157
159
|
<React.StrictMode>
|
|
158
|
-
<RadarApp
|
|
160
|
+
<RadarApp
|
|
161
|
+
apiBase={runtimeConfig?.apiBase}
|
|
162
|
+
basename={runtimeConfig?.basePath}
|
|
163
|
+
manageDocumentTitle
|
|
164
|
+
/>
|
|
159
165
|
</React.StrictMode>
|
|
160
166
|
)
|