From 3c54ae3a21f81775ea61c8b8d80a11dd92258c7d Mon Sep 17 00:00:00 2001 From: nguyentrungthat <80239428+nguentrungthat@users.noreply.github.com> Date: Tue, 25 Nov 2025 14:40:48 +0700 Subject: [PATCH] Improve UI logic and port name handling in components Updated DrawerControl to refine 'Select All' button logic and label. Adjusted FormAddEdit layout proportions for station info and lines. Enhanced ModalTerminal with normalized port name comparison and display. Improved TerminalXTerm loading state management and terminal reset behavior. --- FRONTEND/src/components/DrawerControl.tsx | 11 +++++----- FRONTEND/src/components/FormAddEdit.tsx | 4 ++-- FRONTEND/src/components/ModalTerminal.tsx | 26 ++++++++++++++++++++--- FRONTEND/src/components/TerminalXTerm.tsx | 10 ++++++--- 4 files changed, 38 insertions(+), 13 deletions(-) diff --git a/FRONTEND/src/components/DrawerControl.tsx b/FRONTEND/src/components/DrawerControl.tsx index 61fe0e1..d6c87a6 100644 --- a/FRONTEND/src/components/DrawerControl.tsx +++ b/FRONTEND/src/components/DrawerControl.tsx @@ -892,7 +892,8 @@ export const DrawerSwitchControl: React.FC = ({ className={classes.buttonMenuTool} disabled={isSubmit} title={ - listPortsSelected.length === listPorts.flat().length + listPortsSelected.length === listPorts.flat().length && + listPorts.flat().length > 0 ? "Deselect All" : "Select All" } @@ -908,10 +909,10 @@ export const DrawerSwitchControl: React.FC = ({ } }} > - {listPortsSelected.length === listPorts.flat().length - ? "Deselect All" - : "Select All"}{" "} - {"(" + listPorts.flat().length + ")"} + {listPortsSelected.length === listPorts.flat().length && + listPorts.flat().length > 0 + ? "Clear All" + : "Select All"}