diff --git a/FRONTEND/src/App.tsx b/FRONTEND/src/App.tsx index dc250a2..57ae4db 100644 --- a/FRONTEND/src/App.tsx +++ b/FRONTEND/src/App.tsx @@ -287,6 +287,7 @@ function App() { socket.off("user_close_cli"); socket.off("confirm_take_over"); socket.off("response_content_log"); + socket.off("data_textfsm"); }; }, [socket, stations, selectedLine]); @@ -366,7 +367,6 @@ function App() { useEffect(() => { return () => { - console.log("CLEANUP SOCKET CLI", selectedLine); if (selectedLine) socket?.emit("close_cli", { lineId: selectedLine?.id, @@ -511,10 +511,17 @@ function App() { socket={socket} selectedLines={selectedLines.filter( (el) => - typeof el?.userEmailOpenCLI === "undefined" || + !el?.userEmailOpenCLI || el?.userEmailOpenCLI === user?.email )} - isDisable={isDisable || selectedLines.length === 0} + isDisable={ + isDisable || + selectedLines.filter( + (el) => + !el?.userEmailOpenCLI || + el?.userEmailOpenCLI === user?.email + ).length === 0 + } onClick={() => { setSelectedLines([]); setIsDisable(true); diff --git a/FRONTEND/src/components/CardLine.tsx b/FRONTEND/src/components/CardLine.tsx index 426c256..aa2964b 100644 --- a/FRONTEND/src/components/CardLine.tsx +++ b/FRONTEND/src/components/CardLine.tsx @@ -113,6 +113,7 @@ const CardLine = ({ isDisabled={ typeof line?.userOpenCLI !== "undefined" && typeof line?.userOpenCLI === "string" && + line?.userOpenCLI.length > 0 && line?.userOpenCLI !== user?.userName } line_status={line?.status || ""}