Merge pull request 'UI improvements and bug fixes for line and switch controls' (#16) from that into main

Reviewed-on: #16
This commit is contained in:
andrew.ng 2025-11-27 17:35:02 +11:00
commit bed6f9c8f7
5 changed files with 33 additions and 11 deletions

View File

@ -501,7 +501,7 @@ function App() {
style={{ style={{
margin: 0, margin: 0,
width: "100%", width: "100%",
overflowX: "hidden", // overflowX: "hidden",
}} }}
> >
{station.lines.map((line, i) => ( {station.lines.map((line, i) => (

View File

@ -212,7 +212,7 @@ const CardLine = ({
</Box> </Box>
</Flex> </Flex>
<Box w={"100%"}> <Box w={"100%"}>
<Flex direction={"column"} gap={"4px"} w={"100%"}> <Flex justify={"space-between"} gap={"4px"} w={"100%"}>
<div className={classes.info_line}> <div className={classes.info_line}>
PID:{" "} PID:{" "}
<Text <Text
@ -238,6 +238,20 @@ const CardLine = ({
"" ""
)} )}
</div> </div>
<div
style={{
fontSize: "11px",
color: "red",
}}
>
{line?.userOpenCLI
? (line?.userOpenCLI === user?.userName
? "You are"
: line?.userOpenCLI + " is") + " using"
: ""}
</div>
</Flex>
<Flex direction={"column"} gap={"4px"} w={"100%"}>
<div className={classes.info_line}> <div className={classes.info_line}>
SN:{" "} SN:{" "}
<Text <Text
@ -257,7 +271,7 @@ const CardLine = ({
</Text> </Text>
</div> </div>
</Flex> </Flex>
<Flex justify={"space-between"} w={"100%"}> <Flex justify={"space-between"} w={"100%"} display={"none"}>
<Box> <Box>
{/* {line?.tickets && line?.tickets?.length > 0 ? ( {/* {line?.tickets && line?.tickets?.length > 0 ? (
<Text fz={"13px"}> <Text fz={"13px"}>

View File

@ -10,7 +10,7 @@
.info_line { .info_line {
color: dimgrey; color: dimgrey;
font-size: 11px; font-size: 12px;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 4px; gap: 4px;

View File

@ -884,8 +884,14 @@ export const DrawerSwitchControl: React.FC<DrawerProps> = ({
}} }}
> >
<Box ps={"8px"} pt={"4px"}> <Box ps={"8px"} pt={"4px"}>
{dataStation?.switch ? ( {dataStation?.switch_control_ip ? (
RenderAPCStatus(dataStation?.switch) dataStation?.switch ? (
RenderAPCStatus(dataStation?.switch)
) : (
<Text fw={800} c="red" fz={"12px"}>
DISCONNECTED
</Text>
)
) : ( ) : (
<Text fw={800} c="red" fz={"12px"}> <Text fw={800} c="red" fz={"12px"}>
Switch not available Switch not available

View File

@ -520,11 +520,13 @@ const ModalTerminal = ({
<Text size="sm" fw={"bold"}> <Text size="sm" fw={"bold"}>
Issue: Issue:
</Text> </Text>
{line?.latestScenario?.detectAI?.issue?.map((el, i) => ( {(line?.latestScenario?.detectAI?.issue || [])?.map(
<Box key={i}> (el, i) => (
<Text size="sm">- {el}</Text> <Box key={i}>
</Box> <Text size="sm">- {el}</Text>
))} </Box>
)
)}
</Box> </Box>
</Box> </Box>
) : ( ) : (