confirm before installing software on agent
This commit is contained in:
parent
3d063720ca
commit
e8d2fa588d
|
@ -49,6 +49,7 @@
|
|||
<script>
|
||||
import axios from "axios";
|
||||
import { mapState } from "vuex";
|
||||
import { mapGetters } from "vuex";
|
||||
import mixins from "@/mixins/mixins";
|
||||
export default {
|
||||
name: "InstallSoftware",
|
||||
|
@ -93,17 +94,30 @@ export default {
|
|||
},
|
||||
install(name, version) {
|
||||
const data = { name: name, version: version, pk: this.agentpk };
|
||||
axios
|
||||
.post("/software/install/", data)
|
||||
.then(r => {
|
||||
this.$emit("close");
|
||||
this.notifySuccess(r.data);
|
||||
this.$q
|
||||
.dialog({
|
||||
title: "Install Software",
|
||||
message: `Install ${name} on ${this.agentHostname}?`,
|
||||
persistent: true,
|
||||
ok: { label: "Install" },
|
||||
cancel: { color: "negative" }
|
||||
})
|
||||
.catch(e => {
|
||||
this.notifyError("Something went wrong");
|
||||
.onOk(() => {
|
||||
axios
|
||||
.post("/software/install/", data)
|
||||
.then(r => {
|
||||
this.$emit("close");
|
||||
this.notifySuccess(r.data);
|
||||
})
|
||||
.catch(e => {
|
||||
this.notifyError("Something went wrong");
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["agentHostname"])
|
||||
},
|
||||
created() {
|
||||
this.getChocos();
|
||||
}
|
||||
|
|
|
@ -47,6 +47,9 @@ export const store = new Vuex.Store({
|
|||
a.installed === false ? -1 : 1
|
||||
);
|
||||
return sortedByInstall;
|
||||
},
|
||||
agentHostname(state) {
|
||||
return state.agentSummary.hostname;
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
|
|
Loading…
Reference in New Issue