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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "2.5.8",
3
+ "version": "2.5.9",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -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
- const c1Padded = ' ' + col1 + ' '.repeat(Math.max(0, colWidth - c1Plain.length - 2));
92
- const c2Padded = col2 + ' '.repeat(Math.max(0, colWidth - c2Plain.length));
93
- const c3Padded = col3 + ' '.repeat(Math.max(0, W - colWidth * 2 - c3Plain.length));
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
- console.log(chalk.cyan('║') + c1Padded + c2Padded + c3Padded + chalk.cyan('║'));
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) => {