hedgequantx 2.9.26 → 2.9.28
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 +19 -2
- package/src/pages/ai-agents-ui.js +8 -16
package/package.json
CHANGED
package/src/pages/accounts.js
CHANGED
|
@@ -7,7 +7,7 @@ const ora = require('ora');
|
|
|
7
7
|
|
|
8
8
|
const { connections } = require('../services');
|
|
9
9
|
const { ACCOUNT_STATUS, ACCOUNT_TYPE } = require('../config');
|
|
10
|
-
const { getLogoWidth, getColWidths, drawBoxHeader, drawBoxFooter, draw2ColHeader, visibleLength, displayBanner, clearScreen } = require('../ui');
|
|
10
|
+
const { getLogoWidth, getColWidths, drawBoxHeader, drawBoxFooter, draw2ColHeader, visibleLength, displayBanner, clearScreen, centerText } = require('../ui');
|
|
11
11
|
const { prompts } = require('../utils');
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -173,7 +173,24 @@ const showAccounts = async (service) => {
|
|
|
173
173
|
console.log();
|
|
174
174
|
|
|
175
175
|
} catch (error) {
|
|
176
|
-
if (spinner) spinner.
|
|
176
|
+
if (spinner) spinner.stop();
|
|
177
|
+
|
|
178
|
+
// Display error in a proper box
|
|
179
|
+
const W = boxWidth - 2;
|
|
180
|
+
console.log(chalk.cyan('╔' + '═'.repeat(W) + '╗'));
|
|
181
|
+
console.log(chalk.cyan('║') + chalk.yellow.bold(centerText('TRADING ACCOUNTS', W)) + chalk.cyan('║'));
|
|
182
|
+
console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
|
|
183
|
+
console.log(chalk.cyan('║') + ' '.repeat(W) + chalk.cyan('║'));
|
|
184
|
+
|
|
185
|
+
// Truncate error message to fit
|
|
186
|
+
let errMsg = (error.message || 'Unknown error').toUpperCase();
|
|
187
|
+
const maxLen = W - 4;
|
|
188
|
+
if (errMsg.length > maxLen) {
|
|
189
|
+
errMsg = errMsg.substring(0, maxLen - 3) + '...';
|
|
190
|
+
}
|
|
191
|
+
console.log(chalk.cyan('║') + chalk.red(centerText('ERROR: ' + errMsg, W)) + chalk.cyan('║'));
|
|
192
|
+
console.log(chalk.cyan('║') + ' '.repeat(W) + chalk.cyan('║'));
|
|
193
|
+
console.log(chalk.cyan('╚' + '═'.repeat(W) + '╝'));
|
|
177
194
|
}
|
|
178
195
|
|
|
179
196
|
await prompts.waitForEnter();
|
|
@@ -334,33 +334,25 @@ const drawConnectionTest = async (agents, boxWidth, clearWithBanner) => {
|
|
|
334
334
|
|
|
335
335
|
const W = boxWidth - 2;
|
|
336
336
|
|
|
337
|
-
// Show loading
|
|
337
|
+
// Show loading box with centered spinner text
|
|
338
338
|
clearWithBanner();
|
|
339
339
|
console.log(chalk.cyan('╔' + '═'.repeat(W) + '╗'));
|
|
340
340
|
console.log(chalk.cyan('║') + chalk.yellow.bold(centerText('AI AGENTS CONNECTION TEST', W)) + chalk.cyan('║'));
|
|
341
341
|
console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
|
|
342
|
-
|
|
343
|
-
// Empty lines for vertical centering (top)
|
|
344
|
-
console.log(chalk.cyan('║') + ' '.repeat(W) + chalk.cyan('║'));
|
|
345
342
|
console.log(chalk.cyan('║') + ' '.repeat(W) + chalk.cyan('║'));
|
|
346
343
|
console.log(chalk.cyan('║') + ' '.repeat(W) + chalk.cyan('║'));
|
|
344
|
+
console.log(chalk.cyan('╚' + '═'.repeat(W) + '╝'));
|
|
345
|
+
console.log('');
|
|
347
346
|
|
|
348
|
-
//
|
|
347
|
+
// Spinner with text - centered below the box
|
|
349
348
|
const spinnerText = 'Testing connections...';
|
|
350
|
-
const
|
|
351
|
-
console.log(chalk.cyan('║') + chalk.yellow(paddedText) + chalk.cyan('║'));
|
|
352
|
-
|
|
353
|
-
// Empty lines for vertical centering (bottom)
|
|
354
|
-
console.log(chalk.cyan('║') + ' '.repeat(W) + chalk.cyan('║'));
|
|
355
|
-
console.log(chalk.cyan('║') + ' '.repeat(W) + chalk.cyan('║'));
|
|
356
|
-
console.log(chalk.cyan('║') + ' '.repeat(W) + chalk.cyan('║'));
|
|
357
|
-
console.log(chalk.cyan('╚' + '═'.repeat(W) + '╝'));
|
|
349
|
+
const spinnerLeftPad = Math.floor((W - spinnerText.length - 2) / 2);
|
|
358
350
|
|
|
359
|
-
// Start spinner below the box
|
|
360
351
|
const spinner = ora({
|
|
361
|
-
text:
|
|
352
|
+
text: chalk.yellow(spinnerText),
|
|
362
353
|
spinner: 'dots',
|
|
363
|
-
color: 'yellow'
|
|
354
|
+
color: 'yellow',
|
|
355
|
+
indent: spinnerLeftPad
|
|
364
356
|
}).start();
|
|
365
357
|
|
|
366
358
|
// Run pre-flight check
|