feat: NTP-Einstellungen im GeneralSettings-Tab optimiert
- NTP Server 1–3, Zeitzone und Aktiv-Checkbox eingefügt - 2-Spalten-Layout für bessere Übersicht auf Laptop-Bildschirmen - Scrollbereich hinzugefügt, um Buttons bei kleiner Bildschirmhöhe sichtbar zu halten
This commit is contained in:
@@ -79,7 +79,40 @@ var win_kueLimit2Low = [
|
||||
0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
|
||||
0.1, 0.1,
|
||||
];
|
||||
var win_kueLimit2High = [ "undefined", 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_kueLimit2High = [
|
||||
"undefined",
|
||||
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,
|
||||
];
|
||||
|
||||
//Schleifenintervall (h) für Schleifenmessung
|
||||
var win_kueLoopInterval = [
|
||||
@@ -95,7 +128,40 @@ var win_kueVersion = [
|
||||
];
|
||||
|
||||
//Modulname in Komponente und auf der Anzeige
|
||||
var win_kueID = [ "FTZ_5", "B23", "Kabel 3", "Kabel 4", "Kabel 5", "Kabel 6", "FTZ4562", "Kabel 8", "12344", "Kabel 10", "Kabel 11", "Kabel 12", "Kabel 13", "Kabel 14", "Kabel 15", "H56-77", "Kabel 17", "Kabel 18", "Kabel 19", "Kabel 20", "Kabel 21", "Kabel 22", "Kabel 23", "Kabel 24", "Kabel 25", "Kabel 26", "Kabel 27", "Kabel 28", "Kabel 29", "Kabel 30", "Kabel 31", "Kabel 32", ];;;;
|
||||
var win_kueID = [
|
||||
"FTZ_5",
|
||||
"B23",
|
||||
"Kabel 3",
|
||||
"Kabel 4",
|
||||
"Kabel 5",
|
||||
"Kabel 6",
|
||||
"FTZ4562",
|
||||
"Kabel 8",
|
||||
"12344",
|
||||
"Kabel 10",
|
||||
"Kabel 11",
|
||||
"Kabel 12",
|
||||
"Kabel 13",
|
||||
"Kabel 14",
|
||||
"Kabel 15",
|
||||
"H56-77",
|
||||
"Kabel 17",
|
||||
"Kabel 18",
|
||||
"Kabel 19",
|
||||
"Kabel 20",
|
||||
"Kabel 21",
|
||||
"Kabel 22",
|
||||
"Kabel 23",
|
||||
"Kabel 24",
|
||||
"Kabel 25",
|
||||
"Kabel 26",
|
||||
"Kabel 27",
|
||||
"Kabel 28",
|
||||
"Kabel 29",
|
||||
"Kabel 30",
|
||||
"Kabel 31",
|
||||
"Kabel 32",
|
||||
];
|
||||
|
||||
//---------------------------------------------------
|
||||
|
||||
@@ -166,3 +232,9 @@ var win_tdrLast = [
|
||||
];
|
||||
|
||||
//---------------------------------------------------
|
||||
|
||||
var win_memoryInterval = [
|
||||
0, 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)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"use client"; // /components/main/settingsPageComponents/GeneralSettings.tsx
|
||||
"use client";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { RootState } from "../../../redux/store";
|
||||
import { useSelector } from "react-redux";
|
||||
@@ -40,6 +40,7 @@ const GeneralSettings: React.FC = () => {
|
||||
systemSettings.ntpTimezone || ""
|
||||
);
|
||||
const [active, setActive] = useState(systemSettings.ntpActive || false);
|
||||
|
||||
const handleLogin = async () => {
|
||||
handleAdminLogin(
|
||||
username,
|
||||
@@ -52,25 +53,23 @@ const GeneralSettings: React.FC = () => {
|
||||
setLoginSuccess(false);
|
||||
setError(errorMsg);
|
||||
},
|
||||
dispatch // ✅ hier übergeben
|
||||
dispatch
|
||||
);
|
||||
};
|
||||
|
||||
//-------------------------------
|
||||
useEffect(() => {
|
||||
if (!systemSettings.deviceName) {
|
||||
dispatch(fetchSystemSettingsThunk());
|
||||
}
|
||||
}, []);
|
||||
|
||||
//-------------------------------
|
||||
return (
|
||||
<div className="p-6 md:p-3 bg-gray-100 max-w-5xl mr-auto">
|
||||
<div className="p-6 md:p-3 bg-gray-100 max-w-5xl mr-auto overflow-y-auto max-h-[calc(100vh-200px)] ">
|
||||
<h2 className="text-sm md:text-md font-bold mb-2">
|
||||
Allgemeine Einstellungen
|
||||
</h2>
|
||||
<form className="grid grid-cols-1 md:grid-cols-2 gap-2">
|
||||
{/* ✅ Geräte-Name */}
|
||||
{/* Geräte-Name */}
|
||||
<div className="col-span-2">
|
||||
<label className="block text-xs md:text-sm font-medium">Name:</label>
|
||||
<input
|
||||
@@ -81,7 +80,7 @@ const GeneralSettings: React.FC = () => {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* ✅ MAC Adresse (nur Anzeige) */}
|
||||
{/* MAC Adresse */}
|
||||
<div>
|
||||
<label className="block text-xs md:text-sm font-medium">
|
||||
MAC Adresse 1:
|
||||
@@ -94,7 +93,7 @@ const GeneralSettings: React.FC = () => {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* ✅ Systemzeit & Setzen */}
|
||||
{/* Systemzeit */}
|
||||
<div className="flex flex-col md:flex-row md:items-center gap-1 col-span-2">
|
||||
<div className="flex-1">
|
||||
<label className="block text-xs md:text-sm font-medium">
|
||||
@@ -116,7 +115,7 @@ const GeneralSettings: React.FC = () => {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* ✅ Netzwerk-Einstellungen */}
|
||||
{/* Netzwerk */}
|
||||
<div>
|
||||
<label className="block text-xs md:text-sm font-medium">IP:</label>
|
||||
<input
|
||||
@@ -149,7 +148,63 @@ const GeneralSettings: React.FC = () => {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* ✅ Admin-Login/Logout */}
|
||||
{/* NTP */}
|
||||
<div className="md:grid md:grid-cols-2 md:gap-2 col-span-2">
|
||||
<div>
|
||||
<label className="block text-xs md:text-sm font-medium">
|
||||
NTP Server 1:
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
className="border border-gray-300 rounded h-8 p-1 w-full text-xs"
|
||||
value={ntp1}
|
||||
onChange={(e) => setNtp1(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label className="block text-xs md:text-sm font-medium">
|
||||
NTP Server 2:
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
className="border border-gray-300 rounded h-8 p-1 w-full text-xs"
|
||||
value={ntp2}
|
||||
onChange={(e) => setNtp2(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label className="block text-xs md:text-sm font-medium">
|
||||
NTP Server 3:
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
className="border border-gray-300 rounded h-8 p-1 w-full text-xs"
|
||||
value={ntp3}
|
||||
onChange={(e) => setNtp3(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label className="block text-xs md:text-sm font-medium">
|
||||
Zeitzone:
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
className="border border-gray-300 rounded h-8 p-1 w-full text-xs"
|
||||
value={ntpTimezone}
|
||||
onChange={(e) => setNtpTimezone(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-2 flex items-center gap-2 mt-2">
|
||||
<label className="text-xs md:text-sm font-medium">NTP aktiv:</label>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={active}
|
||||
onChange={(e) => setActive(e.target.checked)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Admin Login */}
|
||||
<div className="col-span-2 flex flex-col gap-1">
|
||||
{isAdminLoggedIn ? (
|
||||
<button
|
||||
@@ -186,13 +241,13 @@ const GeneralSettings: React.FC = () => {
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* ✅ Feedback für den Benutzer */}
|
||||
{/* Feedback */}
|
||||
{loginSuccess && (
|
||||
<p className="text-green-600 text-xs">Login erfolgreich!</p>
|
||||
)}
|
||||
{error && <p className="text-red-500 text-xs">{error}</p>}
|
||||
|
||||
{/* ✅ Buttons */}
|
||||
{/* Buttons */}
|
||||
<div className="col-span-2 flex flex-wrap md:justify-between gap-1 mt-2">
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
||||
|
||||
*/
|
||||
const webVersion = "1.6.273";
|
||||
const webVersion = "1.6.274";
|
||||
export default webVersion;
|
||||
|
||||
Reference in New Issue
Block a user