esLint
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
"use client"; // components/header/settingsModal/SettingsModal.tsx
|
||||
import React, { useState, useEffect } from "react";
|
||||
import React, { useState } from "react";
|
||||
import ReactModal from "react-modal";
|
||||
import "bootstrap-icons/font/bootstrap-icons.css";
|
||||
import { RootState } from "../../../redux/store";
|
||||
@@ -8,13 +8,7 @@ import handleClearDatabase from "./handlers/handleClearDatabase";
|
||||
import handleReboot from "./handlers/handleReboot";
|
||||
import handleSetDateTime from "./handlers/handleSetDateTime";
|
||||
import handleSubmit from "./handlers/handleSubmit";
|
||||
import bcrypt from "bcryptjs";
|
||||
import CryptoJS from "crypto-js";
|
||||
import { useAdminAuth } from "./hooks/useAdminAuth";
|
||||
import { useSystemSettings } from "./hooks/useSystemSettings";
|
||||
import { generateKeyAndIV, generateToken } from "./utils/cryptoUtils";
|
||||
import USERS from "./config/users";
|
||||
import handleAdminLogin from "./handlers/handleAdminLogin";
|
||||
|
||||
ReactModal.setAppElement("#__next");
|
||||
|
||||
@@ -27,13 +21,6 @@ function SettingModal({
|
||||
}) {
|
||||
const { isAdminLoggedIn, logoutAdmin } = useAdminAuth(showModal);
|
||||
|
||||
const { formValues, setFormValues } = useSystemSettings(showModal);
|
||||
|
||||
const [username, setUsername] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
const [error, setError] = useState("");
|
||||
const [showLoginForm, setShowLoginForm] = useState(false);
|
||||
|
||||
const deviceName_Redux = useSelector(
|
||||
(state: RootState) => state.systemSettingsSlice.deviceName
|
||||
);
|
||||
@@ -69,11 +56,11 @@ function SettingModal({
|
||||
);
|
||||
|
||||
const [name, setName] = useState(deviceName_Redux || "");
|
||||
const [mac1, setMac1] = useState(mac1_Redux || "");
|
||||
const [mac1] = useState(mac1_Redux || "");
|
||||
const [ip, setIp] = useState(ip_Redux || "");
|
||||
const [subnet, setSubnet] = useState(subnet_Redux || "");
|
||||
const [gateway, setGateway] = useState(gateway_Redux || "");
|
||||
const [systemUhr, setSystemUhr] = useState(datetime_Redux || "");
|
||||
const [systemUhr] = useState(datetime_Redux || "");
|
||||
const [ntp1, setNtp1] = useState(ntp1_Redux || "");
|
||||
const [ntp2, setNtp2] = useState(ntp2_Redux || "");
|
||||
const [ntp3, setNtp3] = useState(ntp3_Redux || "");
|
||||
@@ -82,7 +69,7 @@ function SettingModal({
|
||||
typeof active_Redux === "boolean" ? active_Redux : active_Redux === "true"
|
||||
);
|
||||
|
||||
const [originalValues, setOriginalValues] = useState({
|
||||
const [originalValues] = useState({
|
||||
name: name,
|
||||
ip: ip,
|
||||
subnet: subnet,
|
||||
@@ -93,6 +80,8 @@ function SettingModal({
|
||||
ntpTimezone: ntpTimezone,
|
||||
active: active,
|
||||
});
|
||||
|
||||
// const [showLoginForm, setShowLoginForm] = useState(false);
|
||||
const currentValues = {
|
||||
name,
|
||||
ip,
|
||||
@@ -266,9 +255,7 @@ function SettingModal({
|
||||
Neustart CPL
|
||||
</button>
|
||||
<button
|
||||
onClick={() =>
|
||||
isAdminLoggedIn ? logoutAdmin() : setShowLoginForm(true)
|
||||
}
|
||||
onClick={() => (isAdminLoggedIn ? logoutAdmin() : null)}
|
||||
className="bg-littwin-blue text-white px-3 py-1 xl:px-4 xl:py-2 rounded w-full md:w-auto"
|
||||
>
|
||||
{isAdminLoggedIn ? "Admin abmelden" : "Admin anmelden"}
|
||||
|
||||
Reference in New Issue
Block a user