Update UI card line view listFeatureTested

This commit is contained in:
nguyentrungthat 2026-02-10 14:28:43 +07:00
parent 215cd4fbe4
commit 0cc78e8715
4 changed files with 66 additions and 33 deletions

View File

@ -1710,7 +1710,7 @@ ${log}
const body = `<table cellpadding="6" cellspacing="0" border="1" style="margin-top: 10px; border-collapse: collapse; width: 100%">
<tr>
<td style="width: 50%; text-align: center;">DPELP</td>
<td style="text-align: center;">Physical Test</td>
<td style="text-align: center;">Physical Testing</td>
</tr>
<tr>
<td style="width: 50%;">
@ -1720,7 +1720,7 @@ ${log}
IOS: <b>${dataShowVersion?.SOFTWARE_IMAGE ?? ''}</b> <b>${dataShowVersion?.VERSION ?? ''}</b><br/>
MEM: <b>${dataShowVersion?.MEMORY ?? ''}</b><br/>
FLASH: <b>${dataShowVersion?.USB_FLASH ?? ''}</b><br/>
License: <b>${
Licenses: <b>${
dataShowLic
? dataShowLic
?.filter((el) => el.LICENSE_TYPE === 'Permanent')
@ -1729,18 +1729,18 @@ ${log}
: ''
}</b><br/>
Summary: <b>${this.config?.latestScenario?.detectAI?.summary || ''}</b><br/>
Issue: <b>${issue?.length ? `<br>- ` + issue.join(`<br>- `) : 'No issues detected.'}</b><br/>
Issues: <b>${issue?.length ? `<br>- ` + issue.join(`<br>- `) : 'No issues detected.'}</b><br/>
</td>
<td>
Total Ports: ${portPhysical?.length}<br/>
Ports Tested (UP): <b style="color: #008000;">${portPhysical.filter((p) => p.tested).length}</b><br/>
Ports Missing: <b style="color: #ff0000;">${portPhysical.filter((p) => !p.tested).length}</b><br/>
Ports Tested (Link UP): <b style="color: #008000;">${portPhysical.filter((p) => p.tested).length}</b><br/>
Ports Missing/Down: <b style="color: #ff0000;">${portPhysical.filter((p) => !p.tested).length}</b><br/>
</td>
</tr>
</table>`
await sendMessageToMail(
`[ATC] - [${this.config.stationName} - Line: ${this.config.lineNumber}] - Summary Fully Tested`,
`[ATC] - [${this.config.stationName} - Line: ${this.config.lineNumber}] - Summary of Testing Results`,
body
)
}

View File

@ -408,6 +408,10 @@ const BottomToolBar = ({
stationId: Number(station.id),
});
});
setIsDisable(true);
setTimeout(() => {
setIsDisable(false);
}, 10000);
}}
>
Physical

View File

@ -337,28 +337,50 @@ const CardLine = ({
</motion.div>
)}
</Flex>
<Flex justify={"space-between"} w={"100%"} display={"none"}>
<Box>
{/* {line?.tickets && line?.tickets?.length > 0 ? (
<Text fz={"13px"}>
<i>{line?.tickets[0].description ?? ""}</i>
</Text>
) : (
""
)} */}
</Box>
<div
style={{
fontSize: "11px",
color: "red",
}}
>
{line?.userOpenCLI
? (line?.userOpenCLI === user?.userName
? "You are"
: line?.userOpenCLI + " is") + " using"
: ""}
</div>
<Flex
align={"center"}
gap={"4px"}
w={"100%"}
style={{
minHeight: "20px",
paddingBottom: "4px",
paddingTop: "2px",
}}
>
{line?.listFeatureTested?.includes("DPELP") ? (
<Text
style={{
border: "1px solid #ccc",
borderRadius: "16px",
paddingLeft: "4px",
paddingRight: "4px",
backgroundColor: "#5aadf1",
}}
fz={"9px"}
c={"dark"}
>
DPELP
</Text>
) : (
""
)}
{line?.listFeatureTested?.includes("PHYSICAL") ? (
<Text
style={{
border: "1px solid #ccc",
borderRadius: "16px",
paddingLeft: "4px",
paddingRight: "4px",
backgroundColor: "#69da53",
}}
fz={"9px"}
c={"dark"}
>
Physical
</Text>
) : (
""
)}
</Flex>
</Box>
</Flex>

View File

@ -138,11 +138,18 @@ const ModalTerminal = ({
}, [opened, line?.listFeatureTested]);
useEffect(() => {
if (opened && line?.tickets && line?.tickets?.length > 0) {
const data = line?.tickets[0];
setLatestTicket(data);
setDataTicket({ ...data, description: "" });
} else {
// if (opened && line?.tickets && line?.tickets?.length > 0) {
// const data = line?.tickets[0];
// setLatestTicket(data);
// setDataTicket({ ...data, description: "" });
// } else {
// setLatestTicket(INIT_TICKET);
// setDataTicket(INIT_TICKET);
// setValueBaud("");
// setActiveStep(0);
// setActiveTabs("general");
// }
if (!opened) {
setLatestTicket(INIT_TICKET);
setDataTicket(INIT_TICKET);
setValueBaud("");