diff --git a/FRONTEND/src/App.tsx b/FRONTEND/src/App.tsx index 8d30158..c8b486c 100644 --- a/FRONTEND/src/App.tsx +++ b/FRONTEND/src/App.tsx @@ -458,7 +458,8 @@ function App() { borderRadius: 8, }}> - - { - setExpanded((prev) => !prev); - }} - > - {isExpand ? ( - - ) : ( - - )} - + {/* ActionIcon đặt bên ngoài Box để không bị overflow: hidden cắt */} + { + setExpanded((prev) => !prev); + }} + > + {isExpand ? ( + + ) : ( + + )} + + - - + + {isExpand ? ( - + {selectedLines.map((el) => ( ) : ( - - - - + + + {/* Danh sách Line - chiếm 1 phần, cố định width và height, hiển thị 2 hàng */} + + {selectedLines.map((el) => ( { selectedLines.forEach((line) => { @@ -767,11 +779,39 @@ const BottomToolBar = ({ )} - - - Selected: {selectedLines.length} /{" "} - {station.lines.length} - + + + {/* Selected count - ở giữa */} + + + Selected: {selectedLines.length} /{" "} + {station.lines.length} + + + + {/* Input + Select All - chiếm 1 phần */} + + {/* Input */} + + + + + {/* Select All */} + - - - )} @@ -822,6 +855,129 @@ const BottomToolBar = ({ + {openScenarioModal && ( +
setOpenScenarioModal(false)} + > +
e.stopPropagation()} + > + {/* Header */} + + + 🎯 Select Scenario to Run + + + + setOpenScenarioModal(false)} + /> + + + + {/* Content */} +
+ {scenarios.length > 0 ? ( + + {scenarios.map((scenario, index) => ( + + ))} + + ) : ( + + + 📋 + + + No scenarios available + + + Please create a new scenario to get started + + + )} +
+
+
+ )} + {/* Drawer Scenario để Add/Edit */} = ({ - + {listPorts?.length > 0 && ( @@ -1217,6 +1217,7 @@ export const DrawerSwitchControl: React.FC = ({ style={{ flex: "0 0 auto", position: "relative", + justifyContent: "center", width: "34px", height: "28px", backgroundColor: @@ -1248,7 +1249,7 @@ export const DrawerSwitchControl: React.FC = ({ flexWrap: "wrap", }} > - + {normalizePortName(port.name)} @@ -1288,8 +1289,9 @@ export const DrawerSwitchControl: React.FC = ({ style={{ flex: "0 0 auto", position: "relative", - width: "40px", - height: "32px", + justifyContent: "center", + width: "34px", + height: "28px", backgroundColor: port.poe === "ON" ? "#f2dcf8" @@ -1319,7 +1321,7 @@ export const DrawerSwitchControl: React.FC = ({ flexWrap: "wrap", }} > - + {normalizePortName(port.name)}
@@ -1359,11 +1361,11 @@ export const DrawerSwitchControl: React.FC = ({ - + {sortedPorts(group) .slice( 0, @@ -1382,8 +1384,9 @@ export const DrawerSwitchControl: React.FC = ({ style={{ flex: "0 0 auto", position: "relative", - width: "40px", - height: "32px", + justifyContent: "center", + width: "34px", + height: "28px", backgroundColor: port.poe === "ON" ? "#f2dcf8" @@ -1413,7 +1416,7 @@ export const DrawerSwitchControl: React.FC = ({ flexWrap: "wrap", }} > - + {normalizePortName(port.name)} @@ -1434,7 +1437,7 @@ export const DrawerSwitchControl: React.FC = ({ ))} - + {sortedPorts(group) .slice( Math.ceil(sortedPorts(group).length / 2), @@ -1453,8 +1456,9 @@ export const DrawerSwitchControl: React.FC = ({ style={{ flex: "0 0 auto", position: "relative", - width: "50px", - height: "40px", + justifyContent: "center", + width: "34px", + height: "28px", backgroundColor: port.poe === "ON" ? "#f2dcf8" @@ -1484,7 +1488,7 @@ export const DrawerSwitchControl: React.FC = ({ flexWrap: "wrap", }} > - + {normalizePortName(port.name)}
diff --git a/FRONTEND/src/components/InputHistory.tsx b/FRONTEND/src/components/InputHistory.tsx index 292554a..5ffd2dc 100644 --- a/FRONTEND/src/components/InputHistory.tsx +++ b/FRONTEND/src/components/InputHistory.tsx @@ -10,10 +10,12 @@ export default function InputHistory({ selectedLines, socket, station, + inputStyle, }: { selectedLines: TLine[]; socket: Socket | null; station: TStation; + inputStyle?: React.CSSProperties; }) { const [value, setValue] = useState(""); const [history, setHistory] = useState([]); @@ -115,6 +117,7 @@ export default function InputHistory({ style={{ width: "30vw", boxShadow: "0px 0px 10px rgba(0, 0, 0, 0.1)", + ...inputStyle, }} placeholder={"Send command to port(s)"} value={value}