hedgequantx 2.5.17 → 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 +26 -14
package/package.json
CHANGED
package/src/menus/dashboard.js
CHANGED
|
@@ -79,24 +79,30 @@ 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
|
+
const colWidth = Math.floor(W / 3);
|
|
84
|
+
|
|
83
85
|
const menuRow3 = (col1, col2, col3) => {
|
|
84
86
|
const c1Plain = col1.replace(/\x1b\[[0-9;]*m/g, '');
|
|
85
87
|
const c2Plain = col2.replace(/\x1b\[[0-9;]*m/g, '');
|
|
86
88
|
const c3Plain = col3.replace(/\x1b\[[0-9;]*m/g, '');
|
|
87
89
|
|
|
88
|
-
//
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
|
|
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
|
+
|
|
94
|
+
const pad2Left = Math.floor((colWidth - c2Plain.length) / 2);
|
|
95
|
+
const pad2Right = colWidth - c2Plain.length - pad2Left;
|
|
96
|
+
|
|
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;
|
|
95
101
|
|
|
96
|
-
const line =
|
|
97
|
-
col1 + ' '.repeat(
|
|
98
|
-
col2 + ' '.repeat(
|
|
99
|
-
col3 + ' '.repeat(
|
|
102
|
+
const line =
|
|
103
|
+
' '.repeat(pad1Left) + col1 + ' '.repeat(pad1Right) +
|
|
104
|
+
' '.repeat(pad2Left) + col2 + ' '.repeat(pad2Right) +
|
|
105
|
+
' '.repeat(pad3Left) + col3 + ' '.repeat(pad3Right);
|
|
100
106
|
|
|
101
107
|
console.log(chalk.cyan('║') + line + chalk.cyan('║'));
|
|
102
108
|
};
|
|
@@ -108,8 +114,14 @@ const balStr = statsInfo.balance !== null ? `$${statsInfo.balance.toLocaleString
|
|
|
108
114
|
console.log(chalk.cyan('║') + ' '.repeat(leftPad) + content + ' '.repeat(padding - leftPad) + chalk.cyan('║'));
|
|
109
115
|
};
|
|
110
116
|
|
|
111
|
-
|
|
112
|
-
|
|
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));
|
|
113
125
|
|
|
114
126
|
// Separator and disconnect button centered
|
|
115
127
|
console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
|