Update
This commit is contained in:
parent
788f108b6a
commit
b14a21088e
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -495,7 +495,7 @@ function App() {
|
|||
setIsDisable(true);
|
||||
setTimeout(() => {
|
||||
setIsDisable(false);
|
||||
}, 10000);
|
||||
}, 5000);
|
||||
}}
|
||||
/>
|
||||
<ScrollArea h={"60vh"} style={{ paddingBottom: "12px" }}>
|
||||
|
|
@ -527,7 +527,7 @@ function App() {
|
|||
setIsDisable(true);
|
||||
setTimeout(() => {
|
||||
setIsDisable(false);
|
||||
}, 10000);
|
||||
}, 5000);
|
||||
}}
|
||||
scenario={el}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in New Issue