diff --git a/BACKEND/app/services/line_connection.ts b/BACKEND/app/services/line_connection.ts index 489c069..4f9b30b 100644 --- a/BACKEND/app/services/line_connection.ts +++ b/BACKEND/app/services/line_connection.ts @@ -118,7 +118,11 @@ export default class LineConnection { lineId: id, data: message, }) - if (!this.config.inventory) this.getInventory(this.outputScenario) + if (!this.config.inventory) { + setTimeout(() => { + this.getInventory() + }, 3000) + } appendLog(message, this.config.stationId, this.config.lineNumber, this.config.port) }) @@ -277,7 +281,8 @@ export default class LineConnection { if ( ['show inventory', 'sh inventory', 'show inv', 'sh inv'].includes( item.command - ) + ) && + !this.config.inventory ) { this.config.inventory = JSON.parse(item.textfsm)[0] } @@ -466,8 +471,8 @@ export default class LineConnection { } } - getInventory = (log: string) => { - const data = textfsmResults(log, 'show inventory') + getInventory = () => { + const data = textfsmResults(this.outputScenario, 'show inventory') try { data.forEach((item) => { if (item?.textfsm && isValidJson(item?.textfsm)) { diff --git a/FRONTEND/src/App.tsx b/FRONTEND/src/App.tsx index 57ae4db..0c3b2a1 100644 --- a/FRONTEND/src/App.tsx +++ b/FRONTEND/src/App.tsx @@ -495,7 +495,7 @@ function App() { setIsDisable(true); setTimeout(() => { setIsDisable(false); - }, 10000); + }, 5000); }} /> @@ -527,7 +527,7 @@ function App() { setIsDisable(true); setTimeout(() => { setIsDisable(false); - }, 10000); + }, 5000); }} scenario={el} /> diff --git a/FRONTEND/src/components/ButtonAction.tsx b/FRONTEND/src/components/ButtonAction.tsx index ac558a6..a3406e5 100644 --- a/FRONTEND/src/components/ButtonAction.tsx +++ b/FRONTEND/src/components/ButtonAction.tsx @@ -54,6 +54,13 @@ export const ButtonDPELP = ({ repeat: "1", note: "", }, + { + expect: "", + send: "show version | include License", + delay: "1000", + repeat: "1", + note: "", + }, { expect: "", send: "show diag",