From 9fcf03e3a7b1ad461b548c86609b79c50a78a264 Mon Sep 17 00:00:00 2001 From: nguyentrungthat <80239428+nguentrungthat@users.noreply.github.com> Date: Mon, 26 Jan 2026 14:54:47 +0700 Subject: [PATCH] Update check flash --- BACKEND/app/services/line_connection.ts | 21 ++++++++++++++------- BACKEND/app/ultils/helper.ts | 14 +++++++------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/BACKEND/app/services/line_connection.ts b/BACKEND/app/services/line_connection.ts index 141f04c..8d69a46 100644 --- a/BACKEND/app/services/line_connection.ts +++ b/BACKEND/app/services/line_connection.ts @@ -523,8 +523,13 @@ export default class LineConnection { this.config.inventory = this.config.inventory ? { ...this.config.inventory, ...dataVer } : dataVer - if (pid && dataVer?.MEMORY) { - await this.checkConfigRam(dataVer?.MEMORY, pid, cleanData(item.output)) + if (pid && (dataVer?.MEMORY || dataVer?.USB_FLASH)) { + await this.checkConfigRam( + dataVer?.MEMORY || '', + dataVer?.USB_FLASH || '', + pid, + cleanData(item.output) + ) } } if ( @@ -1598,20 +1603,22 @@ ${log} return '' } - async checkConfigRam(mem: string, pid: string, output: string) { + async checkConfigRam(mem: string, flash: string, pid: string, output: string) { const configRam = await detectConfigRamByModel(pid) if (configRam) { const isWarningRAM = isRamSufficient(mem, configRam.ram) - if (isWarningRAM) { - const subject = `[ATC] - [${this.config.stationName} - Line: ${this.config.lineNumber}] - Warning RAM Configuration` + const isWarningFlash = isRamSufficient(flash, configRam.flash) + if (isWarningRAM || isWarningFlash) { + const subject = `[ATC] - [${this.config.stationName} - Line: ${this.config.lineNumber}] - Warning RAM, Flash Configuration` const body = `
Station: ${this.config.stationName}
Line: ${this.config.lineNumber}
Model: ${pid}
-RAM: ${mem + ' bytes'} (default: ${configRam.ram})
+RAM: ${mem ? `${mem + ' bytes'} (default: ${configRam.ram})` : ''}
+FLASH: ${flash ? `${flash + ' bytes'} (default: ${configRam.flash})` : ''}