hedgequantx 2.9.218 → 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 +21 -20
package/package.json
CHANGED
package/src/menus/dashboard.js
CHANGED
|
@@ -71,30 +71,31 @@ const dashboardMenu = async (service) => {
|
|
|
71
71
|
// Daemon status
|
|
72
72
|
const daemonOn = isDaemonRunning();
|
|
73
73
|
const daemonDisplay = daemonOn ? 'ON' : 'OFF';
|
|
74
|
-
const daemonColor = daemonOn ? chalk.green : chalk.
|
|
74
|
+
const daemonColor = daemonOn ? chalk.green : chalk.red;
|
|
75
75
|
|
|
76
|
-
//
|
|
77
|
-
const icon = chalk.yellow('✔
|
|
78
|
-
const
|
|
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
|
+
];
|
|
79
84
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const padRight = colWidth - textLen - padLeft;
|
|
85
|
-
return ' '.repeat(Math.max(0, padLeft)) + icon + chalk.white(label + ': ') + valueColor(value) + ' '.repeat(Math.max(0, padRight));
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const col1 = formatCol('Accounts', String(statsInfo.accounts));
|
|
89
|
-
const col2 = formatCol('Balance', balStr, balColor);
|
|
90
|
-
const col3 = formatCol('Daemon', daemonDisplay, daemonColor);
|
|
91
|
-
const col4 = formatCol('AI', agentDisplay, agentColor);
|
|
85
|
+
// Format: "✔ Label: Value" with consistent spacing
|
|
86
|
+
const formatted = items.map(item =>
|
|
87
|
+
`${icon} ${chalk.white(item.label + ':')} ${item.color(item.value)}`
|
|
88
|
+
);
|
|
92
89
|
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
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;
|
|
96
97
|
|
|
97
|
-
console.log(chalk.cyan('║') +
|
|
98
|
+
console.log(chalk.cyan('║') + ' '.repeat(padLeft) + statsContent + ' '.repeat(padRight) + chalk.cyan('║'));
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
|