hedgequantx 2.4.43 → 2.4.44
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 +39 -6
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -143,6 +143,38 @@ const banner = async (clear = true) => {
|
|
|
143
143
|
|
|
144
144
|
const tagline = isMobile ? `HQX v${version}` : `PROP FUTURES ALGO TRADING v${version}`;
|
|
145
145
|
console.log(chalk.cyan('║') + chalk.white(centerText(tagline, innerWidth)) + chalk.cyan('║'));
|
|
146
|
+
|
|
147
|
+
// Close box for loading state
|
|
148
|
+
console.log(chalk.cyan('╚' + '═'.repeat(innerWidth) + '╝'));
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Display banner WITHOUT bottom border (for dashboard to continue)
|
|
153
|
+
*/
|
|
154
|
+
const bannerOpen = async () => {
|
|
155
|
+
const termWidth = process.stdout.columns || 100;
|
|
156
|
+
const isMobile = termWidth < 60;
|
|
157
|
+
const boxWidth = isMobile ? Math.max(termWidth - 2, 40) : Math.max(getLogoWidth(), 98);
|
|
158
|
+
const innerWidth = boxWidth - 2;
|
|
159
|
+
const version = require('../package.json').version;
|
|
160
|
+
|
|
161
|
+
console.log(chalk.cyan('╔' + '═'.repeat(innerWidth) + '╗'));
|
|
162
|
+
|
|
163
|
+
const logoLines = isMobile ? getMobileLogo() : getFullLogo();
|
|
164
|
+
|
|
165
|
+
for (const [hq, x] of logoLines) {
|
|
166
|
+
const fullLine = chalk.cyan(hq) + chalk.yellow(x);
|
|
167
|
+
const totalLen = hq.length + x.length;
|
|
168
|
+
const padding = innerWidth - totalLen;
|
|
169
|
+
const leftPad = Math.floor(padding / 2);
|
|
170
|
+
console.log(chalk.cyan('║') + ' '.repeat(leftPad) + fullLine + ' '.repeat(padding - leftPad) + chalk.cyan('║'));
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
console.log(chalk.cyan('╠' + '═'.repeat(innerWidth) + '╣'));
|
|
174
|
+
|
|
175
|
+
const tagline = isMobile ? `HQX v${version}` : `PROP FUTURES ALGO TRADING v${version}`;
|
|
176
|
+
console.log(chalk.cyan('║') + chalk.white(centerText(tagline, innerWidth)) + chalk.cyan('║'));
|
|
177
|
+
// NO bottom border - dashboardMenu will continue
|
|
146
178
|
};
|
|
147
179
|
|
|
148
180
|
/**
|
|
@@ -172,13 +204,10 @@ const getMobileLogo = () => [
|
|
|
172
204
|
];
|
|
173
205
|
|
|
174
206
|
/**
|
|
175
|
-
* Display banner with closing border
|
|
207
|
+
* Display banner with closing border (alias for banner)
|
|
176
208
|
*/
|
|
177
209
|
const bannerClosed = async () => {
|
|
178
210
|
await banner();
|
|
179
|
-
const termWidth = process.stdout.columns || 100;
|
|
180
|
-
const boxWidth = termWidth < 60 ? Math.max(termWidth - 2, 40) : Math.max(getLogoWidth(), 98);
|
|
181
|
-
console.log(chalk.cyan('╚' + '═'.repeat(boxWidth - 2) + '╝'));
|
|
182
211
|
};
|
|
183
212
|
|
|
184
213
|
// ==================== MENUS ====================
|
|
@@ -262,13 +291,17 @@ const run = async () => {
|
|
|
262
291
|
await refreshStats();
|
|
263
292
|
}
|
|
264
293
|
} else {
|
|
265
|
-
//
|
|
294
|
+
// Show banner with loading spinner
|
|
266
295
|
console.clear();
|
|
267
296
|
await banner(false);
|
|
268
297
|
|
|
269
298
|
const spinner = ora({ text: 'LOADING DASHBOARD...', color: 'cyan' }).start();
|
|
270
299
|
await refreshStats();
|
|
271
|
-
spinner.
|
|
300
|
+
spinner.stop();
|
|
301
|
+
|
|
302
|
+
// Redraw clean dashboard (banner without bottom border + menu)
|
|
303
|
+
console.clear();
|
|
304
|
+
await bannerOpen();
|
|
272
305
|
|
|
273
306
|
const action = await dashboardMenu(currentService);
|
|
274
307
|
|