feat: integriere Systemspannungen und Temperaturen mit Redux Thunk und Slice

- Neues Slice systemVoltTempSlice.ts erstellt für Speicherung von Spannungen und Verlauf
- Thunk fetchSystemVoltTempThunk.ts implementiert für asynchrones Laden der Systemwerte
- Service fetchSystemVoltTempService.ts verwendet API /api/cpl/systemVoltTempAPIHandler
- Mock-Daten in systemVoltTempMockData.js definiert
- system.tsx auf Redux umgestellt: useSelector für Werte und Verlauf, fetch per Thunk
- store.ts angepasst: systemVoltTempSlice hinzugefügt
- Chart.js Darstellung von Spannungen und Temperaturen mit Echtzeit-Update alle 5 Sekunden
This commit is contained in:
Ismail Ali
2025-04-27 11:25:54 +02:00
parent fc66346663
commit 5c3f91cad2
9 changed files with 277 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
// /pages/api/cpl/systemVoltTempAPIHandler.ts
import { NextApiRequest, NextApiResponse } from "next";
import path from "path";
import fs from "fs/promises";
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
const filePath = path.join(
process.cwd(),
"apiMockData",
"SERVICE",
"systemVoltTempMockData.js"
);
try {
const data = await fs.readFile(filePath, "utf-8");
res.status(200).send(data);
} catch (error) {
res.status(404).json({ error: "File not found" });
}
}