Refactor dashboard JS to ES modules; fix collector strategy loading and add auto-backfill

- Split inline JS into separate ES module files (indicators/, strategies/, ui/, utils/)
- Fix brain.py strategy registry to use MAStrategy directly instead of missing modules
- Add auto-backfill for detected data gaps in collector monitoring loop
- Fix chart resize on sidebar toggle
- Fix chart scrollToTime -> setVisibleLogicalRange
This commit is contained in:
BTC Bot
2026-02-18 11:07:30 +01:00
parent eafba745b1
commit 30bedcbb67
31 changed files with 2516 additions and 2054 deletions

View File

@ -0,0 +1,23 @@
export function downloadFile(content, filename, mimeType) {
const blob = new Blob([content], { type: mimeType });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = filename;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(url);
}
export function formatDate(date) {
return new Date(date).toISOString().slice(0, 16);
}
export function formatPrice(price, decimals = 2) {
return price.toFixed(decimals);
}
export function formatPercent(value) {
return (value >= 0 ? '+' : '') + value.toFixed(2) + '%';
}