From 75acf0ed8c2fc39fa6a5aef2cc2fba62eefb6904 Mon Sep 17 00:00:00 2001 From: nguyentrungthat <80239428+nguentrungthat@users.noreply.github.com> Date: Mon, 2 Mar 2026 13:29:24 +0700 Subject: [PATCH] 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. --- BACKEND/app/services/line_connection.ts | 8 ++++++-- FRONTEND/src/components/Modal/ModalTerminal.tsx | 16 +++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/BACKEND/app/services/line_connection.ts b/BACKEND/app/services/line_connection.ts index d9b95af..a5b4304 100644 --- a/BACKEND/app/services/line_connection.ts +++ b/BACKEND/app/services/line_connection.ts @@ -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: ${ dataShowLic ? dataShowLic - ?.filter((el) => el.LICENSE_TYPE === 'Permanent') + ?.filter((el) => el.LICENSE_TYPE?.toLowerCase()?.includes('permanent')) ?.map((v) => v.FEATURE) ?.join(', ') : '' diff --git a/FRONTEND/src/components/Modal/ModalTerminal.tsx b/FRONTEND/src/components/Modal/ModalTerminal.tsx index 2e0c160..c0481c9 100644 --- a/FRONTEND/src/components/Modal/ModalTerminal.tsx +++ b/FRONTEND/src/components/Modal/ModalTerminal.tsx @@ -953,9 +953,10 @@ const ModalTerminal = ({ {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 = ({