From 9beebe091c6f8dc52383bf89f0b3c6cf8cdc8b72 Mon Sep 17 00:00:00 2001 From: Melchior Reimers Date: Sun, 25 Jan 2026 18:41:43 +0100 Subject: [PATCH] updated --- dashboard/public/index.html | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) 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();