hedgequantx 1.2.94 → 1.2.95
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/algo.js +15 -10
package/package.json
CHANGED
package/src/pages/algo.js
CHANGED
|
@@ -604,26 +604,31 @@ const launchAlgo = async (service, account, contract, numContracts, dailyTarget,
|
|
|
604
604
|
console.log(chalk.cyan(V) + chalk.white(actLeft) + dateSection + chalk.yellow(actRight) + chalk.cyan(V));
|
|
605
605
|
console.log(chalk.cyan(BOT));
|
|
606
606
|
|
|
607
|
-
// Logs (without borders) - newest first
|
|
607
|
+
// Logs (without borders) - newest first, fixed number of lines
|
|
608
|
+
const MAX_VISIBLE_LOGS = 15;
|
|
608
609
|
console.log();
|
|
610
|
+
|
|
609
611
|
if (logs.length === 0) {
|
|
610
|
-
console.log(chalk.gray(' Waiting for activity...') + '\x1B[K');
|
|
612
|
+
console.log(chalk.gray(' Waiting for activity...') + '\x1B[K');
|
|
613
|
+
// Fill remaining lines with empty
|
|
614
|
+
for (let i = 0; i < MAX_VISIBLE_LOGS - 1; i++) {
|
|
615
|
+
console.log('\x1B[K');
|
|
616
|
+
}
|
|
611
617
|
} else {
|
|
612
|
-
//
|
|
613
|
-
const reversedLogs = [...logs].reverse();
|
|
618
|
+
// Show newest first (reverse), limited to MAX_VISIBLE_LOGS
|
|
619
|
+
const reversedLogs = [...logs].reverse().slice(0, MAX_VISIBLE_LOGS);
|
|
614
620
|
reversedLogs.forEach(log => {
|
|
615
621
|
const color = typeColors[log.type] || chalk.white;
|
|
616
622
|
const icon = getIcon(log.type);
|
|
617
|
-
// Pad message and clear to end of line to avoid artifacts
|
|
618
623
|
const logLine = ` [${log.timestamp}] ${icon} ${log.message}`;
|
|
619
624
|
console.log(color(logLine) + '\x1B[K');
|
|
620
625
|
});
|
|
626
|
+
// Fill remaining lines with empty to keep fixed height
|
|
627
|
+
for (let i = reversedLogs.length; i < MAX_VISIBLE_LOGS; i++) {
|
|
628
|
+
console.log('\x1B[K');
|
|
629
|
+
}
|
|
621
630
|
}
|
|
622
|
-
//
|
|
623
|
-
for (let i = 0; i < 30; i++) {
|
|
624
|
-
console.log('\x1B[K');
|
|
625
|
-
}
|
|
626
|
-
// Clear remaining lines below
|
|
631
|
+
// Clear anything below
|
|
627
632
|
process.stdout.write('\x1B[J');
|
|
628
633
|
};
|
|
629
634
|
|