hedgequantx 2.7.37 → 2.7.38
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 +29 -29
package/package.json
CHANGED
package/src/menus/dashboard.js
CHANGED
|
@@ -30,9 +30,9 @@ const dashboardMenu = async (service) => {
|
|
|
30
30
|
return chalk.cyan('║') + content + ' '.repeat(Math.max(0, padding)) + chalk.cyan('║');
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
//
|
|
34
|
-
console.log(chalk.cyan('
|
|
35
|
-
console.log(makeLine(chalk.yellow.bold('
|
|
33
|
+
// New rectangle (banner is always closed)
|
|
34
|
+
console.log(chalk.cyan('╔' + '═'.repeat(W) + '╗'));
|
|
35
|
+
console.log(makeLine(chalk.yellow.bold('WELCOME, HQX TRADER!'), 'center'));
|
|
36
36
|
console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
|
|
37
37
|
|
|
38
38
|
// Show connected propfirms
|
|
@@ -87,9 +87,9 @@ const dashboardMenu = async (service) => {
|
|
|
87
87
|
|
|
88
88
|
// Find max width for alignment
|
|
89
89
|
const menuItems = [
|
|
90
|
-
{ left: '[1]
|
|
91
|
-
{ left: '[+]
|
|
92
|
-
{ left: '[I] AI
|
|
90
|
+
{ left: '[1] VIEW ACCOUNTS', right: '[2] VIEW STATS' },
|
|
91
|
+
{ left: '[+] ADD PROP-ACCOUNT', right: '[A] ALGO-TRADING' },
|
|
92
|
+
{ left: '[I] AI AGENTS', right: '[U] UPDATE HQX' },
|
|
93
93
|
];
|
|
94
94
|
|
|
95
95
|
const maxLeftLen = Math.max(...menuItems.map(m => m.left.length));
|
|
@@ -119,18 +119,18 @@ const dashboardMenu = async (service) => {
|
|
|
119
119
|
);
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
menuRow('[1]
|
|
123
|
-
menuRow('[+]
|
|
124
|
-
menuRow('[I] AI
|
|
122
|
+
menuRow('[1] VIEW ACCOUNTS', '[2] VIEW STATS', chalk.cyan, chalk.cyan);
|
|
123
|
+
menuRow('[+] ADD PROP-ACCOUNT', '[A] ALGO-TRADING', chalk.cyan, chalk.magenta);
|
|
124
|
+
menuRow('[I] AI AGENTS', '[U] UPDATE HQX', chalk.green, chalk.yellow);
|
|
125
125
|
|
|
126
126
|
// Separator and centered Disconnect button
|
|
127
127
|
console.log(chalk.cyan('╠' + '─'.repeat(W) + '╣'));
|
|
128
|
-
console.log(makeLine(chalk.red('[X]
|
|
128
|
+
console.log(makeLine(chalk.red('[X] DISCONNECT'), 'center'));
|
|
129
129
|
|
|
130
130
|
console.log(chalk.cyan('╚' + '═'.repeat(W) + '╝'));
|
|
131
131
|
|
|
132
132
|
// Simple input - no duplicate menu
|
|
133
|
-
const input = await prompts.textInput(chalk.cyan('
|
|
133
|
+
const input = await prompts.textInput(chalk.cyan('SELECT (1/2/+/A/I/U/X):'));
|
|
134
134
|
|
|
135
135
|
const actionMap = {
|
|
136
136
|
'1': 'accounts',
|
|
@@ -159,8 +159,8 @@ const handleUpdate = async () => {
|
|
|
159
159
|
currentVersion = require('../../package.json').version || 'unknown';
|
|
160
160
|
} catch (e) {}
|
|
161
161
|
|
|
162
|
-
console.log(chalk.cyan(`\n
|
|
163
|
-
spinner = ora({ text: '
|
|
162
|
+
console.log(chalk.cyan(`\n CURRENT VERSION: V${currentVersion}`));
|
|
163
|
+
spinner = ora({ text: 'CHECKING FOR UPDATES...', color: 'yellow' }).start();
|
|
164
164
|
|
|
165
165
|
let latestVersion;
|
|
166
166
|
try {
|
|
@@ -174,23 +174,23 @@ const handleUpdate = async () => {
|
|
|
174
174
|
throw new Error('Invalid version format');
|
|
175
175
|
}
|
|
176
176
|
} catch (e) {
|
|
177
|
-
spinner.fail('
|
|
178
|
-
console.log(chalk.gray(`
|
|
179
|
-
console.log(chalk.yellow('
|
|
177
|
+
spinner.fail('CANNOT REACH NPM REGISTRY');
|
|
178
|
+
console.log(chalk.gray(` ERROR: ${e.message.toUpperCase()}`));
|
|
179
|
+
console.log(chalk.yellow(' TRY MANUALLY: npm install -g hedgequantx@latest'));
|
|
180
180
|
await prompts.waitForEnter();
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
spinner.succeed(`
|
|
184
|
+
spinner.succeed(`LATEST VERSION: V${latestVersion}`);
|
|
185
185
|
|
|
186
186
|
if (currentVersion === latestVersion) {
|
|
187
|
-
console.log(chalk.green('
|
|
187
|
+
console.log(chalk.green(' ALREADY UP TO DATE!'));
|
|
188
188
|
await prompts.waitForEnter();
|
|
189
189
|
return;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
console.log(chalk.yellow(`
|
|
193
|
-
spinner = ora({ text: '
|
|
192
|
+
console.log(chalk.yellow(` UPDATE AVAILABLE: V${currentVersion} → V${latestVersion}`));
|
|
193
|
+
spinner = ora({ text: 'INSTALLING UPDATE...', color: 'yellow' }).start();
|
|
194
194
|
|
|
195
195
|
try {
|
|
196
196
|
// Try with sudo first on Unix systems
|
|
@@ -205,16 +205,16 @@ const handleUpdate = async () => {
|
|
|
205
205
|
encoding: 'utf8'
|
|
206
206
|
});
|
|
207
207
|
} catch (e) {
|
|
208
|
-
spinner.fail('
|
|
209
|
-
console.log(chalk.gray(`
|
|
210
|
-
console.log(chalk.yellow('
|
|
208
|
+
spinner.fail('UPDATE FAILED - PERMISSION DENIED?');
|
|
209
|
+
console.log(chalk.gray(` ERROR: ${e.message.toUpperCase()}`));
|
|
210
|
+
console.log(chalk.yellow(' TRY MANUALLY WITH SUDO:'));
|
|
211
211
|
console.log(chalk.white(' sudo npm install -g hedgequantx@latest'));
|
|
212
212
|
await prompts.waitForEnter();
|
|
213
213
|
return;
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
spinner.succeed(`
|
|
217
|
-
console.log(chalk.cyan('
|
|
216
|
+
spinner.succeed(`UPDATED TO V${latestVersion}!`);
|
|
217
|
+
console.log(chalk.cyan(' RESTARTING HQX...'));
|
|
218
218
|
|
|
219
219
|
await new Promise(r => setTimeout(r, 1500));
|
|
220
220
|
|
|
@@ -227,15 +227,15 @@ const handleUpdate = async () => {
|
|
|
227
227
|
child.unref();
|
|
228
228
|
process.exit(0);
|
|
229
229
|
} catch (e) {
|
|
230
|
-
console.log(chalk.yellow('\n
|
|
230
|
+
console.log(chalk.yellow('\n PLEASE RESTART HQX MANUALLY:'));
|
|
231
231
|
console.log(chalk.white(' hqx'));
|
|
232
232
|
await prompts.waitForEnter();
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
} catch (error) {
|
|
236
|
-
if (spinner) spinner.fail('
|
|
237
|
-
console.log(chalk.gray(`
|
|
238
|
-
console.log(chalk.yellow('
|
|
236
|
+
if (spinner) spinner.fail('UPDATE ERROR');
|
|
237
|
+
console.log(chalk.gray(` ERROR: ${error.message.toUpperCase()}`));
|
|
238
|
+
console.log(chalk.yellow(' TRY MANUALLY: npm install -g hedgequantx@latest'));
|
|
239
239
|
await prompts.waitForEnter();
|
|
240
240
|
}
|
|
241
241
|
};
|