feat: add default timeout in script manager closes #352

This commit is contained in:
wh1te909
2021-03-31 03:01:46 +00:00
parent b686b53a9c
commit 87fa5ff7a6
11 changed files with 79 additions and 18 deletions

View File

@@ -511,9 +511,10 @@ export default {
}, 500);
},
runFavScript(scriptpk, agentpk) {
let default_timeout = this.favoriteScripts.find(i => i.value === scriptpk).timeout;
const data = {
pk: agentpk,
timeout: 900,
timeout: default_timeout,
scriptPK: scriptpk,
output: "forget",
args: [],
@@ -532,7 +533,7 @@ export default {
}
this.favoriteScripts = r.data
.filter(k => k.favorite === true)
.map(script => ({ label: script.name, value: script.id }))
.map(script => ({ label: script.name, value: script.id, timeout: script.default_timeout }))
.sort((a, b) => a.label.localeCompare(b.label));
});
},