kubefc 0.1.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.
@@ -0,0 +1,346 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import { Box, Text, useInput, useApp, useStdout } from 'ink';
3
+ import Spinner from 'ink-spinner';
4
+ import SelectInput from 'ink-select-input';
5
+ import { getDeployments, getContexts, getNamespaces, getCurrentContext } from '../k8s/client.js';
6
+ import LogViewer from './LogViewer.js';
7
+ import { getCachedDeployments, setCachedDeployments } from '../utils/cache.js';
8
+ export default function App({ deploymentName: initialDeployment, namespace: initialNamespace, context: initialContext, tail, maxRetry, timeout, grepPattern, grepAfter = 0, grepBefore = 0, grepContext = 0, grepIgnoreCase = false, grepInvert = false, }) {
9
+ const { exit } = useApp();
10
+ const { stdout } = useStdout();
11
+ // Navigation State
12
+ const [layer, setLayer] = useState('context');
13
+ const [selectedContext, setSelectedContext] = useState(initialContext || '');
14
+ const [selectedNamespace, setSelectedNamespace] = useState(initialNamespace || 'default');
15
+ const [selectedDeployment, setSelectedDeployment] = useState(initialDeployment || '');
16
+ // Data selection state
17
+ const [isSelectingNamespace, setIsSelectingNamespace] = useState(false);
18
+ const [searchText, setSearchText] = useState('');
19
+ // Data Cache / State
20
+ const [contexts, setContexts] = useState([]);
21
+ const [namespaces, setNamespaces] = useState([]);
22
+ const [deployments, setDeployments] = useState([]);
23
+ // UI State
24
+ const [isLoading, setIsLoading] = useState(false);
25
+ const [error, setError] = useState(null);
26
+ // Initialization logic
27
+ useEffect(() => {
28
+ async function init() {
29
+ if (initialDeployment) {
30
+ // If deployment is specified, jump straight to logs
31
+ // We assume context and namespace are provided or defaults are fine
32
+ // But we might need to resolve context if not provided?
33
+ // The CLI args provide context/namespace directly.
34
+ if (initialContext)
35
+ setSelectedContext(initialContext);
36
+ // namespace is 'default' by default prop if not set, so it's fine.
37
+ setLayer('logs');
38
+ }
39
+ else if (initialContext) {
40
+ // If only context is provided, jump to deployment selection
41
+ setSelectedContext(initialContext);
42
+ setLayer('deployment');
43
+ }
44
+ else {
45
+ // Otherwise start at context selection
46
+ // But we need to load contexts first
47
+ loadContexts();
48
+ }
49
+ }
50
+ init();
51
+ }, []);
52
+ // Clear search text when changing layers or mode
53
+ useEffect(() => {
54
+ setSearchText('');
55
+ }, [layer, isSelectingNamespace]);
56
+ // Loaders
57
+ async function loadContexts() {
58
+ try {
59
+ setIsLoading(true);
60
+ setError(null);
61
+ const ctxs = getContexts();
62
+ setContexts(ctxs);
63
+ // If no context selected yet, try to set current
64
+ if (!selectedContext) {
65
+ try {
66
+ const current = getCurrentContext();
67
+ // We don't auto-select in the UI list (SelectInput doesn't support 'default' index easily without finding it)
68
+ // But we can perhaps highlight it if we find the index.
69
+ // For now, simple list.
70
+ }
71
+ catch (e) { }
72
+ }
73
+ }
74
+ catch (err) {
75
+ setError(`Failed to load contexts: ${err instanceof Error ? err.message : String(err)}`);
76
+ }
77
+ finally {
78
+ setIsLoading(false);
79
+ }
80
+ }
81
+ async function loadNamespaces() {
82
+ try {
83
+ setIsLoading(true);
84
+ setError(null);
85
+ const nss = await getNamespaces(selectedContext || undefined);
86
+ setNamespaces(nss);
87
+ }
88
+ catch (err) {
89
+ setError(`Failed to load namespaces: ${err instanceof Error ? err.message : String(err)}`);
90
+ }
91
+ finally {
92
+ setIsLoading(false);
93
+ }
94
+ }
95
+ // Effects when entering layers
96
+ useEffect(() => {
97
+ if (layer === 'deployment') {
98
+ let active = true;
99
+ const ctx = selectedContext || getCurrentContext();
100
+ const ns = selectedNamespace;
101
+ // 1. Try Cache
102
+ const cached = getCachedDeployments(ctx, ns);
103
+ if (cached && cached.length > 0) {
104
+ setDeployments(cached);
105
+ // We have data, so we don't necessarily need to show 'Loading...'
106
+ // but we are syncing in background.
107
+ // If we want to show strict 'syncing' status we'd need another state.
108
+ // For now, let's keep isLoading false so user can interact immediately.
109
+ setIsLoading(false);
110
+ }
111
+ else {
112
+ setIsLoading(true);
113
+ setDeployments([]);
114
+ }
115
+ setError(null);
116
+ // 2. Background Sync
117
+ (async () => {
118
+ try {
119
+ const deps = await getDeployments(ns, selectedContext || undefined);
120
+ if (active) {
121
+ setCachedDeployments(ctx, ns, deps);
122
+ setDeployments(deps);
123
+ setIsLoading(false);
124
+ if (deps.length === 0) {
125
+ setError(`No deployments found in namespace "${ns}"`);
126
+ }
127
+ }
128
+ }
129
+ catch (err) {
130
+ if (active) {
131
+ // Only show error if we have no deployments (i.e. no cache or cache empty)
132
+ // If we have cache, we might want to swallow the error or show it unobtrusively?
133
+ // But existing error UI blocks the list.
134
+ // So if we have cache, we probably shouldn't set global 'error' that hides the list.
135
+ if (deployments.length === 0 && (!cached || cached.length === 0)) {
136
+ setError(`Failed to load deployments: ${err instanceof Error ? err.message : String(err)}`);
137
+ }
138
+ setIsLoading(false);
139
+ }
140
+ }
141
+ })();
142
+ return () => { active = false; };
143
+ }
144
+ }, [layer, selectedContext, selectedNamespace]);
145
+ useEffect(() => {
146
+ if (isSelectingNamespace) {
147
+ loadNamespaces();
148
+ }
149
+ }, [isSelectingNamespace]);
150
+ // Input Handling for Navigation (Global-ish)
151
+ // We use global input only for ESC when not in specific input modes?
152
+ // Actually, SelectInput consumes input.
153
+ // But we can add a listener that handles 'escape'.
154
+ // Note: distinct useInput hooks might conflict if all active.
155
+ // We should only enable our nav handler when NOT in LogViewer (LogViewer handles its own input).
156
+ useInput((input, key) => {
157
+ // LogViewer handles its own input (including safeExit/q) inside the component
158
+ if (layer === 'logs')
159
+ return;
160
+ if (key.escape) {
161
+ if (isSelectingNamespace) {
162
+ setIsSelectingNamespace(false);
163
+ return;
164
+ }
165
+ // Clear search text if present
166
+ if (searchText) {
167
+ setSearchText('');
168
+ return;
169
+ }
170
+ if (layer === 'deployment') {
171
+ setLayer('context');
172
+ loadContexts(); // Ensure contexts are loaded
173
+ return;
174
+ }
175
+ if (layer === 'context') {
176
+ exit();
177
+ return;
178
+ }
179
+ }
180
+ if (layer === 'deployment' && !isSelectingNamespace && (key.ctrl && input === 'n')) {
181
+ // Switch namespace
182
+ setIsSelectingNamespace(true);
183
+ return;
184
+ }
185
+ // Search Input Handling
186
+ // Only capture if not navigating (arrow keys, enter, esc, tab) and not control keys
187
+ if ((layer === 'context' || layer === 'deployment') && !isSelectingNamespace) {
188
+ // Handle Deletion
189
+ if (key.delete || key.backspace) {
190
+ if (key.meta) {
191
+ // Option+Delete / Meta+Backspace: Remove last word
192
+ setSearchText(prev => {
193
+ const words = prev.trimEnd().split(' ');
194
+ words.pop();
195
+ return words.join(' ') + (words.length > 0 ? ' ' : '');
196
+ });
197
+ return;
198
+ }
199
+ // Standard backspace
200
+ setSearchText(prev => prev.slice(0, -1));
201
+ return;
202
+ }
203
+ // Clear Line (Ctrl+U or Cmd+Delete mapped to ^U)
204
+ if (key.ctrl && input === 'u') {
205
+ setSearchText('');
206
+ return;
207
+ }
208
+ // Alternative Clear (Ctrl+Backspace if supported)
209
+ if (key.ctrl && (key.delete || key.backspace)) {
210
+ setSearchText('');
211
+ return;
212
+ }
213
+ if (input && !key.ctrl && !key.meta && !key.upArrow && !key.downArrow && !key.return && !key.escape && !key.tab) {
214
+ setSearchText(prev => prev + input);
215
+ }
216
+ }
217
+ }, { isActive: layer !== 'logs' });
218
+ // Handlers
219
+ const handleContextSelect = (item) => {
220
+ setSelectedContext(item.value);
221
+ setLayer('deployment');
222
+ };
223
+ const handleDeploymentSelect = (item) => {
224
+ setSelectedDeployment(item.value);
225
+ setLayer('logs');
226
+ };
227
+ const handleNamespaceSelect = (item) => {
228
+ setSelectedNamespace(item.value);
229
+ setIsSelectingNamespace(false);
230
+ // Effect will trigger reload of deployments
231
+ };
232
+ // --- Render Helpers ---
233
+ // Calculate limit for SelectInput
234
+ const height = stdout?.rows || 20;
235
+ // Accounting for header, search bar, footer
236
+ const listLimit = Math.max(5, height - 7);
237
+ // Context Selection View
238
+ if (layer === 'context') {
239
+ if (isLoading)
240
+ return React.createElement(Text, { color: "green" },
241
+ React.createElement(Spinner, { type: "dots" }),
242
+ " Loading contexts...");
243
+ if (error)
244
+ return React.createElement(Text, { color: "red" },
245
+ "Error: ",
246
+ error);
247
+ const filteredContexts = contexts.filter(c => c.toLowerCase().includes(searchText.toLowerCase()));
248
+ const items = filteredContexts.map(c => ({ label: c, value: c }));
249
+ return (React.createElement(Box, { flexDirection: "column" },
250
+ React.createElement(Box, { borderStyle: "round", borderColor: "blue", paddingX: 1 },
251
+ React.createElement(Text, null, "Select Kubernetes Context (Cluster)")),
252
+ React.createElement(Box, { marginBottom: 1 },
253
+ React.createElement(Text, null,
254
+ "Search: ",
255
+ React.createElement(Text, { color: "yellow" }, searchText),
256
+ searchText ? '_' : '')),
257
+ React.createElement(SelectInput, { items: items, onSelect: handleContextSelect, limit: listLimit }),
258
+ React.createElement(Box, { marginTop: 1 },
259
+ React.createElement(Text, { dimColor: true },
260
+ "Press ",
261
+ React.createElement(Text, { color: "yellow" }, "Enter"),
262
+ " to select, ",
263
+ React.createElement(Text, { color: "yellow" }, "Esc"),
264
+ " to exit"))));
265
+ }
266
+ // Deployment Selection View
267
+ if (layer === 'deployment') {
268
+ if (isSelectingNamespace) {
269
+ // Namespace Switcher Overlay
270
+ if (isLoading)
271
+ return React.createElement(Text, { color: "green" },
272
+ React.createElement(Spinner, { type: "dots" }),
273
+ " Loading namespaces...");
274
+ if (error)
275
+ return React.createElement(Box, { flexDirection: "column" },
276
+ React.createElement(Text, { color: "red" },
277
+ "Error: ",
278
+ error),
279
+ React.createElement(Text, { dimColor: true }, "Press Esc to cancel"));
280
+ const items = namespaces.map(ns => ({ label: ns, value: ns }));
281
+ // Try to find default index? Ink SelectInput doesn't support initialIndex easily by value.
282
+ // Users just have to scroll.
283
+ return (React.createElement(Box, { flexDirection: "column" },
284
+ React.createElement(Box, { borderStyle: "double", borderColor: "yellow", paddingX: 1 },
285
+ React.createElement(Text, null, "Select Namespace")),
286
+ React.createElement(SelectInput, { items: items, onSelect: handleNamespaceSelect, limit: listLimit }),
287
+ React.createElement(Box, { marginTop: 1 },
288
+ React.createElement(Text, { dimColor: true },
289
+ "Press ",
290
+ React.createElement(Text, { color: "yellow" }, "Esc"),
291
+ " to cancel"))));
292
+ }
293
+ const filteredDeployments = deployments.filter(d => d.toLowerCase().includes(searchText.toLowerCase()));
294
+ const items = filteredDeployments.map(d => ({ label: d, value: d }));
295
+ return (React.createElement(Box, { flexDirection: "column" },
296
+ React.createElement(Box, { borderStyle: "round", borderColor: "cyan", paddingX: 1, flexDirection: "row", justifyContent: "space-between" },
297
+ React.createElement(Text, null,
298
+ "Context: ",
299
+ React.createElement(Text, { color: "blue" }, selectedContext || 'current'),
300
+ " | Namespace: ",
301
+ React.createElement(Text, { color: "yellow" }, selectedNamespace))),
302
+ isLoading ? (React.createElement(Text, null,
303
+ React.createElement(Spinner, { type: "dots" }),
304
+ " Loading deployments...")) : error ? (React.createElement(Text, { color: "red" },
305
+ "Error: ",
306
+ error)) : (React.createElement(Box, { flexDirection: "column" },
307
+ React.createElement(Box, { marginBottom: 1 },
308
+ React.createElement(Text, null,
309
+ "Search: ",
310
+ React.createElement(Text, { color: "yellow" }, searchText),
311
+ searchText ? '_' : '')),
312
+ React.createElement(SelectInput, { items: items, onSelect: handleDeploymentSelect, limit: listLimit }))),
313
+ React.createElement(Box, { marginTop: 1 },
314
+ React.createElement(Text, { dimColor: true },
315
+ React.createElement(Text, { color: "yellow" }, "Enter"),
316
+ " select deployment |",
317
+ React.createElement(Text, { color: "yellow" }, " Ctrl+N"),
318
+ " switch namespace |",
319
+ React.createElement(Text, { color: "yellow" }, " Esc"),
320
+ " back"))));
321
+ }
322
+ // Log Viewer View
323
+ if (layer === 'logs') {
324
+ // LogViewer handles its own "q" to exit.
325
+ // BUT we want "ESC" to go back to deployment layer.
326
+ // LogViewer actually calls exit() on 'q'.
327
+ // We might need to Modify LogViewer to take an `onBack` prop?
328
+ // User said: "In each layer... press esc to go back".
329
+ // IF I'm in LogViewer, ESC should go back to Deployment selection.
330
+ // Currently LogViewer's 'q' calls exit().
331
+ // I should ideally modify LogViewer to accept an `onExit` or `onBack` callback instead of calling `exit()` hard.
332
+ // Or I can wrap LogViewer.
333
+ // If I pass a custom key handler to LogViewer?
334
+ // LogViewer is complex.
335
+ // The user request applies to the whole app.
336
+ // "In every layer press esc to go back".
337
+ // Let's modify LogViewer slightly to accept `onBack` prop.
338
+ // If `onBack` is provided, 'q' (or strict ESC?) should call it.
339
+ // User said "Press ESC to go back".
340
+ // LogViewer currently: 'q' to quit.
341
+ // I should add ESC handling in LogViewer to call onBack.
342
+ return (React.createElement(LogViewer, { deployment: selectedDeployment, namespace: selectedNamespace, context: selectedContext, tail: tail, maxRetry: maxRetry, timeout: timeout, grepPattern: grepPattern, grepAfter: grepAfter, grepBefore: grepBefore, grepContext: grepContext, grepIgnoreCase: grepIgnoreCase, grepInvert: grepInvert, onBack: () => setLayer('deployment') }));
343
+ }
344
+ return null;
345
+ }
346
+ //# sourceMappingURL=App.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App.js","sourceRoot":"","sources":["../../src/components/App.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAC7D,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAmB/E,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAC3B,cAAc,EAAE,iBAAiB,EACjC,SAAS,EAAE,gBAAgB,EAC3B,OAAO,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;QACnE,0CAA0C;QAC1C,iHAAiH;QACjH,2BAA2B;QAE3B,+CAA+C;QAC/C,wBAAwB;QACxB,6CAA6C;QAC7C,yCAAyC;QAEzC,2DAA2D;QAC3D,gEAAgE;QAChE,oCAAoC;QACpC,oCAAoC;QACpC,yDAAyD;QAEzD,OAAO,CACN,oBAAC,SAAS,IACT,UAAU,EAAE,kBAAkB,EAC9B,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,GACnC,CACF,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC"}
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ interface LogViewerProps {
3
+ deployment: string;
4
+ namespace: string;
5
+ context?: string;
6
+ tail: number;
7
+ maxRetry: number;
8
+ timeout: number;
9
+ grepPattern?: string;
10
+ grepAfter?: number;
11
+ grepBefore?: number;
12
+ grepContext?: number;
13
+ grepIgnoreCase?: boolean;
14
+ grepInvert?: boolean;
15
+ onBack?: () => void;
16
+ }
17
+ export default function LogViewer({ deployment, namespace, context, tail, maxRetry, timeout, grepPattern: initialPattern, grepAfter: initialAfter, grepBefore: initialBefore, grepContext: initialContext, grepIgnoreCase: initialIgnoreCase, grepInvert: initialInvert, onBack, }: LogViewerProps): React.JSX.Element;
18
+ export {};