fix: DataTables and Chart.js loading issues

- Fixed DataTables order column index (was 6, table has 6 columns 0-5)
- Changed order to [[3, 'desc']] for date column
- Removed invalid chart.min.css link (Chart.js 4.x has no separate CSS)
- Changed loadDashboardData call to window.loadDashboardData
This commit is contained in:
TenerifeProp Dev
2026-04-06 20:51:51 +01:00
parent 3b6524d000
commit 30b6221ca8

View File

@@ -14,7 +14,6 @@
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<!-- Chart.js -->
<link href="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.min.css" rel="stylesheet">
<!-- DataTables -->
<link href="https://cdn.jsdelivr.net/npm/datatables.net-bs5@1.13.8/css/dataTables.bootstrap5.min.css" rel="stylesheet">
<!-- Lightpick -->
@@ -2792,7 +2791,7 @@ Ver todos
},
pageLength: 10,
ordering: true,
order: [[6, 'desc']]
order: [[3, 'desc']] // Sort by date column (0-indexed)
});
// ============ CHARTS ============
@@ -3233,14 +3232,14 @@ Ver todos
userRoleEl.textContent = roleNames[user.role] || user.role;
}
// Initialize admin panel
// Initialize admin panel
if (window.admin) {
window.admin.init();
}
// Load dashboard data after auth check
if (typeof loadDashboardData === 'function') {
loadDashboardData();
if (typeof window.loadDashboardData === 'function') {
window.loadDashboardData();
}
} catch (error) {
console.error('Auth check failed:', error);