diff --git a/dashboard/public/index.html b/dashboard/public/index.html
index d18a719..3ca7308 100644
--- a/dashboard/public/index.html
+++ b/dashboard/public/index.html
@@ -143,9 +143,6 @@
let isRefreshing = false;
let refreshInterval = null;
- let isRefreshing = false;
- let refreshInterval = null;
-
async function fetchData(skipCharts = false) {
if (isRefreshing) return; // Verhindere parallele Aufrufe
isRefreshing = true;
@@ -191,14 +188,24 @@
}
function showView(viewId) {
+ if (!viewId) viewId = 'dashboard'; // Default zu dashboard
window.activeView = viewId;
document.querySelectorAll('.view').forEach(v => v.classList.add('hidden'));
- document.getElementById(`view-${viewId}`).classList.remove('hidden');
+ const targetView = document.getElementById(`view-${viewId}`);
+ if (targetView) {
+ targetView.classList.remove('hidden');
+ }
document.querySelectorAll('#sidebar a').forEach(a => a.classList.remove('active-nav'));
- document.getElementById(`nav-${viewId}`).classList.add('active-nav');
+ const targetNav = document.getElementById(`nav-${viewId}`);
+ if (targetNav) {
+ targetNav.classList.add('active-nav');
+ }
const titles = { 'dashboard': 'Market Overview', 'custom-analytics': 'Custom Analytics' };
- document.getElementById('pageTitle').innerText = titles[viewId] || 'Dashboard';
+ const pageTitle = document.getElementById('pageTitle');
+ if (pageTitle) {
+ pageTitle.innerText = titles[viewId] || 'Dashboard';
+ }
updateUrlParams();
}
@@ -764,6 +771,9 @@
document.getElementById('customDateFrom').value = thirtyDaysAgo.toISOString().split('T')[0];
}
+ // Initialisiere Dashboard-View
+ showView('dashboard');
+
await fetchData();
loadFromUrlParams();