hedgequantx 2.5.8 → 2.5.9
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 +16 -5
package/package.json
CHANGED
package/src/menus/dashboard.js
CHANGED
|
@@ -80,7 +80,7 @@ const dashboardMenu = async (service) => {
|
|
|
80
80
|
|
|
81
81
|
console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
|
|
82
82
|
|
|
83
|
-
// Menu in 3 columns
|
|
83
|
+
// Menu in 3 columns - centered
|
|
84
84
|
const colWidth = Math.floor(W / 3);
|
|
85
85
|
|
|
86
86
|
const menuRow3 = (col1, col2, col3) => {
|
|
@@ -88,11 +88,22 @@ const dashboardMenu = async (service) => {
|
|
|
88
88
|
const c2Plain = col2.replace(/\x1b\[[0-9;]*m/g, '');
|
|
89
89
|
const c3Plain = col3.replace(/\x1b\[[0-9;]*m/g, '');
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
const
|
|
91
|
+
// Center each column within its space
|
|
92
|
+
const c1LeftPad = Math.floor((colWidth - c1Plain.length) / 2);
|
|
93
|
+
const c1RightPad = colWidth - c1Plain.length - c1LeftPad;
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
const c2LeftPad = Math.floor((colWidth - c2Plain.length) / 2);
|
|
96
|
+
const c2RightPad = colWidth - c2Plain.length - c2LeftPad;
|
|
97
|
+
|
|
98
|
+
const c3Width = W - colWidth * 2;
|
|
99
|
+
const c3LeftPad = Math.floor((c3Width - c3Plain.length) / 2);
|
|
100
|
+
const c3RightPad = c3Width - c3Plain.length - c3LeftPad;
|
|
101
|
+
|
|
102
|
+
console.log(chalk.cyan('║') +
|
|
103
|
+
' '.repeat(Math.max(0, c1LeftPad)) + col1 + ' '.repeat(Math.max(0, c1RightPad)) +
|
|
104
|
+
' '.repeat(Math.max(0, c2LeftPad)) + col2 + ' '.repeat(Math.max(0, c2RightPad)) +
|
|
105
|
+
' '.repeat(Math.max(0, c3LeftPad)) + col3 + ' '.repeat(Math.max(0, c3RightPad)) +
|
|
106
|
+
chalk.cyan('║'));
|
|
96
107
|
};
|
|
97
108
|
|
|
98
109
|
const centerLine = (content) => {
|