genbox 1.0.109 → 1.0.110
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 +4 -1
- package/package.json +1 -1
package/dist/commands/status.js
CHANGED
|
@@ -421,7 +421,10 @@ exports.statusCommand = new commander_1.Command('status')
|
|
|
421
421
|
for (const app of pm2Services) {
|
|
422
422
|
const statusColor = app.status === 'online' ? chalk_1.default.green :
|
|
423
423
|
app.status === 'stopped' ? chalk_1.default.yellow : chalk_1.default.red;
|
|
424
|
-
|
|
424
|
+
// Memory is already in MB from heartbeat (or bytes from legacy heartbeats)
|
|
425
|
+
// If value > 10000, assume bytes and convert; otherwise assume MB
|
|
426
|
+
const memoryMb = app.memory ? (app.memory > 10000 ? Math.round(app.memory / (1024 * 1024)) : app.memory) : 0;
|
|
427
|
+
console.log(`${app.name}\t\t${statusColor(app.status)}\t\t${app.cpu || 0}%\t${memoryMb}MB`);
|
|
425
428
|
}
|
|
426
429
|
console.log('');
|
|
427
430
|
}
|