@skyhook-io/radar-app 1.17.0 → 1.18.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/README.md +1 -1
- package/package.json +11 -11
- package/src/App.tsx +138 -116
- package/src/api/actions.errorCode.test.ts +40 -0
- package/src/api/actions.test.ts +48 -0
- package/src/api/actions.ts +79 -0
- package/src/api/apiResources.navigation.test.tsx +232 -0
- package/src/api/apiResources.ts +46 -3
- package/src/api/client.gitopsPoll.test.ts +99 -0
- package/src/api/client.helmPreview.test.tsx +48 -0
- package/src/api/client.helmSource.test.ts +39 -0
- package/src/api/client.namespaceSwitch.hook.test.tsx +54 -0
- package/src/api/client.namespaceSwitch.test.ts +107 -0
- package/src/api/client.resourceAvailability.test.ts +24 -0
- package/src/api/client.ts +580 -103
- package/src/api/client.workloadRuns.test.ts +53 -0
- package/src/api/cnpg-ha.live.test.ts +140 -0
- package/src/api/cnpg-ha.test.ts +78 -0
- package/src/api/cnpg-ha.ts +19 -0
- package/src/api/cnpg-history.ts +123 -0
- package/src/api/cnpg-inspect.ts +102 -0
- package/src/api/cnpg-protection.ts +112 -0
- package/src/api/cnpg-recovery.test.tsx +60 -0
- package/src/api/cnpg-recovery.ts +262 -0
- package/src/api/cnpg-sessions.ts +175 -0
- package/src/api/cnpg-storage.ts +138 -0
- package/src/api/cnpg.legacy-reads.test.ts +43 -0
- package/src/api/cnpg.pooler-runtime.test.ts +15 -0
- package/src/api/cnpg.ts +428 -10
- package/src/api/config.test.ts +23 -1
- package/src/api/config.ts +7 -3
- package/src/api/diagnose.ts +4 -1
- package/src/api/drain-plan.test.ts +70 -40
- package/src/api/policy.ts +5 -5
- package/src/api/radarFeatures.render.test.tsx +47 -3
- package/src/api/radarFeatures.ts +5 -1
- package/src/api/reviewedActionMutation.test.tsx +164 -0
- package/src/api/reviewedActionMutation.ts +66 -0
- package/src/api/timelineSource.test.ts +9 -0
- package/src/api/timelineSource.ts +8 -0
- package/src/api/traffic.scope.render.test.tsx +60 -0
- package/src/api/traffic.ts +3 -1
- package/src/components/audit/AuditView.tsx +9 -0
- package/src/components/capacity/CapacityActivity.tsx +3 -31
- package/src/components/capacity/CapacityDemand.tsx +4 -36
- package/src/components/capacity/CapacityOverview.tsx +217 -56
- package/src/components/capacity/CapacityPoolDetail.tsx +6 -55
- package/src/components/capacity/CapacityView.test.tsx +323 -0
- package/src/components/capacity/ClusterSchedulingCard.tsx +2 -10
- package/src/components/capacity/certaintyGlyph.test.tsx +2 -9
- package/src/components/capacity/routes.ts +42 -0
- package/src/components/capacity/shared.tsx +11 -129
- package/src/components/capacity/workspaceRoute.ts +18 -0
- package/src/components/cnpg/CNPGActionHost.compatibility.test.tsx +30 -0
- package/src/components/cnpg/CNPGArchivingRepair.tsx +191 -0
- package/src/components/cnpg/CNPGBlockingSessions.test.tsx +50 -0
- package/src/components/cnpg/CNPGBlockingSessions.tsx +333 -0
- package/src/components/cnpg/CNPGClusterActivity.test.tsx +11 -0
- package/src/components/cnpg/CNPGClusterActivity.tsx +18 -9
- package/src/components/cnpg/CNPGClusterLogs.compatibility.test.tsx +130 -0
- package/src/components/cnpg/CNPGClusterLogs.empty.test.tsx +29 -0
- package/src/components/cnpg/CNPGClusterLogs.test.ts +9 -0
- package/src/components/cnpg/CNPGClusterLogs.tsx +81 -24
- package/src/components/cnpg/CNPGClusterTabs.test.tsx +152 -0
- package/src/components/cnpg/CNPGClusterTabs.tsx +187 -0
- package/src/components/cnpg/CNPGClustersKindView.tsx +46 -0
- package/src/components/cnpg/CNPGConfiguration.test.tsx +223 -0
- package/src/components/cnpg/CNPGConfiguration.tsx +190 -0
- package/src/components/cnpg/CNPGCreateClusterDialog.test.tsx +113 -0
- package/src/components/cnpg/CNPGCreateClusterDialog.tsx +74 -0
- package/src/components/cnpg/CNPGDeclarations.test.ts +107 -0
- package/src/components/cnpg/CNPGDeclarations.tsx +236 -78
- package/src/components/cnpg/CNPGDetailPage.test.tsx +62 -0
- package/src/components/cnpg/CNPGDetailPage.tsx +159 -98
- package/src/components/cnpg/CNPGDrawerTrail.tsx +2 -2
- package/src/components/cnpg/CNPGInvestigationAction.test.tsx +30 -0
- package/src/components/cnpg/CNPGOperator.test.tsx +34 -0
- package/src/components/cnpg/CNPGOperator.tsx +78 -30
- package/src/components/cnpg/CNPGOperatorBanner.tsx +39 -0
- package/src/components/cnpg/CNPGOperatorConditions.test.tsx +45 -0
- package/src/components/cnpg/CNPGOperatorConditions.tsx +16 -0
- package/src/components/cnpg/CNPGOperatorConfig.test.tsx +27 -0
- package/src/components/cnpg/CNPGOperatorDiagnosis.tsx +247 -0
- package/src/components/cnpg/CNPGOverview.test.tsx +171 -0
- package/src/components/cnpg/CNPGOverview.tsx +238 -63
- package/src/components/cnpg/CNPGParametersInEffect.test.tsx +51 -0
- package/src/components/cnpg/CNPGParametersInEffect.tsx +120 -0
- package/src/components/cnpg/CNPGPerformance.prerequisite.test.tsx +48 -0
- package/src/components/cnpg/CNPGPerformance.test.tsx +73 -0
- package/src/components/cnpg/CNPGPerformance.tsx +477 -0
- package/src/components/cnpg/CNPGPooling.test.tsx +89 -0
- package/src/components/cnpg/CNPGPooling.tsx +97 -40
- package/src/components/cnpg/CNPGProtection.test.tsx +145 -0
- package/src/components/cnpg/CNPGProtection.tsx +228 -122
- package/src/components/cnpg/CNPGReplicationTab.test.tsx +87 -0
- package/src/components/cnpg/CNPGReplicationTab.tsx +212 -0
- package/src/components/cnpg/CNPGReplicationView.tsx +264 -0
- package/src/components/cnpg/CNPGStorage.test.tsx +140 -0
- package/src/components/cnpg/CNPGStorage.tsx +619 -0
- package/src/components/cnpg/CNPGSummaryHost.overview.test.tsx +44 -0
- package/src/components/cnpg/CNPGSummaryHost.test.tsx +23 -0
- package/src/components/cnpg/CNPGSummaryHost.tsx +230 -55
- package/src/components/cnpg/CNPGTrends.denied.test.tsx +33 -0
- package/src/components/cnpg/CNPGTrends.missing.test.tsx +69 -0
- package/src/components/cnpg/CNPGTrends.test.ts +38 -0
- package/src/components/cnpg/CNPGTrends.tsx +702 -0
- package/src/components/cnpg/CNPGView.tsx +34 -21
- package/src/components/cnpg/CNPGWorkspace.compatibility.test.tsx +90 -0
- package/src/components/cnpg/actions/CNPGClusterActions.dialog.test.tsx +79 -0
- package/src/components/cnpg/actions/CNPGClusterActions.test.tsx +142 -0
- package/src/components/cnpg/actions/CNPGClusterActions.tsx +853 -0
- package/src/components/cnpg/actions/CNPGConnectButton.read.test.tsx +40 -0
- package/src/components/cnpg/actions/CNPGConnectButton.test.ts +25 -0
- package/src/components/cnpg/actions/CNPGConnectButton.tsx +131 -0
- package/src/components/cnpg/actions/CNPGDestroyInstanceDialog.tsx +185 -0
- package/src/components/cnpg/actions/CNPGInstanceActions.test.tsx +38 -0
- package/src/components/cnpg/actions/CNPGInstanceActions.tsx +74 -0
- package/src/components/cnpg/actions/CNPGMaintenanceBanner.tsx +53 -0
- package/src/components/cnpg/actions/CNPGPoolerActions.test.tsx +35 -0
- package/src/components/cnpg/actions/CNPGPoolerActions.tsx +79 -0
- package/src/components/cnpg/actions/CNPGReportDialog.test.tsx +12 -0
- package/src/components/cnpg/actions/CNPGReportDialog.tsx +91 -0
- package/src/components/cnpg/actions/CNPGScheduleActions.run.test.tsx +58 -0
- package/src/components/cnpg/actions/CNPGScheduleActions.test.tsx +54 -0
- package/src/components/cnpg/actions/CNPGScheduleActions.tsx +208 -0
- package/src/components/cnpg/actions/actionModel.test.ts +111 -0
- package/src/components/cnpg/actions/actionModel.ts +127 -0
- package/src/components/cnpg/actions/renderCNPGHeaderActions.tsx +60 -0
- package/src/components/cnpg/actions/useCNPGWriteGuard.tsx +58 -0
- package/src/components/cnpg/actions/useOpenCNPGPsql.ts +22 -0
- package/src/components/cnpg/archivingRepair.test.ts +104 -0
- package/src/components/cnpg/archivingRepair.ts +145 -0
- package/src/components/cnpg/baseBackup.test.ts +36 -0
- package/src/components/cnpg/baseBackup.ts +36 -0
- package/src/components/cnpg/blocking.test.ts +59 -0
- package/src/components/cnpg/blocking.ts +131 -0
- package/src/components/cnpg/coverageText.test.ts +27 -0
- package/src/components/cnpg/creation/CNPGTargetFields.tsx +110 -0
- package/src/components/cnpg/creation/targetModel.test.ts +137 -0
- package/src/components/cnpg/creation/targetModel.ts +149 -0
- package/src/components/cnpg/fleetStatus.test.ts +46 -0
- package/src/components/cnpg/fleetStatus.ts +43 -0
- package/src/components/cnpg/formFields.ts +2 -0
- package/src/components/cnpg/grantText.test.tsx +11 -0
- package/src/components/cnpg/host.test.tsx +24 -0
- package/src/components/cnpg/host.tsx +101 -0
- package/src/components/cnpg/inspectModel.test.ts +120 -0
- package/src/components/cnpg/inspectModel.ts +140 -0
- package/src/components/cnpg/logicalSlots.test.ts +30 -0
- package/src/components/cnpg/logicalSlots.ts +29 -0
- package/src/components/cnpg/lsn.test.ts +40 -0
- package/src/components/cnpg/lsn.ts +43 -0
- package/src/components/cnpg/operations/CNPGFleetOperation.tsx +30 -0
- package/src/components/cnpg/operations/CNPGOperationTracker.test.tsx +247 -0
- package/src/components/cnpg/operations/CNPGOperationTracker.tsx +255 -0
- package/src/components/cnpg/operations/model.test.ts +510 -0
- package/src/components/cnpg/operations/model.ts +499 -0
- package/src/components/cnpg/operations/presentation.test.ts +80 -0
- package/src/components/cnpg/operations/presentation.ts +84 -0
- package/src/components/cnpg/operations/store.ts +98 -0
- package/src/components/cnpg/operatorStatus.test.ts +134 -0
- package/src/components/cnpg/operatorStatus.ts +194 -0
- package/src/components/cnpg/paths.test.ts +54 -0
- package/src/components/cnpg/paths.ts +47 -4
- package/src/components/cnpg/protection/CNPGAttachArchiveDialog.tsx +185 -0
- package/src/components/cnpg/protection/CNPGCreateScheduleDialog.tsx +196 -0
- package/src/components/cnpg/protection/CNPGProtectionSetup.test.tsx +121 -0
- package/src/components/cnpg/protection/CNPGProtectionSetup.tsx +452 -0
- package/src/components/cnpg/protection/CNPGScheduleInput.tsx +115 -0
- package/src/components/cnpg/protection/CNPGScheduleRepairButton.tsx +120 -0
- package/src/components/cnpg/protection/scheduleModel.test.ts +19 -0
- package/src/components/cnpg/protection/scheduleModel.ts +16 -0
- package/src/components/cnpg/recovery/CNPGRecoveryPoint.tsx +220 -0
- package/src/components/cnpg/recovery/CNPGRestoreButton.test.tsx +29 -0
- package/src/components/cnpg/recovery/CNPGRestoreButton.tsx +26 -0
- package/src/components/cnpg/recovery/CNPGRestoreChecks.test.tsx +23 -0
- package/src/components/cnpg/recovery/CNPGRestoreChecks.tsx +153 -0
- package/src/components/cnpg/recovery/CNPGRestoreDialog.back.test.tsx +149 -0
- package/src/components/cnpg/recovery/CNPGRestoreDialog.test.tsx +46 -0
- package/src/components/cnpg/recovery/CNPGRestoreDialog.tsx +333 -0
- package/src/components/cnpg/recovery/CNPGRestoreProgress.tsx +182 -0
- package/src/components/cnpg/recovery/CNPGRestoreValidation.tsx +216 -0
- package/src/components/cnpg/recovery/restoreModel.test.ts +709 -0
- package/src/components/cnpg/recovery/restoreModel.ts +685 -0
- package/src/components/cnpg/recovery/restoreOperation.ts +56 -0
- package/src/components/cnpg/refresh.test.ts +38 -0
- package/src/components/cnpg/refresh.ts +17 -0
- package/src/components/cnpg/refreshNotice.test.tsx +29 -0
- package/src/components/cnpg/routes.test.ts +34 -3
- package/src/components/cnpg/routes.ts +60 -48
- package/src/components/cnpg/runtimeAssessment.ts +198 -0
- package/src/components/cnpg/runtimeModel.test.ts +175 -0
- package/src/components/cnpg/runtimeModel.ts +196 -0
- package/src/components/cnpg/runtimeParts.test.tsx +17 -0
- package/src/components/cnpg/runtimeParts.tsx +79 -0
- package/src/components/cnpg/shared.test.tsx +59 -0
- package/src/components/cnpg/shared.tsx +100 -182
- package/src/components/cnpg/storageModel.test.ts +107 -0
- package/src/components/cnpg/storageModel.ts +101 -0
- package/src/components/cnpg/trendSamples.test.ts +148 -0
- package/src/components/cnpg/trendSamples.ts +222 -0
- package/src/components/cnpg/useCNPGClusterAssessment.ts +30 -0
- package/src/components/cnpg/useCNPGKubectlContext.test.tsx +45 -0
- package/src/components/cnpg/useCNPGKubectlContext.ts +13 -0
- package/src/components/cnpg/useCNPGNavigate.test.tsx +58 -0
- package/src/components/cnpg/useCNPGNavigate.ts +21 -0
- package/src/components/cnpg/useCNPGPoolerLive.ts +46 -0
- package/src/components/cnpg/useCNPGScreenParams.ts +24 -0
- package/src/components/cnpg/useCNPGSidebarWorkspace.ts +66 -16
- package/src/components/cnpg/workspaceRoute.ts +23 -0
- package/src/components/cost/ApplicationCostTab.test.ts +7 -0
- package/src/components/cost/ApplicationCostTab.tsx +7 -7
- package/src/components/cost/CostView.test.ts +2 -1
- package/src/components/cost/CostView.tsx +0 -2
- package/src/components/cost/WorkloadCostTab.tsx +2 -4
- package/src/components/cost/errors.ts +3 -1
- package/src/components/cost/source.test.ts +10 -0
- package/src/components/cost/source.ts +5 -1
- package/src/components/diagnose/DiagnoseSurface.tsx +3 -3
- package/src/components/diagnose/InvestigationChangesEvidence.test.tsx +352 -0
- package/src/components/diagnose/InvestigationEvidencePane.test.tsx +101 -0
- package/src/components/diagnose/InvestigationView.tsx +2 -1
- package/src/components/diagnose/investigationEvidence/adapters/changes.test.ts +123 -0
- package/src/components/diagnose/investigationEvidence/adapters/changes.ts +192 -3
- package/src/components/diagnose/investigationEvidence/adapters/issues.ts +73 -43
- package/src/components/diagnose/investigationEvidence/adapters/prometheus.ts +64 -2
- package/src/components/diagnose/investigationEvidence/adapters/resource.test.ts +37 -0
- package/src/components/diagnose/investigationEvidence/adapters/testdata/get-changes-created.json +323 -0
- package/src/components/diagnose/investigationEvidence/bodies/streams.tsx +144 -15
- package/src/components/diagnose/investigationEvidence/observations.ts +20 -0
- package/src/components/diagnose/investigationEvidence/parse.ts +57 -1
- package/src/components/diagnose/investigationEvidence/projection.test.ts +123 -0
- package/src/components/diagnose/investigationEvidence/types.ts +11 -0
- package/src/components/diagnose/investigationEvidencePresentation.test.ts +18 -0
- package/src/components/diagnose/investigationState.test.ts +36 -1
- package/src/components/diagnose/investigationState.ts +8 -0
- package/src/components/diagnose/launch.ts +2 -2
- package/src/components/dock/BottomDock.tsx +8 -3
- package/src/components/dock/TerminalTab.test.tsx +17 -0
- package/src/components/dock/TerminalTab.tsx +7 -3
- package/src/components/dock/WorkloadLogsTab.tsx +3 -0
- package/src/components/execution/BatchExecutionView.render.test.tsx +29 -1
- package/src/components/execution/BatchExecutionView.tsx +23 -8
- package/src/components/execution/cluster-template-runs.render.test.tsx +42 -0
- package/src/components/gitops/ArgoResourceDiffLoader.tsx +4 -2
- package/src/components/gitops/GitOpsView.tsx +23 -23
- package/src/components/helm/HelmCompareRoute.test.tsx +59 -0
- package/src/components/helm/HelmCompareRoute.tsx +57 -26
- package/src/components/helm/HelmReleaseDrawer.test.ts +55 -3
- package/src/components/helm/HelmReleaseDrawer.tsx +186 -64
- package/src/components/helm/HelmReleaseNotes.test.tsx +42 -0
- package/src/components/helm/HelmReleaseNotes.tsx +26 -0
- package/src/components/helm/OwnedResources.tsx +2 -2
- package/src/components/helm/TrackChartSourceDialog.render.test.tsx +192 -0
- package/src/components/helm/TrackChartSourceDialog.test.ts +51 -0
- package/src/components/helm/TrackChartSourceDialog.tsx +179 -176
- package/src/components/helm/ValuesDiffPreview.tsx +4 -1
- package/src/components/helm/ValuesViewer.test.tsx +301 -0
- package/src/components/helm/ValuesViewer.tsx +169 -78
- package/src/components/home/ActivitySummary.tsx +2 -1
- package/src/components/home/ClusterHealthCard.tsx +4 -4
- package/src/components/home/CostCard.test.tsx +100 -0
- package/src/components/home/CostCard.tsx +2 -2
- package/src/components/home/HelmSummary.tsx +2 -2
- package/src/components/home/HomeView.tsx +32 -12
- package/src/components/home/MCPSetupDialog.test.tsx +30 -0
- package/src/components/home/MCPSetupDialog.tsx +13 -6
- package/src/components/home/ProblemsPanel.test.tsx +82 -0
- package/src/components/home/TopologyPreview.tsx +2 -2
- package/src/components/home/mcpToolCatalog.ts +18 -2
- package/src/components/issues/IssuesPane.render.test.tsx +143 -0
- package/src/components/issues/IssuesPane.test.ts +65 -1
- package/src/components/issues/IssuesPane.tsx +213 -26
- package/src/components/issues/UncheckedSourceHelp.test.tsx +42 -0
- package/src/components/issues/UncheckedSourceHelp.tsx +24 -0
- package/src/components/issues/uncheckedSources.test.ts +43 -0
- package/src/components/issues/uncheckedSources.ts +74 -0
- package/src/components/logs/ScheduledWorkloadLogsViewer.tsx +4 -2
- package/src/components/resource/PVCUsageBar.render.test.tsx +32 -0
- package/src/components/resource/PVCUsageBar.test.tsx +24 -0
- package/src/components/resource/PVCUsageBar.tsx +15 -6
- package/src/components/resource/WorkloadMetricsHelpDialog.test.tsx +3 -1
- package/src/components/resource/WorkloadMetricsHelpDialog.tsx +1 -1
- package/src/components/resources/CompositeRenderer.tsx +4 -4
- package/src/components/resources/ImageFilesystemModal.test.tsx +68 -0
- package/src/components/resources/ImageFilesystemModal.tsx +11 -4
- package/src/components/resources/PodFilesystemModal.tsx +2 -2
- package/src/components/resources/ResourceDetailDrawer.tsx +2 -2
- package/src/components/resources/ResourcesView.scope.render.test.tsx +58 -0
- package/src/components/resources/ResourcesView.tsx +44 -15
- package/src/components/resources/renderers/FluxHelmReleaseRenderer.test.tsx +111 -0
- package/src/components/resources/renderers/FluxHelmReleaseRenderer.tsx +67 -0
- package/src/components/resources/renderers/KyvernoPolicyCoverage.scope.render.test.tsx +64 -0
- package/src/components/resources/renderers/KyvernoPolicyCoverage.tsx +6 -7
- package/src/components/settings/LocalIntegrationStatus.test.tsx +52 -0
- package/src/components/settings/LocalIntegrationStatus.tsx +3 -4
- package/src/components/settings/SettingsDialog.tsx +49 -30
- package/src/components/timeline/TimelineList.tsx +22 -24
- package/src/components/timeline/TimelineLoadError.test.tsx +62 -0
- package/src/components/timeline/TimelineLoadError.tsx +96 -0
- package/src/components/timeline/TimelineView.tsx +18 -45
- package/src/components/timeline/ViewModeToggle.tsx +20 -0
- package/src/components/timeline/useStickyError.test.tsx +47 -0
- package/src/components/timeline/useStickyError.ts +15 -0
- package/src/components/traffic/TrafficFilterSidebar.test.tsx +77 -0
- package/src/components/traffic/TrafficFilterSidebar.tsx +42 -31
- package/src/components/traffic/TrafficView.tsx +12 -12
- package/src/components/traffic/trafficFilters.test.ts +20 -1
- package/src/components/traffic/trafficFilters.ts +13 -0
- package/src/components/ui/DiagnosticsOverlay.tsx +34 -2
- package/src/components/ui/Markdown.test.tsx +65 -0
- package/src/components/ui/Markdown.tsx +144 -127
- package/src/components/ui/Omnibar.tsx +13 -2
- package/src/components/ui/Toast.tsx +1 -1
- package/src/components/ui/omnibar-match.test.ts +30 -0
- package/src/components/ui/omnibar-match.ts +18 -0
- package/src/components/whats-new/releaseNotes.ts +63 -1
- package/src/components/workload/CronJobSchedulingEvidence.test.tsx +35 -0
- package/src/components/workload/CronJobSchedulingEvidence.tsx +37 -0
- package/src/components/workload/NodeDrainStatus.test.tsx +253 -0
- package/src/components/workload/NodeDrainStatus.tsx +55 -0
- package/src/components/workload/WorkloadView.test.ts +10 -1
- package/src/components/workload/WorkloadView.tsx +63 -243
- package/src/components/workspace/layout.test.tsx +29 -0
- package/src/components/workspace/layout.tsx +259 -0
- package/src/components/workspace/table.ts +7 -0
- package/src/context/ConnectionContext.test.ts +27 -1
- package/src/context/ConnectionContext.tsx +17 -7
- package/src/contexts/CapabilitiesContext.tsx +1 -1
- package/src/integrations/resourceHost.test.tsx +55 -0
- package/src/integrations/resourceHost.ts +99 -0
- package/src/integrations/resourceHosts.test.tsx +142 -0
- package/src/integrations/resourceHosts.tsx +121 -0
- package/src/integrations/workspaceRoute.ts +20 -0
- package/src/integrations/workspaceRoutes.test.ts +40 -0
- package/src/integrations/workspaceRoutes.ts +22 -0
- package/src/integrations/workspaceScreens.tsx +14 -0
- package/src/utils/drawer-trail.ts +35 -0
- package/src/utils/kindFilterStore.test.ts +147 -0
- package/src/utils/kindFilterStore.ts +91 -0
- package/src/utils/navigation.test.ts +13 -1
- package/src/utils/navigation.ts +53 -2
- package/src/utils/page-links.ts +21 -0
- package/src/utils/tabStorage.ts +40 -0
- package/src/utils/viewMemory.test.ts +78 -0
- package/src/utils/viewMemory.ts +54 -0
- package/src/utils/wails-clipboard.ts +4 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useState, useCallback } from 'react'
|
|
1
|
+
import { useEffect, useState, useCallback, useRef } from 'react'
|
|
2
2
|
import { X, Copy, Check, ExternalLink } from 'lucide-react'
|
|
3
3
|
import { clsx } from 'clsx'
|
|
4
4
|
import { TRANSITION_BACKDROP, TRANSITION_PANEL, overlayTransitionStyle } from '../../utils/animation'
|
|
@@ -7,15 +7,29 @@ import { useDiagnostics } from '../../api/client'
|
|
|
7
7
|
import type { DiagnosticsSnapshot, DiagEnvVar, DiagMetricsSourceHealth, DiagDropRecord, DiagErrorEntry, DiagCacheSyncStatus, DiagInformerSyncStatus, DiagSyncPhase, DiagSampleWindow } from '../../api/client'
|
|
8
8
|
import { getK8sUIPerfSnapshot, type K8sUIPerfSnapshot } from '@skyhook-io/k8s-ui'
|
|
9
9
|
|
|
10
|
+
export type DiagnosticsFocus = 'timeline'
|
|
11
|
+
|
|
10
12
|
interface DiagnosticsOverlayProps {
|
|
11
13
|
onClose: () => void
|
|
12
14
|
isOpen?: boolean
|
|
15
|
+
/** Section to scroll to on open, for callers linking to one specific problem. */
|
|
16
|
+
focus?: DiagnosticsFocus
|
|
13
17
|
}
|
|
14
18
|
|
|
15
|
-
export function DiagnosticsOverlay({ onClose, isOpen = true }: DiagnosticsOverlayProps) {
|
|
19
|
+
export function DiagnosticsOverlay({ onClose, isOpen = true, focus }: DiagnosticsOverlayProps) {
|
|
16
20
|
const { data, isLoading, error } = useDiagnostics(true)
|
|
17
21
|
const [copied, setCopied] = useState<'json' | 'formatted' | null>(null)
|
|
18
22
|
const [reportOpened, setReportOpened] = useState(false)
|
|
23
|
+
const timelineRef = useRef<HTMLDivElement>(null)
|
|
24
|
+
const hasData = data != null
|
|
25
|
+
|
|
26
|
+
// Once, when the snapshot first renders: the overlay polls, and re-scrolling
|
|
27
|
+
// on every refresh would yank the reader back while they read other sections.
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (isOpen && hasData && focus === 'timeline') {
|
|
30
|
+
timelineRef.current?.scrollIntoView({ block: 'start' })
|
|
31
|
+
}
|
|
32
|
+
}, [isOpen, hasData, focus])
|
|
19
33
|
|
|
20
34
|
// Close on Escape (capture phase) — only while logically open: the overlay
|
|
21
35
|
// stays mounted through its exit.
|
|
@@ -119,6 +133,7 @@ export function DiagnosticsOverlay({ onClose, isOpen = true }: DiagnosticsOverla
|
|
|
119
133
|
<CacheSection data={data} />
|
|
120
134
|
<MetricsSection data={data} />
|
|
121
135
|
<EventPipelineSection data={data} />
|
|
136
|
+
<div ref={timelineRef} className="scroll-mt-4"><TimelineSection data={data} /></div>
|
|
122
137
|
<InformersSection data={data} />
|
|
123
138
|
<PrometheusSection data={data} />
|
|
124
139
|
<TrafficSection data={data} />
|
|
@@ -330,6 +345,20 @@ function EventPipelineSection({ data }: { data: DiagnosticsSnapshot }) {
|
|
|
330
345
|
)
|
|
331
346
|
}
|
|
332
347
|
|
|
348
|
+
function TimelineSection({ data }: { data: DiagnosticsSnapshot }) {
|
|
349
|
+
if (!data.timeline) return null
|
|
350
|
+
const t = data.timeline
|
|
351
|
+
return (
|
|
352
|
+
<Section title="Timeline" warn={t.degraded}>
|
|
353
|
+
<Row label="Storage" value={t.storageType} warn={t.degraded} />
|
|
354
|
+
{t.degraded && t.degradedReason && <Row label="Unavailable" value={t.degradedReason} warn />}
|
|
355
|
+
{/* An unreachable database has no count to report; 0 would read as empty. */}
|
|
356
|
+
{(!t.degraded || t.storageType === 'memory') && <Row label="Events" value={t.totalEvents.toLocaleString()} />}
|
|
357
|
+
<Row label="Dropped" value={t.totalDrops.toLocaleString()} warn={t.totalDrops > 0} />
|
|
358
|
+
</Section>
|
|
359
|
+
)
|
|
360
|
+
}
|
|
361
|
+
|
|
333
362
|
function InformersSection({ data }: { data: DiagnosticsSnapshot }) {
|
|
334
363
|
if (!data.informers) return null
|
|
335
364
|
const inf = data.informers
|
|
@@ -702,6 +731,9 @@ export function formatForGitHub(data: DiagnosticsSnapshot, frontendPerf?: K8sUIP
|
|
|
702
731
|
const t = data.timeline
|
|
703
732
|
lines.push(`### Timeline`)
|
|
704
733
|
lines.push(`- Storage: \`${t.storageType}\` | Events: ${t.totalEvents.toLocaleString()} | Errors: ${t.storeErrors} | Drops: ${t.totalDrops}`)
|
|
734
|
+
if (t.degraded && t.degradedReason) {
|
|
735
|
+
lines.push(`- Unavailable: ${t.degradedReason}`)
|
|
736
|
+
}
|
|
705
737
|
lines.push(``)
|
|
706
738
|
}
|
|
707
739
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
import { act } from 'react'
|
|
3
|
+
import { createRoot, type Root } from 'react-dom/client'
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
5
|
+
import { Markdown } from './Markdown'
|
|
6
|
+
|
|
7
|
+
Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true })
|
|
8
|
+
|
|
9
|
+
const TEXT = 'First paragraph.\n\nRun `kubectl get pods` then open [the docs](https://example.com).\n\n```\nkubectl describe pod x\n```'
|
|
10
|
+
|
|
11
|
+
let container: HTMLDivElement
|
|
12
|
+
let root: Root
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
container = document.createElement('div')
|
|
16
|
+
document.body.appendChild(container)
|
|
17
|
+
root = createRoot(container)
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
act(() => root.unmount())
|
|
22
|
+
container.remove()
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
// Callers pass fresh inline callbacks on every render, as the investigation
|
|
26
|
+
// views do, so the rendered elements must survive a re-render with new ones.
|
|
27
|
+
function render(label: string) {
|
|
28
|
+
act(() => {
|
|
29
|
+
root.render(
|
|
30
|
+
<Markdown
|
|
31
|
+
codeActions={(code) => <button type="button">{`${label}:${code}`}</button>}
|
|
32
|
+
linkRenderer={(href, children) => (href?.includes('example') ? <a data-custom={label}>{children}</a> : null)}
|
|
33
|
+
>
|
|
34
|
+
{TEXT}
|
|
35
|
+
</Markdown>,
|
|
36
|
+
)
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
describe('Markdown', () => {
|
|
41
|
+
it('keeps its rendered elements across parent re-renders', () => {
|
|
42
|
+
render('a')
|
|
43
|
+
const paragraph = container.querySelector('p')
|
|
44
|
+
const pre = container.querySelector('pre')
|
|
45
|
+
expect(paragraph).not.toBeNull()
|
|
46
|
+
expect(pre).not.toBeNull()
|
|
47
|
+
|
|
48
|
+
render('b')
|
|
49
|
+
|
|
50
|
+
expect(container.querySelector('p')).toBe(paragraph)
|
|
51
|
+
expect(container.querySelector('pre')).toBe(pre)
|
|
52
|
+
expect(paragraph?.isConnected).toBe(true)
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it('applies the latest link and code hooks', () => {
|
|
56
|
+
render('a')
|
|
57
|
+
render('b')
|
|
58
|
+
|
|
59
|
+
expect(container.querySelector('a')?.getAttribute('data-custom')).toBe('b')
|
|
60
|
+
const labels = Array.from(container.querySelectorAll('button')).map((b) => b.textContent?.trim())
|
|
61
|
+
expect(labels).toContain('b:kubectl get pods')
|
|
62
|
+
expect(labels).toContain('b:kubectl describe pod x')
|
|
63
|
+
expect(labels.some((l) => l?.startsWith('a:'))).toBe(false)
|
|
64
|
+
})
|
|
65
|
+
})
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createContext, useContext, useMemo } from 'react'
|
|
2
|
+
import ReactMarkdown, { type Components } from 'react-markdown'
|
|
2
3
|
import remarkGfm from 'remark-gfm'
|
|
3
4
|
import { clsx } from 'clsx'
|
|
4
5
|
|
|
5
6
|
import type { ReactNode } from 'react'
|
|
6
7
|
|
|
7
|
-
interface
|
|
8
|
-
children: string
|
|
9
|
-
className?: string
|
|
8
|
+
interface MarkdownHooks {
|
|
10
9
|
/**
|
|
11
10
|
* Intercepts links before the default anchor renders. Return null to fall
|
|
12
11
|
* through. Lets a caller turn a reserved href (an in-page evidence
|
|
@@ -16,132 +15,150 @@ interface MarkdownProps {
|
|
|
16
15
|
codeActions?: (code: string) => ReactNode
|
|
17
16
|
}
|
|
18
17
|
|
|
18
|
+
interface MarkdownProps extends MarkdownHooks {
|
|
19
|
+
children: string
|
|
20
|
+
className?: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const MarkdownHooksContext = createContext<MarkdownHooks>({})
|
|
24
|
+
|
|
25
|
+
const REMARK_PLUGINS = [remarkGfm]
|
|
26
|
+
|
|
27
|
+
// Module-level so every render hands react-markdown the same component types.
|
|
28
|
+
// A fresh map per render makes React unmount and remount the whole rendered
|
|
29
|
+
// tree whenever the parent re-renders; WebKit then moves the scroll position
|
|
30
|
+
// of any pane the text sits in. Per-call hooks arrive through context instead.
|
|
31
|
+
const COMPONENTS: Components = {
|
|
32
|
+
h1: ({ children }) => (
|
|
33
|
+
<h1 className="text-lg font-bold text-theme-text-primary mt-4 mb-2 first:mt-0">{children}</h1>
|
|
34
|
+
),
|
|
35
|
+
h2: ({ children }) => (
|
|
36
|
+
<h2 className="text-base font-semibold text-theme-text-primary mt-4 mb-2 first:mt-0">{children}</h2>
|
|
37
|
+
),
|
|
38
|
+
h3: ({ children }) => (
|
|
39
|
+
<h3 className="text-sm font-semibold text-theme-text-primary mt-3 mb-1.5">{children}</h3>
|
|
40
|
+
),
|
|
41
|
+
h4: ({ children }) => (
|
|
42
|
+
<h4 className="text-sm font-medium text-theme-text-primary mt-2 mb-1">{children}</h4>
|
|
43
|
+
),
|
|
44
|
+
p: ({ children }) => (
|
|
45
|
+
<p className="text-theme-text-secondary my-2 leading-relaxed">{children}</p>
|
|
46
|
+
),
|
|
47
|
+
a: function MarkdownLink({ href, children }) {
|
|
48
|
+
const { linkRenderer } = useContext(MarkdownHooksContext)
|
|
49
|
+
const custom = linkRenderer?.(href, children)
|
|
50
|
+
if (custom !== null && custom !== undefined) return <>{custom}</>
|
|
51
|
+
return (
|
|
52
|
+
<a
|
|
53
|
+
href={href}
|
|
54
|
+
target="_blank"
|
|
55
|
+
rel="noopener noreferrer"
|
|
56
|
+
className="text-blue-400 hover:text-blue-300 underline underline-offset-2"
|
|
57
|
+
>
|
|
58
|
+
{children}
|
|
59
|
+
</a>
|
|
60
|
+
)
|
|
61
|
+
},
|
|
62
|
+
ul: ({ children }) => (
|
|
63
|
+
<ul className="list-disc list-outside pl-4 my-2 space-y-1 text-theme-text-secondary">{children}</ul>
|
|
64
|
+
),
|
|
65
|
+
ol: ({ children }) => (
|
|
66
|
+
<ol className="list-decimal list-outside pl-4 my-2 space-y-1 text-theme-text-secondary">{children}</ol>
|
|
67
|
+
),
|
|
68
|
+
li: ({ children }) => (
|
|
69
|
+
<li className="leading-relaxed">{children}</li>
|
|
70
|
+
),
|
|
71
|
+
code: function MarkdownCode({ className, children }) {
|
|
72
|
+
const { codeActions } = useContext(MarkdownHooksContext)
|
|
73
|
+
const isInline = !className
|
|
74
|
+
if (isInline) {
|
|
75
|
+
const actions = codeActions?.(String(children))
|
|
76
|
+
if (actions) {
|
|
77
|
+
return (
|
|
78
|
+
<span className="inline-flex max-w-full items-start gap-1 align-middle">
|
|
79
|
+
<code className="inline-code min-w-0">{children}</code>
|
|
80
|
+
{actions}
|
|
81
|
+
</span>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
return (
|
|
85
|
+
<code className="inline-code">
|
|
86
|
+
{children}
|
|
87
|
+
</code>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
return (
|
|
91
|
+
<code className="block font-mono text-theme-text-secondary">{children}</code>
|
|
92
|
+
)
|
|
93
|
+
},
|
|
94
|
+
pre: function MarkdownPre({ children, node }) {
|
|
95
|
+
const { codeActions } = useContext(MarkdownHooksContext)
|
|
96
|
+
const code = node?.children[0]
|
|
97
|
+
const text = code?.type === 'element'
|
|
98
|
+
? code.children.filter(child => child.type === 'text').map(child => child.value).join('')
|
|
99
|
+
: ''
|
|
100
|
+
const actions = codeActions?.(text)
|
|
101
|
+
if (actions) {
|
|
102
|
+
// Render the code directly so an unlabelled fence does not also
|
|
103
|
+
// receive the inline-code action. Only the code scrolls, not Copy.
|
|
104
|
+
return (
|
|
105
|
+
<pre className="my-3 flex items-start gap-2 rounded-lg bg-theme-elevated p-3 text-xs font-mono text-theme-text-secondary">
|
|
106
|
+
<code className="min-w-0 flex-1 overflow-x-auto">{text}</code>
|
|
107
|
+
{actions}
|
|
108
|
+
</pre>
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
return (
|
|
112
|
+
<pre className="my-3 p-3 bg-theme-elevated rounded-lg overflow-x-auto text-xs font-mono text-theme-text-secondary">
|
|
113
|
+
{children}
|
|
114
|
+
</pre>
|
|
115
|
+
)
|
|
116
|
+
},
|
|
117
|
+
blockquote: ({ children }) => (
|
|
118
|
+
<blockquote className="border-l-2 border-theme-border pl-3 my-2 text-theme-text-tertiary italic">
|
|
119
|
+
{children}
|
|
120
|
+
</blockquote>
|
|
121
|
+
),
|
|
122
|
+
table: ({ children }) => (
|
|
123
|
+
<div className="my-3 overflow-x-auto">
|
|
124
|
+
<table className="min-w-full border-collapse text-sm">{children}</table>
|
|
125
|
+
</div>
|
|
126
|
+
),
|
|
127
|
+
thead: ({ children }) => (
|
|
128
|
+
<thead className="bg-theme-elevated">{children}</thead>
|
|
129
|
+
),
|
|
130
|
+
tbody: ({ children }) => (
|
|
131
|
+
<tbody className="divide-y divide-theme-border">{children}</tbody>
|
|
132
|
+
),
|
|
133
|
+
tr: ({ children }) => (
|
|
134
|
+
<tr className="border-b border-theme-border">{children}</tr>
|
|
135
|
+
),
|
|
136
|
+
th: ({ children }) => (
|
|
137
|
+
<th className="px-3 py-2 text-left text-theme-text-primary font-medium border border-theme-border">
|
|
138
|
+
{children}
|
|
139
|
+
</th>
|
|
140
|
+
),
|
|
141
|
+
td: ({ children }) => (
|
|
142
|
+
<td className="px-3 py-2 text-theme-text-secondary border border-theme-border">{children}</td>
|
|
143
|
+
),
|
|
144
|
+
hr: () => <hr className="my-4 border-theme-border" />,
|
|
145
|
+
strong: ({ children }) => (
|
|
146
|
+
<strong className="font-semibold text-theme-text-primary">{children}</strong>
|
|
147
|
+
),
|
|
148
|
+
em: ({ children }) => (
|
|
149
|
+
<em className="italic">{children}</em>
|
|
150
|
+
),
|
|
151
|
+
}
|
|
152
|
+
|
|
19
153
|
export function Markdown({ children, className, linkRenderer, codeActions }: MarkdownProps) {
|
|
154
|
+
const hooks = useMemo(() => ({ linkRenderer, codeActions }), [linkRenderer, codeActions])
|
|
20
155
|
return (
|
|
21
156
|
<div className={clsx('markdown-content', className)}>
|
|
22
|
-
<
|
|
23
|
-
remarkPlugins={
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
),
|
|
28
|
-
h2: ({ children }) => (
|
|
29
|
-
<h2 className="text-base font-semibold text-theme-text-primary mt-4 mb-2 first:mt-0">{children}</h2>
|
|
30
|
-
),
|
|
31
|
-
h3: ({ children }) => (
|
|
32
|
-
<h3 className="text-sm font-semibold text-theme-text-primary mt-3 mb-1.5">{children}</h3>
|
|
33
|
-
),
|
|
34
|
-
h4: ({ children }) => (
|
|
35
|
-
<h4 className="text-sm font-medium text-theme-text-primary mt-2 mb-1">{children}</h4>
|
|
36
|
-
),
|
|
37
|
-
p: ({ children }) => (
|
|
38
|
-
<p className="text-theme-text-secondary my-2 leading-relaxed">{children}</p>
|
|
39
|
-
),
|
|
40
|
-
a: ({ href, children }) => {
|
|
41
|
-
const custom = linkRenderer?.(href, children)
|
|
42
|
-
if (custom !== null && custom !== undefined) return <>{custom}</>
|
|
43
|
-
return (
|
|
44
|
-
<a
|
|
45
|
-
href={href}
|
|
46
|
-
target="_blank"
|
|
47
|
-
rel="noopener noreferrer"
|
|
48
|
-
className="text-blue-400 hover:text-blue-300 underline underline-offset-2"
|
|
49
|
-
>
|
|
50
|
-
{children}
|
|
51
|
-
</a>
|
|
52
|
-
)
|
|
53
|
-
},
|
|
54
|
-
ul: ({ children }) => (
|
|
55
|
-
<ul className="list-disc list-outside pl-4 my-2 space-y-1 text-theme-text-secondary">{children}</ul>
|
|
56
|
-
),
|
|
57
|
-
ol: ({ children }) => (
|
|
58
|
-
<ol className="list-decimal list-outside pl-4 my-2 space-y-1 text-theme-text-secondary">{children}</ol>
|
|
59
|
-
),
|
|
60
|
-
li: ({ children }) => (
|
|
61
|
-
<li className="leading-relaxed">{children}</li>
|
|
62
|
-
),
|
|
63
|
-
code: ({ className, children }) => {
|
|
64
|
-
const isInline = !className
|
|
65
|
-
if (isInline) {
|
|
66
|
-
const actions = codeActions?.(String(children))
|
|
67
|
-
if (actions) {
|
|
68
|
-
return (
|
|
69
|
-
<span className="inline-flex max-w-full items-start gap-1 align-middle">
|
|
70
|
-
<code className="inline-code min-w-0">{children}</code>
|
|
71
|
-
{actions}
|
|
72
|
-
</span>
|
|
73
|
-
)
|
|
74
|
-
}
|
|
75
|
-
return (
|
|
76
|
-
<code className="inline-code">
|
|
77
|
-
{children}
|
|
78
|
-
</code>
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
return (
|
|
82
|
-
<code className="block font-mono text-theme-text-secondary">{children}</code>
|
|
83
|
-
)
|
|
84
|
-
},
|
|
85
|
-
pre: ({ children, node }) => {
|
|
86
|
-
const code = node?.children[0]
|
|
87
|
-
const text = code?.type === 'element'
|
|
88
|
-
? code.children.filter(child => child.type === 'text').map(child => child.value).join('')
|
|
89
|
-
: ''
|
|
90
|
-
const actions = codeActions?.(text)
|
|
91
|
-
if (actions) {
|
|
92
|
-
// Render the code directly so an unlabelled fence does not also
|
|
93
|
-
// receive the inline-code action. Only the code scrolls, not Copy.
|
|
94
|
-
return (
|
|
95
|
-
<pre className="my-3 flex items-start gap-2 rounded-lg bg-theme-elevated p-3 text-xs font-mono text-theme-text-secondary">
|
|
96
|
-
<code className="min-w-0 flex-1 overflow-x-auto">{text}</code>
|
|
97
|
-
{actions}
|
|
98
|
-
</pre>
|
|
99
|
-
)
|
|
100
|
-
}
|
|
101
|
-
return (
|
|
102
|
-
<pre className="my-3 p-3 bg-theme-elevated rounded-lg overflow-x-auto text-xs font-mono text-theme-text-secondary">
|
|
103
|
-
{children}
|
|
104
|
-
</pre>
|
|
105
|
-
)
|
|
106
|
-
},
|
|
107
|
-
blockquote: ({ children }) => (
|
|
108
|
-
<blockquote className="border-l-2 border-theme-border pl-3 my-2 text-theme-text-tertiary italic">
|
|
109
|
-
{children}
|
|
110
|
-
</blockquote>
|
|
111
|
-
),
|
|
112
|
-
table: ({ children }) => (
|
|
113
|
-
<div className="my-3 overflow-x-auto">
|
|
114
|
-
<table className="min-w-full border-collapse text-sm">{children}</table>
|
|
115
|
-
</div>
|
|
116
|
-
),
|
|
117
|
-
thead: ({ children }) => (
|
|
118
|
-
<thead className="bg-theme-elevated">{children}</thead>
|
|
119
|
-
),
|
|
120
|
-
tbody: ({ children }) => (
|
|
121
|
-
<tbody className="divide-y divide-theme-border">{children}</tbody>
|
|
122
|
-
),
|
|
123
|
-
tr: ({ children }) => (
|
|
124
|
-
<tr className="border-b border-theme-border">{children}</tr>
|
|
125
|
-
),
|
|
126
|
-
th: ({ children }) => (
|
|
127
|
-
<th className="px-3 py-2 text-left text-theme-text-primary font-medium border border-theme-border">
|
|
128
|
-
{children}
|
|
129
|
-
</th>
|
|
130
|
-
),
|
|
131
|
-
td: ({ children }) => (
|
|
132
|
-
<td className="px-3 py-2 text-theme-text-secondary border border-theme-border">{children}</td>
|
|
133
|
-
),
|
|
134
|
-
hr: () => <hr className="my-4 border-theme-border" />,
|
|
135
|
-
strong: ({ children }) => (
|
|
136
|
-
<strong className="font-semibold text-theme-text-primary">{children}</strong>
|
|
137
|
-
),
|
|
138
|
-
em: ({ children }) => (
|
|
139
|
-
<em className="italic">{children}</em>
|
|
140
|
-
),
|
|
141
|
-
}}
|
|
142
|
-
>
|
|
143
|
-
{children}
|
|
144
|
-
</ReactMarkdown>
|
|
157
|
+
<MarkdownHooksContext.Provider value={hooks}>
|
|
158
|
+
<ReactMarkdown remarkPlugins={REMARK_PLUGINS} components={COMPONENTS}>
|
|
159
|
+
{children}
|
|
160
|
+
</ReactMarkdown>
|
|
161
|
+
</MarkdownHooksContext.Provider>
|
|
145
162
|
</div>
|
|
146
163
|
)
|
|
147
164
|
}
|
|
@@ -7,6 +7,7 @@ import { TRANSITION_BACKDROP, TRANSITION_MENU, TW_EASE_UI, overlayExitMs, overla
|
|
|
7
7
|
import { SearchPillInput, type SearchModifier } from '@skyhook-io/k8s-ui'
|
|
8
8
|
import { getResourceIcon } from '../../utils/resource-icons'
|
|
9
9
|
import type { SearchHit, SearchMatchedField } from '../../api/client'
|
|
10
|
+
import { contentMatchLabel, partialSearchNotice } from './omnibar-match'
|
|
10
11
|
import { recordUsageEvent } from '../../api/usage-data'
|
|
11
12
|
import { bestScore, type CommandItem } from './command-items'
|
|
12
13
|
import { SearchSyntaxHelp } from './SearchSyntaxHelp'
|
|
@@ -28,6 +29,10 @@ export interface OmnibarSearchResult {
|
|
|
28
29
|
hits: SearchHit[]
|
|
29
30
|
total?: number
|
|
30
31
|
total_matched?: number
|
|
32
|
+
/** "time_limit" when scan report findings were only partly searched. */
|
|
33
|
+
incomplete_findings?: string
|
|
34
|
+
/** Some namespaces' scan reports were left out, access not confirmed yet. */
|
|
35
|
+
access_incomplete?: boolean
|
|
31
36
|
}
|
|
32
37
|
|
|
33
38
|
// Health → dot color (summaryContext.health is the same vocabulary as the rest
|
|
@@ -424,6 +429,7 @@ export const Omnibar = forwardRef<OmnibarHandle, OmnibarProps>(function Omnibar(
|
|
|
424
429
|
const mac = typeof navigator !== 'undefined' && navigator.platform.includes('Mac')
|
|
425
430
|
const total = searchData?.total ?? 0
|
|
426
431
|
const totalMatched = searchData?.total_matched ?? 0
|
|
432
|
+
const partialNotice = partialSearchNotice(searchData)
|
|
427
433
|
const hasNsPill = pills.some((p) => p.key === 'ns')
|
|
428
434
|
const dropdownOpen = open && !suggesting && (rows.length > 0 || searchActive)
|
|
429
435
|
// Presence: the scrim and the results panel are menu-kind overlays (140ms
|
|
@@ -491,6 +497,11 @@ export const Omnibar = forwardRef<OmnibarHandle, OmnibarProps>(function Omnibar(
|
|
|
491
497
|
<ResourceRow key={row.id} hit={row.hit} stale={resourcesStale} selected={row.id === selectedId} onSelect={() => selectRow(row.id)} onActivate={() => { if (!resourcesStale) execute(row) }} />
|
|
492
498
|
))
|
|
493
499
|
)}
|
|
500
|
+
{!isFetching && !isError && partialNotice && (
|
|
501
|
+
<div className="flex items-start gap-2 px-3 py-1.5 text-[11px] text-amber-600 dark:text-amber-400">
|
|
502
|
+
<AlertTriangle className="w-3 h-3 mt-0.5 shrink-0" /> {partialNotice}
|
|
503
|
+
</div>
|
|
504
|
+
)}
|
|
494
505
|
</>
|
|
495
506
|
)}
|
|
496
507
|
|
|
@@ -614,7 +625,7 @@ function ResourceRow({ hit, selected, stale, onSelect, onActivate }: { hit: Sear
|
|
|
614
625
|
const Icon = getResourceIcon(hit.kind)
|
|
615
626
|
const dot = healthDot(hit.summaryContext?.health)
|
|
616
627
|
const issues = hit.summaryContext?.issueCount ?? 0
|
|
617
|
-
const
|
|
628
|
+
const contentLabel = contentMatchLabel(hit.matched)
|
|
618
629
|
return (
|
|
619
630
|
<button
|
|
620
631
|
data-selected={selected}
|
|
@@ -630,7 +641,7 @@ function ResourceRow({ hit, selected, stale, onSelect, onActivate }: { hit: Sear
|
|
|
630
641
|
{hit.namespace ? <> · {highlight(hit.namespace, tokensForSite(hit.matched, 'namespace'))}</> : ''}
|
|
631
642
|
{hit.clusterName ? <> · <span className="text-theme-text-secondary">{hit.clusterName}</span></> : ''}
|
|
632
643
|
</span>
|
|
633
|
-
{
|
|
644
|
+
{contentLabel && <span className="shrink-0 text-[10px] text-theme-text-tertiary italic">{contentLabel}</span>}
|
|
634
645
|
{issues > 0 && <span className="ml-auto shrink-0 text-[10px] font-medium text-amber-600 dark:text-amber-400">{issues} issue{issues === 1 ? '' : 's'}</span>}
|
|
635
646
|
</button>
|
|
636
647
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ToastProvider, useToast, showApiError, showApiSuccess } from '@skyhook-io/k8s-ui'
|
|
1
|
+
export { ToastProvider, useToast, showApiError, showApiSuccess, showApiNotice } from '@skyhook-io/k8s-ui'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { contentMatchLabel, partialSearchNotice } from './omnibar-match'
|
|
3
|
+
|
|
4
|
+
const site = (s: string) => ({ token: 't', site: s, score: 12 })
|
|
5
|
+
|
|
6
|
+
describe('contentMatchLabel', () => {
|
|
7
|
+
it('names a match inside Trivy findings', () => {
|
|
8
|
+
expect(contentMatchLabel([site('content:report.vulnerabilities[3]')])).toBe('in findings')
|
|
9
|
+
})
|
|
10
|
+
it('keeps "in spec" for other content', () => {
|
|
11
|
+
expect(contentMatchLabel([site('content:spec.template.spec.containers[0].env[1].value')])).toBe('in spec')
|
|
12
|
+
expect(contentMatchLabel([site('content:report.checks[0]'), site('content:spec.x')])).toBe('in spec')
|
|
13
|
+
})
|
|
14
|
+
it('is empty when any token matched identity', () => {
|
|
15
|
+
expect(contentMatchLabel([site('content:report.vulnerabilities[0]'), site('name')])).toBe('')
|
|
16
|
+
expect(contentMatchLabel([])).toBe('')
|
|
17
|
+
expect(contentMatchLabel(undefined)).toBe('')
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
describe('partialSearchNotice', () => {
|
|
22
|
+
it('flags partly searched findings and unchecked namespaces', () => {
|
|
23
|
+
expect(partialSearchNotice({ incomplete_findings: 'time_limit' })).toMatch(/not fully searched/)
|
|
24
|
+
expect(partialSearchNotice({ access_incomplete: true })).toMatch(/not fully searched/)
|
|
25
|
+
})
|
|
26
|
+
it('is null for a whole result or an older Radar', () => {
|
|
27
|
+
expect(partialSearchNotice({})).toBeNull()
|
|
28
|
+
expect(partialSearchNotice(undefined)).toBeNull()
|
|
29
|
+
})
|
|
30
|
+
})
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SearchMatchedField } from '../../api/client'
|
|
2
|
+
|
|
3
|
+
// contentMatchLabel names where a hit matched when every token landed in the
|
|
4
|
+
// object's content rather than its name, kind or namespace. Trivy Operator
|
|
5
|
+
// reports keep their findings under `report`, not a spec.
|
|
6
|
+
export function contentMatchLabel(matched: SearchMatchedField[] | undefined): string {
|
|
7
|
+
if (!matched?.length || !matched.every((m) => m.site.startsWith('content:'))) return ''
|
|
8
|
+
return matched.every((m) => m.site.startsWith('content:report.')) ? 'in findings' : 'in spec'
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// partialSearchNotice explains a result the server says is incomplete, so a
|
|
12
|
+
// missing CVE doesn't read as "not affected". Null when the search was whole.
|
|
13
|
+
export function partialSearchNotice(data: { incomplete_findings?: string; access_incomplete?: boolean } | undefined): string | null {
|
|
14
|
+
if (data?.incomplete_findings || data?.access_incomplete) {
|
|
15
|
+
return 'Some scan reports were not fully searched. Try again, or narrow with ns:.'
|
|
16
|
+
}
|
|
17
|
+
return null
|
|
18
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LucideIcon } from 'lucide-react'
|
|
2
|
-
import { Bot, GitCompareArrows, Layers, Network, RefreshCcw, Scale, ScrollText, SlidersHorizontal } from 'lucide-react'
|
|
2
|
+
import { Bot, Database, GitCompareArrows, HardDrive, Hourglass, Layers, Network, RefreshCcw, Scale, ScrollText, SlidersHorizontal, Undo2 } from 'lucide-react'
|
|
3
3
|
import { compareVersions } from '../../utils/version'
|
|
4
4
|
|
|
5
5
|
export interface ReleaseHighlight {
|
|
@@ -47,6 +47,68 @@ export const CHANGELOG_URL = 'https://radarhq.io/changelog'
|
|
|
47
47
|
// major release must have its own entry: scripts/check-whats-new.sh refuses to
|
|
48
48
|
// release one without it.
|
|
49
49
|
export const RELEASE_NOTES: ReleaseNotes[] = [
|
|
50
|
+
{
|
|
51
|
+
version: 'v1.17.0',
|
|
52
|
+
highlights: [
|
|
53
|
+
{
|
|
54
|
+
id: 'cloudnative-pg',
|
|
55
|
+
icon: Database,
|
|
56
|
+
title: 'CloudNativePG, end to end',
|
|
57
|
+
description: 'See which Postgres cluster needs attention and why, whether its backups would restore, and switch over, fence or restore with a review first.',
|
|
58
|
+
leadDescription: 'New views for CloudNativePG show which Postgres cluster needs attention and why, what each instance is doing, and whether its backups would actually let you restore. Create, restore, back up, switch over, fence and hibernate from Radar: you review exactly what will be written, then Radar follows the operation until it sees the outcome.',
|
|
59
|
+
importance: 9,
|
|
60
|
+
path: '/cnpg',
|
|
61
|
+
cta: 'Open CloudNativePG',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 'live-traffic-large-clusters',
|
|
65
|
+
icon: Network,
|
|
66
|
+
title: 'Live Traffic on large Cilium clusters',
|
|
67
|
+
description: 'Traffic is drawn per workload and stays fast on big clusters. Focus on one workload, or get a connection list when the map is too big.',
|
|
68
|
+
importance: 7,
|
|
69
|
+
path: '/traffic',
|
|
70
|
+
cta: 'Open Live Traffic',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'gitops-revert-warnings',
|
|
74
|
+
icon: Undo2,
|
|
75
|
+
title: 'Know before an edit gets reverted',
|
|
76
|
+
description: 'Before Radar edits an object owned by Argo CD, Flux or Helm, it tells you whether the owner will undo the change.',
|
|
77
|
+
importance: 6,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'stuck-deletion-issues',
|
|
81
|
+
icon: Hourglass,
|
|
82
|
+
title: 'Issues for stuck deletions',
|
|
83
|
+
description: "Helm uninstalls and custom resources stuck deleting raise issues, and so do volumes that can't attach to their node's machine type.",
|
|
84
|
+
importance: 6,
|
|
85
|
+
path: '/issues',
|
|
86
|
+
cta: 'Open Issues',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'audit-unused-storage',
|
|
90
|
+
icon: HardDrive,
|
|
91
|
+
title: 'Cluster Audit finds unused storage',
|
|
92
|
+
description: 'Claims nothing uses, claims Pending for over a day, and Released PersistentVolumes, with their size and storage class.',
|
|
93
|
+
// Below v1.16's headline at its 0.75 weight, so an upgrade from v1.15
|
|
94
|
+
// still shows that card.
|
|
95
|
+
importance: 4,
|
|
96
|
+
path: '/checks',
|
|
97
|
+
cta: 'Open Checks',
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
improvements: [
|
|
101
|
+
// The grid fills row by row: pair lines of similar length.
|
|
102
|
+
"Capacity explains why a node pool isn't scaling down",
|
|
103
|
+
'Nodes being removed show as removed, not failed',
|
|
104
|
+
'Helm actions on Flux releases change the right objects',
|
|
105
|
+
'Flux Sync with source matches flux reconcile --with-source',
|
|
106
|
+
'Topology links Services only to the Pods they select',
|
|
107
|
+
'Namespaces stuck Terminating show what holds them',
|
|
108
|
+
'Filters stay put when you switch kinds or sections',
|
|
109
|
+
'Skip an audit check per resource with an annotation',
|
|
110
|
+
],
|
|
111
|
+
},
|
|
50
112
|
{
|
|
51
113
|
version: 'v1.16.0',
|
|
52
114
|
highlights: [
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { renderToStaticMarkup } from 'react-dom/server'
|
|
2
|
+
import { describe, expect, it } from 'vitest'
|
|
3
|
+
import { CronJobSchedulingContext, CronJobSchedulingDetails } from './CronJobSchedulingEvidence'
|
|
4
|
+
import type { CronJobSchedulingEvidence } from '../../api/client'
|
|
5
|
+
|
|
6
|
+
const report: CronJobSchedulingEvidence = {
|
|
7
|
+
uid: 'current-cronjob', state: 'reported', reason: 'InvalidSchedule',
|
|
8
|
+
message: 'original report from Kubernetes', last_reported_at: '2026-10-21T08:00:00Z',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
describe('CronJob scheduling evidence', () => {
|
|
12
|
+
it('does not duplicate an operational report with a second notice', () => {
|
|
13
|
+
expect(renderToStaticMarkup(<CronJobSchedulingContext evidence={report} onViewTimeline={() => {}} />)).toBe('')
|
|
14
|
+
})
|
|
15
|
+
it('makes an edited future schedule neutral and keeps its evidence accessible', () => {
|
|
16
|
+
const html = renderToStaticMarkup(<CronJobSchedulingContext evidence={{ ...report, state: 'configuration_changed', configuration_changed_at: '2026-10-21T08:05:00Z' }} onViewTimeline={() => {}} />)
|
|
17
|
+
expect(html).toContain('Schedule changed after this error')
|
|
18
|
+
expect(html).toContain('Kubernetes has not recorded a scheduled run since the change.')
|
|
19
|
+
expect(html).toContain('Earlier report')
|
|
20
|
+
expect(html).toContain(report.message)
|
|
21
|
+
expect(html).toContain('View timeline')
|
|
22
|
+
expect(html).not.toContain('Operational issues')
|
|
23
|
+
expect(html).not.toContain('Warning')
|
|
24
|
+
})
|
|
25
|
+
it('does not call incomplete history recovery or a confirmed current failure', () => {
|
|
26
|
+
const html = renderToStaticMarkup(<CronJobSchedulingContext evidence={{ ...report, state: 'history_incomplete', history_incomplete: true }} onViewTimeline={() => {}} />)
|
|
27
|
+
expect(html).toContain('Scheduling history is incomplete')
|
|
28
|
+
expect(html).toContain('cannot establish whether it still applies')
|
|
29
|
+
})
|
|
30
|
+
it('provides the report date and existing timeline navigation in expanded evidence', () => {
|
|
31
|
+
const html = renderToStaticMarkup(<CronJobSchedulingDetails evidence={report} onViewTimeline={() => {}} />)
|
|
32
|
+
expect(html).toContain('Last reported')
|
|
33
|
+
expect(html).toContain('View timeline')
|
|
34
|
+
})
|
|
35
|
+
})
|