@skyhook-io/k8s-ui 1.8.10 → 1.8.12
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 +7 -6
- package/src/assets/gitops/argocd.png +0 -0
- package/src/assets/gitops/flux.svg +7 -0
- package/src/components/applications/AppChips.tsx +10 -0
- package/src/components/applications/ApplicationDetail.test.tsx +697 -0
- package/src/components/applications/ApplicationDetail.tsx +3269 -474
- package/src/components/applications/ApplicationsView.tsx +62 -10
- package/src/components/applications/applications-view.test.tsx +47 -0
- package/src/components/applications/index.ts +1 -1
- package/src/components/audit/AuditAlerts.tsx +14 -10
- package/src/components/checks/ChecksView.tsx +2 -3
- package/src/components/checks/severity.ts +14 -10
- package/src/components/cluster-switcher/ClusterSwitcher.tsx +2 -2
- package/src/components/compare/CompareResourcePicker.tsx +2 -2
- package/src/components/gitops/GitOpsDetailLayout.tsx +13 -3
- package/src/components/gitops/GitOpsGraphFilterRail.tsx +2 -1
- package/src/components/gitops/GitOpsTableView.tsx +13 -6
- package/src/components/gitops/ManagedResourcesList.tsx +8 -11
- package/src/components/gitops/SyncCountdown.tsx +26 -17
- package/src/components/gitops/SyncOptionsDialog.test.ts +48 -0
- package/src/components/gitops/SyncOptionsDialog.tsx +190 -46
- package/src/components/gitops/insights/ArgoResourceDiff.tsx +172 -0
- package/src/components/gitops/insights/GitOpsInsightViews.tsx +474 -121
- package/src/components/gitops/insights/index.ts +1 -0
- package/src/components/gitops/insights/insights-helpers.test.ts +102 -1
- package/src/components/gitops/insights/insights-helpers.ts +74 -1
- package/src/components/gitops/tree/GitOpsTreeGraph.tsx +10 -2
- package/src/components/issues/IssuesView.tsx +91 -52
- package/src/components/issues/ResourceIssuesSection.test.tsx +39 -6
- package/src/components/issues/ResourceIssuesSection.tsx +46 -144
- package/src/components/issues/index.ts +3 -0
- package/src/components/issues/issue-timing.ts +53 -0
- package/src/components/issues/issues.test.ts +102 -1
- package/src/components/issues/severity.ts +3 -0
- package/src/components/logs/LogCore.tsx +14 -4
- package/src/components/logs/WorkloadLogsViewer.tsx +31 -6
- package/src/components/logs/useLogStream.ts +8 -1
- package/src/components/namespace-switcher/NamespacePicker.tsx +86 -107
- package/src/components/resources/ResourcesSidebar.test.tsx +71 -0
- package/src/components/resources/ResourcesSidebar.tsx +46 -46
- package/src/components/resources/ResourcesView.selected-kind.test.ts +143 -0
- package/src/components/resources/ResourcesView.tsx +233 -51
- package/src/components/resources/renderers/AWSMachineRenderer.tsx +3 -2
- package/src/components/resources/renderers/AWSManagedClusterRenderer.tsx +3 -2
- package/src/components/resources/renderers/AWSManagedControlPlaneRenderer.tsx +3 -2
- package/src/components/resources/renderers/AWSManagedMachinePoolRenderer.tsx +3 -2
- package/src/components/resources/renderers/AzureMachineRenderer.tsx +3 -2
- package/src/components/resources/renderers/AzureManagedControlPlaneRenderer.tsx +3 -2
- package/src/components/resources/renderers/AzureManagedMachinePoolRenderer.tsx +3 -2
- package/src/components/resources/renderers/CAPIClusterRenderer.tsx +3 -2
- package/src/components/resources/renderers/CAPIKubeadmControlPlaneRenderer.tsx +3 -2
- package/src/components/resources/renderers/CAPIMachineDeploymentRenderer.tsx +3 -2
- package/src/components/resources/renderers/CAPIMachineHealthCheckRenderer.tsx +3 -2
- package/src/components/resources/renderers/CAPIMachinePoolRenderer.tsx +3 -2
- package/src/components/resources/renderers/CAPIMachineRenderer.tsx +3 -2
- package/src/components/resources/renderers/CAPIMachineSetRenderer.tsx +3 -2
- package/src/components/resources/renderers/CertificateRenderer.tsx +3 -2
- package/src/components/resources/renderers/CertificateRequestRenderer.tsx +3 -2
- package/src/components/resources/renderers/ClusterComplianceReportRenderer.tsx +2 -2
- package/src/components/resources/renderers/CompositeRenderer.tsx +3 -2
- package/src/components/resources/renderers/CronWorkflowRenderer.tsx +99 -0
- package/src/components/resources/renderers/ExternalSecretRenderer.tsx +3 -2
- package/src/components/resources/renderers/GCPMachineRenderer.tsx +3 -2
- package/src/components/resources/renderers/GCPManagedControlPlaneRenderer.tsx +3 -2
- package/src/components/resources/renderers/GCPManagedMachinePoolRenderer.tsx +3 -2
- package/src/components/resources/renderers/GRPCRouteRenderer.tsx +7 -3
- package/src/components/resources/renderers/GatewayClassRenderer.tsx +3 -2
- package/src/components/resources/renderers/HTTPRouteRenderer.tsx +7 -3
- package/src/components/resources/renderers/JobRenderer.tsx +3 -1
- package/src/components/resources/renderers/KarpenterEC2NodeClassRenderer.tsx +3 -2
- package/src/components/resources/renderers/KarpenterNodeClaimRenderer.tsx +3 -2
- package/src/components/resources/renderers/KarpenterNodePoolRenderer.tsx +3 -2
- package/src/components/resources/renderers/KedaScaledJobRenderer.tsx +3 -2
- package/src/components/resources/renderers/KedaScaledObjectRenderer.tsx +3 -2
- package/src/components/resources/renderers/ManagedResourceRenderer.tsx +3 -2
- package/src/components/resources/renderers/PVCRenderer.tsx +3 -2
- package/src/components/resources/renderers/PrometheusRuleRenderer.tsx +2 -2
- package/src/components/resources/renderers/SbomReportRenderer.tsx +2 -2
- package/src/components/resources/renderers/SealedSecretRenderer.tsx +3 -2
- package/src/components/resources/renderers/SecretRenderer.tsx +2 -0
- package/src/components/resources/renderers/SecretStoreRenderer.tsx +3 -2
- package/src/components/resources/renderers/ServiceRenderer.tsx +58 -40
- package/src/components/resources/renderers/SimpleRouteRenderer.tsx +7 -3
- package/src/components/resources/renderers/VulnerabilityReportRenderer.tsx +2 -2
- package/src/components/resources/renderers/WorkflowRenderer.test.tsx +43 -0
- package/src/components/resources/renderers/WorkflowRenderer.tsx +60 -78
- package/src/components/resources/renderers/index.ts +1 -0
- package/src/components/resources/resource-utils-argo.test.ts +18 -1
- package/src/components/resources/resource-utils-argo.ts +8 -0
- package/src/components/resources/resource-utils-capi.ts +1 -1
- package/src/components/resources/resource-utils.ts +31 -0
- package/src/components/shared/DetailShell.tsx +2 -2
- package/src/components/shared/ResourceActionsBar.tsx +142 -111
- package/src/components/shared/ResourceRendererDispatch.tsx +33 -4
- package/src/components/shared/UnifiedDiff.tsx +51 -0
- package/src/components/shared/index.ts +1 -0
- package/src/components/timeline/TimelineList.tsx +375 -354
- package/src/components/timeline/TimelineStrip.test.tsx +194 -0
- package/src/components/timeline/TimelineStrip.tsx +836 -0
- package/src/components/timeline/TimelineSwimlanes.test.tsx +1028 -0
- package/src/components/timeline/TimelineSwimlanes.tsx +2498 -593
- package/src/components/timeline/TimelineToolbar.test.tsx +320 -0
- package/src/components/timeline/TimelineToolbar.tsx +759 -0
- package/src/components/timeline/TimelineToolbarState.test.tsx +88 -0
- package/src/components/timeline/index.ts +23 -0
- package/src/components/timeline/scrubber-math.test.ts +235 -0
- package/src/components/timeline/scrubber-math.ts +249 -0
- package/src/components/timeline/shared.test.tsx +219 -0
- package/src/components/timeline/shared.tsx +232 -447
- package/src/components/timeline/timeline-filters.test.ts +196 -0
- package/src/components/timeline/timeline-filters.ts +180 -0
- package/src/components/timeline/timeline-lane-sort.test.ts +97 -0
- package/src/components/timeline/timeline-lane-sort.ts +77 -0
- package/src/components/timeline/timeline-live.test.ts +131 -0
- package/src/components/timeline/timeline-live.ts +77 -0
- package/src/components/topology/GroupNode.tsx +9 -2
- package/src/components/topology/K8sResourceNode.test.ts +11 -0
- package/src/components/topology/K8sResourceNode.tsx +387 -243
- package/src/components/topology/TopologyBreadcrumb.tsx +30 -0
- package/src/components/topology/TopologyControls.tsx +3 -1
- package/src/components/topology/TopologyFilterSidebar.tsx +9 -0
- package/src/components/topology/TopologyGraph.tsx +149 -90
- package/src/components/topology/TopologyOverlayBar.tsx +30 -0
- package/src/components/topology/TopologySearch.tsx +25 -17
- package/src/components/topology/index.ts +2 -0
- package/src/components/topology/layout.ts +10 -2
- package/src/components/topology/topology.css +0 -92
- package/src/components/ui/Badge.tsx +6 -1
- package/src/components/ui/CodeViewer.tsx +2 -2
- package/src/components/ui/Collapse.tsx +59 -0
- package/src/components/ui/ConfirmDialog.tsx +7 -3
- package/src/components/ui/DialogPortal.tsx +31 -9
- package/src/components/ui/Input.tsx +24 -0
- package/src/components/ui/MultiSelectPicker.test.tsx +101 -0
- package/src/components/ui/MultiSelectPicker.tsx +167 -0
- package/src/components/ui/PaneLoader.tsx +10 -2
- package/src/components/ui/ResourceBar.tsx +68 -25
- package/src/components/ui/SearchBox.tsx +18 -4
- package/src/components/ui/SearchPillInput.tsx +2 -2
- package/src/components/ui/SelectMenu.tsx +81 -0
- package/src/components/ui/drawer-components.tsx +48 -32
- package/src/components/ui/index.ts +6 -0
- package/src/components/ui/severity-tone.ts +11 -4
- package/src/components/workload/ResourceDetailDrawer.tsx +6 -2
- package/src/components/workload/WorkloadView.tsx +2706 -475
- package/src/components/workload/index.ts +1 -1
- package/src/theme/tailwind-theme.css +1 -0
- package/src/theme/variables.css +2 -1
- package/src/types/core.ts +57 -4
- package/src/types/gitops-insights.ts +69 -1
- package/src/types/gitops.ts +3 -3
- package/src/utils/application-history.test.ts +538 -0
- package/src/utils/application-history.ts +257 -0
- package/src/utils/application-topology.test.ts +198 -0
- package/src/utils/application-topology.ts +261 -0
- package/src/utils/applications.test.ts +201 -1
- package/src/utils/applications.ts +1182 -393
- package/src/utils/index.ts +3 -0
- package/src/utils/navigation.test.ts +32 -1
- package/src/utils/navigation.ts +70 -0
- package/src/utils/resource-hierarchy.test.ts +1024 -1
- package/src/utils/resource-hierarchy.ts +925 -267
- package/src/utils/resource-icons.ts +2 -0
- package/src/utils/topology-neighborhood.test.ts +202 -1
- package/src/utils/topology-neighborhood.ts +194 -13
- package/src/utils/workflow-execution.test.ts +556 -0
- package/src/utils/workflow-execution.ts +814 -0
- package/src/utils/workload-colors.ts +2 -3
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
} from 'lucide-react'
|
|
19
19
|
import { createTwoFilesPatch } from 'diff'
|
|
20
20
|
import { clsx } from 'clsx'
|
|
21
|
+
import { classifyDiffLine } from './UnifiedDiff'
|
|
21
22
|
import { Tooltip } from '../ui/Tooltip'
|
|
22
23
|
import { ForceDeleteConfirmDialog, type CascadeDependent } from '../ui/ForceDeleteConfirmDialog'
|
|
23
24
|
import { ConfirmDialog } from '../ui/ConfirmDialog'
|
|
@@ -150,6 +151,12 @@ export function ResourceActionsBar({
|
|
|
150
151
|
onDrainNode, isDrainingNode,
|
|
151
152
|
}: ResourceActionsBarProps) {
|
|
152
153
|
const kind = resource.kind.toLowerCase()
|
|
154
|
+
const canOpenWorkloadLogs = Boolean(
|
|
155
|
+
canViewLogs &&
|
|
156
|
+
!hideLogs &&
|
|
157
|
+
openWorkloadLogs &&
|
|
158
|
+
['deployments', 'statefulsets', 'daemonsets', 'jobs', 'workflows', 'cronjobs', 'cronworkflows', 'workflowtemplates', 'clusterworkflowtemplates', 'scaledjobs'].includes(kind)
|
|
159
|
+
)
|
|
153
160
|
|
|
154
161
|
// Delete confirmation state
|
|
155
162
|
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false)
|
|
@@ -362,33 +369,21 @@ export function ResourceActionsBar({
|
|
|
362
369
|
</button>
|
|
363
370
|
)}
|
|
364
371
|
{isRollbackKind && onRollback && (
|
|
365
|
-
<
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
{canViewLogs && !hideLogs && ['deployments', 'statefulsets', 'daemonsets'].includes(kind) && openWorkloadLogs && (
|
|
381
|
-
<button
|
|
382
|
-
onClick={() => openWorkloadLogs({
|
|
383
|
-
namespace: resource.namespace,
|
|
384
|
-
workloadKind: kind,
|
|
385
|
-
workloadName: resource.name,
|
|
386
|
-
})}
|
|
387
|
-
className="flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium btn-brand-muted rounded-lg"
|
|
388
|
-
>
|
|
389
|
-
<FileText className="w-3.5 h-3.5" />
|
|
390
|
-
Logs
|
|
391
|
-
</button>
|
|
372
|
+
<Tooltip content={hasMultipleRevisions ? 'View revision history and rollback' : 'Only one revision exists'} delay={150}>
|
|
373
|
+
<button
|
|
374
|
+
onClick={() => setShowRevisions(true)}
|
|
375
|
+
disabled={!hasMultipleRevisions}
|
|
376
|
+
className={clsx(
|
|
377
|
+
"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg transition-colors",
|
|
378
|
+
hasMultipleRevisions
|
|
379
|
+
? "text-white bg-amber-600 hover:bg-amber-700"
|
|
380
|
+
: "text-theme-text-disabled bg-theme-elevated"
|
|
381
|
+
)}
|
|
382
|
+
>
|
|
383
|
+
<History className="w-3.5 h-3.5" />
|
|
384
|
+
Rollback
|
|
385
|
+
</button>
|
|
386
|
+
</Tooltip>
|
|
392
387
|
)}
|
|
393
388
|
</>
|
|
394
389
|
)}
|
|
@@ -473,8 +468,22 @@ export function ResourceActionsBar({
|
|
|
473
468
|
/>
|
|
474
469
|
)}
|
|
475
470
|
|
|
471
|
+
{canOpenWorkloadLogs && (
|
|
472
|
+
<button
|
|
473
|
+
onClick={() => openWorkloadLogs?.({
|
|
474
|
+
namespace: resource.namespace,
|
|
475
|
+
workloadKind: kind,
|
|
476
|
+
workloadName: resource.name,
|
|
477
|
+
})}
|
|
478
|
+
className="flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium btn-brand-muted rounded-lg"
|
|
479
|
+
>
|
|
480
|
+
<FileText className="w-3.5 h-3.5" />
|
|
481
|
+
Logs
|
|
482
|
+
</button>
|
|
483
|
+
)}
|
|
484
|
+
|
|
476
485
|
{/* Job logs */}
|
|
477
|
-
{kind === 'jobs' && onCopyCommand && (
|
|
486
|
+
{kind === 'jobs' && onCopyCommand && (!canViewLogs || !openWorkloadLogs) && (
|
|
478
487
|
<button
|
|
479
488
|
onClick={(e) => onCopyCommand(
|
|
480
489
|
`kubectl logs job/${resource.name} -n ${resource.namespace} -f`,
|
|
@@ -488,26 +497,43 @@ export function ResourceActionsBar({
|
|
|
488
497
|
</button>
|
|
489
498
|
)}
|
|
490
499
|
|
|
491
|
-
{
|
|
492
|
-
<div className="flex-1" />
|
|
493
|
-
|
|
494
|
-
{/* Universal actions (right-aligned) */}
|
|
495
|
-
{onToggleYaml && (
|
|
500
|
+
{kind === 'workflows' && onCopyCommand && (!canViewLogs || !openWorkloadLogs) && (
|
|
496
501
|
<button
|
|
497
|
-
onClick={
|
|
498
|
-
|
|
499
|
-
'
|
|
500
|
-
|
|
501
|
-
? 'btn-brand'
|
|
502
|
-
: 'text-theme-text-secondary hover:text-theme-text-primary border border-theme-border-light hover:bg-theme-elevated'
|
|
502
|
+
onClick={(e) => onCopyCommand(
|
|
503
|
+
`argo logs ${resource.name} -n ${resource.namespace}`,
|
|
504
|
+
'Logs command copied',
|
|
505
|
+
e
|
|
503
506
|
)}
|
|
504
|
-
|
|
507
|
+
className="flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium btn-brand-muted rounded-lg"
|
|
505
508
|
>
|
|
506
|
-
<
|
|
507
|
-
|
|
509
|
+
<FileText className="w-3.5 h-3.5" />
|
|
510
|
+
Logs
|
|
508
511
|
</button>
|
|
509
512
|
)}
|
|
510
513
|
|
|
514
|
+
{/* Spacer pushes universal actions to the right */}
|
|
515
|
+
<div className="flex-1" />
|
|
516
|
+
|
|
517
|
+
{/* Universal actions (right-aligned). The AI/Diagnose action is NOT here — it
|
|
518
|
+
lives in the detail header chrome (see WorkloadView), set apart from these
|
|
519
|
+
imperative ops. */}
|
|
520
|
+
{onToggleYaml && (
|
|
521
|
+
<Tooltip content="Toggle YAML view" delay={150}>
|
|
522
|
+
<button
|
|
523
|
+
onClick={onToggleYaml}
|
|
524
|
+
className={clsx(
|
|
525
|
+
'flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg transition-colors',
|
|
526
|
+
showYaml
|
|
527
|
+
? 'btn-brand'
|
|
528
|
+
: 'text-theme-text-secondary hover:text-theme-text-primary border border-theme-border-light hover:bg-theme-elevated'
|
|
529
|
+
)}
|
|
530
|
+
>
|
|
531
|
+
<FileCode2 className="w-3.5 h-3.5" />
|
|
532
|
+
YAML
|
|
533
|
+
</button>
|
|
534
|
+
</Tooltip>
|
|
535
|
+
)}
|
|
536
|
+
|
|
511
537
|
{(onCompareTo || onCompareAcrossClusters) && (
|
|
512
538
|
<div
|
|
513
539
|
className="relative"
|
|
@@ -669,35 +695,37 @@ function FluxActions({ resource, data, onReconcile, isReconciling, onSyncWithSou
|
|
|
669
695
|
return (
|
|
670
696
|
<>
|
|
671
697
|
{onReconcile && (
|
|
672
|
-
<
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
698
|
+
<Tooltip content={isSuspended ? 'Cannot reconcile while suspended' : 'Trigger reconciliation'} delay={150}>
|
|
699
|
+
<button
|
|
700
|
+
onClick={() => onReconcile({
|
|
701
|
+
kind: resource.kind,
|
|
702
|
+
namespace: resource.namespace,
|
|
703
|
+
name: resource.name,
|
|
704
|
+
})}
|
|
705
|
+
disabled={isReconciling || isSuspended}
|
|
706
|
+
className="flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium btn-brand rounded-lg"
|
|
707
|
+
>
|
|
708
|
+
<RefreshCw className={`w-3.5 h-3.5 ${isReconciling ? 'animate-spin' : ''}`} />
|
|
709
|
+
{isReconciling ? 'Reconciling...' : 'Reconcile'}
|
|
710
|
+
</button>
|
|
711
|
+
</Tooltip>
|
|
685
712
|
)}
|
|
686
713
|
|
|
687
714
|
{hasSource && onSyncWithSource && (
|
|
688
|
-
<
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
715
|
+
<Tooltip content={isSuspended ? 'Cannot sync while suspended' : 'Fetch latest from source, then reconcile'} delay={150}>
|
|
716
|
+
<button
|
|
717
|
+
onClick={() => onSyncWithSource({
|
|
718
|
+
kind: resource.kind,
|
|
719
|
+
namespace: resource.namespace,
|
|
720
|
+
name: resource.name,
|
|
721
|
+
})}
|
|
722
|
+
disabled={isSyncing || isSuspended}
|
|
723
|
+
className="flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-white bg-purple-600 hover:bg-purple-700 rounded-lg transition-colors disabled:opacity-50"
|
|
724
|
+
>
|
|
725
|
+
<RefreshCw className={`w-3.5 h-3.5 ${isSyncing ? 'animate-spin' : ''}`} />
|
|
726
|
+
{isSyncing ? 'Syncing...' : 'Sync with Source'}
|
|
727
|
+
</button>
|
|
728
|
+
</Tooltip>
|
|
701
729
|
)}
|
|
702
730
|
|
|
703
731
|
{isSuspended ? (
|
|
@@ -751,34 +779,36 @@ function ArgoActions({ resource, data, onSync, isSyncing, onRefresh, isRefreshin
|
|
|
751
779
|
return (
|
|
752
780
|
<>
|
|
753
781
|
{onSync && (
|
|
754
|
-
<
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
782
|
+
<Tooltip content="Sync application" delay={150}>
|
|
783
|
+
<button
|
|
784
|
+
onClick={() => onSync({
|
|
785
|
+
namespace: resource.namespace,
|
|
786
|
+
name: resource.name,
|
|
787
|
+
})}
|
|
788
|
+
disabled={isSyncing}
|
|
789
|
+
className="flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium btn-brand rounded-lg"
|
|
790
|
+
>
|
|
791
|
+
<RefreshCw className={`w-3.5 h-3.5 ${isSyncing ? 'animate-spin' : ''}`} />
|
|
792
|
+
{isSyncing ? 'Syncing...' : 'Sync'}
|
|
793
|
+
</button>
|
|
794
|
+
</Tooltip>
|
|
766
795
|
)}
|
|
767
796
|
|
|
768
797
|
{onRefresh && (
|
|
769
|
-
<
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
798
|
+
<Tooltip content="Refresh (re-read from git)" delay={150}>
|
|
799
|
+
<button
|
|
800
|
+
onClick={() => onRefresh({
|
|
801
|
+
namespace: resource.namespace,
|
|
802
|
+
name: resource.name,
|
|
803
|
+
hard: false,
|
|
804
|
+
})}
|
|
805
|
+
disabled={isRefreshing}
|
|
806
|
+
className="flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium btn-brand-muted rounded-lg"
|
|
807
|
+
>
|
|
808
|
+
<RefreshCw className={`w-3.5 h-3.5 ${isRefreshing ? 'animate-spin' : ''}`} />
|
|
809
|
+
{isRefreshing ? 'Refreshing...' : 'Refresh'}
|
|
810
|
+
</button>
|
|
811
|
+
</Tooltip>
|
|
782
812
|
)}
|
|
783
813
|
|
|
784
814
|
{hasAutomatedSync ? (
|
|
@@ -945,8 +975,10 @@ export function RevisionHistoryDialog({ kind, namespace, name, open, onClose, re
|
|
|
945
975
|
<td className="py-2 pr-3 text-theme-text-primary font-mono">
|
|
946
976
|
#{rev.number}
|
|
947
977
|
</td>
|
|
948
|
-
<td className="py-2 pr-3 text-theme-text-secondary font-mono
|
|
949
|
-
{
|
|
978
|
+
<td className="py-2 pr-3 text-theme-text-secondary font-mono max-w-[180px]">
|
|
979
|
+
<Tooltip content={rev.image} delay={300} wrapperClassName="min-w-0">
|
|
980
|
+
<span className="truncate">{getImageTag(rev.image)}</span>
|
|
981
|
+
</Tooltip>
|
|
950
982
|
</td>
|
|
951
983
|
<td className="py-2 pr-3 text-theme-text-secondary whitespace-nowrap">
|
|
952
984
|
{formatTimeAgo(rev.createdAt)}
|
|
@@ -954,19 +986,20 @@ export function RevisionHistoryDialog({ kind, namespace, name, open, onClose, re
|
|
|
954
986
|
<td className="py-2 text-right">
|
|
955
987
|
<div className="flex items-center gap-1 justify-end">
|
|
956
988
|
{!rev.isCurrent && rev.template && currentRevision?.template && (
|
|
957
|
-
<
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
989
|
+
<Tooltip content="Compare with current revision" delay={150}>
|
|
990
|
+
<button
|
|
991
|
+
onClick={() => setDiffRevision(diffRevision === rev.number ? null : rev.number)}
|
|
992
|
+
className={clsx(
|
|
993
|
+
"px-2 py-0.5 text-xs font-medium rounded transition-colors flex items-center gap-1",
|
|
994
|
+
diffRevision === rev.number
|
|
995
|
+
? "bg-blue-500/20 text-blue-400 border border-blue-400/50"
|
|
996
|
+
: "text-blue-400 hover:text-blue-300 hover:bg-blue-500/10 border border-transparent"
|
|
997
|
+
)}
|
|
998
|
+
>
|
|
999
|
+
<GitCompare className="w-3 h-3" />
|
|
1000
|
+
Diff
|
|
1001
|
+
</button>
|
|
1002
|
+
</Tooltip>
|
|
970
1003
|
)}
|
|
971
1004
|
{rev.isCurrent ? (
|
|
972
1005
|
<span className="badge status-healthy">
|
|
@@ -1092,9 +1125,7 @@ function RevisionDiffView({ currentTemplate, selectedTemplate, currentRevision,
|
|
|
1092
1125
|
{hasChanges ? (
|
|
1093
1126
|
<pre className="text-xs font-mono p-0 m-0">
|
|
1094
1127
|
{diffLines.map((line, index) => {
|
|
1095
|
-
const isAddition =
|
|
1096
|
-
const isDeletion = line.startsWith('-') && !line.startsWith('---')
|
|
1097
|
-
const isHeader = line.startsWith('@@') || line.startsWith('---') || line.startsWith('+++')
|
|
1128
|
+
const { isAddition, isRemoval: isDeletion, isHeader } = classifyDiffLine(line)
|
|
1098
1129
|
|
|
1099
1130
|
return (
|
|
1100
1131
|
<div
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
getPVCStatus,
|
|
12
12
|
getRolloutStatus,
|
|
13
13
|
getWorkflowStatus,
|
|
14
|
+
getCronWorkflowStatus,
|
|
14
15
|
getCertificateStatus,
|
|
15
16
|
getPVStatus,
|
|
16
17
|
getClusterIssuerStatus,
|
|
@@ -82,6 +83,7 @@ import {
|
|
|
82
83
|
SecretRenderer,
|
|
83
84
|
JobRenderer,
|
|
84
85
|
CronJobRenderer,
|
|
86
|
+
CronWorkflowRenderer,
|
|
85
87
|
HPARenderer,
|
|
86
88
|
NodeRenderer,
|
|
87
89
|
PVCRenderer,
|
|
@@ -316,12 +318,12 @@ export interface RendererOverrides {
|
|
|
316
318
|
// Known resource types with specific renderers (module-level to avoid re-allocation)
|
|
317
319
|
const KNOWN_KINDS = new Set([
|
|
318
320
|
'pods', 'deployments', 'statefulsets', 'daemonsets', 'replicasets',
|
|
319
|
-
'services', 'endpointslices', 'ingresses', 'configmaps', 'secrets', 'jobs', 'cronjobs',
|
|
321
|
+
'services', 'endpointslices', 'ingresses', 'configmaps', 'secrets', 'jobs', 'cronjobs', 'cronworkflows',
|
|
320
322
|
'hpas', 'horizontalpodautoscalers', 'nodes', 'persistentvolumeclaims',
|
|
321
323
|
'rollouts', 'certificates', 'workflows', 'persistentvolumes',
|
|
322
324
|
'storageclasses', 'certificaterequests', 'clusterissuers', 'issuers',
|
|
323
325
|
'orders', 'challenges',
|
|
324
|
-
'gateways', 'gatewayclasses', 'httproutes', 'grpcroutes', 'tcproutes', 'tlsroutes', 'sealedsecrets', 'workflowtemplates',
|
|
326
|
+
'gateways', 'gatewayclasses', 'httproutes', 'grpcroutes', 'tcproutes', 'tlsroutes', 'sealedsecrets', 'workflowtemplates', 'clusterworkflowtemplates',
|
|
325
327
|
'networkpolicies', 'networkpolicy',
|
|
326
328
|
'ciliumnetworkpolicies', 'ciliumnetworkpolicy', 'ciliumclusterwidenetworkpolicies', 'ciliumclusterwidenetworkpolicy',
|
|
327
329
|
'clusternetworkpolicies', 'clusternetworkpolicy',
|
|
@@ -406,6 +408,8 @@ interface ResourceRendererDispatchProps {
|
|
|
406
408
|
eventsHint?: React.ReactNode
|
|
407
409
|
/** When provided, sidebar sections (related resources, events, labels, annotations, metadata) are passed to this render prop instead of being rendered inline */
|
|
408
410
|
renderSidebar?: (sections: React.ReactNode) => React.ReactNode
|
|
411
|
+
/** Additional overview content that belongs in the main content column after the resource renderer sections. */
|
|
412
|
+
mainFooter?: React.ReactNode
|
|
409
413
|
/** K8s events for the focused resource — always shown (no toggle hides them)
|
|
410
414
|
* so resource history can't go missing. */
|
|
411
415
|
events?: TimelineEvent[]
|
|
@@ -440,6 +444,7 @@ export function ResourceRendererDispatch({
|
|
|
440
444
|
onOpenLogs,
|
|
441
445
|
eventsHint,
|
|
442
446
|
renderSidebar,
|
|
447
|
+
mainFooter,
|
|
443
448
|
events,
|
|
444
449
|
eventsLoading,
|
|
445
450
|
updates,
|
|
@@ -527,12 +532,13 @@ export function ResourceRendererDispatch({
|
|
|
527
532
|
{kind === 'secrets' && <SecretRenderer data={data} certificateInfo={certificateInfo} resourceData={data} onSaveSecretValue={onSaveSecretValue} isSaving={isSavingSecret} />}
|
|
528
533
|
{kind === 'jobs' && <JobRenderer data={data} />}
|
|
529
534
|
{kind === 'cronjobs' && <CronJobRenderer data={data} onNavigate={onNavigate} />}
|
|
535
|
+
{kind === 'cronworkflows' && <CronWorkflowRenderer data={data} onNavigate={onNavigate} />}
|
|
530
536
|
{(kind === 'hpas' || kind === 'horizontalpodautoscalers') && <HPAComp data={data} onNavigate={onNavigate} hpaDiagnosis={hpaDiagnosis} />}
|
|
531
537
|
{kind === 'nodes' && <NodeComp data={data} relationships={relationships} />}
|
|
532
538
|
{kind === 'persistentvolumeclaims' && <PVCComp data={data} onNavigate={onNavigate} />}
|
|
533
539
|
{kind === 'rollouts' && <RolloutRenderer data={data} />}
|
|
534
540
|
{kind === 'certificates' && !data?.apiVersion?.includes('networking.internal.knative.dev') && <CertificateRenderer data={data} />}
|
|
535
|
-
{kind === 'workflows' && <WorkflowRenderer data={data} />}
|
|
541
|
+
{kind === 'workflows' && <WorkflowRenderer data={data} onNavigate={onNavigate} />}
|
|
536
542
|
{kind === 'persistentvolumes' && <PersistentVolumeRenderer data={data} onNavigate={onNavigate} />}
|
|
537
543
|
{kind === 'storageclasses' && <StorageClassRenderer data={data} />}
|
|
538
544
|
{kind === 'certificaterequests' && <CertificateRequestRenderer data={data} />}
|
|
@@ -547,7 +553,7 @@ export function ResourceRendererDispatch({
|
|
|
547
553
|
{kind === 'tcproutes' && <SimpleRouteRenderer data={data} kind="TCPRoute" onNavigate={onNavigate} />}
|
|
548
554
|
{kind === 'tlsroutes' && <SimpleRouteRenderer data={data} kind="TLSRoute" onNavigate={onNavigate} />}
|
|
549
555
|
{kind === 'sealedsecrets' && <SealedSecretRenderer data={data} onNavigate={onNavigate} />}
|
|
550
|
-
{kind === 'workflowtemplates' && <WorkflowTemplateRenderer data={data} />}
|
|
556
|
+
{(kind === 'workflowtemplates' || kind === 'clusterworkflowtemplates') && <WorkflowTemplateRenderer data={data} />}
|
|
551
557
|
{(kind === 'networkpolicies' || kind === 'networkpolicy') && <NetworkPolicyRenderer data={data} />}
|
|
552
558
|
{(kind === 'ciliumnetworkpolicies' || kind === 'ciliumnetworkpolicy' || kind === 'ciliumclusterwidenetworkpolicies' || kind === 'ciliumclusterwidenetworkpolicy') && <CiliumNetworkPolicyRenderer data={data} />}
|
|
553
559
|
{(kind === 'clusternetworkpolicies' || kind === 'clusternetworkpolicy') && <ClusterNetworkPolicyRenderer data={data} />}
|
|
@@ -712,6 +718,7 @@ export function ResourceRendererDispatch({
|
|
|
712
718
|
{!renderSidebar && sidebarContent}
|
|
713
719
|
</>
|
|
714
720
|
)}
|
|
721
|
+
{mainFooter}
|
|
715
722
|
</div>
|
|
716
723
|
{renderSidebar && sidebarContent && renderSidebar(sidebarContent)}
|
|
717
724
|
</div>
|
|
@@ -722,6 +729,27 @@ export function ResourceRendererDispatch({
|
|
|
722
729
|
// RESOURCE STATUS HELPER
|
|
723
730
|
// ============================================================================
|
|
724
731
|
|
|
732
|
+
// Coarse health hint for the per-resource Diagnose entry point: should the action
|
|
733
|
+
// read as an urgent "Diagnose" (resource has a live problem) or a quiet "ask AI"?
|
|
734
|
+
// Derived from the same status the detail badge shows, so the button matches what
|
|
735
|
+
// the user sees. We key off the StatusBadge `level` (the workload/pod status fns
|
|
736
|
+
// return it) — NOT the color string, which varies by helper. 'unknown' for kinds
|
|
737
|
+
// without a level (we don't assert "Diagnose" when we can't tell → quiet variant).
|
|
738
|
+
export type DiagnoseHealthHint = 'problem' | 'healthy' | 'unknown'
|
|
739
|
+
export function diagnoseHealthHint(kind: string, data: any): DiagnoseHealthHint {
|
|
740
|
+
const st = getResourceStatus(kind, data) as { level?: string } | null
|
|
741
|
+
switch (st?.level) {
|
|
742
|
+
case 'unhealthy':
|
|
743
|
+
case 'degraded':
|
|
744
|
+
case 'alert':
|
|
745
|
+
return 'problem'
|
|
746
|
+
case 'healthy':
|
|
747
|
+
return 'healthy'
|
|
748
|
+
default:
|
|
749
|
+
return 'unknown'
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
|
|
725
753
|
export function getResourceStatus(kind: string, data: any): { text: string; color: string } | null {
|
|
726
754
|
if (!data) return null
|
|
727
755
|
const k = kind.toLowerCase()
|
|
@@ -752,6 +780,7 @@ export function getResourceStatus(kind: string, data: any): { text: string; colo
|
|
|
752
780
|
if (k === 'persistentvolumeclaims') return getPVCStatus(data)
|
|
753
781
|
if (k === 'rollouts') return getRolloutStatus(data)
|
|
754
782
|
if (k === 'workflows') return getWorkflowStatus(data)
|
|
783
|
+
if (k === 'cronworkflows') return getCronWorkflowStatus(data)
|
|
755
784
|
if (k === 'certificates') {
|
|
756
785
|
if (data.apiVersion?.includes('networking.internal.knative.dev')) {
|
|
757
786
|
const status = getKnativeConditionStatus(data)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { clsx } from 'clsx'
|
|
2
|
+
|
|
3
|
+
// Shared unified-diff rendering primitives. Every diff surface (Helm manifest
|
|
4
|
+
// diff, Helm values preview, revision history, Argo resource diff) classifies
|
|
5
|
+
// lines by the same leading marker; keeping that logic here stops the four
|
|
6
|
+
// renderers from silently drifting apart.
|
|
7
|
+
|
|
8
|
+
// classifyDiffLine tags a unified-diff line as an addition, a removal, or a hunk/
|
|
9
|
+
// file header. `+++`/`---` file headers are NOT additions/removals.
|
|
10
|
+
export function classifyDiffLine(line: string): {
|
|
11
|
+
isAddition: boolean
|
|
12
|
+
isRemoval: boolean
|
|
13
|
+
isHeader: boolean
|
|
14
|
+
} {
|
|
15
|
+
return {
|
|
16
|
+
isAddition: line.startsWith('+') && !line.startsWith('+++'),
|
|
17
|
+
isRemoval: line.startsWith('-') && !line.startsWith('---'),
|
|
18
|
+
isHeader: line.startsWith('@@') || line.startsWith('---') || line.startsWith('+++'),
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// hasDiffBodyChange is true when a unified-diff string has any added/removed body
|
|
23
|
+
// line (ignoring the patch's own file/hunk headers) — the "any real change?"
|
|
24
|
+
// short-circuit shared by the manifest and Argo diff surfaces.
|
|
25
|
+
export function hasDiffBodyChange(diff: string): boolean {
|
|
26
|
+
return diff.split('\n').some((line) => {
|
|
27
|
+
const { isAddition, isRemoval } = classifyDiffLine(line)
|
|
28
|
+
return isAddition || isRemoval
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// DiffLine renders one unified-diff line colored by marker — the gutter-less
|
|
33
|
+
// "manifest" style shared by the Helm manifest diff and the Argo resource diff.
|
|
34
|
+
// (The line-numbered gutter variants build their own row but share
|
|
35
|
+
// classifyDiffLine.)
|
|
36
|
+
export function DiffLine({ line }: { line: string }) {
|
|
37
|
+
const { isAddition, isRemoval, isHeader } = classifyDiffLine(line)
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
className={clsx(
|
|
41
|
+
'whitespace-pre',
|
|
42
|
+
isAddition && 'bg-green-500/10 text-green-700 dark:text-green-400',
|
|
43
|
+
isRemoval && 'bg-red-500/10 text-red-700 dark:text-red-400',
|
|
44
|
+
isHeader && 'text-theme-text-tertiary font-bold',
|
|
45
|
+
!isAddition && !isRemoval && !isHeader && 'text-theme-text-secondary'
|
|
46
|
+
)}
|
|
47
|
+
>
|
|
48
|
+
{line || ' '}
|
|
49
|
+
</div>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
@@ -4,3 +4,4 @@ export { ResourceActionsBar, RevisionHistoryDialog } from './ResourceActionsBar'
|
|
|
4
4
|
export { CreateResourceDialog, type CreateResourceDialogProps, type ApplyResult } from './CreateResourceDialog'
|
|
5
5
|
export { HelmManagedByChip, ManagedByChip, type HelmOwnerRef } from './ManagedByChip'
|
|
6
6
|
export { DetailShell, type DetailShellProps, type DetailShellTab } from './DetailShell'
|
|
7
|
+
export { classifyDiffLine, hasDiffBodyChange, DiffLine } from './UnifiedDiff'
|