hedgequantx 2.5.16 → 2.5.18
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 +24 -16
package/package.json
CHANGED
package/src/menus/dashboard.js
CHANGED
|
@@ -79,7 +79,7 @@ const balStr = statsInfo.balance !== null ? `$${statsInfo.balance.toLocaleString
|
|
|
79
79
|
|
|
80
80
|
console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
|
|
81
81
|
|
|
82
|
-
// Menu in 3 columns -
|
|
82
|
+
// Menu in 3 columns - fixed width columns for perfect alignment
|
|
83
83
|
const colWidth = Math.floor(W / 3);
|
|
84
84
|
|
|
85
85
|
const menuRow3 = (col1, col2, col3) => {
|
|
@@ -87,22 +87,24 @@ const balStr = statsInfo.balance !== null ? `$${statsInfo.balance.toLocaleString
|
|
|
87
87
|
const c2Plain = col2.replace(/\x1b\[[0-9;]*m/g, '');
|
|
88
88
|
const c3Plain = col3.replace(/\x1b\[[0-9;]*m/g, '');
|
|
89
89
|
|
|
90
|
-
// Center each
|
|
91
|
-
const
|
|
92
|
-
const
|
|
90
|
+
// Center each item within its fixed-width column
|
|
91
|
+
const pad1Left = Math.floor((colWidth - c1Plain.length) / 2);
|
|
92
|
+
const pad1Right = colWidth - c1Plain.length - pad1Left;
|
|
93
93
|
|
|
94
|
-
const
|
|
95
|
-
const
|
|
94
|
+
const pad2Left = Math.floor((colWidth - c2Plain.length) / 2);
|
|
95
|
+
const pad2Right = colWidth - c2Plain.length - pad2Left;
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
const
|
|
97
|
+
// Third column gets remaining width
|
|
98
|
+
const col3Width = W - (colWidth * 2);
|
|
99
|
+
const pad3Left = Math.floor((col3Width - c3Plain.length) / 2);
|
|
100
|
+
const pad3Right = col3Width - c3Plain.length - pad3Left;
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
' '.repeat(
|
|
103
|
-
' '.repeat(
|
|
104
|
-
' '.repeat(
|
|
105
|
-
|
|
102
|
+
const line =
|
|
103
|
+
' '.repeat(pad1Left) + col1 + ' '.repeat(pad1Right) +
|
|
104
|
+
' '.repeat(pad2Left) + col2 + ' '.repeat(pad2Right) +
|
|
105
|
+
' '.repeat(pad3Left) + col3 + ' '.repeat(pad3Right);
|
|
106
|
+
|
|
107
|
+
console.log(chalk.cyan('║') + line + chalk.cyan('║'));
|
|
106
108
|
};
|
|
107
109
|
|
|
108
110
|
const centerLine = (content) => {
|
|
@@ -112,8 +114,14 @@ const balStr = statsInfo.balance !== null ? `$${statsInfo.balance.toLocaleString
|
|
|
112
114
|
console.log(chalk.cyan('║') + ' '.repeat(leftPad) + content + ' '.repeat(padding - leftPad) + chalk.cyan('║'));
|
|
113
115
|
};
|
|
114
116
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
// Fixed-width menu items for perfect alignment
|
|
118
|
+
const menuItem = (key, label, color) => {
|
|
119
|
+
const text = `[${key}] ${label.padEnd(14)}`;
|
|
120
|
+
return color(text);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
menuRow3(menuItem('1', 'VIEW ACCOUNTS', chalk.cyan), menuItem('2', 'VIEW STATS', chalk.cyan), menuItem('+', 'ADD ACCOUNT', chalk.cyan));
|
|
124
|
+
menuRow3(menuItem('A', 'ALGO TRADING', chalk.magenta), menuItem('I', 'AI AGENT', chalk.magenta), menuItem('U', 'UPDATE HQX', chalk.yellow));
|
|
117
125
|
|
|
118
126
|
// Separator and disconnect button centered
|
|
119
127
|
console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
|