diff --git a/BACKEND/app/services/line_connection.ts b/BACKEND/app/services/line_connection.ts index a7eb03c..8410791 100644 --- a/BACKEND/app/services/line_connection.ts +++ b/BACKEND/app/services/line_connection.ts @@ -1021,7 +1021,7 @@ export default class LineConnection { await sendMessageToMail( `[ATC] - [${this.config.stationName} - Line: ${this.config.lineNumber}] - Raw log issue ${result?.errors?.some((e) => e.category === 'SPECIAL_KEYWORD') ? '+ Special keywords' : ''}`, tableHTML + - `${` + `${`

Logs:

@@ -1062,9 +1062,9 @@ export default class LineConnection { ${r.rule} ${r.message} ${escapeHtml(r.log.trim()) - .split('*') - .filter((el) => el) - .join('
*')} + .split('*') + .filter((el) => el) + .join('
*')} ` ) @@ -1229,6 +1229,10 @@ Ports Missing/Down: ${missing.length}\n\n` lineId: this.config.id, data: ports, }) + if (ports.length === this.config.ports.length) { + this.sendReportPhysicalTest() + this.endTesting() + } } } catch (error) { console.log('checkingPhysicalPort', error) @@ -1433,7 +1437,7 @@ Ports Missing/Down: ${missing.length}\n\n` await sendMessageToMail( `[ATC] - [${this.config.stationName} - Line: ${this.config.lineNumber}] - Load IOS Report`, body + - `${` + `${`

Logs:

@@ -1471,7 +1475,7 @@ Ports Missing/Down: ${missing.length}\n\n` await sendMessageToMail( `[ATC] - [${this.config.stationName} - Line: ${this.config.lineNumber}] - Load License Report`, body + - `${` + `${`

Logs:

@@ -1776,15 +1780,15 @@ ${log}
${escapeHtml(output) - .replace('show ver', '') - .replace('sh ver', '') - .replace('show version', '') - .replace('sh version', '') - .replace(mem, `${mem}`) - .replace( - flash, - `${flash}` - )}
+ .replace('show ver', '') + .replace('sh ver', '') + .replace('show version', '') + .replace('sh version', '') + .replace(mem, `${mem}`) + .replace( + flash, + `${flash}` + )}
` await sendMessageToMail(subject, body) } @@ -1857,14 +1861,13 @@ ${log} IOS: ${dataShowVersion?.SOFTWARE_IMAGE ?? ''} ${dataShowVersion?.VERSION ?? ''}
MEM: ${dataShowVersion?.MEMORY ? convertFromKilobytesString(dataShowVersion?.MEMORY) : ''}
FLASH: ${dataShowVersion?.USB_FLASH ? convertFromKilobytesString(dataShowVersion?.USB_FLASH) : ''}
- Licenses: ${ - dataShowLic - ? dataShowLic - ?.filter((el) => el.LICENSE_TYPE?.toLowerCase()?.includes('permanent')) - ?.map((v) => v.FEATURE) - ?.join(', ') - : '' - }
+ Licenses: ${dataShowLic + ? dataShowLic + ?.filter((el) => el.LICENSE_TYPE?.toLowerCase()?.includes('permanent')) + ?.map((v) => v.FEATURE) + ?.join(', ') + : '' + }
Summary: ${summary}
Issues: ${issue?.length ? `
- ` + issue.join(`
- `) : 'No issues detected.'}

@@ -1872,23 +1875,21 @@ ${log} Total Ports: ${portPhysical?.length}
Ports Tested (Link UP): ${tested.length} (${testedPoE?.length} PoE, ${testedSFP?.length} SFP)
Ports Missing/Down: ${missing.length}
- ${ - missingPoE?.length - ? ` + ${missingPoE?.length + ? `
Ports Missing PoE
────────────────────────────────
${missingPoE.map((p) => physicalTest.normalizePortName(p.name)).join('
')}
` - : '' - } - ${ - missingSFP?.length - ? ` + : '' + } + ${missingSFP?.length + ? `
Ports Missing SFP
────────────────────────────────
${missingSFP.map((p) => physicalTest.normalizePortName(p.name)).join('
')}
` - : '' - } + : '' + } ${reasonSkipPhysical} diff --git a/BACKEND/app/services/physical_test_service.ts b/BACKEND/app/services/physical_test_service.ts index db25a9a..22bbfde 100644 --- a/BACKEND/app/services/physical_test_service.ts +++ b/BACKEND/app/services/physical_test_service.ts @@ -181,32 +181,29 @@ export class PhysicalPortTest {
- ${ - missing.length - ? ` + ${missing.length + ? ` ────────────────────────────────
Missing Ports
- ${ - missingPoE?.length - ? `` - : '' - } - ${ - missingSFP?.length - ? `` - : '' - } + : '' + }
+ ${missingPoE?.length + ? `
${missingPoE.map((p) => this.normalizePortName(p.name)).join('
')}
+ : '' + } + ${missingSFP?.length + ? `
${missingSFP.map((p) => this.normalizePortName(p.name)).join('
')}
` - : '' - } + : '' + }

`.trim() @@ -276,6 +273,10 @@ export class PhysicalPortTest { } }) } + if (ports.length === this.expectedPorts.length) { + this.done = true + this.onDone() + } } return this.getTestedPorts() diff --git a/BACKEND/app/ultils/templates/show_inventory.ts b/BACKEND/app/ultils/templates/show_inventory.ts index 28c4eba..c3bbf38 100644 --- a/BACKEND/app/ultils/templates/show_inventory.ts +++ b/BACKEND/app/ultils/templates/show_inventory.ts @@ -41,7 +41,8 @@ const parseLog = (data: string) => { }) // If "pid", "vid", or "sn" are matched, push a completed record if (currentRecord.pid || currentRecord.vid || currentRecord.sn) { - records.push({ ...currentRecord }) + if (!currentRecord?.name?.toLowerCase().includes('stack')) + records.push({ ...currentRecord }) currentRecord = { name: '', descr: '', diff --git a/BACKEND/providers/socket_io_provider.ts b/BACKEND/providers/socket_io_provider.ts index 531cf21..b72ebec 100644 --- a/BACKEND/providers/socket_io_provider.ts +++ b/BACKEND/providers/socket_io_provider.ts @@ -53,22 +53,22 @@ type StationAction = ( export default class SocketIoProvider { private static _io: CustomServer - constructor(protected app: ApplicationService) {} + constructor(protected app: ApplicationService) { } /** * Register bindings to the container */ - register() {} + register() { } /** * The container bindings have booted */ - async boot() {} + async boot() { } /** * The application has been booted */ - async start() {} + async start() { } /** * The process has been started @@ -83,7 +83,7 @@ export default class SocketIoProvider { /** * Preparing to shutdown the app */ - async shutdown() {} + async shutdown() { } public static get io() { return this._io @@ -100,7 +100,7 @@ export class WebSocketIo { lineConnecting: number[] = [] // key = lineId intervalKeepConnect: { [key: string]: NodeJS.Timeout } = {} - constructor(protected app: ApplicationService) {} + constructor(protected app: ApplicationService) { } async boot() { const SOCKET_IO_PORT = env.get('SOCKET_PORT') || 8989