refactor: mMeldungen angepasst

This commit is contained in:
ISA
2025-08-01 09:44:30 +02:00
parent 423c87ca11
commit 975d3b726f
9 changed files with 14 additions and 4014 deletions

View File

@@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
NEXT_PUBLIC_EXPORT_STATIC=false
NEXT_PUBLIC_USE_CGI=false
# App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.672
NEXT_PUBLIC_APP_VERSION=1.6.673
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)

View File

@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
NEXT_PUBLIC_EXPORT_STATIC=true
NEXT_PUBLIC_USE_CGI=true
# App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.6.672
NEXT_PUBLIC_APP_VERSION=1.6.673
NEXT_PUBLIC_CPL_MODE=production

View File

@@ -1,3 +1,8 @@
## [1.6.673] 2025-08-01
- feat: Script zum Abrufen und Speichern von CPL-Meldungen als Mockdaten hinzugefügt
---
## [1.6.672] 2025-08-01
- style: apply littwin-blue color to NTP settings checkbox

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
/*
Das Script fetchMessagesData.mjs lädt Meldungen von einem CPL-Gerät über eine HTTPS-API für einen angegebenen Zeitraum herunter.
Es authentifiziert sich mit Benutzername und Passwort, akzeptiert selbst-signierte Zertifikate und speichert die abgerufenen Daten
als JSON in zwei Dateien (messages.json und messages_all.json) im Verzeichnis meldungen. Das Script dient dazu,
als JSON in zwei Dateien ( messages_all.json) im Verzeichnis meldungen. Das Script dient dazu,
Mockdaten für Tests oder Simulationen aktuell zu halten.
*/
@@ -32,10 +32,7 @@ async function fetchAndSaveMessages() {
throw new Error(`Fehler beim Abrufen der Meldungen: ${res.status}`);
const data = await res.json();
await fs.mkdir(targetDir, { recursive: true });
await fs.writeFile(
path.join(targetDir, "messages.json"),
JSON.stringify(data, null, 2)
);
await fs.writeFile(
path.join(targetDir, "messages_all.json"),
JSON.stringify(data, null, 2)

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "cpl-v4",
"version": "1.6.672",
"version": "1.6.673",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "cpl-v4",
"version": "1.6.672",
"version": "1.6.673",
"dependencies": {
"@fontsource/roboto": "^5.1.0",
"@headlessui/react": "^2.2.4",

View File

@@ -1,6 +1,6 @@
{
"name": "cpl-v4",
"version": "1.6.672",
"version": "1.6.673",
"private": true,
"scripts": {
"dev": "next dev",

View File

@@ -22,7 +22,7 @@ export default async function handler(
const filePath = path.join(
process.cwd(),
"mocks/device-cgi-simulator/meldungen/messages.json"
"mocks/device-cgi-simulator/meldungen/messages_all.json"
);
const fileContents = await fs.readFile(filePath, "utf-8");
const data = JSON.parse(fileContents);

View File

@@ -1,6 +1,6 @@
// pages/api/cpl/messages.ts
import { NextApiRequest, NextApiResponse } from "next";
import messagesRaw from "@/mocks/device-cgi-simulator/meldungen/messages.json";
import messagesRaw from "@/mocks/device-cgi-simulator/meldungen/messages_all.json";
export default function handler(req: NextApiRequest, res: NextApiResponse) {
const { fromDate, toDate } = req.query;