Update gpt, form

This commit is contained in:
nguyentrungthat 2026-05-18 13:16:04 +07:00
parent f9ac92ddf9
commit 507f228888
2 changed files with 17 additions and 10 deletions

1
BACKEND/.gitignore vendored
View File

@ -29,3 +29,4 @@ storage/system_logs
storage/ios
storage/i
storage/license
storage/report_sn

View File

@ -537,14 +537,6 @@ export default class LineConnection {
}, 5000)
return
} else if (timeoutTimer) clearTimeout(timeoutTimer)
this.outputScenario += `\n---end-scenarios---${now}---${userName}---\n`
this.outputBuffer = ''
this.config.runningScenario = ''
this.socketIO.emit('running_scenario', {
stationId: this.config.stationId,
lineId: this.config.id,
title: '',
})
const logScenarios = this.outputScenario
const data = textfsmResults(logScenarios, '')
@ -604,6 +596,9 @@ export default class LineConnection {
scenario.title.includes('DPELP') &&
script.title.includes('DPELP')
) {
this.outputScenario += `\n---end-scenarios---${now}---${userName}---\n`
this.outputBuffer = ''
this.config.runningScenario = ''
this.listScenarios.push(scenario.id)
// this.outputScenario = ''
this.runScript(scenario, userName)
@ -651,6 +646,14 @@ export default class LineConnection {
// this.updateNote(result.sn, result)
// }
}
this.outputScenario += `\n---end-scenarios---${now}---${userName}---\n`
this.outputBuffer = ''
this.config.runningScenario = ''
this.socketIO.emit('running_scenario', {
stationId: this.config.stationId,
lineId: this.config.id,
title: '',
})
this.config.data = data
this.socketIO.emit('data_textfsm', {
stationId: this.config.stationId,
@ -910,7 +913,6 @@ export default class LineConnection {
const payload = {
model: 'gpt-5-mini',
max_tokens: 1000,
messages: [
{
role: 'user',
@ -935,6 +937,7 @@ export default class LineConnection {
},
}
)
console.log('AI detect log response:', remoteResp.data)
return remoteResp.data?.Status === 'OK' ? remoteResp.data?.data : ''
} catch (error: any) {
console.log('[ERROR] Detect log from AI', error)
@ -2277,7 +2280,10 @@ Ports Missing/Down: ${missing.length}\n\n`
<tr><td style="padding-bottom:10px;">
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="background:#fff;border:1px solid #e5e7eb;border-radius:10px;border-collapse:separate;">
<tr><td style="padding:16px 20px;">
<div style="font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.8px;color:#9ca3af;padding-bottom:7px;border-bottom:1px solid #f0f1f3;margin-bottom:10px;">Receiving &amp; Inspection Notes</div>
<div style="display:flex;justify-content:space-between; align-items:center;border-bottom:1px solid #f0f1f3;padding-bottom:10px;">
<div style="font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.8px;color:#9ca3af;">Receiving &amp; Inspection Notes</div>
<div style="color:#222222;font-size:11px;font-weight:500;opacity:.65;">${dataIncomingBySN?.packagePo?.receivedBy?.fullName || 'Unknown'} · ${dataIncomingBySN?.packagePo?.receivedDate ? momentTZ(dataIncomingBySN?.packagePo?.receivedDate).tz(timeZone).format('DD MMM, HH:mm') : ''}</div>
</div>
<div style="padding:10px 14px;background:#fffbeb;border-left:3px solid #f59e0b;border-radius:0 6px 6px 0;font-size:12px;color:#92400e;margin-bottom:8px;">
<div style="font-weight:700;margin-bottom:4px;font-size:11px;">&#9888; Warning from Warehouse</div>
<p style="margin:0;">${dataIncomingBySN?.packagePo?.notes || ''}</p>