@calltelemetry/cli 0.3.9 → 0.4.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/dist/commands/diag.d.ts.map +1 -1
- package/dist/commands/diag.js +7 -0
- package/dist/commands/diag.js.map +1 -1
- package/dist/commands/jtapi.d.ts.map +1 -1
- package/dist/commands/jtapi.js +10 -9
- package/dist/commands/jtapi.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/compose.d.ts.map +1 -1
- package/dist/lib/compose.js +1 -3
- package/dist/lib/compose.js.map +1 -1
- package/dist/lib/env.d.ts +14 -0
- package/dist/lib/env.d.ts.map +1 -0
- package/dist/lib/env.js +74 -0
- package/dist/lib/env.js.map +1 -0
- package/dist/lib/jtapi.d.ts +67 -2
- package/dist/lib/jtapi.d.ts.map +1 -1
- package/dist/lib/jtapi.js +261 -14
- package/dist/lib/jtapi.js.map +1 -1
- package/dist/lib/paths.d.ts +1 -1
- package/dist/lib/paths.d.ts.map +1 -1
- package/dist/lib/paths.js +1 -1
- package/dist/lib/paths.js.map +1 -1
- package/dist/lib/redact.d.ts +10 -0
- package/dist/lib/redact.d.ts.map +1 -0
- package/dist/lib/redact.js +45 -0
- package/dist/lib/redact.js.map +1 -0
- package/dist/lib/secrets.d.ts +2 -1
- package/dist/lib/secrets.d.ts.map +1 -1
- package/dist/lib/secrets.js +16 -1
- package/dist/lib/secrets.js.map +1 -1
- package/dist/lib/showtech-steps.d.ts +7 -0
- package/dist/lib/showtech-steps.d.ts.map +1 -0
- package/dist/lib/showtech-steps.js +351 -0
- package/dist/lib/showtech-steps.js.map +1 -0
- package/dist/ui/views/DiagShowTechView.d.ts +6 -0
- package/dist/ui/views/DiagShowTechView.d.ts.map +1 -0
- package/dist/ui/views/DiagShowTechView.js +68 -0
- package/dist/ui/views/DiagShowTechView.js.map +1 -0
- package/dist/ui/views/JtapiView.d.ts +7 -0
- package/dist/ui/views/JtapiView.d.ts.map +1 -0
- package/dist/ui/views/JtapiView.js +405 -0
- package/dist/ui/views/JtapiView.js.map +1 -0
- package/dist/ui/views/MainMenu.d.ts.map +1 -1
- package/dist/ui/views/MainMenu.js +6 -15
- package/dist/ui/views/MainMenu.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useMemo } from 'react';
|
|
3
|
+
import { Box, Text, useInput } from 'ink';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { AppShell, Section, StepList, StatusBox } from '../components/index.js';
|
|
6
|
+
import { useStepRunner, useLogLevel } from '../hooks/index.js';
|
|
7
|
+
import { showtechSteps } from '../../lib/showtech-steps.js';
|
|
8
|
+
import { getPaths } from '../../lib/paths.js';
|
|
9
|
+
function timestamp() {
|
|
10
|
+
const d = new Date();
|
|
11
|
+
return [
|
|
12
|
+
d.getFullYear(),
|
|
13
|
+
String(d.getMonth() + 1).padStart(2, '0'),
|
|
14
|
+
String(d.getDate()).padStart(2, '0'),
|
|
15
|
+
'-',
|
|
16
|
+
String(d.getHours()).padStart(2, '0'),
|
|
17
|
+
String(d.getMinutes()).padStart(2, '0'),
|
|
18
|
+
String(d.getSeconds()).padStart(2, '0'),
|
|
19
|
+
].join('');
|
|
20
|
+
}
|
|
21
|
+
export function DiagShowTechView({ onBack }) {
|
|
22
|
+
const { installDir } = getPaths();
|
|
23
|
+
const bundleDir = useMemo(() => join(installDir, `ct-showtech-${timestamp()}`), [installDir]);
|
|
24
|
+
const steps = useMemo(() => showtechSteps(bundleDir), [bundleDir]);
|
|
25
|
+
const runner = useStepRunner(steps);
|
|
26
|
+
const { level: logLevel, cycle: cycleLogLevel } = useLogLevel();
|
|
27
|
+
const [phase, setPhase] = useState('running');
|
|
28
|
+
const [error, setError] = useState(null);
|
|
29
|
+
// Start collection immediately
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
runner.run();
|
|
32
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
33
|
+
// Track completion
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (phase !== 'running')
|
|
36
|
+
return;
|
|
37
|
+
if (runner.isDone)
|
|
38
|
+
setPhase('done');
|
|
39
|
+
const failed = runner.states.find(s => s.status === 'error');
|
|
40
|
+
if (failed) {
|
|
41
|
+
setError(failed.detail ?? 'Collection failed');
|
|
42
|
+
setPhase('error');
|
|
43
|
+
}
|
|
44
|
+
}, [phase, runner.isDone, runner.states]);
|
|
45
|
+
useInput((input, key) => {
|
|
46
|
+
if (input === 'd' && phase === 'running') {
|
|
47
|
+
cycleLogLevel();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (phase === 'done' || phase === 'error') {
|
|
51
|
+
if (input === 'q' || key.escape || key.leftArrow)
|
|
52
|
+
onBack?.();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
const isComplete = phase === 'done' || phase === 'error';
|
|
56
|
+
// Get archive path from last step detail
|
|
57
|
+
const archiveDetail = runner.states[runner.states.length - 1]?.detail;
|
|
58
|
+
return (_jsxs(AppShell, { command: "ct diag showtech", onBack: onBack, isComplete: isComplete, logLevel: logLevel, children: [phase === 'running' && (_jsxs(Section, { title: "Collecting Support Bundle", children: [_jsx(StepList, { steps: runner.states, expanded: logLevel !== 'normal' }), _jsx(Box, { paddingLeft: 2, paddingTop: 1, children: _jsx(Text, { dimColor: true, children: "d Log Level" }) })] })), phase === 'done' && (_jsxs(_Fragment, { children: [_jsx(Section, { title: "Collecting Support Bundle", children: _jsx(StepList, { steps: runner.states }) }), _jsx(Box, { paddingLeft: 2, marginTop: 1, children: _jsx(StatusBox, { variant: "success", title: "Support Bundle Ready", lines: [
|
|
59
|
+
archiveDetail ?? `${bundleDir}.tar.gz`,
|
|
60
|
+
'',
|
|
61
|
+
'Share this file with CallTelemetry support.',
|
|
62
|
+
'Sensitive values have been automatically redacted.',
|
|
63
|
+
] }) })] })), phase === 'error' && (_jsxs(_Fragment, { children: [_jsx(Section, { title: "Collecting Support Bundle", children: _jsx(StepList, { steps: runner.states, expanded: true }) }), _jsx(Box, { paddingLeft: 2, marginTop: 1, children: _jsx(StatusBox, { variant: "error", title: "Collection Failed", lines: [
|
|
64
|
+
error ?? 'Unknown error',
|
|
65
|
+
'A partial bundle may have been created.',
|
|
66
|
+
] }) }), _jsx(Box, { paddingLeft: 2, paddingTop: 1, children: _jsx(Text, { dimColor: true, children: "q Back" }) })] }))] }));
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=DiagShowTechView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiagShowTechView.js","sourceRoot":"","sources":["../../../src/ui/views/DiagShowTechView.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAQ9C,SAAS,SAAS;IAChB,MAAM,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;IACrB,OAAO;QACL,CAAC,CAAC,WAAW,EAAE;QACf,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;QACzC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,C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JtapiViewProps {
|
|
2
|
+
onBack?: () => void;
|
|
3
|
+
initialAction?: 'enable' | 'disable' | 'status' | 'troubleshoot';
|
|
4
|
+
}
|
|
5
|
+
export declare function JtapiView({ onBack, initialAction }: JtapiViewProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=JtapiView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JtapiView.d.ts","sourceRoot":"","sources":["../../../src/ui/views/JtapiView.tsx"],"names":[],"mappings":"AAkBA,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;CAClE;AAED,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,cAAc,kDAogBlE"}
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
3
|
+
import { Box, Text, useInput } from 'ink';
|
|
4
|
+
import { AppShell, Section, StepList, Divider, StatusLine, StatusBox, Spinner, Confirm } from '../components/index.js';
|
|
5
|
+
import { useStepRunner } from '../hooks/index.js';
|
|
6
|
+
import { isJtapiEnabled, enableJtapi, disableJtapi, getJtapiContainerStatus, getJtapiHealthCheck, getJtapiDependencyStatus, getJtapiWebConfig, checkJtapiPrereqs, waitForHealth, } from '../../lib/jtapi.js';
|
|
7
|
+
import { compose, composeExec, composeUp } from '../../lib/compose.js';
|
|
8
|
+
export function JtapiView({ onBack, initialAction }) {
|
|
9
|
+
const initialPhase = initialAction === 'enable' ? 'pre_enable'
|
|
10
|
+
: initialAction === 'disable' ? 'disabling'
|
|
11
|
+
: initialAction === 'troubleshoot' ? 'troubleshoot'
|
|
12
|
+
: 'dashboard';
|
|
13
|
+
const [phase, setPhase] = useState(initialPhase);
|
|
14
|
+
const [enabled, setEnabled] = useState(() => isJtapiEnabled());
|
|
15
|
+
const [container, setContainer] = useState(null);
|
|
16
|
+
const [health, setHealth] = useState(null);
|
|
17
|
+
const [deps, setDeps] = useState(null);
|
|
18
|
+
const [webConfig, setWebConfig] = useState(null);
|
|
19
|
+
const [prereqs, setPrereqs] = useState(null);
|
|
20
|
+
const [errorMessage, setErrorMessage] = useState('');
|
|
21
|
+
const [doneAction, setDoneAction] = useState('enable');
|
|
22
|
+
const [loading, setLoading] = useState(false);
|
|
23
|
+
// ── Dashboard data fetching ──
|
|
24
|
+
const fetchDashboard = useCallback(async () => {
|
|
25
|
+
setLoading(true);
|
|
26
|
+
try {
|
|
27
|
+
const currentEnabled = isJtapiEnabled();
|
|
28
|
+
setEnabled(currentEnabled);
|
|
29
|
+
if (currentEnabled) {
|
|
30
|
+
const [c, h, d, w] = await Promise.all([
|
|
31
|
+
getJtapiContainerStatus(),
|
|
32
|
+
getJtapiHealthCheck(),
|
|
33
|
+
getJtapiDependencyStatus(),
|
|
34
|
+
getJtapiWebConfig(),
|
|
35
|
+
]);
|
|
36
|
+
setContainer(c);
|
|
37
|
+
setHealth(h);
|
|
38
|
+
setDeps(d);
|
|
39
|
+
setWebConfig(w);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch { /* ignore dashboard fetch errors */ }
|
|
43
|
+
setLoading(false);
|
|
44
|
+
}, []);
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (phase === 'dashboard')
|
|
47
|
+
fetchDashboard();
|
|
48
|
+
}, [phase, fetchDashboard]);
|
|
49
|
+
// ── Pre-enable checks ──
|
|
50
|
+
const fetchPrereqs = useCallback(async () => {
|
|
51
|
+
setPrereqs(null);
|
|
52
|
+
const results = await checkJtapiPrereqs();
|
|
53
|
+
setPrereqs(results);
|
|
54
|
+
}, []);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (phase === 'pre_enable')
|
|
57
|
+
fetchPrereqs();
|
|
58
|
+
}, [phase, fetchPrereqs]);
|
|
59
|
+
// ── Enable steps ──
|
|
60
|
+
const enableSteps = [
|
|
61
|
+
{
|
|
62
|
+
label: 'Write JTAPI configuration to .env',
|
|
63
|
+
run: async () => {
|
|
64
|
+
await enableJtapi();
|
|
65
|
+
return 'configured';
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: 'Start services with JTAPI profile',
|
|
70
|
+
run: async () => {
|
|
71
|
+
await composeUp(['-d'], { pipe: true });
|
|
72
|
+
return 'started';
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: 'Wait for sidecar health',
|
|
77
|
+
run: async (ctx) => {
|
|
78
|
+
const start = Date.now();
|
|
79
|
+
const interval = setInterval(() => {
|
|
80
|
+
const elapsed = Math.round((Date.now() - start) / 1000);
|
|
81
|
+
ctx?.log(`Waiting... ${elapsed}s`);
|
|
82
|
+
}, 5000);
|
|
83
|
+
try {
|
|
84
|
+
const healthy = await waitForHealth(90);
|
|
85
|
+
clearInterval(interval);
|
|
86
|
+
if (!healthy)
|
|
87
|
+
throw new Error('Sidecar did not become healthy within 90 seconds');
|
|
88
|
+
return 'healthy';
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
clearInterval(interval);
|
|
92
|
+
throw err;
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
const enableRunner = useStepRunner(enableSteps);
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
if (phase === 'enabling')
|
|
100
|
+
enableRunner.run();
|
|
101
|
+
}, [phase]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
102
|
+
// Handle enable completion / failure
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
if (phase !== 'enabling')
|
|
105
|
+
return;
|
|
106
|
+
const hasError = enableRunner.states.some(s => s.status === 'error');
|
|
107
|
+
if (enableRunner.isDone) {
|
|
108
|
+
setDoneAction('enable');
|
|
109
|
+
setPhase('done');
|
|
110
|
+
}
|
|
111
|
+
else if (!enableRunner.isRunning && hasError) {
|
|
112
|
+
// Rollback
|
|
113
|
+
(async () => {
|
|
114
|
+
try {
|
|
115
|
+
await compose(['--profile', 'jtapi', 'stop'], { pipe: true }).catch(() => { });
|
|
116
|
+
await disableJtapi();
|
|
117
|
+
await composeUp(['-d', '--remove-orphans'], { pipe: true }).catch(() => { });
|
|
118
|
+
}
|
|
119
|
+
catch { /* best effort */ }
|
|
120
|
+
const failedStep = enableRunner.states.find(s => s.status === 'error');
|
|
121
|
+
setErrorMessage(failedStep?.detail ?? 'Enable failed — rollback completed');
|
|
122
|
+
setPhase('error');
|
|
123
|
+
})();
|
|
124
|
+
}
|
|
125
|
+
}, [phase, enableRunner.isDone, enableRunner.isRunning, enableRunner.states]);
|
|
126
|
+
// ── Disable steps ──
|
|
127
|
+
const disableSteps = [
|
|
128
|
+
{
|
|
129
|
+
label: 'Check JTAPI status',
|
|
130
|
+
run: async () => {
|
|
131
|
+
const current = isJtapiEnabled();
|
|
132
|
+
if (!current)
|
|
133
|
+
return 'already disabled';
|
|
134
|
+
return 'enabled — proceeding to disable';
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
label: 'Stop all JTAPI services',
|
|
139
|
+
run: async () => {
|
|
140
|
+
if (!isJtapiEnabled())
|
|
141
|
+
return 'skipped';
|
|
142
|
+
await compose(['--profile', 'jtapi', 'stop'], { pipe: true });
|
|
143
|
+
return 'stopped';
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
label: 'Remove JTAPI configuration from .env',
|
|
148
|
+
run: async () => {
|
|
149
|
+
if (!isJtapiEnabled())
|
|
150
|
+
return 'skipped';
|
|
151
|
+
await disableJtapi();
|
|
152
|
+
return 'removed';
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
label: 'Restart services without JTAPI',
|
|
157
|
+
run: async () => {
|
|
158
|
+
await composeUp(['-d', '--remove-orphans'], { pipe: true });
|
|
159
|
+
return 'restarted';
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
];
|
|
163
|
+
const disableRunner = useStepRunner(disableSteps);
|
|
164
|
+
useEffect(() => {
|
|
165
|
+
if (phase === 'disabling')
|
|
166
|
+
disableRunner.run();
|
|
167
|
+
}, [phase]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
168
|
+
useEffect(() => {
|
|
169
|
+
if (phase !== 'disabling')
|
|
170
|
+
return;
|
|
171
|
+
const hasError = disableRunner.states.some(s => s.status === 'error');
|
|
172
|
+
if (disableRunner.isDone) {
|
|
173
|
+
setDoneAction('disable');
|
|
174
|
+
setPhase('done');
|
|
175
|
+
}
|
|
176
|
+
else if (!disableRunner.isRunning && hasError) {
|
|
177
|
+
const failedStep = disableRunner.states.find(s => s.status === 'error');
|
|
178
|
+
setErrorMessage(failedStep?.detail ?? 'Disable failed');
|
|
179
|
+
setPhase('error');
|
|
180
|
+
}
|
|
181
|
+
}, [phase, disableRunner.isDone, disableRunner.isRunning, disableRunner.states]);
|
|
182
|
+
// ── Troubleshoot steps ──
|
|
183
|
+
const troubleshootSteps = [
|
|
184
|
+
{
|
|
185
|
+
label: 'Feature State',
|
|
186
|
+
run: async () => isJtapiEnabled() ? 'Enabled' : 'Disabled',
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
label: 'Container: jtapi-sidecar',
|
|
190
|
+
run: async () => {
|
|
191
|
+
const s = await getJtapiContainerStatus();
|
|
192
|
+
if (!s.running)
|
|
193
|
+
throw new Error(`${s.state} — Run: ct jtapi enable`);
|
|
194
|
+
return `${s.state} (${s.health})`;
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
label: 'Container: ct-media',
|
|
199
|
+
run: async () => {
|
|
200
|
+
const result = await compose(['ps', '--format', 'json', 'ct-media'], { pipe: true });
|
|
201
|
+
const out = String(result.stdout ?? '').trim();
|
|
202
|
+
if (!out)
|
|
203
|
+
throw new Error('not found');
|
|
204
|
+
try {
|
|
205
|
+
const obj = JSON.parse(out.split('\n')[0]);
|
|
206
|
+
if ((obj.State ?? '').toLowerCase() !== 'running')
|
|
207
|
+
throw new Error('not running');
|
|
208
|
+
return 'running';
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
if (out.toLowerCase().includes('running'))
|
|
212
|
+
return 'running';
|
|
213
|
+
throw new Error('not running');
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
label: 'Container: minio',
|
|
219
|
+
run: async () => {
|
|
220
|
+
const result = await compose(['ps', '--format', 'json', 'minio'], { pipe: true });
|
|
221
|
+
const out = String(result.stdout ?? '').trim();
|
|
222
|
+
if (!out)
|
|
223
|
+
throw new Error('not found');
|
|
224
|
+
try {
|
|
225
|
+
const obj = JSON.parse(out.split('\n')[0]);
|
|
226
|
+
if ((obj.State ?? '').toLowerCase() !== 'running')
|
|
227
|
+
throw new Error('not running');
|
|
228
|
+
return 'running';
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
if (out.toLowerCase().includes('running'))
|
|
232
|
+
return 'running';
|
|
233
|
+
throw new Error('not running');
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
label: 'Container: nats',
|
|
239
|
+
run: async () => {
|
|
240
|
+
const result = await compose(['ps', '--format', 'json', 'nats'], { pipe: true });
|
|
241
|
+
const out = String(result.stdout ?? '').trim();
|
|
242
|
+
if (!out)
|
|
243
|
+
throw new Error('not found');
|
|
244
|
+
try {
|
|
245
|
+
const obj = JSON.parse(out.split('\n')[0]);
|
|
246
|
+
if ((obj.State ?? '').toLowerCase() !== 'running')
|
|
247
|
+
throw new Error('not running');
|
|
248
|
+
return 'running';
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
if (out.toLowerCase().includes('running'))
|
|
252
|
+
return 'running';
|
|
253
|
+
throw new Error('not running');
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
label: 'NATS KV Stores',
|
|
259
|
+
run: async () => {
|
|
260
|
+
const result = await composeExec('nats', ['nats', 'kv', 'ls'], { pipe: true });
|
|
261
|
+
const out = result.stdout ?? '';
|
|
262
|
+
const buckets = out.split('\n').filter((l) => l.trim()).map((l) => l.trim());
|
|
263
|
+
return buckets.length > 0 ? buckets.join(', ') : 'none';
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
label: 'NATS Object Store',
|
|
268
|
+
run: async () => {
|
|
269
|
+
const result = await composeExec('nats', ['nats', 'object', 'ls'], { pipe: true });
|
|
270
|
+
const out = result.stdout ?? '';
|
|
271
|
+
const stores = out.split('\n').filter((l) => l.trim()).map((l) => l.trim());
|
|
272
|
+
return stores.length > 0 ? stores.join(', ') : 'none';
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
label: 'Sidecar Health',
|
|
277
|
+
run: async () => {
|
|
278
|
+
const h = await getJtapiHealthCheck();
|
|
279
|
+
if (!h.reachable)
|
|
280
|
+
throw new Error('Sidecar has 90s startup period. Wait and retry.');
|
|
281
|
+
return h.status ?? 'OK';
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
label: 'Web JTAPI Config',
|
|
286
|
+
run: async () => {
|
|
287
|
+
const config = await getJtapiWebConfig();
|
|
288
|
+
if (!config.configured)
|
|
289
|
+
throw new Error('Configure JTAPI in web UI: Settings > JTAPI');
|
|
290
|
+
return `mode=${config.mode}`;
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
];
|
|
294
|
+
const troubleshootRunner = useStepRunner(troubleshootSteps);
|
|
295
|
+
useEffect(() => {
|
|
296
|
+
if (phase === 'troubleshoot')
|
|
297
|
+
troubleshootRunner.run();
|
|
298
|
+
}, [phase]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
299
|
+
// ── Keyboard ──
|
|
300
|
+
useInput((input, key) => {
|
|
301
|
+
if (phase === 'dashboard') {
|
|
302
|
+
if (input === 'e' && !enabled)
|
|
303
|
+
setPhase('pre_enable');
|
|
304
|
+
else if (input === 'd' && enabled)
|
|
305
|
+
setPhase('disabling');
|
|
306
|
+
else if (input === 't')
|
|
307
|
+
setPhase('troubleshoot');
|
|
308
|
+
else if (input === 'q' || key.escape)
|
|
309
|
+
onBack?.();
|
|
310
|
+
}
|
|
311
|
+
else if (phase === 'pre_enable') {
|
|
312
|
+
if (input === 'y') {
|
|
313
|
+
const critical = prereqs?.filter(r => !r.passed && r.label !== 'JTAPI status');
|
|
314
|
+
if (!critical || critical.length === 0)
|
|
315
|
+
setPhase('enabling');
|
|
316
|
+
}
|
|
317
|
+
else if (input === 'n' || key.escape)
|
|
318
|
+
setPhase('dashboard');
|
|
319
|
+
}
|
|
320
|
+
else if (phase === 'troubleshoot') {
|
|
321
|
+
if ((input === 'q' || key.escape) && troubleshootRunner.isDone)
|
|
322
|
+
setPhase('dashboard');
|
|
323
|
+
}
|
|
324
|
+
else if (phase === 'done') {
|
|
325
|
+
if (input === 'q' || key.escape)
|
|
326
|
+
onBack?.();
|
|
327
|
+
}
|
|
328
|
+
else if (phase === 'error') {
|
|
329
|
+
if (input === 'r') {
|
|
330
|
+
setErrorMessage('');
|
|
331
|
+
if (doneAction === 'enable')
|
|
332
|
+
setPhase('pre_enable');
|
|
333
|
+
else
|
|
334
|
+
setPhase('dashboard');
|
|
335
|
+
}
|
|
336
|
+
else if (input === 'q' || key.escape)
|
|
337
|
+
onBack?.();
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
// ── Render ──
|
|
341
|
+
const commandName = phase === 'enabling' ? 'ct jtapi enable'
|
|
342
|
+
: phase === 'disabling' ? 'ct jtapi disable'
|
|
343
|
+
: phase === 'troubleshoot' ? 'ct jtapi troubleshoot'
|
|
344
|
+
: 'ct jtapi';
|
|
345
|
+
const isComplete = phase === 'done' || phase === 'error' ||
|
|
346
|
+
(phase === 'dashboard' && !loading) ||
|
|
347
|
+
(phase === 'troubleshoot' && troubleshootRunner.isDone);
|
|
348
|
+
// ── Dashboard ──
|
|
349
|
+
if (phase === 'dashboard') {
|
|
350
|
+
return (_jsxs(AppShell, { command: commandName, onBack: onBack, isComplete: isComplete, children: [_jsxs(Section, { title: "JTAPI Sidecar", children: [_jsx(StatusLine, { status: enabled ? 'ok' : 'warn', label: enabled ? 'ENABLED' : 'DISABLED' }), enabled && loading && _jsx(Spinner, { label: "Loading status..." }), enabled && container && (_jsxs(_Fragment, { children: [_jsx(StatusLine, { status: container.running ? 'ok' : 'fail', label: `Container: ${container.state}${container.health !== 'unknown' ? ` (${container.health})` : ''}` }), container.uptime && (_jsx(StatusLine, { status: "info", label: `Uptime: ${container.uptime}` }))] })), enabled && webConfig && (_jsx(StatusLine, { status: webConfig.configured ? 'ok' : 'warn', label: `Config: ${webConfig.configured ? `JTAPI_MODE=${webConfig.mode}` : 'not configured'}` })), enabled && deps && deps.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { bold: true, children: "Dependencies:" }), deps.map((d) => (_jsx(StatusLine, { status: d.running ? 'ok' : 'fail', label: ` ${d.name.padEnd(14)} ${d.running ? d.health : 'not running'}` }, d.name)))] })), !enabled && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { children: "JTAPI enables Cisco phone control (call routing, greetings, device management)." }), _jsx(Text, { children: "To get started: enable the sidecar, then configure CUCM servers in the web UI." })] }))] }), _jsx(Divider, {}), _jsx(Box, { paddingLeft: 2, children: _jsx(Text, { dimColor: true, children: enabled
|
|
351
|
+
? 'd Disable t Troubleshoot q Back'
|
|
352
|
+
: 'e Enable t Troubleshoot q Back' }) })] }));
|
|
353
|
+
}
|
|
354
|
+
// ── Pre-enable ──
|
|
355
|
+
if (phase === 'pre_enable') {
|
|
356
|
+
return (_jsx(AppShell, { command: "ct jtapi enable", onBack: () => setPhase('dashboard'), children: _jsx(Section, { title: "JTAPI Enable \u2014 Pre-flight Checks", children: !prereqs ? (_jsx(Spinner, { label: "Running pre-flight checks..." })) : (_jsxs(_Fragment, { children: [prereqs.map((r, i) => (_jsx(StatusLine, { status: r.passed ? 'ok' : (r.label === 'JTAPI status' ? 'warn' : 'fail'), label: `${r.label}: ${r.detail}` }, i))), _jsx(Divider, {}), prereqs.some(r => !r.passed && r.label !== 'JTAPI status') ? (_jsx(Text, { color: "red", children: "Cannot proceed \u2014 fix blocked checks above." })) : (_jsx(Confirm, { message: "Proceed with enable?", onConfirm: (yes) => {
|
|
357
|
+
if (yes)
|
|
358
|
+
setPhase('enabling');
|
|
359
|
+
else
|
|
360
|
+
setPhase('dashboard');
|
|
361
|
+
} }))] })) }) }));
|
|
362
|
+
}
|
|
363
|
+
// ── Enabling ──
|
|
364
|
+
if (phase === 'enabling') {
|
|
365
|
+
return (_jsx(AppShell, { command: "ct jtapi enable", children: _jsx(Section, { title: "JTAPI Enable", children: _jsx(StepList, { steps: enableRunner.states }) }) }));
|
|
366
|
+
}
|
|
367
|
+
// ── Disabling ──
|
|
368
|
+
if (phase === 'disabling') {
|
|
369
|
+
return (_jsx(AppShell, { command: "ct jtapi disable", children: _jsx(Section, { title: "JTAPI Disable", children: _jsx(StepList, { steps: disableRunner.states }) }) }));
|
|
370
|
+
}
|
|
371
|
+
// ── Troubleshoot ──
|
|
372
|
+
if (phase === 'troubleshoot') {
|
|
373
|
+
const passed = troubleshootRunner.states.filter(s => s.status === 'done').length;
|
|
374
|
+
const failed = troubleshootRunner.states.filter(s => s.status === 'error').length;
|
|
375
|
+
const total = troubleshootRunner.states.length;
|
|
376
|
+
return (_jsxs(AppShell, { command: "ct jtapi troubleshoot", onBack: () => setPhase('dashboard'), isComplete: troubleshootRunner.isDone, children: [_jsx(Section, { title: "JTAPI Troubleshoot", children: _jsx(StepList, { steps: troubleshootRunner.states }) }), troubleshootRunner.isDone && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Divider, {}), _jsx(StatusLine, { status: failed === 0 ? 'ok' : 'warn', label: failed === 0
|
|
377
|
+
? `${passed}/${total} checks passed`
|
|
378
|
+
: `${passed}/${total} checks passed, ${failed} failed` }), _jsx(Box, { paddingLeft: 2, marginTop: 1, children: _jsx(Text, { dimColor: true, children: "q Back to dashboard" }) })] }))] }));
|
|
379
|
+
}
|
|
380
|
+
// ── Done ──
|
|
381
|
+
if (phase === 'done') {
|
|
382
|
+
const isEnable = doneAction === 'enable';
|
|
383
|
+
return (_jsxs(AppShell, { command: isEnable ? 'ct jtapi enable' : 'ct jtapi disable', onBack: onBack, isComplete: true, children: [_jsx(StatusBox, { variant: "success", title: isEnable ? 'JTAPI Sidecar Enabled' : 'JTAPI Sidecar Disabled', lines: isEnable ? [
|
|
384
|
+
'The sidecar is running and healthy.',
|
|
385
|
+
'',
|
|
386
|
+
'Next steps:',
|
|
387
|
+
' 1. Upload JTAPI JAR via web UI (Settings > JTAPI)',
|
|
388
|
+
' 2. Add CUCM server via web UI (Settings > JTAPI > Servers)',
|
|
389
|
+
' 3. Restart services: ct update',
|
|
390
|
+
] : [
|
|
391
|
+
'JTAPI services have been stopped and removed from the configuration.',
|
|
392
|
+
] }), _jsx(Box, { paddingLeft: 2, marginTop: 1, children: _jsx(Text, { dimColor: true, children: "q Back" }) })] }));
|
|
393
|
+
}
|
|
394
|
+
// ── Error ──
|
|
395
|
+
if (phase === 'error') {
|
|
396
|
+
return (_jsxs(AppShell, { command: commandName, onBack: onBack, isComplete: true, children: [_jsx(StatusBox, { variant: "error", title: doneAction === 'enable' ? 'JTAPI Enable Failed' : 'JTAPI Disable Failed', lines: [
|
|
397
|
+
errorMessage,
|
|
398
|
+
'',
|
|
399
|
+
doneAction === 'enable' ? 'Rollback completed — JTAPI has been disabled.' : '',
|
|
400
|
+
'The previous configuration is still active.',
|
|
401
|
+
].filter(Boolean) }), _jsx(Box, { paddingLeft: 2, marginTop: 1, children: _jsx(Text, { dimColor: true, children: "r Retry q Back" }) })] }));
|
|
402
|
+
}
|
|
403
|
+
return null;
|
|
404
|
+
}
|
|
405
|
+
//# sourceMappingURL=JtapiView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JtapiView.js","sourceRoot":"","sources":["../../../src/ui/views/JtapiView.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACvH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EACL,cAAc,EAAE,WAAW,EAAE,YAAY,EACzC,uBAAuB,EAAE,mBAAmB,EAC5C,wBAAwB,EAAE,iBAAiB,EAC3C,iBAAiB,EAAE,aAAa,GACjC,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AASvE,MAAM,UAAU,SAAS,CAAC,EAAE,MAAM,EAAE,aAAa,EAAkB;IACjE,MAAM,YAAY,GAAU,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY;QACnE,CAAC,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW;YAC3C,CAAC,CAAC,aAAa,KAAK,cAAc,CAAC,CAAC,CAAC,cAAc;gBACnD,CAAC,CAAC,WAAW,CAAC;IAEhB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAQ,YAAY,CAAC,CAAC;IACxD,MAAM,CAAC,OAAO,EAAE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YAAY;wBACZ,EAAE;wBACF,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,+CAA+C,CAAC,CAAC,CAAC,EAAE;wBAC9E,6CAA6C;qBAC9C,CAAC,MAAM,CAAC,OAAO,CAAC,GACjB,EACF,KAAC,GAAG,IAAC,WAAW,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,YAC/B,KAAC,IAAI,IAAC,QAAQ,uCAAwB,GAClC,IACG,CACZ,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainMenu.d.ts","sourceRoot":"","sources":["../../../src/ui/views/MainMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MainMenu.d.ts","sourceRoot":"","sources":["../../../src/ui/views/MainMenu.tsx"],"names":[],"mappings":"AAgNA,UAAU,aAAa;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2EAA2E;IAC3E,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,aAAa,2CA6YlF"}
|
|
@@ -37,10 +37,8 @@ import { DockerNetworkView } from './DockerNetworkView.js';
|
|
|
37
37
|
import { DiagNetworkView } from './DiagNetworkView.js';
|
|
38
38
|
import { DiagServiceView } from './DiagServiceView.js';
|
|
39
39
|
import { DiagDatabaseView } from './DiagDatabaseView.js';
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import { JtapiStatusView } from './JtapiStatusView.js';
|
|
43
|
-
import { JtapiTroubleshootView } from './JtapiTroubleshootView.js';
|
|
40
|
+
import { DiagShowTechView } from './DiagShowTechView.js';
|
|
41
|
+
import { JtapiView } from './JtapiView.js';
|
|
44
42
|
import { OfflineListView } from './OfflineListView.js';
|
|
45
43
|
import { OfflineFetchView } from './OfflineFetchView.js';
|
|
46
44
|
import { OfflineDownloadView } from './OfflineDownloadView.js';
|
|
@@ -129,18 +127,13 @@ const MENU_ITEMS = [
|
|
|
129
127
|
{ label: 'Network', description: 'Comprehensive network diagnostics', value: 'diag network' },
|
|
130
128
|
{ label: 'Service', description: 'Systemd service and container logs', value: 'diag service' },
|
|
131
129
|
{ label: 'Database', description: 'Database health and performance', value: 'diag database' },
|
|
130
|
+
{ label: 'Show Tech', description: 'Collect support bundle', value: 'diag showtech' },
|
|
132
131
|
],
|
|
133
132
|
},
|
|
134
133
|
{
|
|
135
134
|
label: 'JTAPI',
|
|
136
|
-
description: '
|
|
135
|
+
description: 'Cisco phone control sidecar',
|
|
137
136
|
value: 'jtapi',
|
|
138
|
-
children: [
|
|
139
|
-
{ label: 'Enable', description: 'Enable JTAPI sidecar', value: 'jtapi enable' },
|
|
140
|
-
{ label: 'Disable', description: 'Disable JTAPI sidecar', value: 'jtapi disable' },
|
|
141
|
-
{ label: 'Status', description: 'Show JTAPI status', value: 'jtapi status' },
|
|
142
|
-
{ label: 'Troubleshoot', description: 'Comprehensive JTAPI diagnostics', value: 'jtapi troubleshoot' },
|
|
143
|
-
],
|
|
144
137
|
},
|
|
145
138
|
{
|
|
146
139
|
label: 'Offline',
|
|
@@ -189,10 +182,8 @@ const VIEW_MAP = {
|
|
|
189
182
|
'diag network': (onBack) => _jsx(DiagNetworkView, { onBack: onBack }),
|
|
190
183
|
'diag service': (onBack) => _jsx(DiagServiceView, { onBack: onBack }),
|
|
191
184
|
'diag database': (onBack) => _jsx(DiagDatabaseView, { onBack: onBack }),
|
|
192
|
-
'
|
|
193
|
-
'jtapi
|
|
194
|
-
'jtapi status': (onBack) => _jsx(JtapiStatusView, { onBack: onBack }),
|
|
195
|
-
'jtapi troubleshoot': (onBack) => _jsx(JtapiTroubleshootView, { onBack: onBack }),
|
|
185
|
+
'diag showtech': (onBack) => _jsx(DiagShowTechView, { onBack: onBack }),
|
|
186
|
+
'jtapi': (onBack) => _jsx(JtapiView, { onBack: onBack }),
|
|
196
187
|
'offline list': (onBack) => _jsx(OfflineListView, { onBack: onBack }),
|
|
197
188
|
'offline fetch': (onBack) => _jsx(OfflineFetchView, { onBack: onBack }),
|
|
198
189
|
'offline download': (onBack) => _jsx(OfflineDownloadView, { onBack: onBack }),
|