genbox 1.0.85 → 1.0.87
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 +32 -21
- package/package.json +1 -1
package/dist/commands/status.js
CHANGED
|
@@ -391,21 +391,24 @@ exports.statusCommand = new commander_1.Command('status')
|
|
|
391
391
|
sshAvailable = true;
|
|
392
392
|
// Check if cloud-init is still running
|
|
393
393
|
if (status.includes('running')) {
|
|
394
|
-
//
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
console.log(chalk_1.default.yellow('[INFO] Setup in progress...'));
|
|
401
|
-
}
|
|
394
|
+
// Calculate total elapsed from genbox creation time (DB timestamp)
|
|
395
|
+
const createdAt = target.createdAt;
|
|
396
|
+
const totalElapsedSecs = createdAt
|
|
397
|
+
? Math.floor((Date.now() - new Date(createdAt).getTime()) / 1000)
|
|
398
|
+
: Math.floor((Date.now() - startTime) / 1000); // Fallback to CLI start time
|
|
399
|
+
console.log(chalk_1.default.yellow(`[INFO] Setup in progress... (elapsed: ${formatDuration(totalElapsedSecs)})`));
|
|
402
400
|
console.log('');
|
|
403
|
-
// Show timing breakdown
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
console.log(
|
|
401
|
+
// Show timing breakdown
|
|
402
|
+
const timing = getTimingBreakdown(target.ipAddress, keyPath);
|
|
403
|
+
if (timing.total !== null || createdAt) {
|
|
404
|
+
console.log(chalk_1.default.blue('[INFO] === Timing Breakdown ==='));
|
|
405
|
+
// Provisioning time = total elapsed - server uptime
|
|
406
|
+
if (timing.total !== null && createdAt) {
|
|
407
|
+
const provisioningSecs = Math.max(0, totalElapsedSecs - timing.total);
|
|
408
|
+
console.log(` Provisioning: ${formatDuration(provisioningSecs)} (before boot)`);
|
|
409
|
+
}
|
|
407
410
|
if (timing.total !== null) {
|
|
408
|
-
console.log(`
|
|
411
|
+
console.log(` Server Uptime: ${formatDuration(timing.total)}`);
|
|
409
412
|
}
|
|
410
413
|
console.log('');
|
|
411
414
|
}
|
|
@@ -487,21 +490,29 @@ exports.statusCommand = new commander_1.Command('status')
|
|
|
487
490
|
}
|
|
488
491
|
// Cloud-init still running
|
|
489
492
|
if (status.includes('running')) {
|
|
490
|
-
//
|
|
493
|
+
// Calculate total elapsed from genbox creation time (DB timestamp)
|
|
494
|
+
const createdAt = target.createdAt;
|
|
491
495
|
const timing = getTimingBreakdown(target.ipAddress, keyPath);
|
|
492
|
-
|
|
493
|
-
|
|
496
|
+
const totalElapsedSecs = createdAt
|
|
497
|
+
? Math.floor((Date.now() - new Date(createdAt).getTime()) / 1000)
|
|
498
|
+
: timing.total; // Fallback to server uptime
|
|
499
|
+
if (totalElapsedSecs !== null) {
|
|
500
|
+
console.log(chalk_1.default.yellow(`[INFO] Setup in progress... (elapsed: ${formatDuration(totalElapsedSecs)})`));
|
|
494
501
|
}
|
|
495
502
|
else {
|
|
496
503
|
console.log(chalk_1.default.yellow('[INFO] Setup in progress...'));
|
|
497
504
|
}
|
|
498
505
|
console.log('');
|
|
499
|
-
// Show timing breakdown
|
|
500
|
-
if (timing.
|
|
501
|
-
console.log(chalk_1.default.blue('[INFO] === Timing
|
|
502
|
-
|
|
506
|
+
// Show timing breakdown
|
|
507
|
+
if (timing.total !== null || createdAt) {
|
|
508
|
+
console.log(chalk_1.default.blue('[INFO] === Timing Breakdown ==='));
|
|
509
|
+
// Provisioning time = total elapsed - server uptime
|
|
510
|
+
if (timing.total !== null && totalElapsedSecs !== null) {
|
|
511
|
+
const provisioningSecs = Math.max(0, totalElapsedSecs - timing.total);
|
|
512
|
+
console.log(` Provisioning: ${formatDuration(provisioningSecs)} (before boot)`);
|
|
513
|
+
}
|
|
503
514
|
if (timing.total !== null) {
|
|
504
|
-
console.log(`
|
|
515
|
+
console.log(` Server Uptime: ${formatDuration(timing.total)}`);
|
|
505
516
|
}
|
|
506
517
|
console.log('');
|
|
507
518
|
}
|