diff --git a/BACKEND/app/controllers/healcheck_controller.ts b/BACKEND/app/controllers/healcheck_controller.ts index 4a95506..14a4ac6 100644 --- a/BACKEND/app/controllers/healcheck_controller.ts +++ b/BACKEND/app/controllers/healcheck_controller.ts @@ -54,7 +54,7 @@ export default class HealCheckController { serialNumberA: dataSN?.serialNumberA, productModelId: dataSN?.productModelId, orgId: dataSN?.orgId, - notes: dataSN?.notes, + testNotes: dataSN?.testNotes, }, }, { @@ -88,6 +88,11 @@ export default class HealCheckController { status: false, message: error?.message || 'Checking api wiki fail', }, + { + name: 'update-note-sn', + status: false, + message: error?.message || 'Checking api update note SN fail', + }, ], } } diff --git a/BACKEND/app/services/line_connection.ts b/BACKEND/app/services/line_connection.ts index 1f1fe62..35e3ea3 100644 --- a/BACKEND/app/services/line_connection.ts +++ b/BACKEND/app/services/line_connection.ts @@ -24,6 +24,7 @@ import redis from '@adonisjs/redis/services/main' import Line from '#models/line' import { ErrorRow, TestResult } from '../ultils/types.js' import moment from 'moment' +import momentTZ from 'moment-timezone' type Inventory = { pid: string @@ -872,13 +873,14 @@ export default class LineConnection { .map( (r) => `
Line: ${this.config.lineNumber} - Station: ${this.config.stationName}
-Summary: ${result.summary}
+Summary: ${result.summary}. ${value.summary}
AI Detected:
- ${tableAI} ` } @@ -932,7 +931,9 @@ export default class LineConnection { : data.license ? [data.license] : [] - const note = `\n\n-------ATC-${moment(new Date()).format('YYYY/MM/DD')}-------\nLicense: ${licenses.join(', ')}\nIssues:\n${data.issues?.length ? `- ` + data.issues.join(`\n- `) : ''}` + const timeZone = process.env.TIME_ZONE || 'Australia/Sydney' + const dataFormat = momentTZ().tz(timeZone).format('YYYY/MM/DD, HH:mm') + const note = `-------[ATC]-[${dataFormat}]-------\nLicense: ${licenses.join(', ')}\nSummary: ${data?.summary || ''}\nIssues:\n${data.issues?.length ? `- ` + data.issues.join(`\n- `) : ''}\n\n` await updateNoteToERP(sn, note) } } diff --git a/BACKEND/app/ultils/helper.ts b/BACKEND/app/ultils/helper.ts index 598a8da..5473326 100644 --- a/BACKEND/app/ultils/helper.ts +++ b/BACKEND/app/ultils/helper.ts @@ -650,7 +650,7 @@ export async function updateNoteToERP(sn: string, note: string) { serialNumberA: dataSN?.serialNumberA, productModelId: dataSN?.productModelId, orgId: dataSN?.orgId, - notes: (dataSN?.notes || '') + note, + testNotes: note + (dataSN?.testNotes || ''), } // console.log(payload) await axios.post( diff --git a/FRONTEND/src/components/Modal/ModalTerminal.tsx b/FRONTEND/src/components/Modal/ModalTerminal.tsx index 3739784..6353068 100644 --- a/FRONTEND/src/components/Modal/ModalTerminal.tsx +++ b/FRONTEND/src/components/Modal/ModalTerminal.tsx @@ -27,6 +27,7 @@ import TerminalCLI from "../TerminalXTerm"; import type { Socket } from "socket.io-client"; import { useEffect, useMemo, useState } from "react"; import { + IconCaretRight, IconCircleCheckFilled, IconCircleDot, IconInfoCircle, @@ -82,6 +83,8 @@ const ModalTerminal = ({ const [valueBaud, setValueBaud] = useState