From ba039431ef2f3555d0c9e1c3ecb1a3fb39bb9395 Mon Sep 17 00:00:00 2001 From: joseph le Date: Wed, 20 Sep 2023 16:15:27 +0700 Subject: [PATCH] add webhook gitea --- .../src/components/TestDevice/TestDevice.jsx | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/netmiko_client/src/components/TestDevice/TestDevice.jsx b/netmiko_client/src/components/TestDevice/TestDevice.jsx index 0031d4b..c73ef61 100644 --- a/netmiko_client/src/components/TestDevice/TestDevice.jsx +++ b/netmiko_client/src/components/TestDevice/TestDevice.jsx @@ -54,6 +54,7 @@ import { WebLinksAddon } from "xterm-addon-web-links"; const TestDevice = ({ socket, user }) => { const [isloading, setIsLoading] = useReducer((x) => x + 1, 0); const [print, setPrint] = useState(false); + // const [scanCheck, setScanCheck] = useState(false); const [openHistory, setOpenHistory] = useState(false); const [listLastLogs, setlistLastLogs] = useState([]); const [allStation, setAllStation] = useState([]); @@ -1157,8 +1158,17 @@ const TestDevice = ({ socket, user }) => { }); socket?.on("sendListDeviceOn", (data) => { + // console.log(data) setListDeviceOn(data); - + // console.log(Date.now(), data); + // data.map((t) => { + // // if (listTestAuto.filter((item) => item.id === t.id).length === 0) { + // temp.push(t.infoLine); + // station_temp.push(t.station); + // listMode.push(t.mode); + // // setListTestAuto((listTestAuto) => [...listTestAuto, t]) + // // } + // }); let temp = []; let station_temp = []; let listMode = []; @@ -1192,6 +1202,8 @@ const TestDevice = ({ socket, user }) => { created_by: user.username, }); } + // }, 5000); + // } } catch (error) { console.log(error); } @@ -1210,9 +1222,16 @@ const TestDevice = ({ socket, user }) => { // if (data.type === "input") { setIsLoading(); // } + + // if (data.type === "test") { + // getAllLastLog(); + // } + + // toast.success("update command") }); }, [socket]); console.log(listTestAuto); + // console.log(listDeviceOff); //Update list line run useEffect(() => { let temp = [];