@skyhook-io/k8s-ui 1.7.14 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -7
- package/src/components/applications/ApplicationsList.tsx +131 -115
- package/src/components/applications/index.ts +3 -1
- package/src/components/audit/AuditCard.tsx +1 -1
- package/src/components/charts/AreaChart.tsx +52 -18
- package/src/components/charts/MetricsSummary.tsx +12 -3
- package/src/components/charts/saturation.test.ts +34 -0
- package/src/components/charts/saturation.ts +1 -0
- package/src/components/charts/types.ts +5 -4
- package/src/components/checks/ChecksView.tsx +12 -23
- package/src/components/checks/severity.ts +11 -11
- package/src/components/gitops/GitOpsTableView.tsx +298 -274
- package/src/components/issues/IssuesView.tsx +4 -6
- package/src/components/issues/severity.ts +19 -11
- package/src/components/issues/types.ts +22 -2
- package/src/components/logs/WorkloadLogsViewer.tsx +16 -7
- package/src/components/resources/ResourcesSidebar.tsx +3 -1
- package/src/components/resources/ResourcesView.tsx +180 -21
- package/src/components/resources/get-pod-problems.test.ts +127 -0
- package/src/components/resources/index.ts +1 -0
- package/src/components/resources/renderers/HPARenderer.test.tsx +91 -0
- package/src/components/resources/renderers/HPARenderer.tsx +93 -86
- package/src/components/resources/renderers/PodRenderer.test.tsx +56 -0
- package/src/components/resources/renderers/PodRenderer.tsx +1 -1
- package/src/components/resources/renderers/WorkloadRenderer.test.tsx +83 -0
- package/src/components/resources/renderers/WorkloadRenderer.tsx +73 -4
- package/src/components/resources/resource-utils-hpa.test.ts +30 -0
- package/src/components/resources/resource-utils-hpa.ts +106 -0
- package/src/components/resources/resource-utils.ts +41 -28
- package/src/components/shared/ResourceRendererDispatch.tsx +10 -2
- package/src/components/ui/DistributionBar.tsx +88 -0
- package/src/components/ui/Facet.tsx +130 -0
- package/src/components/ui/PageHeader.tsx +43 -0
- package/src/components/ui/SearchPillInput.tsx +237 -0
- package/src/components/ui/SortableTh.tsx +58 -0
- package/src/components/ui/SummaryTile.tsx +60 -0
- package/src/components/ui/drawer-components.tsx +56 -17
- package/src/components/ui/index.ts +12 -0
- package/src/components/workload/WorkloadView.tsx +18 -1
- package/src/theme/tailwind-theme.css +1 -0
- package/src/theme/variables.css +7 -3
- package/src/types/core.ts +64 -2
- package/src/utils/bulk-workload-actions.test.ts +78 -0
- package/src/utils/bulk-workload-actions.ts +50 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/rbac-blast-radius.test.ts +48 -3
- package/src/utils/rbac-blast-radius.ts +14 -4
- package/tsconfig.json +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
|
|
2
2
|
import { createPortal } from 'react-dom'
|
|
3
3
|
import { ChevronDown, ChevronRight, ExternalLink, EyeOff, MoreHorizontal, Search, ShieldCheck, Wrench, X } from 'lucide-react'
|
|
4
|
-
import { ClusterName, EmptyState, FilterPill } from '../ui'
|
|
4
|
+
import { ClusterName, EmptyState, FilterPill, DistributionBar, DistributionLegendChip } from '../ui'
|
|
5
5
|
import type { CheckMeta, CheckReference } from '../audit'
|
|
6
6
|
import { CHECK_SEVERITIES, CHECK_SEVERITY_RANK, type Check, type CheckSeverity, type EffectiveCheckFinding, type CheckResourceRef } from './types'
|
|
7
7
|
import {
|
|
@@ -367,35 +367,24 @@ export function ChecksView({ checks, catalog, anyData, resourceHref, onResourceC
|
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
export function CheckSeverityBar({ totals }: { totals: Record<CheckSeverity, number> }) {
|
|
370
|
-
const sum = CHECK_SEVERITIES.reduce((n, s) => n + totals[s], 0)
|
|
371
370
|
return (
|
|
372
|
-
<
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
totals[s] > 0 ? (
|
|
377
|
-
<div key={s} className={`${SEVERITY_FILL_CLASS[s]} transition-[width] duration-500 ease-out`} style={{ width: `${(totals[s] / sum) * 100}%` }} />
|
|
378
|
-
) : null,
|
|
379
|
-
)}
|
|
380
|
-
</div>
|
|
371
|
+
<DistributionBar
|
|
372
|
+
ariaLabel="Severity distribution"
|
|
373
|
+
segments={CHECK_SEVERITIES.map((s) => ({ key: s, count: totals[s], fillClass: SEVERITY_FILL_CLASS[s] }))}
|
|
374
|
+
/>
|
|
381
375
|
)
|
|
382
376
|
}
|
|
383
377
|
|
|
384
378
|
export function CheckSeverityChip({ severity, count, active, onClick }: { severity: CheckSeverity; count: number; active: boolean; onClick: () => void }) {
|
|
385
379
|
return (
|
|
386
|
-
<
|
|
387
|
-
|
|
380
|
+
<DistributionLegendChip
|
|
381
|
+
label={SEVERITY_LABEL[severity]}
|
|
382
|
+
count={count}
|
|
383
|
+
fillClass={SEVERITY_FILL_CLASS[severity]}
|
|
384
|
+
textClass={SEVERITY_TEXT_CLASS[severity]}
|
|
385
|
+
active={active}
|
|
388
386
|
onClick={onClick}
|
|
389
|
-
|
|
390
|
-
className={[
|
|
391
|
-
'group inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs transition-colors',
|
|
392
|
-
active ? 'border-theme-border bg-theme-elevated text-theme-text-primary' : 'border-transparent text-theme-text-secondary hover:bg-theme-hover/60',
|
|
393
|
-
].join(' ')}
|
|
394
|
-
>
|
|
395
|
-
<span className={`h-2 w-2 rounded-full ${SEVERITY_FILL_CLASS[severity]} ${count === 0 ? 'opacity-30' : ''}`} />
|
|
396
|
-
<span className={`font-semibold tabular-nums ${count > 0 ? SEVERITY_TEXT_CLASS[severity] : 'text-theme-text-tertiary'}`}>{count}</span>
|
|
397
|
-
<span>{SEVERITY_LABEL[severity]}</span>
|
|
398
|
-
</button>
|
|
387
|
+
/>
|
|
399
388
|
)
|
|
400
389
|
}
|
|
401
390
|
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import type { CheckSeverity } from './types'
|
|
2
|
+
import { BADGE_SEVERITY_COLORS as sev } from '../ui/Badge'
|
|
2
3
|
|
|
3
|
-
// The visual language for the 4-tier Checks severity ladder.
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// left rail top-to-bottom and severity is obvious without reading a word.
|
|
7
|
-
//
|
|
8
|
-
// Class strings are literal so each consuming app's Tailwind @source scan emits
|
|
9
|
-
// them.
|
|
4
|
+
// The visual language for the 4-tier Checks severity ladder. One hue per tier:
|
|
5
|
+
// red=critical, orange=high, amber=medium, neutral=low — read the queue's left
|
|
6
|
+
// rail top-to-bottom and severity is obvious without reading a word.
|
|
10
7
|
|
|
11
8
|
export const SEVERITY_LABEL: Record<CheckSeverity, string> = {
|
|
12
9
|
critical: 'Critical',
|
|
@@ -16,11 +13,14 @@ export const SEVERITY_LABEL: Record<CheckSeverity, string> = {
|
|
|
16
13
|
}
|
|
17
14
|
|
|
18
15
|
// Pill badge — the loud, explicit severity signal on rows + drawer header.
|
|
16
|
+
// Uses the canonical Badge severity tones (BADGE_SEVERITY_COLORS) so the queue's
|
|
17
|
+
// severity pills read identically to status badges everywhere else (rendered
|
|
18
|
+
// with `badge-sm`).
|
|
19
19
|
export const SEVERITY_BADGE_CLASS: Record<CheckSeverity, string> = {
|
|
20
|
-
critical:
|
|
21
|
-
high:
|
|
22
|
-
medium:
|
|
23
|
-
low:
|
|
20
|
+
critical: sev.error,
|
|
21
|
+
high: sev.alert,
|
|
22
|
+
medium: sev.warning,
|
|
23
|
+
low: sev.neutral,
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
// Solid fill — dots + the proportional distribution bar segments.
|