start moving schedtasks to nats wh1te909/rmmagent@0cde11a067

This commit is contained in:
wh1te909
2020-11-29 23:40:29 +00:00
parent f0af0c6b3c
commit 305ea3aa09
2 changed files with 12 additions and 9 deletions

View File

@@ -555,13 +555,17 @@ export default {
persistent: true,
})
.onOk(() => {
const data = { pk: pk, action: "rebootnow" };
axios.post("/agents/poweraction/", data).then(r => {
this.$q.dialog({
title: `Restarting ${hostname}`,
message: `${hostname} will now be restarted`,
this.$q.loading.show();
this.$axios
.post("/agents/reboot/", { pk: pk })
.then(r => {
this.$q.loading.hide();
this.notifySuccess(`${hostname} will now be restarted`);
})
.catch(e => {
this.$q.loading.hide();
this.notifyError(e.response.data);
});
});
});
},
agentRowSelected(pk) {

View File

@@ -33,7 +33,6 @@
</template>
<script>
import axios from "axios";
import { mapGetters } from "vuex";
import mixins from "@/mixins/mixins";
import { date } from "quasar";
@@ -50,8 +49,8 @@ export default {
scheduleReboot() {
this.$q.loading.show({ message: "Contacting agent..." });
const data = { pk: this.selectedAgentPk, datetime: this.datetime };
axios
.post("/agents/rebootlater/", data)
this.$axios
.patch("/agents/reboot/", data)
.then(r => {
this.$q.loading.hide();
this.$emit("close");