hedgequantx 2.5.16 → 2.5.17
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 +13 -17
package/package.json
CHANGED
package/src/menus/dashboard.js
CHANGED
|
@@ -79,30 +79,26 @@ 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 -
|
|
83
|
-
const colWidth = Math.floor(W / 3);
|
|
84
|
-
|
|
82
|
+
// Menu in 3 columns - evenly distributed
|
|
85
83
|
const menuRow3 = (col1, col2, col3) => {
|
|
86
84
|
const c1Plain = col1.replace(/\x1b\[[0-9;]*m/g, '');
|
|
87
85
|
const c2Plain = col2.replace(/\x1b\[[0-9;]*m/g, '');
|
|
88
86
|
const c3Plain = col3.replace(/\x1b\[[0-9;]*m/g, '');
|
|
89
87
|
|
|
90
|
-
//
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const
|
|
88
|
+
// Total content length
|
|
89
|
+
const totalContent = c1Plain.length + c2Plain.length + c3Plain.length;
|
|
90
|
+
// Available space for padding
|
|
91
|
+
const totalPadding = W - totalContent;
|
|
92
|
+
// Divide into 4 gaps: left margin, between 1-2, between 2-3, right margin
|
|
93
|
+
const gap = Math.floor(totalPadding / 4);
|
|
94
|
+
const extraPad = totalPadding - (gap * 4);
|
|
96
95
|
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
const line = ' '.repeat(gap) +
|
|
97
|
+
col1 + ' '.repeat(gap) +
|
|
98
|
+
col2 + ' '.repeat(gap) +
|
|
99
|
+
col3 + ' '.repeat(gap + extraPad);
|
|
100
100
|
|
|
101
|
-
console.log(chalk.cyan('║') +
|
|
102
|
-
' '.repeat(Math.max(0, c1LeftPad)) + col1 + ' '.repeat(Math.max(0, c1RightPad)) +
|
|
103
|
-
' '.repeat(Math.max(0, c2LeftPad)) + col2 + ' '.repeat(Math.max(0, c2RightPad)) +
|
|
104
|
-
' '.repeat(Math.max(0, c3LeftPad)) + col3 + ' '.repeat(Math.max(0, c3RightPad)) +
|
|
105
|
-
chalk.cyan('║'));
|
|
101
|
+
console.log(chalk.cyan('║') + line + chalk.cyan('║'));
|
|
106
102
|
};
|
|
107
103
|
|
|
108
104
|
const centerLine = (content) => {
|