hedgequantx 2.7.1 → 2.7.2
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 +20 -13
package/package.json
CHANGED
package/src/menus/dashboard.js
CHANGED
|
@@ -51,18 +51,14 @@ const dashboardMenu = async (service) => {
|
|
|
51
51
|
const balStr = statsInfo.balance !== null ? `$${statsInfo.balance.toLocaleString()}` : '--';
|
|
52
52
|
const balColor = statsInfo.balance !== null ? chalk.green : chalk.gray;
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
} else {
|
|
59
|
-
pnlColor = chalk.gray;
|
|
60
|
-
pnlDisplay = '--';
|
|
61
|
-
}
|
|
54
|
+
// AI Agents status
|
|
55
|
+
const agentCount = statsInfo.agents || 0;
|
|
56
|
+
const agentDisplay = agentCount > 0 ? `${agentCount} connected` : 'disconnected';
|
|
57
|
+
const agentColor = agentCount > 0 ? chalk.green : chalk.red;
|
|
62
58
|
|
|
63
59
|
// Yellow icons: ✔ for each stat
|
|
64
60
|
const icon = chalk.yellow('✔ ');
|
|
65
|
-
const statsPlain = `✔ Connections: ${statsInfo.connections} ✔ Accounts: ${statsInfo.accounts} ✔ Balance: ${balStr} ✔
|
|
61
|
+
const statsPlain = `✔ Connections: ${statsInfo.connections} ✔ Accounts: ${statsInfo.accounts} ✔ Balance: ${balStr} ✔ AI Agents: ${agentDisplay}`;
|
|
66
62
|
const statsLeftPad = Math.floor((W - statsPlain.length) / 2);
|
|
67
63
|
const statsRightPad = W - statsPlain.length - statsLeftPad;
|
|
68
64
|
|
|
@@ -70,19 +66,30 @@ const dashboardMenu = async (service) => {
|
|
|
70
66
|
icon + chalk.white(`Connections: ${statsInfo.connections}`) + ' ' +
|
|
71
67
|
icon + chalk.white(`Accounts: ${statsInfo.accounts}`) + ' ' +
|
|
72
68
|
icon + chalk.white('Balance: ') + balColor(balStr) + ' ' +
|
|
73
|
-
icon + chalk.white('
|
|
69
|
+
icon + chalk.white('AI Agents: ') + agentColor(agentDisplay) +
|
|
74
70
|
' '.repeat(Math.max(0, statsRightPad)) + chalk.cyan('║'));
|
|
75
71
|
}
|
|
76
72
|
|
|
77
73
|
console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
|
|
78
74
|
|
|
79
|
-
// Menu in 2 columns
|
|
75
|
+
// Menu in 2 columns - centered
|
|
80
76
|
const col1Width = Math.floor(W / 2);
|
|
77
|
+
const col2Width = W - col1Width;
|
|
78
|
+
|
|
81
79
|
const menuRow = (left, right) => {
|
|
82
80
|
const leftPlain = left.replace(/\x1b\[[0-9;]*m/g, '');
|
|
83
81
|
const rightPlain = right.replace(/\x1b\[[0-9;]*m/g, '');
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
|
|
83
|
+
// Center left item in col1
|
|
84
|
+
const leftPadL = Math.floor((col1Width - leftPlain.length) / 2);
|
|
85
|
+
const leftPadR = col1Width - leftPlain.length - leftPadL;
|
|
86
|
+
const leftPadded = ' '.repeat(leftPadL) + left + ' '.repeat(leftPadR);
|
|
87
|
+
|
|
88
|
+
// Center right item in col2
|
|
89
|
+
const rightPadL = Math.floor((col2Width - rightPlain.length) / 2);
|
|
90
|
+
const rightPadR = col2Width - rightPlain.length - rightPadL;
|
|
91
|
+
const rightPadded = ' '.repeat(rightPadL) + right + ' '.repeat(rightPadR);
|
|
92
|
+
|
|
86
93
|
console.log(chalk.cyan('║') + leftPadded + rightPadded + chalk.cyan('║'));
|
|
87
94
|
};
|
|
88
95
|
|