hedgequantx 1.2.144 → 1.2.145
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/app.js +48 -5
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -689,13 +689,56 @@ const dashboardMenu = async (service) => {
|
|
|
689
689
|
console.log(chalk.cyan('║') + chalk.yellow.bold(centerLine('Welcome, HQX Trader!', W)) + chalk.cyan('║'));
|
|
690
690
|
console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
|
|
691
691
|
|
|
692
|
-
// Connection info - show all active connections
|
|
692
|
+
// Connection info - show all active connections in boxes (max 3 per row)
|
|
693
693
|
const allConns = connections.getAll();
|
|
694
694
|
if (allConns.length > 0) {
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
695
|
+
const maxPerRow = 3;
|
|
696
|
+
const boxPadding = 2; // padding inside each mini-box
|
|
697
|
+
const gap = 2; // gap between boxes
|
|
698
|
+
|
|
699
|
+
// Calculate box width based on number of connections (max 3)
|
|
700
|
+
const numBoxes = Math.min(allConns.length, maxPerRow);
|
|
701
|
+
const totalGaps = (numBoxes - 1) * gap;
|
|
702
|
+
const boxWidth = Math.floor((W - totalGaps - 2) / numBoxes); // -2 for outer padding
|
|
703
|
+
|
|
704
|
+
// Process connections in rows of 3
|
|
705
|
+
for (let rowStart = 0; rowStart < allConns.length; rowStart += maxPerRow) {
|
|
706
|
+
const rowConns = allConns.slice(rowStart, rowStart + maxPerRow);
|
|
707
|
+
const numInRow = rowConns.length;
|
|
708
|
+
const rowBoxWidth = Math.floor((W - (numInRow - 1) * gap - 2) / numInRow);
|
|
709
|
+
|
|
710
|
+
// Top border of boxes
|
|
711
|
+
let topLine = ' ';
|
|
712
|
+
for (let i = 0; i < numInRow; i++) {
|
|
713
|
+
topLine += '┌' + '─'.repeat(rowBoxWidth - 2) + '┐';
|
|
714
|
+
if (i < numInRow - 1) topLine += ' '.repeat(gap);
|
|
715
|
+
}
|
|
716
|
+
const topPad = W - topLine.length;
|
|
717
|
+
console.log(chalk.cyan('║') + chalk.green(topLine) + ' '.repeat(Math.max(0, topPad)) + chalk.cyan('║'));
|
|
718
|
+
|
|
719
|
+
// Content of boxes
|
|
720
|
+
let contentLine = ' ';
|
|
721
|
+
for (let i = 0; i < numInRow; i++) {
|
|
722
|
+
const connText = rowConns[i].propfirm || rowConns[i].type || 'Connected';
|
|
723
|
+
const truncated = connText.length > rowBoxWidth - 4 ? connText.slice(0, rowBoxWidth - 7) + '...' : connText;
|
|
724
|
+
const innerWidth = rowBoxWidth - 4; // -2 for borders, -2 for padding
|
|
725
|
+
const textPad = Math.floor((innerWidth - truncated.length) / 2);
|
|
726
|
+
const textPadRight = innerWidth - truncated.length - textPad;
|
|
727
|
+
contentLine += '│ ' + ' '.repeat(textPad) + truncated + ' '.repeat(textPadRight) + ' │';
|
|
728
|
+
if (i < numInRow - 1) contentLine += ' '.repeat(gap);
|
|
729
|
+
}
|
|
730
|
+
const contentPad = W - contentLine.length;
|
|
731
|
+
console.log(chalk.cyan('║') + chalk.green(contentLine) + ' '.repeat(Math.max(0, contentPad)) + chalk.cyan('║'));
|
|
732
|
+
|
|
733
|
+
// Bottom border of boxes
|
|
734
|
+
let bottomLine = ' ';
|
|
735
|
+
for (let i = 0; i < numInRow; i++) {
|
|
736
|
+
bottomLine += '└' + '─'.repeat(rowBoxWidth - 2) + '┘';
|
|
737
|
+
if (i < numInRow - 1) bottomLine += ' '.repeat(gap);
|
|
738
|
+
}
|
|
739
|
+
const bottomPad = W - bottomLine.length;
|
|
740
|
+
console.log(chalk.cyan('║') + chalk.green(bottomLine) + ' '.repeat(Math.max(0, bottomPad)) + chalk.cyan('║'));
|
|
741
|
+
}
|
|
699
742
|
}
|
|
700
743
|
|
|
701
744
|
console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
|