fix: Initial-Bezeichnung für KÜ "---" entfernt
This commit is contained in:
@@ -7,6 +7,7 @@ import "bootstrap-icons/font/bootstrap-icons.css"; // Import Bootstrap Icons
|
|||||||
import handleSave from "./handlers/handleSave";
|
import handleSave from "./handlers/handleSave";
|
||||||
import handleDisplayEinschalten from "./handlers/handleDisplayEinschalten";
|
import handleDisplayEinschalten from "./handlers/handleDisplayEinschalten";
|
||||||
import handleChange from "./handlers/handleChange";
|
import handleChange from "./handlers/handleChange";
|
||||||
|
import firmwareUpdate from "./handlers/firmwareUpdate";
|
||||||
|
|
||||||
function decodeToken(token) {
|
function decodeToken(token) {
|
||||||
try {
|
try {
|
||||||
@@ -21,8 +22,8 @@ function decodeToken(token) {
|
|||||||
function KueModal({ showModal, onClose, slot, onModulNameChange }) {
|
function KueModal({ showModal, onClose, slot, onModulNameChange }) {
|
||||||
const [isAdmin, setIsAdmin] = useState(false);
|
const [isAdmin, setIsAdmin] = useState(false);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const [ids, setIds] = useState(Array(32).fill("---"));
|
const [ids, setIds] = useState(Array(32).fill(""));
|
||||||
const [bezeichnungen, setBezeichnungen] = useState(Array(32).fill("---"));
|
const [bezeichnungen, setBezeichnungen] = useState(Array(32).fill(""));
|
||||||
const [isolationsgrenzwerte, setIsolationsgrenzwerte] = useState(
|
const [isolationsgrenzwerte, setIsolationsgrenzwerte] = useState(
|
||||||
Array(32).fill(10.0)
|
Array(32).fill(10.0)
|
||||||
);
|
);
|
||||||
@@ -242,7 +243,10 @@ function KueModal({ showModal, onClose, slot, onModulNameChange }) {
|
|||||||
<div className="flex justify-end bg-gray-100 p-4 rounded-b-lg">
|
<div className="flex justify-end bg-gray-100 p-4 rounded-b-lg">
|
||||||
{/* Bedingte Anzeige der Firmware-Update-Schaltfläche */}
|
{/* Bedingte Anzeige der Firmware-Update-Schaltfläche */}
|
||||||
{isAdmin && (
|
{isAdmin && (
|
||||||
<button className="bg-littwin-blue text-white p-2 rounded flex items-center mr-2">
|
<button
|
||||||
|
onClick={() => firmwareUpdate(slot)}
|
||||||
|
className="bg-littwin-blue text-white p-2 rounded flex items-center mr-2"
|
||||||
|
>
|
||||||
Firmware Update
|
Firmware Update
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
|||||||
16
components/modales/kueModal/handlers/firmwareUpdate.js
Normal file
16
components/modales/kueModal/handlers/firmwareUpdate.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
const firmwareUpdate = (slot) => {
|
||||||
|
const url = `${window.location.origin}/CPL?/kabelueberwachung.html&KSU${slot}=1`;
|
||||||
|
fetch(url, { method: "GET" })
|
||||||
|
.then((response) => {
|
||||||
|
if (response.ok) {
|
||||||
|
alert(`Update an ${slot + 1} erfolgreich gestartet!`);
|
||||||
|
} else {
|
||||||
|
alert("Fehler beim Update!");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error("Fehler:", error);
|
||||||
|
alert("Fehler beim Update!");
|
||||||
|
});
|
||||||
|
};
|
||||||
|
export default firmwareUpdate;
|
||||||
Reference in New Issue
Block a user