mirror of
https://github.com/jpros/tacticalrmm-web.git
synced 2026-02-28 23:31:54 +00:00
Policy Overview Add/Edit
This commit is contained in:
@@ -42,7 +42,7 @@ import { mapState } from "vuex";
|
||||
import mixins from "@/mixins/mixins";
|
||||
export default {
|
||||
name: "AddCpuLoadCheck",
|
||||
props: ["agentpk"],
|
||||
props: ["agentpk", "policypk"],
|
||||
mixins: [mixins],
|
||||
data() {
|
||||
return {
|
||||
@@ -53,8 +53,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
addCheck() {
|
||||
pk = (this.policypk) ? {policy: policypk} : {pk: agentpk}
|
||||
|
||||
const data = {
|
||||
pk: this.agentpk,
|
||||
pk,
|
||||
check_type: "cpuload",
|
||||
threshold: this.threshold,
|
||||
failure: this.failure
|
||||
@@ -63,7 +65,13 @@ export default {
|
||||
.post("/checks/addstandardcheck/", data)
|
||||
.then(r => {
|
||||
this.$emit("close");
|
||||
this.$store.dispatch("loadChecks", this.agentpk);
|
||||
|
||||
if (this.policypk) {
|
||||
this.$store.dispatch("loadPolicyChecks", this.policypk);
|
||||
} else {
|
||||
this.$store.dispatch("loadChecks", this.agentpk);
|
||||
}
|
||||
|
||||
this.notifySuccess("CPU load check was added!");
|
||||
})
|
||||
.catch(e => this.notifyError(e.response.data.error));
|
||||
|
||||
Reference in New Issue
Block a user