From b14a21088ec8dd5804c51bd6c14c21fd2fe71571 Mon Sep 17 00:00:00 2001 From: nguyentrungthat <80239428+nguentrungthat@users.noreply.github.com> Date: Mon, 10 Nov 2025 10:01:31 +0700 Subject: [PATCH] Update --- BACKEND/app/services/line_connection.ts | 13 +++++++++---- FRONTEND/src/App.tsx | 4 ++-- FRONTEND/src/components/ButtonAction.tsx | 7 +++++++ 3 files changed, 18 insertions(+), 6 deletions(-) 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",