docs: Zusatzfunktionen (Kai, 25.06.2025) in TODO.md ergänzt

This commit is contained in:
ISA
2025-06-25 11:42:42 +02:00
parent ca2a0cb00d
commit 2fcd0755a4
29 changed files with 369 additions and 122 deletions

View File

@@ -18,7 +18,13 @@ import handleAdminLogin from "./handlers/handleAdminLogin";
ReactModal.setAppElement("#__next");
function SettingModal({ showModal, onClose }) {
function SettingModal({
showModal,
onClose,
}: {
showModal: boolean;
onClose: () => void;
}) {
const { isAdminLoggedIn, logoutAdmin } = useAdminAuth(showModal);
const { formValues, setFormValues } = useSystemSettings(showModal);
@@ -72,9 +78,21 @@ function SettingModal({ showModal, onClose }) {
const [ntp2, setNtp2] = useState(ntp2_Redux || "");
const [ntp3, setNtp3] = useState(ntp3_Redux || "");
const [ntpTimezone, setNtpTimezone] = useState(ntpTimezone_Redux || "");
const [active, setActive] = useState(active_Redux || "");
const [active, setActive] = useState<boolean>(
typeof active_Redux === "boolean" ? active_Redux : active_Redux === "true"
);
const [originalValues, setOriginalValues] = useState({});
const [originalValues, setOriginalValues] = useState({
name: name,
ip: ip,
subnet: subnet,
gateway: gateway,
ntp1: ntp1,
ntp2: ntp2,
ntp3: ntp3,
ntpTimezone: ntpTimezone,
active: active,
});
const currentValues = {
name,
ip,
@@ -228,12 +246,14 @@ function SettingModal({ showModal, onClose }) {
</div>
<div>
<label className="block font-medium">NTP Active:</label>
<input
type="text"
<select
className="border border-gray-300 rounded p-1 xl:p-2 w-full"
value={active}
onChange={(e) => setActive(e.target.value)}
/>
value={active ? "true" : "false"}
onChange={(e) => setActive(e.target.value === "true")}
>
<option value="true">true</option>
<option value="false">false</option>
</select>
</div>
</div>
@@ -241,13 +261,13 @@ function SettingModal({ showModal, onClose }) {
<div className="flex flex-col md:flex-row justify-between mt-4 gap-2">
<button
className="bg-littwin-blue text-white px-3 py-1 xl:px-4 xl:py-2 rounded w-full md:w-auto"
onClick={handleReboot}
onClick={() => handleReboot()}
>
Neustart CPL
</button>
<button
onClick={() =>
isAdminLoggedIn ? handleAdminLogout() : setShowLoginForm(true)
isAdminLoggedIn ? logoutAdmin() : setShowLoginForm(true)
}
className="bg-littwin-blue text-white px-3 py-1 xl:px-4 xl:py-2 rounded w-full md:w-auto"
>