hedgequantx 1.8.48 → 1.8.49
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/pages/accounts.js +2 -3
- package/src/ui/index.js +53 -1
package/package.json
CHANGED
package/src/pages/accounts.js
CHANGED
|
@@ -28,7 +28,7 @@ const showAccounts = async (service) => {
|
|
|
28
28
|
let spinner;
|
|
29
29
|
|
|
30
30
|
try {
|
|
31
|
-
// Single spinner for loading
|
|
31
|
+
// Single spinner for loading (appears below the dashboard header)
|
|
32
32
|
spinner = ora({ text: 'Loading accounts...', color: 'yellow' }).start();
|
|
33
33
|
|
|
34
34
|
const allConns = connections.count() > 0 ? connections.getAll() : (service ? [{ service, propfirm: service.propfirm?.name || 'Unknown', type: 'single' }] : []);
|
|
@@ -78,8 +78,7 @@ const showAccounts = async (service) => {
|
|
|
78
78
|
} catch (e) {}
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
spinner.
|
|
82
|
-
console.clear();
|
|
81
|
+
spinner.succeed('Accounts loaded');
|
|
83
82
|
console.log();
|
|
84
83
|
|
|
85
84
|
// Display accounts
|
package/src/ui/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* UI Module Exports
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
const chalk = require('chalk');
|
|
5
6
|
const { detectDevice, getDevice, getSeparator } = require('./device');
|
|
6
7
|
const {
|
|
7
8
|
getLogoWidth,
|
|
@@ -24,6 +25,55 @@ const {
|
|
|
24
25
|
} = require('./table');
|
|
25
26
|
const { createBoxMenu } = require('./menu');
|
|
26
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Display HQX Banner (without closing border)
|
|
30
|
+
*/
|
|
31
|
+
const displayBanner = () => {
|
|
32
|
+
console.clear();
|
|
33
|
+
const termWidth = process.stdout.columns || 100;
|
|
34
|
+
const isMobile = termWidth < 60;
|
|
35
|
+
const boxWidth = isMobile ? Math.max(termWidth - 2, 40) : Math.max(getLogoWidth(), 98);
|
|
36
|
+
const innerWidth = boxWidth - 2;
|
|
37
|
+
|
|
38
|
+
let version = '1.0.0';
|
|
39
|
+
try { version = require('../../package.json').version; } catch (e) {}
|
|
40
|
+
|
|
41
|
+
console.log(chalk.cyan('╔' + '═'.repeat(innerWidth) + '╗'));
|
|
42
|
+
|
|
43
|
+
if (isMobile) {
|
|
44
|
+
const logoHQ = ['██╗ ██╗ ██████╗ ','██║ ██║██╔═══██╗','███████║██║ ██║','██╔══██║██║▄▄ ██║','██║ ██║╚██████╔╝','╚═╝ ╚═╝ ╚══▀▀═╝ '];
|
|
45
|
+
const logoX = ['██╗ ██╗','╚██╗██╔╝',' ╚███╔╝ ',' ██╔██╗ ','██╔╝ ██╗','╚═╝ ╚═╝'];
|
|
46
|
+
logoHQ.forEach((line, i) => {
|
|
47
|
+
const fullLine = chalk.cyan(line) + chalk.yellow(logoX[i]);
|
|
48
|
+
const totalLen = line.length + logoX[i].length;
|
|
49
|
+
const padding = innerWidth - totalLen;
|
|
50
|
+
const leftPad = Math.floor(padding / 2);
|
|
51
|
+
console.log(chalk.cyan('║') + ' '.repeat(leftPad) + fullLine + ' '.repeat(padding - leftPad) + chalk.cyan('║'));
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
const logo = [
|
|
55
|
+
'██╗ ██╗███████╗██████╗ ██████╗ ███████╗ ██████╗ ██╗ ██╗ █████╗ ███╗ ██╗████████╗',
|
|
56
|
+
'██║ ██║██╔════╝██╔══██╗██╔════╝ ██╔════╝██╔═══██╗██║ ██║██╔══██╗████╗ ██║╚══██╔══╝',
|
|
57
|
+
'███████║█████╗ ██║ ██║██║ ███╗█████╗ ██║ ██║██║ ██║███████║██╔██╗ ██║ ██║ ',
|
|
58
|
+
'██╔══██║██╔══╝ ██║ ██║██║ ██║██╔══╝ ██║▄▄ ██║██║ ██║██╔══██║██║╚██╗██║ ██║ ',
|
|
59
|
+
'██║ ██║███████╗██████╔╝╚██████╔╝███████╗╚██████╔╝╚██████╔╝██║ ██║██║ ╚████║ ██║ ',
|
|
60
|
+
'╚═╝ ╚═╝╚══════╝╚═════╝ ╚═════╝ ╚══════╝ ╚══▀▀═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ '
|
|
61
|
+
];
|
|
62
|
+
const logoX = ['██╗ ██╗','╚██╗██╔╝',' ╚███╔╝ ',' ██╔██╗ ','██╔╝ ██╗','╚═╝ ╚═╝'];
|
|
63
|
+
logo.forEach((line, i) => {
|
|
64
|
+
const fullLine = chalk.cyan(line) + chalk.yellow(logoX[i]);
|
|
65
|
+
const totalLen = line.length + logoX[i].length;
|
|
66
|
+
const padding = innerWidth - totalLen;
|
|
67
|
+
const leftPad = Math.floor(padding / 2);
|
|
68
|
+
console.log(chalk.cyan('║') + ' '.repeat(leftPad) + fullLine + ' '.repeat(padding - leftPad) + chalk.cyan('║'));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
console.log(chalk.cyan('╠' + '═'.repeat(innerWidth) + '╣'));
|
|
73
|
+
const tagline = isMobile ? `HQX v${version}` : `Prop Futures Algo Trading v${version}`;
|
|
74
|
+
console.log(chalk.cyan('║') + chalk.white(centerText(tagline, innerWidth)) + chalk.cyan('║'));
|
|
75
|
+
};
|
|
76
|
+
|
|
27
77
|
/**
|
|
28
78
|
* Ensure stdin is ready for inquirer prompts
|
|
29
79
|
* This fixes input leaking to bash after session restore or algo trading
|
|
@@ -69,5 +119,7 @@ module.exports = {
|
|
|
69
119
|
// Menu
|
|
70
120
|
createBoxMenu,
|
|
71
121
|
// Stdin
|
|
72
|
-
prepareStdin
|
|
122
|
+
prepareStdin,
|
|
123
|
+
// Banner
|
|
124
|
+
displayBanner
|
|
73
125
|
};
|