hedgequantx 2.9.217 → 2.9.219
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/package.json +1 -1
- package/src/menus/dashboard.js +25 -17
package/package.json
CHANGED
package/src/menus/dashboard.js
CHANGED
|
@@ -11,6 +11,7 @@ const { getLogoWidth, centerText, prepareStdin, displayBanner, clearScreen } = r
|
|
|
11
11
|
const { getCachedStats } = require('../services/stats-cache');
|
|
12
12
|
const { prompts } = require('../utils');
|
|
13
13
|
const { getActiveAgentCount } = require('../pages/ai-agents');
|
|
14
|
+
const { isDaemonRunning } = require('../services/daemon');
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Dashboard menu after login
|
|
@@ -67,27 +68,34 @@ const dashboardMenu = async (service) => {
|
|
|
67
68
|
const agentDisplay = agentCount > 0 ? 'ON' : 'OFF';
|
|
68
69
|
const agentColor = agentCount > 0 ? chalk.green : chalk.red;
|
|
69
70
|
|
|
70
|
-
//
|
|
71
|
-
const
|
|
72
|
-
const
|
|
71
|
+
// Daemon status
|
|
72
|
+
const daemonOn = isDaemonRunning();
|
|
73
|
+
const daemonDisplay = daemonOn ? 'ON' : 'OFF';
|
|
74
|
+
const daemonColor = daemonOn ? chalk.green : chalk.red;
|
|
73
75
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
// Build stats items
|
|
77
|
+
const icon = chalk.yellow('✔');
|
|
78
|
+
const items = [
|
|
79
|
+
{ label: 'Accounts', value: String(statsInfo.accounts), color: chalk.white },
|
|
80
|
+
{ label: 'Balance', value: balStr, color: balColor },
|
|
81
|
+
{ label: 'Daemon', value: daemonDisplay, color: daemonColor },
|
|
82
|
+
{ label: 'AI', value: agentDisplay, color: agentColor },
|
|
83
|
+
];
|
|
81
84
|
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
+
// Format: "✔ Label: Value" with consistent spacing
|
|
86
|
+
const formatted = items.map(item =>
|
|
87
|
+
`${icon} ${chalk.white(item.label + ':')} ${item.color(item.value)}`
|
|
88
|
+
);
|
|
85
89
|
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
const
|
|
90
|
+
// Join with consistent gaps and center the whole line
|
|
91
|
+
const gap = ' '; // 4 spaces between items
|
|
92
|
+
const statsContent = formatted.join(gap);
|
|
93
|
+
const statsPlainLen = statsContent.replace(/\x1b\[[0-9;]*m/g, '').length;
|
|
94
|
+
const totalPad = W - statsPlainLen;
|
|
95
|
+
const padLeft = Math.floor(totalPad / 2);
|
|
96
|
+
const padRight = totalPad - padLeft;
|
|
89
97
|
|
|
90
|
-
console.log(chalk.cyan('║') +
|
|
98
|
+
console.log(chalk.cyan('║') + ' '.repeat(padLeft) + statsContent + ' '.repeat(padRight) + chalk.cyan('║'));
|
|
91
99
|
}
|
|
92
100
|
|
|
93
101
|
console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
|