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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user