hedgequantx 2.5.3 → 2.5.4
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 +10 -17
package/package.json
CHANGED
package/src/menus/dashboard.js
CHANGED
|
@@ -52,36 +52,29 @@ const dashboardMenu = async (service) => {
|
|
|
52
52
|
const balStr = statsInfo.balance !== null ? `$${statsInfo.balance.toLocaleString()}` : '--';
|
|
53
53
|
const balColor = statsInfo.balance !== null ? chalk.green : chalk.gray;
|
|
54
54
|
|
|
55
|
-
let pnlDisplay, pnlColor;
|
|
56
|
-
if (statsInfo.pnl !== null) {
|
|
57
|
-
pnlColor = statsInfo.pnl >= 0 ? chalk.green : chalk.red;
|
|
58
|
-
pnlDisplay = `${statsInfo.pnl >= 0 ? '+' : ''}$${Math.abs(statsInfo.pnl).toLocaleString()}`;
|
|
59
|
-
} else {
|
|
60
|
-
pnlColor = chalk.gray;
|
|
61
|
-
pnlDisplay = '--';
|
|
62
|
-
}
|
|
63
|
-
|
|
64
55
|
// AI status
|
|
65
56
|
const aiConnection = aiService.getConnection();
|
|
66
57
|
const aiStatus = aiConnection
|
|
67
58
|
? aiConnection.provider.name.split(' ')[0] // Just "CLAUDE" or "OPENAI"
|
|
68
59
|
: null;
|
|
69
60
|
|
|
70
|
-
//
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
const
|
|
61
|
+
// Build stats line with simple ASCII icons (+ for connected, - for not)
|
|
62
|
+
const statsContent = `+ CONNECTIONS: ${statsInfo.connections} + ACCOUNTS: ${statsInfo.accounts} + BALANCE: ${balStr} ${aiStatus ? '+' : '-'} AI: ${aiStatus || 'NONE'}`;
|
|
63
|
+
const statsLen = statsContent.length;
|
|
64
|
+
const statsLeftPad = Math.max(0, Math.floor((W - statsLen) / 2));
|
|
65
|
+
const statsRightPad = Math.max(0, W - statsLen - statsLeftPad);
|
|
74
66
|
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
const
|
|
67
|
+
// Now build with colors (use same text so length matches)
|
|
68
|
+
const icon = chalk.yellow('+ ');
|
|
69
|
+
const aiIcon = aiStatus ? chalk.magenta('+ ') : chalk.gray('- ');
|
|
70
|
+
const aiText = aiStatus ? chalk.magenta(aiStatus) : chalk.gray('NONE');
|
|
78
71
|
|
|
79
72
|
console.log(chalk.cyan('║') + ' '.repeat(statsLeftPad) +
|
|
80
73
|
icon + chalk.white(`CONNECTIONS: ${statsInfo.connections}`) + ' ' +
|
|
81
74
|
icon + chalk.white(`ACCOUNTS: ${statsInfo.accounts}`) + ' ' +
|
|
82
75
|
icon + chalk.white('BALANCE: ') + balColor(balStr) + ' ' +
|
|
83
76
|
aiIcon + chalk.white('AI: ') + aiText +
|
|
84
|
-
' '.repeat(
|
|
77
|
+
' '.repeat(statsRightPad) + chalk.cyan('║'));
|
|
85
78
|
}
|
|
86
79
|
|
|
87
80
|
console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
|