genbox 1.0.36 → 1.0.37
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/status.js +23 -5
- package/package.json +1 -1
package/dist/commands/status.js
CHANGED
|
@@ -193,10 +193,14 @@ exports.statusCommand = new commander_1.Command('status')
|
|
|
193
193
|
const dbStatus = target.status; // 'provisioning' | 'running' | 'error' etc.
|
|
194
194
|
const setupDuration = target.setupDuration;
|
|
195
195
|
const setupCompletedAt = target.setupCompletedAt;
|
|
196
|
-
// If DB says RUNNING
|
|
197
|
-
if (dbStatus === 'running'
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
// If DB says RUNNING, setup is complete (use DB as source of truth)
|
|
197
|
+
if (dbStatus === 'running') {
|
|
198
|
+
if (setupCompletedAt && setupDuration) {
|
|
199
|
+
console.log(chalk_1.default.green(`[SUCCESS] Setup completed! (took ${formatDuration(setupDuration)})`));
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
console.log(chalk_1.default.green(`[SUCCESS] Genbox is running`));
|
|
203
|
+
}
|
|
200
204
|
console.log('');
|
|
201
205
|
// Show billing info
|
|
202
206
|
const billing = {
|
|
@@ -322,7 +326,21 @@ exports.statusCommand = new commander_1.Command('status')
|
|
|
322
326
|
console.log(chalk_1.default.dim(' Run `genbox connect` to investigate.'));
|
|
323
327
|
return;
|
|
324
328
|
}
|
|
325
|
-
//
|
|
329
|
+
// If DB says TERMINATED
|
|
330
|
+
if (dbStatus === 'terminated') {
|
|
331
|
+
const destroyReason = target.destroyReason;
|
|
332
|
+
console.log(chalk_1.default.red(`[TERMINATED] Genbox has been destroyed`));
|
|
333
|
+
if (destroyReason) {
|
|
334
|
+
console.log(chalk_1.default.dim(` Reason: ${destroyReason}`));
|
|
335
|
+
}
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
// If DB says STOPPED
|
|
339
|
+
if (dbStatus === 'stopped') {
|
|
340
|
+
console.log(chalk_1.default.yellow('[STOPPED] Genbox is stopped'));
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
// Fallback: try legacy cloud-init check for backwards compatibility (should rarely reach here)
|
|
326
344
|
let status = sshExec(target.ipAddress, keyPath, 'cloud-init status 2>&1');
|
|
327
345
|
if (!status || status.includes('not found')) {
|
|
328
346
|
// No cloud-init, check our status file
|