hedgequantx 1.5.6 → 1.5.7
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 +11 -20
- package/src/menus/dashboard.js +13 -29
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -259,35 +259,26 @@ const mainMenu = async () => {
|
|
|
259
259
|
console.log(chalk.cyan('║') + leftText + ' '.repeat(Math.max(0, leftPad)) + rightText + ' '.repeat(Math.max(0, rightPad)) + chalk.cyan('║'));
|
|
260
260
|
};
|
|
261
261
|
|
|
262
|
-
menuRow(chalk.cyan('[1] ProjectX'), chalk.cyan('[2] Rithmic'));
|
|
263
|
-
menuRow(chalk.cyan('[3] Tradovate'), chalk.red('[X] Exit'));
|
|
264
|
-
|
|
265
262
|
console.log(chalk.cyan('╚' + '═'.repeat(innerWidth) + '╝'));
|
|
266
263
|
console.log();
|
|
267
264
|
|
|
265
|
+
// Use list type - more stable stdin handling
|
|
268
266
|
const { action } = await inquirer.prompt([
|
|
269
267
|
{
|
|
270
|
-
type: '
|
|
268
|
+
type: 'list',
|
|
271
269
|
name: 'action',
|
|
272
|
-
message: chalk.cyan('
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
270
|
+
message: chalk.cyan('Select platform:'),
|
|
271
|
+
choices: [
|
|
272
|
+
{ name: chalk.cyan('[1] ProjectX'), value: 'projectx' },
|
|
273
|
+
{ name: chalk.cyan('[2] Rithmic'), value: 'rithmic' },
|
|
274
|
+
{ name: chalk.cyan('[3] Tradovate'), value: 'tradovate' },
|
|
275
|
+
{ name: chalk.red('[X] Exit'), value: 'exit' }
|
|
276
|
+
],
|
|
277
|
+
loop: false
|
|
278
278
|
}
|
|
279
279
|
]);
|
|
280
280
|
|
|
281
|
-
|
|
282
|
-
const actionMap = {
|
|
283
|
-
'1': 'projectx',
|
|
284
|
-
'2': 'rithmic',
|
|
285
|
-
'3': 'tradovate',
|
|
286
|
-
'x': 'exit',
|
|
287
|
-
'X': 'exit'
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
return actionMap[action] || 'exit';
|
|
281
|
+
return action;
|
|
291
282
|
};
|
|
292
283
|
|
|
293
284
|
/**
|
package/src/menus/dashboard.js
CHANGED
|
@@ -106,44 +106,28 @@ const dashboardMenu = async (service) => {
|
|
|
106
106
|
console.log(chalk.cyan('║') + ' ' + left + leftPad + ' ' + (right || '') + rightPad + chalk.cyan('║'));
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
menuRow(chalk.cyan('[1] View Accounts'), chalk.cyan('[2] View Stats'));
|
|
110
|
-
menuRow(chalk.cyan('[+] Add Prop-Account'), chalk.cyan('[A] Algo-Trading'));
|
|
111
|
-
menuRow(chalk.yellow('[U] Update HQX'), chalk.red('[X] Disconnect'));
|
|
112
|
-
|
|
113
109
|
console.log(chalk.cyan('╚' + '═'.repeat(W) + '╝'));
|
|
114
110
|
console.log();
|
|
115
111
|
|
|
116
|
-
//
|
|
117
|
-
prepareStdin();
|
|
118
|
-
await new Promise(resolve => setTimeout(resolve, 100));
|
|
119
|
-
|
|
112
|
+
// Use list type instead of input - more stable stdin handling
|
|
120
113
|
const { action } = await inquirer.prompt([
|
|
121
114
|
{
|
|
122
|
-
type: '
|
|
115
|
+
type: 'list',
|
|
123
116
|
name: 'action',
|
|
124
|
-
message: chalk.cyan('
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
117
|
+
message: chalk.cyan('Select action:'),
|
|
118
|
+
choices: [
|
|
119
|
+
{ name: chalk.cyan('[1] View Accounts'), value: 'accounts' },
|
|
120
|
+
{ name: chalk.cyan('[2] View Stats'), value: 'stats' },
|
|
121
|
+
{ name: chalk.cyan('[+] Add Prop-Account'), value: 'add_prop_account' },
|
|
122
|
+
{ name: chalk.magenta('[A] Algo-Trading'), value: 'algotrading' },
|
|
123
|
+
{ name: chalk.yellow('[U] Update HQX'), value: 'update' },
|
|
124
|
+
{ name: chalk.red('[X] Disconnect'), value: 'disconnect' }
|
|
125
|
+
],
|
|
126
|
+
loop: false
|
|
130
127
|
}
|
|
131
128
|
]);
|
|
132
129
|
|
|
133
|
-
|
|
134
|
-
const actionMap = {
|
|
135
|
-
'1': 'accounts',
|
|
136
|
-
'2': 'stats',
|
|
137
|
-
'+': 'add_prop_account',
|
|
138
|
-
'a': 'algotrading',
|
|
139
|
-
'A': 'algotrading',
|
|
140
|
-
'u': 'update',
|
|
141
|
-
'U': 'update',
|
|
142
|
-
'x': 'disconnect',
|
|
143
|
-
'X': 'disconnect'
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
return actionMap[action] || 'accounts';
|
|
130
|
+
return action;
|
|
147
131
|
};
|
|
148
132
|
|
|
149
133
|
/**
|