Dashboard aktiv in navigtion beim ersten Aufruf

This commit is contained in:
ISA
2024-09-24 20:16:35 +02:00
parent 817495cd25
commit 8c05e61852
3 changed files with 129 additions and 14 deletions

View File

@@ -7,7 +7,10 @@ const DeviceData = () => {
useEffect(() => {
const fetchData = async () => {
try {
const response = await fetch("/api/fetchDeviceData");
// Stelle sicher, dass die URL auf den richtigen Server zeigt (localhost:3000)
const response = await fetch(
"http://localhost:3000/api/fetchDeviceData"
);
if (!response.ok) {
throw new Error(`Fehler beim Abrufen der Daten: ${response.status}`);
}

View File

@@ -14,7 +14,7 @@ function Navigation() {
}, [pathname]);
const menuItems = [
{ name: "Übersicht", path: "/" },
{ name: "Übersicht", path: "/dashboard" },
{ name: "Kabelüberwachung", path: "/kabelueberwachung" },
{ name: "Zutrittskontrolle", path: "/access" },
{ name: "Ein- und Ausgänge", path: "/einausgaenge" },