From 850b7444356a9688fd8c80fb775ba56480d1e2ce Mon Sep 17 00:00:00 2001 From: "andrew.ng" Date: Wed, 3 Jun 2026 13:45:13 +0700 Subject: [PATCH] Update show Key issue when RESULT !== Pass --- BACKEND/app/services/line_connection.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/BACKEND/app/services/line_connection.ts b/BACKEND/app/services/line_connection.ts index 00f68e7..e9f7593 100644 --- a/BACKEND/app/services/line_connection.ts +++ b/BACKEND/app/services/line_connection.ts @@ -2100,7 +2100,7 @@ Ports Missing/Down: ${missing.length}\n\n` const configRam = await detectConfigRamByModel(config?.inventory?.pid) // AI issue rows (one per real AI issue, fall back to file's hardcoded row when none) - const aiIssueRowsHtml = + let aiIssueRowsHtml = issues.length > 0 ? issues.length > 1 ? issues @@ -2112,6 +2112,25 @@ Ports Missing/Down: ${missing.length}\n\n` .join('') : `
★ AI${escapeHtml(issues[0].split('\n')[0] || '')}
` : `` + const AIIssue = issues.join('\n') || 'No issues detected.' + + // Extract "Key issue" lines from AIIssue and append to aiIssueRowsHtml when summaryStatus !== 'PASS' + let keyIssueHtml = '' + if (summaryStatus !== 'PASS') { + const keyIssueRegex = /.*Key issue.*/gi + const keyIssueMatches = AIIssue.match(keyIssueRegex) + if (keyIssueMatches && keyIssueMatches.length > 0) { + keyIssueHtml = keyIssueMatches + .map( + (issue) => + `
${escapeHtml(issue)}
` + ) + .join('') + } + } + + // Append key issue HTML to aiIssueRowsHtml + if (summaryStatus !== 'PASS') aiIssueRowsHtml = aiIssueRowsHtml + keyIssueHtml // License boxes (real licenses if available, else file's hardcoded boxes) const licenseBoxesHtml =