From 91b2bdba7b6248a55d8e3819b01a63c17db100f4 Mon Sep 17 00:00:00 2001 From: nguyentrungthat <80239428+nguentrungthat@users.noreply.github.com> Date: Tue, 12 May 2026 14:22:45 +0700 Subject: [PATCH] Update form Summary --- BACKEND/app/services/line_connection.ts | 93 ++++++++++++------------- FRONTEND/src/App.tsx | 4 +- FRONTEND/src/components/CardLine.tsx | 2 +- 3 files changed, 50 insertions(+), 49 deletions(-) diff --git a/BACKEND/app/services/line_connection.ts b/BACKEND/app/services/line_connection.ts index 9a25183..947a1ba 100644 --- a/BACKEND/app/services/line_connection.ts +++ b/BACKEND/app/services/line_connection.ts @@ -1918,11 +1918,6 @@ Ports Missing/Down: ${missing.length}\n\n` snapConfig: LineConfig snapPhysical: PhysicalPortTest reason: string - outputTestLog: string - userTest: { - dpelp: { name: string; time: number } - physical: { name: string; time: number } - } }) => { if (this.debounceSendSummaryReport) clearTimeout(this.debounceSendSummaryReport) const timeZone = process.env.TIME_ZONE || 'Australia/Sydney' @@ -1960,7 +1955,7 @@ Ports Missing/Down: ${missing.length}\n\n` const aiIssue = issues.length > 0 ? issues.join('\n') : '' let summaryStatus = 'PASS' - const match = aiIssue.match(/^RESULT:\s*(PASS WITH WARNING|PASS|FAIL|INSUFFICIENT DATA)/im) + const match = aiIssue.match(/RESULT:\s*(PASS WITH WARNING|PASS|FAIL|INSUFFICIENT DATA)/im) if (match) { const status = match[1] summaryStatus = status @@ -2016,6 +2011,7 @@ Ports Missing/Down: ${missing.length}\n\n` const productPN = escapeHtml(String(config?.inventory?.pid || '')) const productSN = escapeHtml(String(config?.inventory?.sn || '')) const productVid = escapeHtml(String(config?.inventory?.vid || '')) + const iosName = escapeHtml(String(dataShowVersion?.SOFTWARE_IMAGE || '')) const iosVersion = escapeHtml(String(dataShowVersion?.VERSION || '')) const macAddress = escapeHtml(String(dataShowVersion?.MAC_ADDRESS || '')) const memDisplay = escapeHtml(memText !== '—' ? memText : '-') @@ -2153,7 +2149,7 @@ Ports Missing/Down: ${missing.length}\n\n` - -
+
Product Info
@@ -2166,19 +2162,19 @@ Ports Missing/Down: ${missing.length}\n\n`
+
Technical Specs
- + - + @@ -2210,24 +2206,28 @@ Ports Missing/Down: ${missing.length}\n\n` - - - @@ -2359,7 +2361,7 @@ Ports Missing/Down: ${missing.length}\n\n` Software Check - +
SpecificationActualActual Default
IOS-XE Version${iosVersion}${iosName + ' ' + iosVersion} ${'N/A'}
+
@@ -2258,14 +2258,30 @@ Ports Missing/Down: ${missing.length}\n\n`
Received
-
- Unknown +
+ Not Available
${momentTZ().tz(timeZone).format('DD MMM')}
+
+ - - @@ -2313,17 +2313,18 @@ Ports Missing/Down: ${missing.length}\n\n`
Receiving & Inspection Notes
⚠ Warning from Warehouse
-

Box arrived with slight indentation on the left corner. Internal foam was still intact. Serial number on box was partially obscured by shipping label but verified upon unboxing.

-
+

Box arrived with slight indentation on the left corner. Internal foam was still intact. Serial number on box was partially obscured by shipping label but verified upon unboxing.

+

Not Available

+
Accessory Checklist
- + + + +
Rackmount PSU (Internal) Console Cable Documents Original Box
Not Available
+
+ ✓ +
+ +
+ Visual Check +
+
+ Not Available +
+
+ ${momentTZ().tz(timeZone).format('DD MMM')} +
+
✓ @@ -2274,26 +2290,10 @@ Ports Missing/Down: ${missing.length}\n\n` Software Test
- ${snapshot?.userTest?.dpelp?.name || ''} + ${this?.userTest?.dpelp?.name || ''}
- ${momentTZ(snapshot?.userTest?.dpelp?.time).tz(timeZone).format('DD MMM, HH:mm')} -
-
-
- ✓ -
- -
- Physical Check -
-
- ${snapshot?.userTest?.physical?.name || ''} -
-
- ${momentTZ(snapshot?.userTest?.physical?.time).tz(timeZone).format('DD MMM, HH:mm')} + ${momentTZ(this?.userTest?.dpelp?.time).tz(timeZone).format('DD MMM, HH:mm')}
+ +
- +
- + +
- Physical Check + Visual Check ${snapshot?.userTest?.physical?.name || ''} · ${momentTZ(snapshot?.userTest?.physical?.time).tz(timeZone).format('DD MMM, HH:mm')}${this?.userTest?.physical?.name || ''} · ${momentTZ(this?.userTest?.physical?.time).tz(timeZone).format('DD MMM, HH:mm')}Not Available
@@ -2340,9 +2341,10 @@ Ports Missing/Down: ${missing.length}\n\n`
+ ${checklistRowsHtml} Not Available
${snapshot?.userTest?.dpelp?.name || ''} · ${momentTZ(snapshot?.userTest?.dpelp?.time).tz(timeZone).format('DD MMM, HH:mm')}${this?.userTest?.dpelp?.name || ''} · ${momentTZ(this?.userTest?.dpelp?.time).tz(timeZone).format('DD MMM, HH:mm')}
@@ -2401,7 +2403,7 @@ Ports Missing/Down: ${missing.length}\n\n`
- +
CONSOLE RAW OUTPUT (Boot Log snippet)
${snapshot?.outputTestLog || 'No test log available'}
${this?.outputTestLog || 'No test log available'}
@@ -2416,14 +2418,15 @@ Ports Missing/Down: ${missing.length}\n\n` this.updateNote(config?.inventory?.sn, this.dataDPELP as DataDPELP) await sendMessageToMail( - `[ATC] - [${config.stationName} - Line: ${config.lineNumber}] - [${this.config.inventory?.pid}] - [${this.config.inventory?.sn}] - Summary of Testing Results`, + `[ATC] - [${config.stationName} - L${config.lineNumber}] - ${this.config.inventory?.pid} - ${this.config.inventory?.sn} - Test Summary`, body ) + this.outputTestLog = '' this.socketIO.emit('summary_tested', { stationId: this.config.stationId, lineId: this.config.id, body: body, - title: `[${config.stationName} - Line: ${config.lineNumber}] - Summary of Testing Results`, + title: `[ATC] - [${config.stationName} - L${config.lineNumber}] - ${this.config.inventory?.pid} - ${this.config.inventory?.sn} - Test Summary`, }) } @@ -2465,8 +2468,6 @@ Ports Missing/Down: ${missing.length}\n\n` snapConfig: this.config, snapPhysical: this.physicalTest, reason: '', - outputTestLog: this.outputTestLog, - userTest: this.userTest, } this.debounceSendSummaryReport = setTimeout(() => { if (!this.config.listFeatureTested?.includes('PHYSICAL')) { @@ -2477,8 +2478,6 @@ Ports Missing/Down: ${missing.length}\n\n` this.config.listFeatureTested = ['DPELP', 'PHYSICAL', 'SUMMARY'] this.sendFeatureTested() this.sendReportSummaryV2(snapshot) - this.outputTestLog = '' - this.userTest = { dpelp: { name: '', time: 0 }, physical: { name: '', time: 0 } } }, timeout) } diff --git a/FRONTEND/src/App.tsx b/FRONTEND/src/App.tsx index c2642b7..802c85e 100644 --- a/FRONTEND/src/App.tsx +++ b/FRONTEND/src/App.tsx @@ -493,7 +493,9 @@ function App() { if ( valueLine && openModalTerminal && - selectedLine?.id === valueLine?.id + selectedLine?.id === valueLine?.id && + (!valueLine?.listPortsPhysical || + valueLine?.listPortsPhysical?.length === 0) ) setLinesConfirmSkipPort((pre) => [ ...pre, diff --git a/FRONTEND/src/components/CardLine.tsx b/FRONTEND/src/components/CardLine.tsx index c4c0333..8f22f54 100644 --- a/FRONTEND/src/components/CardLine.tsx +++ b/FRONTEND/src/components/CardLine.tsx @@ -158,7 +158,7 @@ const CardLine = ({ const text = lines.join("\n"); const match = text.match( - /^RESULT:\s*(PASS WITH WARNING|PASS|FAIL|INSUFFICIENT DATA)/im, + /RESULT:\s*(PASS WITH WARNING|PASS|FAIL|INSUFFICIENT DATA)/im, ); if (!match) {