Fix: Data inconsistency pada transisi tahun/bulan dan setup API lokal untuk testing

- Fix deteksi transisi bulan untuk semua bulan (tidak hanya 1 Januari)
- Perbaikan validasi data dengan threshold 20% untuk transisi bulan/tahun
- Auto-reset chart jika data hourly tidak valid
- Setup force local mode untuk testing API lokal
- Perbaikan normalisasi dan validasi tanggal
- Enhanced logging untuk debugging transisi
This commit is contained in:
BTekno Dev
2026-01-01 23:38:42 +07:00
parent fccda40d72
commit 5e330e931b
6 changed files with 655 additions and 48 deletions

View File

@@ -111,8 +111,12 @@
// Tambahkan info lebih detail untuk debugging
if (error.message === 'Failed to fetch' || error.message.includes('fetch')) {
errorMessage = 'Gagal terhubung ke server API. Pastikan backend API sudah running di ' +
(await import('./dashboard/js/config.js')).then(m => m.API_CONFIG.BASE_URL).catch(() => 'http://localhost:8000');
try {
const { API_CONFIG } = await import('./dashboard/js/config.js');
errorMessage = 'Gagal terhubung ke server API. Pastikan backend API sudah running di ' + API_CONFIG.BASE_URL;
} catch (e) {
errorMessage = 'Gagal terhubung ke server API. Pastikan backend API sudah running di https://api.btekno.cloud';
}
}
errorDiv.textContent = errorMessage;