@skyhook-io/radar-app 1.8.3 → 1.8.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 +5 -5
- package/src/App.tsx +248 -92
- package/src/RadarApp.tsx +4 -1
- package/src/api/client.ts +32 -6
- package/src/components/ConnectionErrorView.tsx +1 -1
- package/src/components/ContextSwitcher.tsx +5 -1
- package/src/components/NamespaceSwitcher.tsx +21 -300
- package/src/components/applications/ApplicationsView.tsx +13 -1
- package/src/components/audit/AuditView.tsx +11 -2
- package/src/components/cost/CostView.tsx +12 -2
- package/src/components/gitops/GitOpsView.tsx +22 -7
- package/src/components/helm/HelmCompareRoute.tsx +1342 -0
- package/src/components/helm/HelmReleaseDrawer.tsx +189 -352
- package/src/components/helm/HelmView.tsx +79 -62
- package/src/components/helm/ManifestDiffViewer.tsx +4 -4
- package/src/components/home/ClusterHealthCard.tsx +6 -1
- package/src/components/home/HomeView.tsx +12 -1
- package/src/components/home/mcpToolCatalog.ts +1 -1
- package/src/components/issues/IssuesPane.tsx +29 -18
- package/src/components/resources/ResourceDetailDrawer.tsx +8 -3
- package/src/components/resources/ResourcesView.tsx +3 -0
- package/src/components/timeline/TimelineView.tsx +26 -2
- package/src/components/traffic/TrafficView.tsx +17 -10
- package/src/components/ui/Markdown.tsx +2 -2
- package/src/components/ui/Omnibar.tsx +1 -1
- package/src/components/workload/WorkloadView.tsx +5 -1
- package/src/filter/FilterLocationBridge.tsx +30 -0
- package/src/hooks/useKeyboardShortcuts.tsx +1 -0
- package/src/index.ts +15 -0
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
GitOpsDetailLayout,
|
|
9
9
|
GitOpsGraphFilterRail,
|
|
10
10
|
GitOpsTableView as SharedGitOpsTableView,
|
|
11
|
+
FreshnessControl,
|
|
11
12
|
GitOpsTreeGraph,
|
|
12
13
|
RollbackDialog,
|
|
13
14
|
SyncOptionsDialog,
|
|
@@ -61,6 +62,7 @@ import {
|
|
|
61
62
|
useResource,
|
|
62
63
|
} from '../../api/client'
|
|
63
64
|
import { useAPIResources } from '../../api/apiResources'
|
|
65
|
+
import { useConnection } from '../../context/ConnectionContext'
|
|
64
66
|
import { apiUrl, getAuthHeaders, getCredentialsMode } from '../../api/config'
|
|
65
67
|
import { useRegisterShortcut } from '../../hooks/useKeyboardShortcuts'
|
|
66
68
|
import { CodeViewer } from '../ui/CodeViewer'
|
|
@@ -80,6 +82,11 @@ const GITOPS_KINDS: APIResource[] = [
|
|
|
80
82
|
|
|
81
83
|
const KIND_BY_NAME = new Map(GITOPS_KINDS.map((k) => [k.name, k]))
|
|
82
84
|
|
|
85
|
+
// Rows are the table's primary content; their poll cadence is what the toolbar
|
|
86
|
+
// freshness signal advertises ("Auto-refreshes every 2m"). Single source of
|
|
87
|
+
// truth so the signal can't drift from the actual refetchInterval below.
|
|
88
|
+
const GITOPS_ROWS_REFRESH_INTERVAL_MS = 120_000
|
|
89
|
+
|
|
83
90
|
interface ResourceCountsResponse {
|
|
84
91
|
counts: Record<string, number>
|
|
85
92
|
forbidden?: string[]
|
|
@@ -102,6 +109,7 @@ export function GitOpsView({ namespaces, onOpenResource, onClearNamespaces }: Gi
|
|
|
102
109
|
|
|
103
110
|
function GitOpsTableView({ namespaces, onClearNamespaces }: { namespaces: string[]; onClearNamespaces?: () => void }) {
|
|
104
111
|
const navigate = useNavigate()
|
|
112
|
+
const { connection } = useConnection()
|
|
105
113
|
const namespacesParam = namespaces.join(',')
|
|
106
114
|
const { data: apiResources, isLoading: apiResourcesLoading } = useAPIResources()
|
|
107
115
|
|
|
@@ -191,7 +199,7 @@ function GitOpsTableView({ namespaces, onClearNamespaces }: { namespaces: string
|
|
|
191
199
|
},
|
|
192
200
|
enabled: !apiResourcesLoading,
|
|
193
201
|
staleTime: 30_000,
|
|
194
|
-
refetchInterval:
|
|
202
|
+
refetchInterval: GITOPS_ROWS_REFRESH_INTERVAL_MS,
|
|
195
203
|
})
|
|
196
204
|
|
|
197
205
|
// Row mutations invalidate granular keys (['resource', …], ['gitops-tree', …])
|
|
@@ -201,11 +209,11 @@ function GitOpsTableView({ namespaces, onClearNamespaces }: { namespaces: string
|
|
|
201
209
|
// inviting a duplicate request. Radar serves reads from an informer cache that
|
|
202
210
|
// lags the write by the watch-propagation delay, so refetch once now (covers
|
|
203
211
|
// an already-current cache) and once shortly after to catch the propagated
|
|
204
|
-
// update; refetch() forces a fetch regardless of staleTime.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
212
|
+
// update; refetch() forces a fetch regardless of staleTime. The toolbar's
|
|
213
|
+
// manual refresh reuses refetchTable so rows + counts stay in sync.
|
|
214
|
+
// Return the combined promise so the toolbar's refresh animation waits for the
|
|
215
|
+
// real fetches to settle before showing its success checkmark.
|
|
216
|
+
const refetchTable = () => Promise.all([rowsQuery.refetch(), countsQuery.refetch()])
|
|
209
217
|
const refetchTableAfterMutation = () => {
|
|
210
218
|
refetchTable()
|
|
211
219
|
window.setTimeout(refetchTable, 1200)
|
|
@@ -280,7 +288,14 @@ function GitOpsTableView({ namespaces, onClearNamespaces }: { namespaces: string
|
|
|
280
288
|
error={(rowsQuery.error as Error | null) ?? null}
|
|
281
289
|
counts={countsQuery.data?.counts ?? {}}
|
|
282
290
|
countsUnavailable={countsQuery.data?.unavailable}
|
|
283
|
-
|
|
291
|
+
freshnessSlot={
|
|
292
|
+
<FreshnessControl
|
|
293
|
+
mode="auto"
|
|
294
|
+
dataUpdatedAt={rowsQuery.dataUpdatedAt}
|
|
295
|
+
onRefresh={refetchTable}
|
|
296
|
+
connectionState={connection.state}
|
|
297
|
+
/>
|
|
298
|
+
}
|
|
284
299
|
onRowClick={(row) => {
|
|
285
300
|
const ns = row.namespace || '_'
|
|
286
301
|
const params = new URLSearchParams()
|