Enable scenario run and reporting, adjust UI elements

Uncommented code to run scenarios and send reports via email and Zulip in the backend, and commented out the scenario confirmation modal in the frontend. Also adjusted the height of the ScrollArea in the BottomToolBar component for improved UI layout.
This commit is contained in:
nguyentrungthat 2025-12-18 08:12:23 +07:00
parent 4b130df801
commit 6e282c42bd
4 changed files with 29 additions and 30 deletions

View File

@ -473,11 +473,11 @@ export default class LineConnection {
// console.log(pid, scenario)
if (scenario && scenario.id !== script.id) {
this.outputScenario = ''
// this.runScript(scenario, userName)
this.socketIO.emit('confirm_scenario', {
scenario: scenario,
id: this.config.id,
})
this.runScript(scenario, userName)
// this.socketIO.emit('confirm_scenario', {
// scenario: scenario,
// id: this.config.id,
// })
resolve(true)
return
}
@ -490,13 +490,13 @@ export default class LineConnection {
},
data,
})
if (script?.send_result || script?.sendResult) {
this.dataDPELP = result
console.log(
`DPELP DATA line ${this.config.lineNumber} of ${this.config.stationName}:`,
this.dataDPELP
)
}
// if (script?.send_result || script?.sendResult) {
this.dataDPELP = result
console.log(
`DPELP DATA line ${this.config.lineNumber} of ${this.config.stationName}:`,
this.dataDPELP
)
// }
if (this.config.latestScenario)
this.config.latestScenario = { ...this.config.latestScenario, detectAI: detectLog }
this.config.data = data

View File

@ -574,24 +574,23 @@ export class WebSocketIo {
const linkWiki =
process.env.LINK_WIKI || 'https://logs.danielvu.com/api/wiki/page/insert?title=Dev_test'
// await axios.post(linkWiki, {
// data: tableHTML,
// titleAuto: `[${scenarioName || 'DPELP'}] - ${stationName} - ` + dataFormat,
// })
await axios.post(linkWiki, {
data: tableHTML,
titleAuto: `[${scenarioName || 'DPELP'}] - ${stationName} - ` + dataFormat,
})
await sendMessageToMail(
'andrew.ng@apactech.io',
`[${scenarioName || 'DPELP'}] - ${stationName} - ${dataFormat}`,
tableHTML
// ,
// ['ips@ipsupply.com.au', 'kay@ipsupply.com.au', 'joseph@apactech.io']
tableHTML,
['ips@ipsupply.com.au', 'kay@ipsupply.com.au', 'joseph@apactech.io']
)
await sendMessageToZulip(
'stream',
'ATC_Report',
station.name,
`\n\n---\n**[${scenarioName || 'DPELP'}] - ${stationName} - ${dataFormat}**\n\n` +
zulipMess
)
// await sendMessageToZulip(
// 'stream',
// 'ATC_Report',
// station.name,
// `\n\n---\n**[${scenarioName || 'DPELP'}] - ${stationName} - ${dataFormat}**\n\n` +
// zulipMess
// )
} catch (error) {
console.log(error)
}

View File

@ -52,7 +52,7 @@ import PageLogin from "./components/Authentication/LoginPage";
import DraggableTabs from "./components/DragTabs";
import { isJsonString } from "./untils/helper";
import BottomToolBar from "./components/BottomToolBar";
import ModalConfirmRunScenario from "./components/Modal/ModalConfirmRunScenario";
// import ModalConfirmRunScenario from "./components/Modal/ModalConfirmRunScenario";
const apiUrl = import.meta.env.VITE_BACKEND_URL;
@ -827,11 +827,11 @@ function App() {
scenarios={scenarios}
/>
<ModalConfirmRunScenario
{/* <ModalConfirmRunScenario
socket={socket}
station={stations.find((el) => el.id === Number(activeTab))}
scenarios={scenarios}
/>
/> */}
</Container>
);
}

View File

@ -193,7 +193,7 @@ const BottomToolBar = ({
>
<Flex justify={"space-between"} align="flex-start">
<Box>
<ScrollArea h={"11vh"}>
<ScrollArea h={"9vh"}>
<Flex wrap={"wrap"} gap={"8px"} w={"420px"}>
{selectedLines.map((el) => (
<Box