fix: Gerätestandort im Header jetzt einzeilig – kein Zeilenumbruch mehr

- whitespace-nowrap verhindert Umbruch
- truncate + max-w beschränkt Länge visuell
- bessere Darstellung auch bei hoher Auflösung
This commit is contained in:
Ismail Ali
2025-04-30 22:54:12 +02:00
parent 40777f212b
commit 823d12fcea
6 changed files with 73 additions and 41 deletions

View File

@@ -1,6 +1,6 @@
// /apiMockData/SERVICE/SystemMockData.js
var win_appVersion = "0.02";
var win_deviceName = "CPLV4_Ismail_Mockup";
var win_deviceName = "CPLV4 Ismail Rastede";
var win_mac1 = "0 48 86 81 46 143";
var win_ip = "10.10.0.243";
var win_subnet = "255.255.255.0";

View File

@@ -98,34 +98,29 @@ var win_kueID = [
//TDR---------------------------------------------------
var win_tdrAtten = [
2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
2.0, 2.0,
];
1, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0
];;
var win_tdrPulse = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
];
var win_tdrSpeed = [
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
100, 100,
];
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100
];;;;
var win_tdrAmp = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
];
var win_tdrTrigger = [
80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
];
80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80
];;
var win_tdrLocation = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
];
var win_tdrActive = [
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
];;
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
];;;
var win_tdrLast = [
"2024-10-17 07:51:54:000",
"2024-09-30 08:38:50:000",
@@ -167,3 +162,9 @@ var win_memoryInterval = [
5, 0, 15, 0, 0, 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0
];
//Speicherintervall (Kein, 1 MInute, 5 Minuten, 10 Minuten, 15 Minuten, 30 Minuten, 60 Minuten, 360 Minuten (6h), 720 Minuten (12h)

View File

@@ -95,11 +95,11 @@ function Header() {
height={60}
priority
/>
<div className="flex flex-col leading-tight">
<div className="flex flex-col leading-tight whitespace-nowrap">
<h2 className="text-xl laptop:text-base xl:text-lg font-bold">
Meldestation
</h2>
<p className="text-gray-600 text-lg laptop:text-sm xl:text-base">
<p className="text-gray-600 text-lg laptop:text-sm xl:text-base truncate max-w-[20vw]">
{deviceName}
</p>
</div>

View File

@@ -26,34 +26,63 @@ export default function TdrEinstellung({ slot }: Props) {
const handleSave = () => {
const { daempfung, geschwindigkeit, trigger } = tdrData;
if (!daempfung.trim() || !geschwindigkeit.trim() || !trigger.trim()) {
alert("Bitte alle Felder ausfüllen.");
return;
}
const base = `${window.location.origin}/CPL?/kabelueberwachung.html`;
const isDev = window.location.hostname === "localhost";
const urls = [
`${base}&KTD${slot}=${tdrData.daempfung.trim()}`,
`${base}&KTS${slot}=${tdrData.geschwindigkeit.trim()}`,
`${base}&KTE${slot}=${tdrData.trigger.trim()}`,
];
if (isDev) {
const requests = [
{ key: "win_tdrAtten", value: daempfung.trim() },
{ key: "win_tdrSpeed", value: geschwindigkeit.trim() },
{ key: "win_tdrTrigger", value: trigger.trim() },
];
Promise.all(
urls.map((url) =>
fetch(url).then((res) => {
if (!res.ok) throw new Error(`Fehler bei ${url}`);
return res.text();
})
Promise.all(
requests.map(({ key, value }) =>
fetch(
`/api/cpl/updateTdrSettingsDataAPIHandler?key=${key}&slot=${slot}&value=${value}`
).then((res) => {
if (!res.ok) throw new Error(`Fehler bei ${key}`);
return res.json();
})
)
)
)
.then(() => {
alert("TDR-Einstellungen erfolgreich gesendet.");
})
.catch((err) => {
console.error("Fehler beim Senden:", err);
alert("Fehler beim Senden der TDR-Einstellungen.");
});
.then(() => {
alert("TDR-Mockdaten erfolgreich gespeichert.");
})
.catch((err) => {
console.error("Fehler beim Speichern der Mockdaten:", err);
alert("Fehler beim Speichern der TDR-Einstellungen.");
});
} else {
const base = `${window.location.origin}/CPL?/kabelueberwachung.html`;
const urls = [
`${base}&KTD${slot}=${daempfung.trim()}`,
`${base}&KTS${slot}=${geschwindigkeit.trim()}`,
`${base}&KTE${slot}=${trigger.trim()}`,
];
Promise.all(
urls.map((url) =>
fetch(url).then((res) => {
if (!res.ok) throw new Error(`Fehler bei ${url}`);
return res.text();
})
)
)
.then(() => {
alert("TDR-Einstellungen erfolgreich gesendet.");
})
.catch((err) => {
console.error("Fehler beim Senden:", err);
alert("Fehler beim Senden der TDR-Einstellungen.");
});
}
};
const handleTdrToggle = () => {
@@ -65,7 +94,7 @@ export default function TdrEinstellung({ slot }: Props) {
if (isDev) {
fetch(
`/api/cpl/updateTdrSettingsDataAPIHandler?slot=${slot}&value=${
`/api/cpl/updateTdrSettingsDataAPIHandler?key=win_tdrActive&slot=${slot}&value=${
newState ? 1 : 0
}`
)

View File

@@ -6,5 +6,5 @@
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
*/
const webVersion = "1.6.321";
const webVersion = "1.6.322";
export default webVersion;

View File

@@ -4,13 +4,15 @@ import path from "path";
import fs from "fs/promises";
export default async function handler(req, res) {
const { slot, value } = req.query;
const { slot, value, key } = req.query;
if (slot === undefined || value === undefined) {
return res.status(400).json({ error: "Missing slot or value" });
}
const key = "win_tdrActive";
if (!slot || !value || !key) {
return res.status(400).json({ error: "Missing slot, value, or key" });
}
const filePath = path.join(
process.cwd(),
"apiMockData/SERVICE/kabelueberwachungMockData.js"