@skyhook-io/radar-app 1.18.0 → 1.18.2
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 +6 -0
- package/package.json +2 -3
- package/src/App.tsx +43 -12
- package/src/api/client.deleteResource.test.tsx +111 -0
- package/src/api/client.gitops-destination.test.tsx +55 -0
- package/src/api/client.resource-list.test.ts +76 -0
- package/src/api/client.resourceAudit.test.tsx +57 -0
- package/src/api/client.resourcePath.test.ts +107 -0
- package/src/api/client.ts +197 -57
- package/src/api/quotas.ts +9 -20
- package/src/api/radarFeatures.ts +2 -0
- package/src/api/resourceLists.test.ts +84 -0
- package/src/api/resourceLists.ts +71 -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/CNPGView.tsx +1 -0
- package/src/components/cnpg/actions/useCNPGWriteGuard.tsx +1 -0
- package/src/components/compare/CompareResourcePicker.test.tsx +58 -0
- package/src/components/compare/CompareViewRoute.tsx +5 -1
- package/src/components/compare/useCompareCandidates.ts +1 -1
- package/src/components/compare/useCompareLauncher.tsx +4 -2
- package/src/components/diagnose/ApplyDialog.test.tsx +10 -0
- package/src/components/diagnose/ApplyDialog.tsx +8 -1
- package/src/components/diagnose/AssessmentCard.tsx +60 -0
- package/src/components/diagnose/DiagnoseSurface.tsx +5 -0
- package/src/components/diagnose/InvestigationEvidencePane.test.tsx +62 -2
- package/src/components/diagnose/InvestigationEvidenceSections.tsx +6 -5
- package/src/components/diagnose/InvestigationView.tsx +47 -13
- package/src/components/diagnose/StoryExcerpt.tsx +24 -5
- package/src/components/diagnose/assessmentCopy.ts +11 -0
- package/src/components/diagnose/investigationEvidence/adapters/changes.ts +36 -1
- package/src/components/diagnose/investigationEvidence/adapters/crossplane.test.tsx +85 -0
- package/src/components/diagnose/investigationEvidence/adapters/issues.ts +1 -0
- package/src/components/diagnose/investigationEvidence/adapters/listCoverage.test.ts +415 -0
- package/src/components/diagnose/investigationEvidence/adapters/prometheus.test.ts +2 -1
- package/src/components/diagnose/investigationEvidence/adapters/prometheus.ts +2 -1
- package/src/components/diagnose/investigationEvidence/adapters/resource.ts +107 -8
- 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/inventory.tsx +66 -16
- package/src/components/diagnose/investigationEvidence/bodies/workload.tsx +5 -1
- package/src/components/diagnose/investigationEvidence/builder.ts +16 -2
- package/src/components/diagnose/investigationEvidence/cardParts.tsx +7 -2
- package/src/components/diagnose/investigationEvidence/excerpt.ts +2 -0
- package/src/components/diagnose/investigationEvidence/identity.test.ts +1 -1
- package/src/components/diagnose/investigationEvidence/observations.ts +8 -3
- package/src/components/diagnose/investigationEvidence/projection.test.ts +81 -4
- package/src/components/diagnose/investigationEvidence/types.ts +15 -0
- package/src/components/diagnose/investigationEvidencePresentation.test.ts +36 -2
- package/src/components/diagnose/investigationEvidencePresentation.ts +33 -8
- package/src/components/diagnose/storyParts.test.tsx +53 -0
- package/src/components/diagnose/toolCallLabel.test.ts +9 -0
- package/src/components/diagnose/toolCallLabel.ts +2 -0
- package/src/components/execution/BatchExecutionView.image-browse.test.tsx +46 -0
- package/src/components/execution/BatchExecutionView.tsx +6 -4
- package/src/components/gitops/GitOpsView.identity.test.tsx +113 -0
- package/src/components/gitops/GitOpsView.tsx +62 -40
- package/src/components/gitops/useDestinationCluster.ts +2 -1
- package/src/components/helm/ArtifactHubSourceSearch.test.tsx +124 -0
- package/src/components/helm/ArtifactHubSourceSearch.tsx +240 -0
- package/src/components/helm/ChartBrowser.tsx +9 -8
- 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/TrackChartSourceDialog.render.test.tsx +269 -96
- package/src/components/helm/TrackChartSourceDialog.tsx +607 -104
- package/src/components/helm/ValuesViewer.test.tsx +1 -0
- package/src/components/helm/ValuesViewer.tsx +4 -2
- package/src/components/home/ClusterHealthCard.tsx +28 -21
- package/src/components/home/MCPSetupDialog.test.tsx +27 -2
- package/src/components/home/MCPSetupDialog.tsx +14 -2
- package/src/components/home/mcpToolCatalog.ts +39 -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/resource/PrometheusCharts.overlays.test.ts +45 -0
- package/src/components/resource/PrometheusCharts.tsx +2 -2
- package/src/components/resources/CompositeRenderer.tsx +4 -0
- package/src/components/resources/ResourcesView.tsx +30 -68
- package/src/components/resources/renderers/PodRenderer.tsx +4 -1
- package/src/components/settings/LocalConnectionSettings.tsx +1 -0
- package/src/components/settings/MyPermissionsDialog.tsx +12 -9
- package/src/components/traffic/TrafficSourcePill.test.tsx +110 -0
- package/src/components/traffic/TrafficSourcePill.tsx +111 -0
- package/src/components/traffic/TrafficView.tsx +9 -55
- package/src/components/ui/DiagnosticsOverlay.test.ts +25 -0
- package/src/components/ui/DiagnosticsOverlay.tsx +2 -1
- package/src/components/ui/Omnibar.note.test.tsx +141 -0
- package/src/components/ui/Omnibar.tsx +82 -18
- package/src/components/ui/RadarOmnibar.test.tsx +201 -0
- package/src/components/ui/RadarOmnibar.tsx +39 -4
- package/src/components/ui/SearchSyntaxHelp.test.tsx +39 -0
- package/src/components/ui/SearchSyntaxHelp.tsx +23 -2
- package/src/components/ui/UpdateNotification.manual.test.tsx +177 -0
- package/src/components/ui/UpdateNotification.test.tsx +4 -1
- package/src/components/ui/UpdateNotification.tsx +61 -10
- package/src/components/ui/omnibar-match.test.ts +15 -8
- package/src/components/ui/omnibar-match.ts +11 -6
- package/src/components/ui/searchCoverage.fixtures.ts +16 -0
- package/src/components/ui/searchCoverageNote.test.ts +245 -0
- package/src/components/ui/searchCoverageNote.ts +222 -0
- package/src/components/usage-data/UsageDataPrompt.tsx +19 -1
- package/src/components/whats-new/WhatsNew.test.ts +10 -0
- package/src/components/whats-new/WhatsNew.tsx +5 -4
- package/src/components/whats-new/WhatsNewDialog.test.tsx +20 -0
- package/src/components/whats-new/releaseNotes.ts +57 -5
- package/src/components/workload/WorkloadView.tsx +18 -6
- package/src/components/workspace/layout.tsx +2 -1
- package/src/contexts/CapabilitiesContext.tsx +1 -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/hooks/useResourceCounts.ts +2 -0
- package/src/index.css +87 -4
- package/src/index.ts +7 -0
- package/src/utils/artifacthub.test.ts +18 -0
- package/src/utils/artifacthub.ts +9 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { useState, type ReactNode } from 'react'
|
|
2
|
+
import { Badge, Input } from '@skyhook-io/k8s-ui'
|
|
3
|
+
import { useArtifactHubSearch } from '../../api/client'
|
|
4
|
+
import type { ArtifactHubChart } from '../../types'
|
|
5
|
+
import { artifactHubPublisher, isArtifactHubOfficial } from '../../utils/artifacthub'
|
|
6
|
+
|
|
7
|
+
export type PublicChartSource = { type: 'repository'; url: string } | { type: 'oci'; url: string; prefix: string }
|
|
8
|
+
|
|
9
|
+
export function publicChartSourceURL(raw: string): string | undefined {
|
|
10
|
+
try {
|
|
11
|
+
const url = new URL(raw)
|
|
12
|
+
if (
|
|
13
|
+
!['http:', 'https:', 'oci:'].includes(url.protocol) ||
|
|
14
|
+
!url.hostname ||
|
|
15
|
+
url.username ||
|
|
16
|
+
url.password ||
|
|
17
|
+
url.search ||
|
|
18
|
+
url.hash
|
|
19
|
+
)
|
|
20
|
+
return
|
|
21
|
+
url.hostname = url.hostname.toLowerCase()
|
|
22
|
+
return url.toString().replace(/\/+$/, '')
|
|
23
|
+
} catch {
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function artifactHubChartSource(chart: ArtifactHubChart, chartName: string): PublicChartSource | undefined {
|
|
29
|
+
if (chart.name !== chartName) return
|
|
30
|
+
const address = publicChartSourceURL(chart.repository.url)
|
|
31
|
+
if (!address) return
|
|
32
|
+
if (!address.startsWith('oci://')) return { type: 'repository', url: address }
|
|
33
|
+
if (address.endsWith(`/${chartName}`))
|
|
34
|
+
return { type: 'oci', url: address, prefix: address.slice(0, -(chartName.length + 1)) }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface ArtifactHubSourceSearchProps {
|
|
38
|
+
chartName: string
|
|
39
|
+
disabled: boolean
|
|
40
|
+
isConfigured: (source: PublicChartSource) => boolean
|
|
41
|
+
onAdd: (chart: ArtifactHubChart, source: PublicChartSource) => void
|
|
42
|
+
onConfigured: (source: PublicChartSource) => void
|
|
43
|
+
manualAction: ReactNode
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const PAGE_SIZE = 60
|
|
47
|
+
|
|
48
|
+
function listingPriority(chart: ArtifactHubChart) {
|
|
49
|
+
return Number(isArtifactHubOfficial(chart)) * 2 + Number(Boolean(chart.repository.verifiedPublisher))
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function listingKey(chart: ArtifactHubChart) {
|
|
53
|
+
return JSON.stringify([
|
|
54
|
+
chart.packageId,
|
|
55
|
+
chart.repository.organizationName,
|
|
56
|
+
chart.repository.userAlias,
|
|
57
|
+
chart.repository.name,
|
|
58
|
+
chart.repository.organizationDisplayName,
|
|
59
|
+
chart.repository.displayName,
|
|
60
|
+
chart.version,
|
|
61
|
+
])
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function ArtifactHubSourceSearch({
|
|
65
|
+
chartName,
|
|
66
|
+
disabled,
|
|
67
|
+
isConfigured,
|
|
68
|
+
onAdd,
|
|
69
|
+
onConfigured,
|
|
70
|
+
manualAction,
|
|
71
|
+
}: ArtifactHubSourceSearchProps) {
|
|
72
|
+
const [started, setStarted] = useState(false)
|
|
73
|
+
const [offset, setOffset] = useState(0)
|
|
74
|
+
const [selectedURL, setSelectedURL] = useState('')
|
|
75
|
+
const [filter, setFilter] = useState('')
|
|
76
|
+
const search = useArtifactHubSearch(chartName, { offset, limit: PAGE_SIZE }, started)
|
|
77
|
+
const listings = new Map<string, { chart: ArtifactHubChart; source: PublicChartSource }>()
|
|
78
|
+
for (const chart of search.data?.charts ?? []) {
|
|
79
|
+
const source = artifactHubChartSource(chart, chartName)
|
|
80
|
+
if (!source) continue
|
|
81
|
+
const current = listings.get(source.url)
|
|
82
|
+
if (
|
|
83
|
+
!current ||
|
|
84
|
+
listingPriority(chart) > listingPriority(current.chart) ||
|
|
85
|
+
(listingPriority(chart) === listingPriority(current.chart) && listingKey(chart) < listingKey(current.chart))
|
|
86
|
+
) {
|
|
87
|
+
listings.set(source.url, { chart, source })
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const matches = [...listings.values()]
|
|
91
|
+
|
|
92
|
+
const selected = matches.find((item) => item.source.url === selectedURL)
|
|
93
|
+
const filtered = matches.filter(({ chart, source }) =>
|
|
94
|
+
`${chart.repository.name} ${chart.repository.displayName ?? ''} ${artifactHubPublisher(chart.repository)} ${chart.repository.organizationName ?? ''} ${chart.repository.userAlias ?? ''} ${source.url}`
|
|
95
|
+
.toLowerCase()
|
|
96
|
+
.includes(filter.trim().toLowerCase()),
|
|
97
|
+
)
|
|
98
|
+
const changePage = (nextOffset: number) => {
|
|
99
|
+
setOffset(nextOffset)
|
|
100
|
+
setSelectedURL('')
|
|
101
|
+
setFilter('')
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<section className="flex flex-col flex-1 min-h-0" aria-label="Public chart sources">
|
|
106
|
+
{!started ? (
|
|
107
|
+
<div className="flex-1 flex flex-col items-center justify-center gap-3 p-6 text-center">
|
|
108
|
+
<p className="text-sm text-theme-text-secondary">
|
|
109
|
+
Find public repositories for <span className="font-medium text-theme-text-primary">{chartName}</span>.
|
|
110
|
+
</p>
|
|
111
|
+
<button type="button" onClick={() => setStarted(true)} className="btn-brand px-3 py-2 text-sm">
|
|
112
|
+
Search ArtifactHub
|
|
113
|
+
</button>
|
|
114
|
+
<p className="text-xs text-theme-text-tertiary">Only the chart name is sent.</p>
|
|
115
|
+
</div>
|
|
116
|
+
) : (
|
|
117
|
+
<>
|
|
118
|
+
<div className="shrink-0 px-4 py-3 border-b border-theme-border space-y-2" aria-live="polite">
|
|
119
|
+
<p className="text-xs text-theme-text-secondary">
|
|
120
|
+
Matching names and ArtifactHub badges do not prove where this release was installed from.
|
|
121
|
+
</p>
|
|
122
|
+
{matches.length > 6 && (
|
|
123
|
+
<Input
|
|
124
|
+
aria-label="Filter public sources on this page"
|
|
125
|
+
value={filter}
|
|
126
|
+
onChange={(event) => {
|
|
127
|
+
setFilter(event.target.value)
|
|
128
|
+
setSelectedURL('')
|
|
129
|
+
}}
|
|
130
|
+
placeholder="Filter this page by publisher or address"
|
|
131
|
+
className="w-full"
|
|
132
|
+
/>
|
|
133
|
+
)}
|
|
134
|
+
{search.isFetching && <p className="text-xs text-theme-text-secondary">Searching ArtifactHub...</p>}
|
|
135
|
+
{search.error && (
|
|
136
|
+
<div role="alert" className="text-sm text-theme-text-secondary">
|
|
137
|
+
<p>Could not search ArtifactHub. You can still add a source manually.</p>
|
|
138
|
+
<button
|
|
139
|
+
type="button"
|
|
140
|
+
onClick={() => void search.refetch()}
|
|
141
|
+
disabled={search.isFetching}
|
|
142
|
+
className="text-accent hover:underline disabled:opacity-50"
|
|
143
|
+
>
|
|
144
|
+
Retry search
|
|
145
|
+
</button>
|
|
146
|
+
</div>
|
|
147
|
+
)}
|
|
148
|
+
</div>
|
|
149
|
+
<div className="flex-1 min-h-0 overflow-y-auto" aria-label="Public source results">
|
|
150
|
+
{!search.isFetching && !search.error && search.data && filtered.length === 0 && (
|
|
151
|
+
<p className="p-4 text-sm text-theme-text-secondary">
|
|
152
|
+
{filter
|
|
153
|
+
? 'No matching sources on this page.'
|
|
154
|
+
: 'No exact chart-name matches on this page. Try another page or add a source manually.'}
|
|
155
|
+
</p>
|
|
156
|
+
)}
|
|
157
|
+
{filtered.map(({ chart, source }) => (
|
|
158
|
+
<button
|
|
159
|
+
key={source.url}
|
|
160
|
+
type="button"
|
|
161
|
+
aria-label={`Choose source: ${source.url}`}
|
|
162
|
+
aria-pressed={selectedURL === source.url}
|
|
163
|
+
onClick={() => setSelectedURL(source.url)}
|
|
164
|
+
className={`w-full text-left px-4 py-3 border-b border-theme-border hover:bg-theme-hover ${selectedURL === source.url ? 'bg-theme-active' : ''}`}
|
|
165
|
+
>
|
|
166
|
+
<span className="flex flex-wrap items-center gap-x-2 gap-y-1">
|
|
167
|
+
<span className="text-sm font-medium">{chart.repository.displayName || chart.repository.name}</span>
|
|
168
|
+
<span className="text-xs text-theme-text-tertiary">
|
|
169
|
+
{artifactHubPublisher(chart.repository) !==
|
|
170
|
+
(chart.repository.displayName || chart.repository.name) && artifactHubPublisher(chart.repository)}
|
|
171
|
+
</span>
|
|
172
|
+
{isConfigured(source) && (
|
|
173
|
+
<Badge tone="note" size="sm">
|
|
174
|
+
Configured
|
|
175
|
+
</Badge>
|
|
176
|
+
)}
|
|
177
|
+
{isArtifactHubOfficial(chart) && (
|
|
178
|
+
<Badge tone="note" size="sm">
|
|
179
|
+
{chart.official ? 'ArtifactHub official package' : 'ArtifactHub official repository'}
|
|
180
|
+
</Badge>
|
|
181
|
+
)}
|
|
182
|
+
{chart.repository.verifiedPublisher && (
|
|
183
|
+
<Badge tone="note" size="sm">
|
|
184
|
+
ArtifactHub verified publisher
|
|
185
|
+
</Badge>
|
|
186
|
+
)}
|
|
187
|
+
</span>
|
|
188
|
+
<span className="block font-mono text-xs text-theme-text-secondary break-all mt-1">{source.url}</span>
|
|
189
|
+
</button>
|
|
190
|
+
))}
|
|
191
|
+
</div>
|
|
192
|
+
{search.data && (
|
|
193
|
+
<div className="shrink-0 flex items-center justify-between gap-3 px-4 py-2 border-t border-theme-border text-xs">
|
|
194
|
+
<button
|
|
195
|
+
type="button"
|
|
196
|
+
onClick={() => changePage(offset - PAGE_SIZE)}
|
|
197
|
+
disabled={offset === 0 || search.isFetching}
|
|
198
|
+
className="text-accent hover:underline disabled:opacity-50"
|
|
199
|
+
>
|
|
200
|
+
Previous results
|
|
201
|
+
</button>
|
|
202
|
+
<span className="text-theme-text-tertiary">Search page {offset / PAGE_SIZE + 1}</span>
|
|
203
|
+
<button
|
|
204
|
+
type="button"
|
|
205
|
+
onClick={() => changePage(offset + PAGE_SIZE)}
|
|
206
|
+
disabled={search.data.charts.length < PAGE_SIZE || search.isFetching}
|
|
207
|
+
className="text-accent hover:underline disabled:opacity-50"
|
|
208
|
+
>
|
|
209
|
+
Next results
|
|
210
|
+
</button>
|
|
211
|
+
</div>
|
|
212
|
+
)}
|
|
213
|
+
</>
|
|
214
|
+
)}
|
|
215
|
+
<div className="shrink-0 flex items-center justify-between gap-3 px-4 py-3 border-t border-theme-border">
|
|
216
|
+
{manualAction}
|
|
217
|
+
{started && (
|
|
218
|
+
<button
|
|
219
|
+
type="button"
|
|
220
|
+
disabled={
|
|
221
|
+
!selected || search.isFetching || Boolean(search.error) || (!isConfigured(selected.source) && disabled)
|
|
222
|
+
}
|
|
223
|
+
onClick={() => {
|
|
224
|
+
if (!selected) return
|
|
225
|
+
if (isConfigured(selected.source)) onConfigured(selected.source)
|
|
226
|
+
else onAdd(selected.chart, selected.source)
|
|
227
|
+
}}
|
|
228
|
+
className="btn-brand px-3 py-2 text-sm disabled:opacity-50"
|
|
229
|
+
>
|
|
230
|
+
{selected && isConfigured(selected.source)
|
|
231
|
+
? 'Show in My Repos'
|
|
232
|
+
: selected?.source.type === 'oci'
|
|
233
|
+
? 'Register OCI source'
|
|
234
|
+
: 'Add repository'}
|
|
235
|
+
</button>
|
|
236
|
+
)}
|
|
237
|
+
</div>
|
|
238
|
+
</section>
|
|
239
|
+
)
|
|
240
|
+
}
|
|
@@ -8,6 +8,7 @@ import type { ChartInfo, HelmRepository, ArtifactHubChart, ChartSource } from '.
|
|
|
8
8
|
import { SEVERITY_BADGE } from '../../utils/badge-colors'
|
|
9
9
|
import { Tooltip } from '../ui/Tooltip'
|
|
10
10
|
import { useToast } from '../ui/Toast'
|
|
11
|
+
import { artifactHubPublisher, isArtifactHubOfficial } from '../../utils/artifacthub'
|
|
11
12
|
import { formatRelativeAgeTime } from '@skyhook-io/k8s-ui/utils/format'
|
|
12
13
|
|
|
13
14
|
interface ChartBrowserProps {
|
|
@@ -123,8 +124,8 @@ export function ChartBrowser({ onChartSelect }: ChartBrowserProps) {
|
|
|
123
124
|
|
|
124
125
|
return (
|
|
125
126
|
<div className="flex flex-col h-full">
|
|
126
|
-
{/* Toolbar */}
|
|
127
|
-
<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">
|
|
128
129
|
<div className="flex items-center gap-2 text-theme-text-secondary">
|
|
129
130
|
<Package className="w-5 h-5" />
|
|
130
131
|
<span className="font-medium">Charts</span>
|
|
@@ -213,7 +214,7 @@ export function ChartBrowser({ onChartSelect }: ChartBrowserProps) {
|
|
|
213
214
|
|
|
214
215
|
{/* ArtifactHub filters */}
|
|
215
216
|
{chartSource === 'artifacthub' && (
|
|
216
|
-
<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">
|
|
217
218
|
<label className="flex items-center gap-1.5 text-sm text-theme-text-secondary">
|
|
218
219
|
<input
|
|
219
220
|
type="checkbox"
|
|
@@ -251,7 +252,7 @@ export function ChartBrowser({ onChartSelect }: ChartBrowserProps) {
|
|
|
251
252
|
)}
|
|
252
253
|
|
|
253
254
|
{/* Search */}
|
|
254
|
-
<div className="flex-1 relative">
|
|
255
|
+
<div className="flex-1 relative phone:order-last phone:basis-full">
|
|
255
256
|
<Search className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-theme-text-tertiary" />
|
|
256
257
|
<Input
|
|
257
258
|
placeholder={chartSource === 'local' ? "Search charts..." : "Search ArtifactHub..."}
|
|
@@ -548,7 +549,7 @@ function ArtifactHubChartCard({ chart, onSelect }: ArtifactHubChartCardProps) {
|
|
|
548
549
|
<div className="flex items-center gap-2 mt-0.5 text-xs text-theme-text-tertiary">
|
|
549
550
|
<span className="flex items-center gap-1">
|
|
550
551
|
<Building2 className="w-3 h-3" />
|
|
551
|
-
{chart.repository
|
|
552
|
+
{artifactHubPublisher(chart.repository)}
|
|
552
553
|
</span>
|
|
553
554
|
<span className="flex items-center gap-1">
|
|
554
555
|
<Globe className="w-3 h-3" />
|
|
@@ -630,12 +631,12 @@ function ArtifactHubChartCard({ chart, onSelect }: ArtifactHubChartCardProps) {
|
|
|
630
631
|
</Tooltip>
|
|
631
632
|
|
|
632
633
|
{/* Official */}
|
|
633
|
-
<Tooltip content={chart
|
|
634
|
+
<Tooltip content={isArtifactHubOfficial(chart) ? 'Official package' : 'Community package'}>
|
|
634
635
|
<span className={clsx(
|
|
635
636
|
'p-1.5 rounded',
|
|
636
|
-
chart
|
|
637
|
+
isArtifactHubOfficial(chart) ? SEVERITY_BADGE.success : 'bg-theme-elevated/50 text-theme-text-disabled'
|
|
637
638
|
)}>
|
|
638
|
-
<Star className={clsx('w-4 h-4', chart
|
|
639
|
+
<Star className={clsx('w-4 h-4', isArtifactHubOfficial(chart) && 'fill-current')} />
|
|
639
640
|
</span>
|
|
640
641
|
</Tooltip>
|
|
641
642
|
</div>
|
|
@@ -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)}
|