Increase test interval and relax license check

Increase physical test polling interval from 5s to 15s (backend setInterval and frontend AutoProgress ms) to reduce polling frequency. Add handling to stop the interval when physicalTest.done, send the physical test report, and end testing. Change license filtering to be case-insensitive and match any value containing "permanent" (backend and frontend) so licenses are detected regardless of casing/format.
This commit is contained in:
nguyentrungthat 2026-03-02 13:29:24 +07:00
parent 7e422e4852
commit 75acf0ed8c
2 changed files with 15 additions and 9 deletions

View File

@ -1154,10 +1154,14 @@ export default class LineConnection {
const interval = setInterval(async () => {
if (!this.config.runningPhysical || this.config.status !== 'connected') {
clearInterval(interval)
} else if (this.physicalTest.done) {
clearInterval(interval)
this.sendReportPhysicalTest()
this.endTesting()
} else {
this.checkingPhysicalPort()
}
}, 5000)
}, 15000)
}
async checkingPhysicalPort() {
@ -1777,7 +1781,7 @@ ${log}
Licenses: <b>${
dataShowLic
? dataShowLic
?.filter((el) => el.LICENSE_TYPE === 'Permanent')
?.filter((el) => el.LICENSE_TYPE?.toLowerCase()?.includes('permanent'))
?.map((v) => v.FEATURE)
?.join(', ')
: ''

View File

@ -953,9 +953,10 @@ const ModalTerminal = ({
<Text size="md">
{findDataShowLicense()
? findDataShowLicense()
?.filter(
(el: TextTSMLicense) =>
el.LICENSE_TYPE === "Permanent"
?.filter((el: TextTSMLicense) =>
el.LICENSE_TYPE?.toLowerCase()?.includes(
"permanent"
)
)
?.map((v: TextTSMLicense) => v.FEATURE)
?.join(", ")
@ -1030,9 +1031,10 @@ const ModalTerminal = ({
sn: line?.inventory?.sn || "",
licenses: findDataShowLicense()
? findDataShowLicense()
?.filter(
(el: TextTSMLicense) =>
el.LICENSE_TYPE === "Permanent"
?.filter((el: TextTSMLicense) =>
el.LICENSE_TYPE?.toLowerCase()?.includes(
"permanent"
)
)
?.map((v: TextTSMLicense) => v.FEATURE)
: [],
@ -1187,7 +1189,7 @@ const ModalTerminal = ({
<Tabs.Panel value="physical">
<AutoProgress
start={isPhysicalTest || false}
ms={5000}
ms={15000}
style={{ marginTop: "8px" }}
/>
<fieldset>