Update run dpelp
This commit is contained in:
parent
637bdfa16b
commit
f0b1a09fd4
|
|
@ -1,14 +1,7 @@
|
|||
import fs from 'node:fs'
|
||||
import { textfsmResults } from './../ultils/templates/index.js'
|
||||
import net from 'node:net'
|
||||
import {
|
||||
appendLog,
|
||||
cleanData,
|
||||
getLogWithTimeScenario,
|
||||
isValidJson,
|
||||
mapToLineFormat,
|
||||
sleep,
|
||||
} from '../ultils/helper.js'
|
||||
import { appendLog, cleanData, isValidJson, mapToLineFormat, sleep } from '../ultils/helper.js'
|
||||
import Scenario from '#models/scenario'
|
||||
import Station from '#models/station'
|
||||
import APCController from './apc_connection.js'
|
||||
|
|
@ -418,7 +411,7 @@ export default class LineConnection {
|
|||
this.config.lineNumber
|
||||
)
|
||||
|
||||
const logScenarios = getLogWithTimeScenario(this.outputScenario, now) || ''
|
||||
const logScenarios = this.outputScenario
|
||||
const data = textfsmResults(logScenarios, '')
|
||||
try {
|
||||
data.forEach((item) => {
|
||||
|
|
@ -485,9 +478,9 @@ export default class LineConnection {
|
|||
}
|
||||
|
||||
if (step.send) {
|
||||
this.outputScenario += `\n---send-command---"${step?.send ?? ''}"---${now}---\n`
|
||||
this.outputScenario += `\n---send-command---"${(step?.send ?? '').toString().replace(/\r/g, '\\r').replace(/\n/g, '\\n')}"---${now}---\n`
|
||||
appendLog(
|
||||
`\n---send-command---"${step?.send ?? ''}"---${now}---\n`,
|
||||
`\n---send-command---"${(step?.send ?? '').toString().replace(/\r/g, '\\r').replace(/\n/g, '\\n')}"---${now}---\n`,
|
||||
this.config.stationId,
|
||||
this.config.stationName,
|
||||
this.config.stationIp,
|
||||
|
|
|
|||
|
|
@ -567,8 +567,9 @@ export class WebSocketIo {
|
|||
await sendMessageToMail(
|
||||
'andrew.ng@apactech.io',
|
||||
`[DPELP] Report AUTO - ${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']
|
||||
)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
|
|
|
|||
|
|
@ -135,13 +135,13 @@ export const ButtonDPELP = ({
|
|||
repeat: "1",
|
||||
note: "",
|
||||
},
|
||||
{
|
||||
expect: "",
|
||||
send: "show platform",
|
||||
delay: "3000",
|
||||
repeat: "1",
|
||||
note: "",
|
||||
},
|
||||
// {
|
||||
// expect: "",
|
||||
// send: "show platform",
|
||||
// delay: "3000",
|
||||
// repeat: "1",
|
||||
// note: "",
|
||||
// },
|
||||
];
|
||||
socket?.emit(
|
||||
"run_scenario",
|
||||
|
|
|
|||
|
|
@ -406,6 +406,11 @@ const CardLine = ({
|
|||
selectedLines={[line]}
|
||||
isDisable={isDisabled}
|
||||
onClick={() => {
|
||||
socket?.emit("run_all_dpelp", {
|
||||
lineIds: [line?.id],
|
||||
stationName: stationItem.name,
|
||||
stationId: Number(stationItem.id),
|
||||
});
|
||||
setIsDisabled(true);
|
||||
setTimeout(() => {
|
||||
setIsDisabled(false);
|
||||
|
|
|
|||
|
|
@ -720,11 +720,9 @@ export const DrawerSwitchControl: React.FC<DrawerProps> = ({
|
|||
const [checkedActive, setCheckedActive] = useState("all");
|
||||
|
||||
useEffect(() => {
|
||||
if (!open) {
|
||||
setListPortsSelected([]);
|
||||
setLoading(true);
|
||||
}
|
||||
}, [open]);
|
||||
setListPortsSelected([]);
|
||||
setLoading(true);
|
||||
}, [stationId]);
|
||||
|
||||
useEffect(() => {
|
||||
const value = localStorage.getItem("show-switch-port");
|
||||
|
|
|
|||
Loading…
Reference in New Issue