@skyhook-io/radar-app 1.18.1 → 1.19.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 +4 -4
- package/src/App.tsx +23 -9
- package/src/api/client.deleteResource.test.tsx +111 -0
- package/src/api/client.resourceAudit.test.tsx +57 -0
- package/src/api/client.resourcePath.test.ts +107 -0
- package/src/api/client.ts +136 -37
- package/src/api/diagnose.test.ts +33 -2
- package/src/api/diagnose.ts +93 -3
- package/src/api/radarFeatures.ts +1 -0
- package/src/components/capacity/CapacityDemand.tsx +6 -3
- package/src/components/capacity/CapacityOverview.tsx +14 -7
- package/src/components/capacity/CapacityPoolDetail.tsx +7 -5
- package/src/components/capacity/ClusterSchedulingCard.tsx +3 -3
- package/src/components/capacity/shared.tsx +9 -5
- package/src/components/cnpg/CNPGOverview.tsx +4 -1
- package/src/components/cnpg/actions/useCNPGWriteGuard.tsx +1 -0
- package/src/components/diagnose/AIMarkdown.tsx +1 -1
- package/src/components/diagnose/ActivityTurn.tsx +34 -14
- package/src/components/diagnose/AgentControls.tsx +53 -6
- package/src/components/diagnose/AgentSetupNotice.tsx +1 -1
- package/src/components/diagnose/AgentSigninNotice.test.tsx +98 -0
- package/src/components/diagnose/AgentSigninNotice.tsx +61 -0
- package/src/components/diagnose/AnalysisStory.test.tsx +22 -0
- package/src/components/diagnose/AnalysisStory.tsx +17 -4
- package/src/components/diagnose/ApplyDialog.test.tsx +10 -0
- package/src/components/diagnose/ApplyDialog.tsx +8 -1
- package/src/components/diagnose/AssessmentCard.tsx +99 -8
- package/src/components/diagnose/DiagnoseContext.capacity.test.tsx +113 -0
- package/src/components/diagnose/DiagnoseContext.question.test.tsx +245 -0
- package/src/components/diagnose/DiagnoseContext.tsx +205 -9
- package/src/components/diagnose/DiagnoseSurface.test.tsx +54 -0
- package/src/components/diagnose/DiagnoseSurface.tsx +98 -21
- package/src/components/diagnose/EvidenceCard.tsx +67 -14
- package/src/components/diagnose/Home.test.tsx +182 -5
- package/src/components/diagnose/Home.tsx +168 -36
- package/src/components/diagnose/InvestigationCapacityNotice.test.tsx +246 -0
- package/src/components/diagnose/InvestigationCapacityNotice.tsx +241 -0
- package/src/components/diagnose/InvestigationEvidencePane.story.test.tsx +97 -6
- package/src/components/diagnose/InvestigationEvidencePane.test.tsx +119 -2
- package/src/components/diagnose/InvestigationEvidencePane.tsx +59 -11
- package/src/components/diagnose/InvestigationEvidenceSections.tsx +11 -6
- package/src/components/diagnose/InvestigationView.tsx +203 -42
- package/src/components/diagnose/LocalDiagnoseAction.tsx +23 -16
- package/src/components/diagnose/QuestionComposer.test.tsx +553 -0
- package/src/components/diagnose/QuestionComposer.tsx +487 -0
- package/src/components/diagnose/QuestionFocus.test.tsx +38 -0
- package/src/components/diagnose/QuestionFocus.tsx +123 -0
- package/src/components/diagnose/ResourcePicker.tsx +206 -0
- package/src/components/diagnose/StoryExcerpt.tsx +12 -3
- package/src/components/diagnose/assessmentCopy.ts +16 -0
- package/src/components/diagnose/investigationCase.runs.test.tsx +328 -0
- package/src/components/diagnose/investigationCase.ts +33 -1
- package/src/components/diagnose/investigationEvidence/adapters/changes.ts +36 -1
- package/src/components/diagnose/investigationEvidence/adapters/coverage.test.tsx +46 -0
- package/src/components/diagnose/investigationEvidence/adapters/crossplane.test.tsx +85 -0
- package/src/components/diagnose/investigationEvidence/adapters/diagnose.ts +8 -0
- package/src/components/diagnose/investigationEvidence/adapters/issues.ts +1 -0
- package/src/components/diagnose/investigationEvidence/adapters/posture.ts +29 -1
- package/src/components/diagnose/investigationEvidence/adapters/prometheus.test.ts +42 -1
- package/src/components/diagnose/investigationEvidence/adapters/prometheus.ts +29 -2
- package/src/components/diagnose/investigationEvidence/adapters/testdata/crossplane-paused-get-resource.json +28 -0
- package/src/components/diagnose/investigationEvidence/bodies/index.tsx +2 -0
- package/src/components/diagnose/investigationEvidence/bodies/metrics.test.tsx +111 -0
- package/src/components/diagnose/investigationEvidence/bodies/metrics.tsx +67 -16
- package/src/components/diagnose/investigationEvidence/bodies/workload.tsx +5 -1
- package/src/components/diagnose/investigationEvidence/builder.ts +3 -1
- package/src/components/diagnose/investigationEvidence/cardParts.tsx +7 -2
- package/src/components/diagnose/investigationEvidence/excerpt.test.ts +18 -5
- package/src/components/diagnose/investigationEvidence/excerpt.ts +22 -11
- package/src/components/diagnose/investigationEvidence/identity.test.ts +1 -1
- package/src/components/diagnose/investigationEvidence/index.ts +1 -1
- package/src/components/diagnose/investigationEvidence/navigation.tsx +2 -0
- package/src/components/diagnose/investigationEvidence/observations.ts +7 -3
- package/src/components/diagnose/investigationEvidence/projection.test.ts +57 -3
- package/src/components/diagnose/investigationEvidence/types.ts +2 -0
- package/src/components/diagnose/investigationEvidencePartition.ts +6 -1
- package/src/components/diagnose/investigationEvidencePresentation.test.ts +36 -2
- package/src/components/diagnose/investigationEvidencePresentation.ts +33 -8
- package/src/components/diagnose/investigationFocus.test.ts +271 -0
- package/src/components/diagnose/investigationFocus.ts +132 -0
- package/src/components/diagnose/parts.test.tsx +20 -0
- package/src/components/diagnose/questionSuggestions.test.ts +111 -0
- package/src/components/diagnose/questionSuggestions.ts +150 -0
- package/src/components/diagnose/storyParts.test.tsx +66 -0
- package/src/components/diagnose/target.test.ts +143 -2
- package/src/components/diagnose/target.ts +109 -7
- package/src/components/diagnose/testdata/story-runs.json +474 -0
- package/src/components/diagnose/verdictText.test.tsx +87 -0
- package/src/components/diagnose/verdictText.ts +68 -0
- package/src/components/helm/ChartBrowser.tsx +4 -4
- package/src/components/helm/HelmReleaseDrawer.tsx +6 -2
- package/src/components/helm/HelmView.tsx +34 -23
- package/src/components/helm/InstallWizard.tsx +6 -2
- package/src/components/helm/ValuesViewer.test.tsx +1 -0
- package/src/components/helm/ValuesViewer.tsx +4 -2
- package/src/components/home/ClusterHealthCard.tsx +40 -59
- package/src/components/home/HomeAgentBlock.test.tsx +113 -0
- package/src/components/home/HomeAgentBlock.tsx +94 -0
- package/src/components/home/HomeView.tsx +5 -6
- package/src/components/home/MCPSetupDialog.test.tsx +27 -2
- package/src/components/home/MCPSetupDialog.tsx +14 -2
- package/src/components/home/RadarVersionLine.test.tsx +0 -14
- package/src/components/home/RadarVersionLine.tsx +3 -28
- package/src/components/home/mcpToolCatalog.ts +29 -2
- package/src/components/issues/IssuesPane.render.test.tsx +5 -5
- package/src/components/nav/PrimaryNavRail.tsx +34 -2
- package/src/components/product-hunt/ProductHuntNotice.render.test.tsx +120 -0
- package/src/components/product-hunt/ProductHuntNotice.test.ts +121 -0
- package/src/components/product-hunt/ProductHuntNotice.tsx +202 -0
- package/src/components/product-hunt/launchWindow.ts +78 -0
- package/src/components/product-hunt/useProductHuntRailEntry.test.tsx +76 -0
- package/src/components/product-hunt/useProductHuntRailEntry.ts +27 -0
- package/src/components/resources/CompositeRenderer.tsx +4 -0
- package/src/components/resources/ResourcesView.tsx +1 -1
- package/src/components/settings/LocalConnectionSettings.tsx +1 -0
- package/src/components/ui/Omnibar.investigate.test.tsx +105 -0
- package/src/components/ui/Omnibar.tsx +47 -3
- package/src/components/ui/RadarOmnibar.test.tsx +19 -0
- package/src/components/ui/RadarOmnibar.tsx +12 -0
- package/src/components/ui/SearchSyntaxHelp.test.tsx +39 -0
- package/src/components/ui/SearchSyntaxHelp.tsx +23 -2
- package/src/components/ui/UpdateNotification.test.tsx +2 -0
- package/src/components/ui/UpdateNotification.tsx +32 -5
- package/src/components/usage-data/UsageDataPrompt.tsx +19 -1
- package/src/components/whats-new/WhatsNewDialog.test.tsx +3 -3
- package/src/components/whats-new/releaseNotes.ts +60 -1
- package/src/components/workload/WorkloadView.tsx +10 -4
- package/src/components/workspace/layout.tsx +2 -1
- package/src/contexts/CapabilitiesContext.tsx +1 -0
- package/src/hooks/useAgentSignin.test.tsx +190 -0
- package/src/hooks/useAgentSignin.ts +160 -0
- package/src/hooks/useApproveAfterSignin.test.tsx +108 -0
- package/src/hooks/useGitOpsWriteGuard.test.tsx +126 -2
- package/src/hooks/useGitOpsWriteGuard.ts +25 -3
- package/src/hooks/useResolvedGitOpsOwner.ts +14 -9
- package/src/index.css +85 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { renderToStaticMarkup } from "react-dom/server";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
|
|
4
|
+
import { VerdictText } from "./AssessmentCard";
|
|
5
|
+
import {
|
|
6
|
+
assessmentStateLabel,
|
|
7
|
+
plainVerdictText,
|
|
8
|
+
verdictSentence,
|
|
9
|
+
} from "./verdictText";
|
|
10
|
+
|
|
11
|
+
describe("VerdictText", () => {
|
|
12
|
+
it("renders code spans and nothing else as markup", () => {
|
|
13
|
+
const html = renderToStaticMarkup(
|
|
14
|
+
<VerdictText text="ConfigMap `checkout-settings` is **missing**" />,
|
|
15
|
+
);
|
|
16
|
+
expect(html).toBe(
|
|
17
|
+
'ConfigMap <code class="inline-code">checkout-settings</code> is missing',
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("keeps code contents exactly as written", () => {
|
|
22
|
+
expect(
|
|
23
|
+
renderToStaticMarkup(
|
|
24
|
+
<VerdictText text="`__init__` fails on `*.svc.*` and `[a-z](x)`" />,
|
|
25
|
+
),
|
|
26
|
+
).toBe(
|
|
27
|
+
'<code class="inline-code">__init__</code> fails on <code class="inline-code">*.svc.*</code> and <code class="inline-code">[a-z](x)</code>',
|
|
28
|
+
);
|
|
29
|
+
expect(plainVerdictText("`__init__` fails on `*.svc.*`")).toBe(
|
|
30
|
+
"__init__ fails on *.svc.*",
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("keeps a sentence that looks like markdown structure as text", () => {
|
|
35
|
+
expect(
|
|
36
|
+
renderToStaticMarkup(<VerdictText text="1. pod restarts # times" />),
|
|
37
|
+
).toBe("1. pod restarts # times");
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe("verdictSentence", () => {
|
|
42
|
+
it("is the headline, as one plain line", () => {
|
|
43
|
+
expect(
|
|
44
|
+
verdictSentence({
|
|
45
|
+
summary: "The `api` container\nexits; see [logs](http://x)",
|
|
46
|
+
rootCause: "ignored",
|
|
47
|
+
}),
|
|
48
|
+
).toBe("The api container exits; see logs");
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("keeps doubled underscores in prose identifiers", () => {
|
|
52
|
+
expect(plainVerdictText("checkout__config is unset")).toBe(
|
|
53
|
+
"checkout__config is unset",
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("falls back to the cause, and is empty for an answer", () => {
|
|
58
|
+
expect(
|
|
59
|
+
verdictSentence({ summary: " ", rootCause: "DB_PORT is bad" }),
|
|
60
|
+
).toBe("DB_PORT is bad");
|
|
61
|
+
expect(verdictSentence({ rootCause: "DB_PORT is `abc`" })).toBe(
|
|
62
|
+
"DB_PORT is abc",
|
|
63
|
+
);
|
|
64
|
+
expect(verdictSentence({})).toBe("");
|
|
65
|
+
expect(plainVerdictText(undefined)).toBe("");
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
describe("assessmentStateLabel", () => {
|
|
70
|
+
it("says how sure the assessment is, as Findings does", () => {
|
|
71
|
+
expect(
|
|
72
|
+
assessmentStateLabel({ rootCause: "x", certainty: "suspected" })?.text,
|
|
73
|
+
).toBe("Suspected");
|
|
74
|
+
expect(assessmentStateLabel({ inconclusive: true })?.text).toBe(
|
|
75
|
+
"Couldn't determine",
|
|
76
|
+
);
|
|
77
|
+
expect(assessmentStateLabel({ healthy: true })).toEqual({
|
|
78
|
+
text: "Healthy",
|
|
79
|
+
warn: false,
|
|
80
|
+
});
|
|
81
|
+
expect(assessmentStateLabel({ healthy: true }, true)).toEqual({
|
|
82
|
+
text: "Conflicts with captured evidence",
|
|
83
|
+
warn: true,
|
|
84
|
+
});
|
|
85
|
+
expect(assessmentStateLabel({ rootCause: "x" })).toBeUndefined();
|
|
86
|
+
});
|
|
87
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Diagnosis } from "../../api/diagnose";
|
|
2
|
+
import { CERTAINTY_LABEL } from "./assessmentCopy";
|
|
3
|
+
|
|
4
|
+
// A code span is literal: its contents (`__init__`, `*.svc.*`) are never
|
|
5
|
+
// read as markdown. Splitting on it first keeps cleanup to the prose.
|
|
6
|
+
const CODE_SPAN = /(`[^`\n]+`)/g;
|
|
7
|
+
|
|
8
|
+
function isCodeSpan(part: string): boolean {
|
|
9
|
+
return part.length > 2 && part.startsWith("`") && part.endsWith("`");
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type VerdictPart = { code: boolean; text: string };
|
|
13
|
+
|
|
14
|
+
// A verdict split into prose and literal code, prose with its bold and
|
|
15
|
+
// single-character emphasis markers dropped. Doubled underscores stay: in a
|
|
16
|
+
// verdict they are far more often an identifier (checkout__config) than
|
|
17
|
+
// markdown. Shared by every place that shows a verdict sentence.
|
|
18
|
+
export function verdictParts(text: string): VerdictPart[] {
|
|
19
|
+
return text.split(CODE_SPAN).flatMap((part): VerdictPart[] => {
|
|
20
|
+
if (isCodeSpan(part)) return [{ code: true, text: part.slice(1, -1) }];
|
|
21
|
+
const prose = part
|
|
22
|
+
.replace(/\[([^\]]*)\]\([^)]*\)/g, "$1")
|
|
23
|
+
.replace(/\*\*/g, "")
|
|
24
|
+
.replace(/(^|\W)[*_](\S(?:[^*_\n]*\S)?)[*_](?=\W|$)/g, "$1$2");
|
|
25
|
+
return prose ? [{ code: false, text: prose }] : [];
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// A verdict as one plain line, for places that show it outside Findings: the
|
|
30
|
+
// history and the completion card. Markdown links keep their text; emphasis
|
|
31
|
+
// markers are dropped and code keeps its exact contents.
|
|
32
|
+
export function plainVerdictText(text: string | undefined): string {
|
|
33
|
+
return verdictParts(text ?? "")
|
|
34
|
+
.map((part) => part.text)
|
|
35
|
+
.join("")
|
|
36
|
+
.replace(/\s+/g, " ")
|
|
37
|
+
.trim();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// The sentence a finished assessment stands on: its headline when it has
|
|
41
|
+
// one, else the technical cause. Empty for an answer that settled nothing.
|
|
42
|
+
export function verdictSentence(diagnosis: {
|
|
43
|
+
summary?: string;
|
|
44
|
+
rootCause?: string;
|
|
45
|
+
}): string {
|
|
46
|
+
return plainVerdictText(diagnosis.summary?.trim() || diagnosis.rootCause);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// How sure the assessment is, in the words Findings shows beside it, so a
|
|
50
|
+
// sentence repeated elsewhere never reads more certain than Findings does.
|
|
51
|
+
export function assessmentStateLabel(
|
|
52
|
+
diagnosis: Partial<
|
|
53
|
+
Pick<Diagnosis, "inconclusive" | "healthy" | "rootCause" | "certainty">
|
|
54
|
+
>,
|
|
55
|
+
evidenceConflict = false,
|
|
56
|
+
): { text: string; warn: boolean } | undefined {
|
|
57
|
+
if (diagnosis.inconclusive && !diagnosis.rootCause) {
|
|
58
|
+
return { text: "Couldn't determine", warn: false };
|
|
59
|
+
}
|
|
60
|
+
if (diagnosis.healthy && !diagnosis.rootCause) {
|
|
61
|
+
return evidenceConflict
|
|
62
|
+
? { text: "Conflicts with captured evidence", warn: true }
|
|
63
|
+
: { text: "Healthy", warn: false };
|
|
64
|
+
}
|
|
65
|
+
return diagnosis.certainty
|
|
66
|
+
? { text: CERTAINTY_LABEL[diagnosis.certainty], warn: false }
|
|
67
|
+
: undefined;
|
|
68
|
+
}
|
|
@@ -124,8 +124,8 @@ export function ChartBrowser({ onChartSelect }: ChartBrowserProps) {
|
|
|
124
124
|
|
|
125
125
|
return (
|
|
126
126
|
<div className="flex flex-col h-full">
|
|
127
|
-
{/* Toolbar */}
|
|
128
|
-
<div className="flex items-center gap-4 px-4 py-3 border-b border-theme-border bg-theme-surface/50 shrink-0">
|
|
127
|
+
{/* Toolbar. Phones: the controls wrap and search takes its own row. */}
|
|
128
|
+
<div className="flex items-center gap-4 px-4 py-3 border-b border-theme-border bg-theme-surface/50 shrink-0 phone:flex-wrap phone:gap-2 phone:px-3">
|
|
129
129
|
<div className="flex items-center gap-2 text-theme-text-secondary">
|
|
130
130
|
<Package className="w-5 h-5" />
|
|
131
131
|
<span className="font-medium">Charts</span>
|
|
@@ -214,7 +214,7 @@ export function ChartBrowser({ onChartSelect }: ChartBrowserProps) {
|
|
|
214
214
|
|
|
215
215
|
{/* ArtifactHub filters */}
|
|
216
216
|
{chartSource === 'artifacthub' && (
|
|
217
|
-
<div className="flex items-center gap-3">
|
|
217
|
+
<div className="flex items-center gap-3 phone:flex-wrap phone:gap-x-3 phone:gap-y-2">
|
|
218
218
|
<label className="flex items-center gap-1.5 text-sm text-theme-text-secondary">
|
|
219
219
|
<input
|
|
220
220
|
type="checkbox"
|
|
@@ -252,7 +252,7 @@ export function ChartBrowser({ onChartSelect }: ChartBrowserProps) {
|
|
|
252
252
|
)}
|
|
253
253
|
|
|
254
254
|
{/* Search */}
|
|
255
|
-
<div className="flex-1 relative">
|
|
255
|
+
<div className="flex-1 relative phone:order-last phone:basis-full">
|
|
256
256
|
<Search className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-theme-text-tertiary" />
|
|
257
257
|
<Input
|
|
258
258
|
placeholder={chartSource === 'local' ? "Search charts..." : "Search ArtifactHub..."}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AlertBanner } from '@skyhook-io/k8s-ui/components/ui/drawer-components'
|
|
2
2
|
import { useState, useCallback, useEffect, useRef } from 'react'
|
|
3
3
|
import { flushSync } from 'react-dom'
|
|
4
|
-
import { FetchResult, useDockReservedHeight, compareVersions } from '@skyhook-io/k8s-ui'
|
|
4
|
+
import { FetchResult, useDockReservedHeight, compareVersions, usePhoneLayout } from '@skyhook-io/k8s-ui'
|
|
5
5
|
import { startViewTransitionSafe } from '@skyhook-io/k8s-ui/utils/view-transition'
|
|
6
6
|
import { TRANSITION_DRAWER } from '../../utils/animation'
|
|
7
7
|
import { useRefreshAnimation } from '../../hooks/useRefreshAnimation'
|
|
@@ -167,6 +167,10 @@ export function HelmReleaseDrawer({ release, onClose, onNavigateToResource, isOp
|
|
|
167
167
|
const [selectedSourceUpgrade, setSelectedSourceUpgrade] = useState<SourceUpgradeSelection | null>(null)
|
|
168
168
|
const selectedSourceRef = useRef<SourceUpgradeSelection | null>(null)
|
|
169
169
|
const [adjustValues, setAdjustValues] = useState(false)
|
|
170
|
+
// Phones upgrade with the existing values. An adjustment already open when
|
|
171
|
+
// a phone rotates to portrait stays visible, since its edits would
|
|
172
|
+
// otherwise apply unseen.
|
|
173
|
+
const isPhone = usePhoneLayout()
|
|
170
174
|
const [editedUpgradeYaml, setEditedUpgradeYaml] = useState('')
|
|
171
175
|
const [upgradeYamlError, setUpgradeYamlError] = useState<string | null>(null)
|
|
172
176
|
const [upgradeValuesSeeded, setUpgradeValuesSeeded] = useState(false)
|
|
@@ -1006,7 +1010,7 @@ export function HelmReleaseDrawer({ release, onClose, onNavigateToResource, isOp
|
|
|
1006
1010
|
)}
|
|
1007
1011
|
</div>
|
|
1008
1012
|
)}
|
|
1009
|
-
{upgradeProgress.length === 0 && canHelmWrite && (
|
|
1013
|
+
{upgradeProgress.length === 0 && canHelmWrite && (!isPhone || adjustValues) && (
|
|
1010
1014
|
<div className="mt-3 border-t border-theme-border pt-3">
|
|
1011
1015
|
<Tooltip content="Edit the user-supplied Helm values that Radar will pass to this upgrade.">
|
|
1012
1016
|
<button
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState, useMemo, useRef, useEffect, useCallback, forwardRef } from 'react'
|
|
2
2
|
import { useRegisterShortcuts } from '../../hooks/useKeyboardShortcuts'
|
|
3
3
|
import { Package, Search, ArrowUpCircle, LayoutGrid, List, Shield, GitBranch, ChevronRight, RotateCcw, Clock } from 'lucide-react'
|
|
4
|
-
import { PaneLoader, PageHeader, SortableTh, FreshnessControl, type SortDir, Input } from '@skyhook-io/k8s-ui'
|
|
4
|
+
import { PaneLoader, PageHeader, SortableTh, FreshnessControl, type SortDir, Input, usePhoneLayout } from '@skyhook-io/k8s-ui'
|
|
5
5
|
import { useConnection } from '../../context/ConnectionContext'
|
|
6
6
|
import { clsx } from 'clsx'
|
|
7
7
|
import { useHelmReleases, useHelmBatchUpgradeInfo, isForbiddenError } from '../../api/client'
|
|
@@ -51,6 +51,11 @@ export function HelmView({ namespaces, selectedRelease, onReleaseClick }: HelmVi
|
|
|
51
51
|
}),
|
|
52
52
|
[],
|
|
53
53
|
)
|
|
54
|
+
// Phones hide these columns, so a sort on one of them (set at a wider
|
|
55
|
+
// width) would order the list with no visible header; fall back to the
|
|
56
|
+
// server's order there instead.
|
|
57
|
+
const isPhone = usePhoneLayout()
|
|
58
|
+
const effectiveSort = isPhone && sort && PHONE_HIDDEN_SORT_KEYS.has(sort.key) ? null : sort
|
|
54
59
|
|
|
55
60
|
const filteredReleases = useMemo(() => {
|
|
56
61
|
if (!releases) return []
|
|
@@ -64,10 +69,10 @@ export function HelmView({ namespaces, selectedRelease, onReleaseClick }: HelmVi
|
|
|
64
69
|
)
|
|
65
70
|
: releases
|
|
66
71
|
|
|
67
|
-
if (!
|
|
68
|
-
const factor =
|
|
69
|
-
return [...filtered].sort((a, b) => compareReleases(a, b,
|
|
70
|
-
}, [releases, searchTerm,
|
|
72
|
+
if (!effectiveSort) return filtered
|
|
73
|
+
const factor = effectiveSort.dir === 'asc' ? 1 : -1
|
|
74
|
+
return [...filtered].sort((a, b) => compareReleases(a, b, effectiveSort.key) * factor)
|
|
75
|
+
}, [releases, searchTerm, effectiveSort])
|
|
71
76
|
|
|
72
77
|
// Keyboard navigation state
|
|
73
78
|
const searchInputRef = useRef<HTMLInputElement>(null)
|
|
@@ -78,7 +83,7 @@ export function HelmView({ namespaces, selectedRelease, onReleaseClick }: HelmVi
|
|
|
78
83
|
|
|
79
84
|
// Reset highlight when the visible order changes (search or sort) — otherwise
|
|
80
85
|
// the index would point at whatever release shifted into that row.
|
|
81
|
-
useEffect(() => { setHighlightedIndex(-1) }, [searchTerm,
|
|
86
|
+
useEffect(() => { setHighlightedIndex(-1) }, [searchTerm, effectiveSort])
|
|
82
87
|
|
|
83
88
|
// Scroll highlighted row into view
|
|
84
89
|
useEffect(() => {
|
|
@@ -301,16 +306,18 @@ export function HelmView({ namespaces, selectedRelease, onReleaseClick }: HelmVi
|
|
|
301
306
|
)}
|
|
302
307
|
</div>
|
|
303
308
|
) : (
|
|
309
|
+
// On phones the fixed-width columns would leave Name no room;
|
|
310
|
+
// what they hide is all in the release detail.
|
|
304
311
|
<table className="w-full table-fixed">
|
|
305
312
|
<thead className="bg-theme-base sticky top-0 z-10">
|
|
306
313
|
<tr>
|
|
307
|
-
<SortableTh label="Name" sortKey="name" activeKey={
|
|
308
|
-
<SortableTh label="Namespace" sortKey="namespace" activeKey={
|
|
309
|
-
<SortableTh label="Chart" sortKey="chart" activeKey={
|
|
310
|
-
<SortableTh label="App Version" sortKey="appVersion" activeKey={
|
|
311
|
-
<SortableTh label="Status" sortKey="status" activeKey={
|
|
312
|
-
<SortableTh label="Rev" sortKey="revision" activeKey={
|
|
313
|
-
<SortableTh label="Updated" sortKey="updated" activeKey={
|
|
314
|
+
<SortableTh label="Name" sortKey="name" activeKey={effectiveSort?.key ?? null} direction={effectiveSort?.dir ?? 'asc'} onSort={onSort} className="w-[28%] phone:w-auto" />
|
|
315
|
+
<SortableTh label="Namespace" sortKey="namespace" activeKey={effectiveSort?.key ?? null} direction={effectiveSort?.dir ?? 'asc'} onSort={onSort} className="w-[18%] phone:hidden" />
|
|
316
|
+
<SortableTh label="Chart" sortKey="chart" activeKey={effectiveSort?.key ?? null} direction={effectiveSort?.dir ?? 'asc'} onSort={onSort} className="w-[22%] phone:hidden" />
|
|
317
|
+
<SortableTh label="App Version" sortKey="appVersion" activeKey={effectiveSort?.key ?? null} direction={effectiveSort?.dir ?? 'asc'} onSort={onSort} className="w-24 hidden xl:table-cell" />
|
|
318
|
+
<SortableTh label="Status" sortKey="status" activeKey={effectiveSort?.key ?? null} direction={effectiveSort?.dir ?? 'asc'} onSort={onSort} className="w-40 phone:w-[6.5rem]" />
|
|
319
|
+
<SortableTh label="Rev" sortKey="revision" activeKey={effectiveSort?.key ?? null} direction={effectiveSort?.dir ?? 'asc'} onSort={onSort} className="w-16 phone:hidden" />
|
|
320
|
+
<SortableTh label="Updated" sortKey="updated" activeKey={effectiveSort?.key ?? null} direction={effectiveSort?.dir ?? 'asc'} onSort={onSort} className="w-24 phone:hidden" />
|
|
314
321
|
</tr>
|
|
315
322
|
</thead>
|
|
316
323
|
<tbody className="table-divide-subtle">
|
|
@@ -361,6 +368,9 @@ function releaseIdentityKey(release: Pick<HelmRelease, 'namespace' | 'name' | 's
|
|
|
361
368
|
|
|
362
369
|
type HelmSortKey = 'name' | 'namespace' | 'chart' | 'appVersion' | 'status' | 'revision' | 'updated'
|
|
363
370
|
|
|
371
|
+
// Columns the release table hides on phones (the phone: classes on the headers).
|
|
372
|
+
const PHONE_HIDDEN_SORT_KEYS: ReadonlySet<HelmSortKey> = new Set<HelmSortKey>(['namespace', 'chart', 'revision', 'updated'])
|
|
373
|
+
|
|
364
374
|
function compareReleases(a: HelmRelease, b: HelmRelease, key: HelmSortKey): number {
|
|
365
375
|
let cmp: number
|
|
366
376
|
switch (key) {
|
|
@@ -535,10 +545,10 @@ const ReleaseRow = forwardRef<HTMLTableRowElement, ReleaseRowProps>(
|
|
|
535
545
|
: 'hover:bg-theme-surface/50'
|
|
536
546
|
)}
|
|
537
547
|
>
|
|
538
|
-
<td className="px-4 py-3">
|
|
539
|
-
<div className="flex min-w-0 items-center gap-2">
|
|
548
|
+
<td className="px-4 py-3 phone:px-3">
|
|
549
|
+
<div className="flex min-w-0 items-center gap-2 phone:flex-wrap phone:gap-y-1">
|
|
540
550
|
<Package className="w-4 h-4 text-theme-text-tertiary shrink-0" />
|
|
541
|
-
<span className="min-w-0 truncate text-sm font-medium text-theme-text-primary">{release.name}</span>
|
|
551
|
+
<span className="min-w-0 truncate text-sm font-medium text-theme-text-primary phone:max-w-[calc(100%-1.5rem)] phone:shrink-0">{release.name}</span>
|
|
542
552
|
{getHealthBadge()}
|
|
543
553
|
{listOperation && <HelmOperationChip operation={listOperation} />}
|
|
544
554
|
{release.managedByFluxHelmRelease && (
|
|
@@ -557,13 +567,14 @@ const ReleaseRow = forwardRef<HTMLTableRowElement, ReleaseRowProps>(
|
|
|
557
567
|
</Tooltip>
|
|
558
568
|
)}
|
|
559
569
|
</div>
|
|
570
|
+
<span className="hidden truncate pl-6 text-xs text-theme-text-tertiary phone:block">{release.namespace}</span>
|
|
560
571
|
</td>
|
|
561
|
-
<td className="px-4 py-3 w-[18%]">
|
|
572
|
+
<td className="px-4 py-3 w-[18%] phone:hidden">
|
|
562
573
|
<Tooltip content={release.namespace}>
|
|
563
574
|
<span className="block truncate text-sm text-theme-text-secondary">{release.namespace}</span>
|
|
564
575
|
</Tooltip>
|
|
565
576
|
</td>
|
|
566
|
-
<td className="px-4 py-3 w-[22%]">
|
|
577
|
+
<td className="px-4 py-3 w-[22%] phone:hidden">
|
|
567
578
|
<Tooltip content={`${release.chart}-${release.chartVersion}`}>
|
|
568
579
|
<span className="text-sm text-theme-text-secondary truncate block">
|
|
569
580
|
{release.chart}-{release.chartVersion}
|
|
@@ -579,11 +590,11 @@ const ReleaseRow = forwardRef<HTMLTableRowElement, ReleaseRowProps>(
|
|
|
579
590
|
</Tooltip>
|
|
580
591
|
)}
|
|
581
592
|
</td>
|
|
582
|
-
<td className="px-4 py-3 w-40">
|
|
593
|
+
<td className="px-4 py-3 w-40 phone:w-[6.5rem] phone:px-3">
|
|
583
594
|
{isHelmReleaseActionable(release.status) ? (
|
|
584
595
|
<Tooltip content="Click row to view rollback / history / logs and recover">
|
|
585
596
|
<span
|
|
586
|
-
className={clsx('badge inline-flex items-center gap-1', getStatusColor(release.status))}
|
|
597
|
+
className={clsx('badge inline-flex items-center gap-1 phone:whitespace-normal', getStatusColor(release.status))}
|
|
587
598
|
>
|
|
588
599
|
{release.status}
|
|
589
600
|
<ChevronRight className="w-3 h-3 opacity-70" />
|
|
@@ -592,7 +603,7 @@ const ReleaseRow = forwardRef<HTMLTableRowElement, ReleaseRowProps>(
|
|
|
592
603
|
) : (
|
|
593
604
|
<span
|
|
594
605
|
className={clsx(
|
|
595
|
-
'badge',
|
|
606
|
+
'badge phone:whitespace-normal',
|
|
596
607
|
getStatusColor(release.status)
|
|
597
608
|
)}
|
|
598
609
|
>
|
|
@@ -600,10 +611,10 @@ const ReleaseRow = forwardRef<HTMLTableRowElement, ReleaseRowProps>(
|
|
|
600
611
|
</span>
|
|
601
612
|
)}
|
|
602
613
|
</td>
|
|
603
|
-
<td className="px-4 py-3 w-16">
|
|
614
|
+
<td className="px-4 py-3 w-16 phone:hidden">
|
|
604
615
|
<span className="text-sm text-theme-text-secondary">{release.revision}</span>
|
|
605
616
|
</td>
|
|
606
|
-
<td className="px-4 py-3 w-24">
|
|
617
|
+
<td className="px-4 py-3 w-24 phone:hidden">
|
|
607
618
|
<Tooltip content={release.updated}>
|
|
608
619
|
<span className="text-sm text-theme-text-secondary">
|
|
609
620
|
{formatAge(release.updated)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useCallback, useEffect, useMemo, useRef } from 'react'
|
|
2
2
|
import { X, Package, ChevronRight, ChevronLeft, Play, Loader2, AlertTriangle, CheckCircle, User, BookOpen, Link as LinkIcon, Star, BadgeCheck, Shield, Globe, Building2, Plus, Minus, Terminal } from 'lucide-react'
|
|
3
|
-
import { PaneLoader, Input, useDebouncedValue } from '@skyhook-io/k8s-ui'
|
|
3
|
+
import { PaneLoader, Input, useDebouncedValue, usePhoneLayout } from '@skyhook-io/k8s-ui'
|
|
4
4
|
import { clsx } from 'clsx'
|
|
5
5
|
import yaml from 'yaml'
|
|
6
6
|
import { createPatch } from 'diff'
|
|
@@ -661,6 +661,10 @@ interface ValuesStepProps {
|
|
|
661
661
|
function ValuesStep({ valuesYaml, setValuesYaml, yamlError, setYamlError, chartDetail, source }: ValuesStepProps) {
|
|
662
662
|
const [showEditor, setShowEditor] = useState(false)
|
|
663
663
|
const editorDisclosure = useDisclosure(showEditor)
|
|
664
|
+
// Phones install with the chart's values: authoring YAML by touch is
|
|
665
|
+
// error-prone. An editor already open when a phone rotates stays, and the
|
|
666
|
+
// review step shows any change from the defaults.
|
|
667
|
+
const isPhone = usePhoneLayout()
|
|
664
668
|
|
|
665
669
|
const isLocal = source === 'local'
|
|
666
670
|
const localDetail = chartDetail as ChartDetail | undefined
|
|
@@ -703,7 +707,7 @@ function ValuesStep({ valuesYaml, setValuesYaml, yamlError, setYamlError, chartD
|
|
|
703
707
|
</div>
|
|
704
708
|
|
|
705
709
|
{/* Collapsible editor section */}
|
|
706
|
-
<div className=
|
|
710
|
+
<div className={`border border-theme-border rounded-lg overflow-hidden${isPhone && !showEditor ? ' hidden' : ''}`}>
|
|
707
711
|
<button
|
|
708
712
|
{...editorDisclosure.buttonProps}
|
|
709
713
|
onClick={() => setShowEditor(!showEditor)}
|
|
@@ -17,6 +17,7 @@ const overridesQuery = vi.hoisted(() => ({
|
|
|
17
17
|
|
|
18
18
|
vi.mock('@skyhook-io/k8s-ui', () => ({
|
|
19
19
|
PaneLoader: ({ label }: { label: string }) => <div>{label}</div>,
|
|
20
|
+
usePhoneLayout: () => false,
|
|
20
21
|
}))
|
|
21
22
|
vi.mock('../../api/client', () => ({
|
|
22
23
|
useCanHelmAct: () => ({ allowed: true }),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useCallback, useEffect, useMemo } from 'react'
|
|
2
2
|
import { Copy, Check, Settings, Pencil, X, Eye, Play, Loader2 } from 'lucide-react'
|
|
3
|
-
import { PaneLoader } from '@skyhook-io/k8s-ui'
|
|
3
|
+
import { PaneLoader, usePhoneLayout } from '@skyhook-io/k8s-ui'
|
|
4
4
|
import { clsx } from 'clsx'
|
|
5
5
|
import yaml from 'yaml'
|
|
6
6
|
import type { HelmValues, ValuesPreviewResponse } from '../../types'
|
|
@@ -60,7 +60,9 @@ export function ValuesViewer({
|
|
|
60
60
|
const overridesData = overridesQuery.data
|
|
61
61
|
const overridesBaseline = useMemo(() => (overridesData ? (overridesData.userSupplied ?? {}) : undefined), [overridesData])
|
|
62
62
|
const overridesReady = overridesBaseline !== undefined && !overridesQuery.error && !overridesQuery.isFetching
|
|
63
|
-
|
|
63
|
+
// Phones read values but don't edit them: authoring YAML by touch is error-prone.
|
|
64
|
+
const isPhone = usePhoneLayout()
|
|
65
|
+
const canOfferEdit = Boolean(namespace && name) && canHelmWrite && !isHistoricalRevision && !isPhone
|
|
64
66
|
const canEdit = canOfferEdit && overridesReady
|
|
65
67
|
|
|
66
68
|
const displayValues = showEffectiveValues ? values?.computed : overridesBaseline
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
2
2
|
import type { DashboardResponse, DashboardMetrics, DashboardCRDCount } from '../../api/client'
|
|
3
3
|
import { HealthRing } from './HealthRing'
|
|
4
4
|
import {
|
|
5
5
|
AlertTriangle, CheckCircle, XCircle,
|
|
6
6
|
Cpu, MemoryStick, Database, Container, Globe, Network as NetworkIcon, Briefcase, Clock,
|
|
7
|
-
ArrowRight, Server, Boxes, Shield,
|
|
7
|
+
ArrowRight, Server, Boxes, Shield, Info,
|
|
8
8
|
} from 'lucide-react'
|
|
9
9
|
import { clsx } from 'clsx'
|
|
10
10
|
import { formatCPUMillicores, formatMemoryMiB } from '../../utils/format'
|
|
11
11
|
import { useCapabilitiesContext } from '../../contexts/CapabilitiesContext'
|
|
12
|
-
import {
|
|
12
|
+
import { HomeAgentBlock } from './HomeAgentBlock'
|
|
13
13
|
import { assetUrl, pluralize, parseContextName } from '@skyhook-io/k8s-ui'
|
|
14
14
|
import { Tooltip } from '../ui/Tooltip'
|
|
15
15
|
import { mcpEndpointUrl } from '../../api/config'
|
|
@@ -112,6 +112,12 @@ function getPlatformInfo(platform: string): { name: string; icon: string | null
|
|
|
112
112
|
if (platformLower.includes('docker')) {
|
|
113
113
|
return { name: 'Docker Desktop', icon: null }
|
|
114
114
|
}
|
|
115
|
+
if (platformLower === 'nkp') {
|
|
116
|
+
return { name: 'Nutanix Kubernetes Platform', icon: null }
|
|
117
|
+
}
|
|
118
|
+
if (platformLower === 'nutanix') {
|
|
119
|
+
return { name: 'Nutanix', icon: null }
|
|
120
|
+
}
|
|
115
121
|
// The Go backend returns "generic" for unrecognized platforms — that
|
|
116
122
|
// literal string is no better than the empty case, so fall back to
|
|
117
123
|
// the friendlier "Kubernetes" label for both. Only pass the platform
|
|
@@ -142,7 +148,6 @@ export function ClusterHealthCard({
|
|
|
142
148
|
}: ClusterHealthCardProps) {
|
|
143
149
|
void _topCRDs // Reserved for future CRD display
|
|
144
150
|
|
|
145
|
-
const [mcpDialogOpen, setMcpDialogOpen] = useState(false)
|
|
146
151
|
const caps = useCapabilitiesContext()
|
|
147
152
|
// Default to local mode when the backend doesn't ship a `deployment`
|
|
148
153
|
// field (older Radar binaries pre-0.2.2). Local rendering is the safe
|
|
@@ -224,11 +229,11 @@ export function ClusterHealthCard({
|
|
|
224
229
|
|
|
225
230
|
return (
|
|
226
231
|
<div className="rounded-xl bg-theme-surface shadow-theme-sm overflow-hidden">
|
|
227
|
-
{/* Main health section - three columns */}
|
|
228
|
-
<div className="px-6 py-5 border-b border-theme-border/50">
|
|
229
|
-
<div className="flex items-stretch gap-8">
|
|
232
|
+
{/* Main health section - three columns; stacked on phones */}
|
|
233
|
+
<div className="px-6 py-5 border-b border-theme-border/50 phone:px-4">
|
|
234
|
+
<div className="flex items-stretch gap-8 phone:flex-col phone:gap-5">
|
|
230
235
|
{/* Left: Cluster info */}
|
|
231
|
-
<div className="flex flex-col justify-center w-[300px] shrink-0 pr-8 border-r border-theme-border/50">
|
|
236
|
+
<div className="flex flex-col justify-center w-[300px] shrink-0 pr-8 border-r border-theme-border/50 phone:w-auto phone:pr-0 phone:border-r-0">
|
|
232
237
|
<div className="flex items-center gap-2 mb-1.5">
|
|
233
238
|
{platformInfo.icon ? (
|
|
234
239
|
<img src={platformInfo.icon} alt={platformInfo.name} className="w-5 h-5 object-contain" />
|
|
@@ -269,17 +274,6 @@ export function ClusterHealthCard({
|
|
|
269
274
|
)}
|
|
270
275
|
{radarVersion}
|
|
271
276
|
<span><span className="font-mono">{counts.namespaces}</span> namespaces</span>
|
|
272
|
-
{/* Show raw kubeconfig context as muted metadata only when
|
|
273
|
-
it differs from the headline AND we're in local mode
|
|
274
|
-
(in-cluster has no meaningful context name, cloud
|
|
275
|
-
shell already renders the canonical name). */}
|
|
276
|
-
{cluster.name && cluster.name !== headlineName && deployment.mode === 'local' && (
|
|
277
|
-
<Tooltip content={cluster.name}>
|
|
278
|
-
<span className="font-mono text-[10px] text-theme-text-disabled break-all leading-snug pt-0.5">
|
|
279
|
-
{cluster.name}
|
|
280
|
-
</span>
|
|
281
|
-
</Tooltip>
|
|
282
|
-
)}
|
|
283
277
|
</div>
|
|
284
278
|
{freshness && <div className="mt-2">{freshness}</div>}
|
|
285
279
|
{nodeVersionSkew && (
|
|
@@ -305,43 +299,28 @@ export function ClusterHealthCard({
|
|
|
305
299
|
</span>
|
|
306
300
|
</Tooltip>
|
|
307
301
|
)}
|
|
308
|
-
{/*
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
would mislead a Cloud user. */}
|
|
302
|
+
{/* OSS-only: in Cloud, MCP discovery lives at the hub level
|
|
303
|
+
(org-wide endpoint, PAT-authed) rather than per-cluster, so this
|
|
304
|
+
localhost/no-auth entry would mislead a Cloud user. */}
|
|
312
305
|
{showLocalMcpCard && (
|
|
313
|
-
<
|
|
314
|
-
onClick={() => setMcpDialogOpen(true)}
|
|
315
|
-
className="flex items-center gap-2 mt-3 px-2.5 py-2 bg-purple-500/5 hover:bg-purple-500/10 border border-purple-500/20 rounded-md transition-colors w-full"
|
|
316
|
-
>
|
|
317
|
-
<Radio className="w-3.5 h-3.5 text-purple-400 animate-pulse shrink-0" />
|
|
318
|
-
<div className="flex flex-col gap-0.5 min-w-0 flex-1 text-left">
|
|
319
|
-
<span className="text-xs font-medium text-purple-400">{caps.mcpReadOnly ? 'MCP Server Live (read-only)' : 'MCP Server Live'}</span>
|
|
320
|
-
<Tooltip content={mcpUrl} wrapperClassName="min-w-0">
|
|
321
|
-
<span className="text-[10px] text-theme-text-tertiary truncate font-mono">
|
|
322
|
-
HTTP · {mcpUrl}
|
|
323
|
-
</span>
|
|
324
|
-
</Tooltip>
|
|
325
|
-
</div>
|
|
326
|
-
<Info className="w-3.5 h-3.5 text-purple-400/60 shrink-0" />
|
|
327
|
-
</button>
|
|
306
|
+
<HomeAgentBlock mcpUrl={mcpUrl} readOnly={caps.mcpReadOnly} execTools={caps.mcpExecTools} />
|
|
328
307
|
)}
|
|
329
|
-
<MCPSetupDialog open={mcpDialogOpen} onClose={() => setMcpDialogOpen(false)} mcpUrl={mcpUrl} readOnly={caps.mcpReadOnly} />
|
|
330
308
|
</div>
|
|
331
309
|
|
|
332
310
|
{/* Center: Three health rings */}
|
|
333
|
-
|
|
311
|
+
{/* Phones: the three rings share one row; each ring's status lines stack. */}
|
|
312
|
+
<div className="flex-1 flex items-center justify-center gap-12 phone:grid phone:grid-cols-3 phone:items-start phone:gap-2">
|
|
334
313
|
{/* Pods Ring */}
|
|
335
314
|
{isRestricted('pods') ? (
|
|
336
315
|
<RestrictedRing label="Pods" />
|
|
337
316
|
) : (
|
|
338
317
|
<button
|
|
339
318
|
onClick={() => onNavigateToKind('pods')}
|
|
340
|
-
className="flex flex-col items-center gap-2 hover:-translate-y-1 hover:scale-105 transition-all duration-200"
|
|
319
|
+
className="flex flex-col items-center gap-2 phone:min-w-0 hover:-translate-y-1 hover:scale-105 transition-all duration-200"
|
|
341
320
|
>
|
|
342
321
|
<HealthRing segments={podsRingSegments} size={88} strokeWidth={8} label={String(podsTotal)} />
|
|
343
|
-
<span className="text-sm font-semibold uppercase tracking-wider text-theme-text-secondary">Pods</span>
|
|
344
|
-
<div className="flex items-center gap-2 text-xs font-mono">
|
|
322
|
+
<span className="text-sm font-semibold uppercase tracking-wider text-theme-text-secondary phone:text-[11px] phone:tracking-wide">Pods</span>
|
|
323
|
+
<div className="flex items-center gap-2 text-xs font-mono phone:flex-col phone:gap-0.5">
|
|
345
324
|
{health.healthy > 0 && (
|
|
346
325
|
<span className="flex items-center gap-0.5 text-green-500">
|
|
347
326
|
<CheckCircle className="w-3 h-3" />
|
|
@@ -370,11 +349,11 @@ export function ClusterHealthCard({
|
|
|
370
349
|
) : (
|
|
371
350
|
<button
|
|
372
351
|
onClick={() => onNavigateToKind('deployments')}
|
|
373
|
-
className="flex flex-col items-center gap-2 hover:-translate-y-1 hover:scale-105 transition-all duration-200"
|
|
352
|
+
className="flex flex-col items-center gap-2 phone:min-w-0 hover:-translate-y-1 hover:scale-105 transition-all duration-200"
|
|
374
353
|
>
|
|
375
354
|
<HealthRing segments={deploymentsRingSegments} size={88} strokeWidth={8} label={String(counts.deployments.total)} />
|
|
376
|
-
<span className="text-sm font-semibold uppercase tracking-wider text-theme-text-secondary">Deployments</span>
|
|
377
|
-
<div className="flex items-center gap-2 text-xs font-mono">
|
|
355
|
+
<span className="text-sm font-semibold uppercase tracking-wider text-theme-text-secondary phone:text-[11px] phone:tracking-wide">Deployments</span>
|
|
356
|
+
<div className="flex items-center gap-2 text-xs font-mono phone:flex-col phone:gap-0.5">
|
|
378
357
|
<span className="text-green-500">{counts.deployments.available} available</span>
|
|
379
358
|
{counts.deployments.unavailable > 0 && (
|
|
380
359
|
<span className="text-red-500">{counts.deployments.unavailable} unavailable</span>
|
|
@@ -389,11 +368,11 @@ export function ClusterHealthCard({
|
|
|
389
368
|
) : (
|
|
390
369
|
<button
|
|
391
370
|
onClick={() => onNavigateToKind('nodes')}
|
|
392
|
-
className="flex flex-col items-center gap-2 hover:-translate-y-1 hover:scale-105 transition-all duration-200"
|
|
371
|
+
className="flex flex-col items-center gap-2 phone:min-w-0 hover:-translate-y-1 hover:scale-105 transition-all duration-200"
|
|
393
372
|
>
|
|
394
373
|
<HealthRing segments={nodesRingSegments} size={88} strokeWidth={8} label={String(counts.nodes.total)} />
|
|
395
|
-
<span className="text-sm font-semibold uppercase tracking-wider text-theme-text-secondary">Nodes</span>
|
|
396
|
-
<div className="flex items-center gap-2 text-xs font-mono">
|
|
374
|
+
<span className="text-sm font-semibold uppercase tracking-wider text-theme-text-secondary phone:text-[11px] phone:tracking-wide">Nodes</span>
|
|
375
|
+
<div className="flex items-center gap-2 text-xs font-mono phone:flex-col phone:gap-0.5">
|
|
397
376
|
<span className="text-green-500">{counts.nodes.ready} ready</span>
|
|
398
377
|
{cordonedCount > 0 && (
|
|
399
378
|
<span className="text-yellow-500">{cordonedCount} cordoned</span>
|
|
@@ -410,7 +389,7 @@ export function ClusterHealthCard({
|
|
|
410
389
|
</div>
|
|
411
390
|
|
|
412
391
|
{/* Right: Resource utilization */}
|
|
413
|
-
<div className="flex flex-col justify-center w-[300px] shrink-0 pl-8 border-l border-theme-border/50">
|
|
392
|
+
<div className="flex flex-col justify-center w-[300px] shrink-0 pl-8 border-l border-theme-border/50 phone:w-auto phone:pl-0 phone:border-l-0">
|
|
414
393
|
<div className="flex items-center gap-2 mb-3">
|
|
415
394
|
<Boxes className="w-4 h-4 text-theme-text-tertiary" />
|
|
416
395
|
<span className="text-[10px] uppercase tracking-wider text-theme-text-tertiary">Resource Utilization</span>
|
|
@@ -470,10 +449,10 @@ export function ClusterHealthCard({
|
|
|
470
449
|
</div>
|
|
471
450
|
</div>
|
|
472
451
|
|
|
473
|
-
{/* Secondary resources row — matches top row's 3-column layout */}
|
|
474
|
-
<div className="flex items-stretch px-6 py-2.5 bg-theme-surface/30">
|
|
452
|
+
{/* Secondary resources row — matches top row's 3-column layout; stacked on phones */}
|
|
453
|
+
<div className="flex items-stretch px-6 py-2.5 bg-theme-surface/30 phone:flex-col phone:gap-3 phone:px-4 phone:py-3">
|
|
475
454
|
{/* Left column: Warning indicators (aligned with cluster info) */}
|
|
476
|
-
<div className="flex flex-col justify-center gap-1 w-1/4 shrink-0 pr-4 border-r border-theme-border/50">
|
|
455
|
+
<div className="flex flex-col justify-center gap-1 w-1/4 shrink-0 pr-4 border-r border-theme-border/50 phone:w-auto phone:flex-row phone:flex-wrap phone:pr-0 phone:border-r-0">
|
|
477
456
|
{health.warningEvents > 0 && (
|
|
478
457
|
<Tooltip content="Native Kubernetes Warning events (e.g., ImagePullBackOff, FailedScheduling)" wrapperClassName="w-fit">
|
|
479
458
|
<button
|
|
@@ -499,7 +478,7 @@ export function ClusterHealthCard({
|
|
|
499
478
|
</div>
|
|
500
479
|
|
|
501
480
|
{/* Center column: Resources (aligned with health rings) */}
|
|
502
|
-
<div className="w-1/2 grid grid-cols-3 items-center justify-items-center px-4">
|
|
481
|
+
<div className="w-1/2 grid grid-cols-3 items-center justify-items-center px-4 phone:w-auto phone:flex phone:flex-wrap phone:gap-x-1 phone:px-0">
|
|
503
482
|
{secondaryResources.map((res) => (
|
|
504
483
|
<button
|
|
505
484
|
key={res.kind}
|
|
@@ -523,7 +502,7 @@ export function ClusterHealthCard({
|
|
|
523
502
|
</div>
|
|
524
503
|
|
|
525
504
|
{/* Right column: Browse All (aligned with resource utilization) */}
|
|
526
|
-
<div className="flex items-center justify-center w-1/4 shrink-0 pl-4 border-l border-theme-border/50">
|
|
505
|
+
<div className="flex items-center justify-center w-1/4 shrink-0 pl-4 border-l border-theme-border/50 phone:w-auto phone:justify-start phone:pl-0 phone:border-l-0">
|
|
527
506
|
<button
|
|
528
507
|
onClick={onNavigateToView}
|
|
529
508
|
className="flex items-center gap-2 text-base font-medium text-theme-text-secondary hover:text-theme-text-primary transition-colors"
|
|
@@ -571,15 +550,17 @@ function KubernetesVersionLine({
|
|
|
571
550
|
}
|
|
572
551
|
wrapperClassName="w-fit"
|
|
573
552
|
>
|
|
553
|
+
{/* Inline text, not flex: flex items shrink and wrap separately, which
|
|
554
|
+
splits a long distribution version and the link into two columns. */}
|
|
574
555
|
<button
|
|
575
556
|
onClick={onNavigate}
|
|
576
|
-
className="group
|
|
557
|
+
className="group text-left hover:text-theme-text-secondary transition-colors"
|
|
577
558
|
>
|
|
578
|
-
|
|
559
|
+
Kubernetes {version}
|
|
579
560
|
{behind > 0 && (
|
|
580
|
-
<span
|
|
561
|
+
<> · <span className="whitespace-nowrap">Upgrade impact</span></>
|
|
581
562
|
)}
|
|
582
|
-
<ArrowRight className="w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity" />
|
|
563
|
+
<ArrowRight className="inline-block w-3 h-3 ml-1 align-[-2px] opacity-0 group-hover:opacity-100 transition-opacity" />
|
|
583
564
|
</button>
|
|
584
565
|
</Tooltip>
|
|
585
566
|
)
|