more run script rework

This commit is contained in:
wh1te909
2021-07-16 06:11:40 +00:00
parent f1a63eac80
commit 14dfdf4488
2 changed files with 15 additions and 2 deletions

View File

@@ -19,7 +19,7 @@
<script>
// composition imports
import { ref, computed, watch } from "vue";
import { ref, computed, watch, onMounted } from "vue";
import { useStore } from "vuex";
import { formatDate, formatTableColumnText } from "@/utils/format";
import { fetchAgentHistory } from "@/api/agents";
@@ -83,6 +83,11 @@ export default {
}
});
// vue component hooks
onMounted(() => {
getHistory();
});
return {
// reactive
history,

View File

@@ -112,7 +112,7 @@
// composition imports
import { ref, watch, computed, onMounted } from "vue";
import { useStore } from "vuex";
import { useDialogPluginComponent } from "quasar";
import { useDialogPluginComponent, useQuasar } from "quasar";
import { useScriptDropdown } from "@/composables/scripts";
import { useCustomFieldDropdown } from "@/composables/core";
import { runScript } from "@/api/agents";
@@ -128,6 +128,7 @@ export default {
agent: !Object,
},
setup(props) {
const $q = useQuasar();
// setup vuex store
const { state } = useStore();
const showCommunityScripts = computed(() => state.showCommunityScripts);
@@ -167,6 +168,13 @@ export default {
ret.value = await runScript(data);
loading.value = false;
if (output.value === "forget") {
onDialogHide();
$q.notify({
message: ret.value,
color: "positive",
});
}
}
// watchers