mirror of
https://github.com/jpros/tacticalrmm-web.git
synced 2026-03-04 12:53:22 +00:00
Fixing automation Api with Checks changes
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
>
|
||||
<q-menu>
|
||||
<q-list dense style="min-width: 200px">
|
||||
<q-item clickable v-close-popup @click="showAddDialog('AddDiskSpaceCheck')">
|
||||
<q-item clickable v-close-popup @click="showAddDialog('DiskSpaceCheck')">
|
||||
<q-item-section side>
|
||||
<q-icon size="xs" name="far fa-hdd" />
|
||||
</q-item-section>
|
||||
@@ -36,7 +36,7 @@
|
||||
</q-item-section>
|
||||
<q-item-section>Memory Check</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="showAddDialog('AddWinSvcCheck')">
|
||||
<q-item clickable v-close-popup @click="showAddDialog('WinSvcCheck')">
|
||||
<q-item-section side>
|
||||
<q-icon size="xs" name="fas fa-cogs" />
|
||||
</q-item-section>
|
||||
@@ -99,14 +99,14 @@
|
||||
</template>
|
||||
<!-- body slots -->
|
||||
<template v-slot:body="props">
|
||||
<q-tr @contextmenu="editCheckPK = props.row.id" :props="props">
|
||||
<q-tr :props="props">
|
||||
<!-- context menu -->
|
||||
<q-menu context-menu>
|
||||
<q-list dense style="min-width: 200px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="showEditDialog(props.row.check_type)"
|
||||
@click="showEditDialog(props.row)"
|
||||
id="context-edit"
|
||||
>
|
||||
<q-item-section side>
|
||||
@@ -117,7 +117,7 @@
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="deleteCheck(props.row.id, props.row.check_type)"
|
||||
@click="deleteCheck(props.row)"
|
||||
id="context-delete"
|
||||
>
|
||||
<q-item-section side>
|
||||
@@ -206,16 +206,14 @@
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
import mixins, { notifySuccessConfig, notifyErrorConfig } from "@/mixins/mixins";
|
||||
import PolicyStatus from "@/components/automation/modals/PolicyStatus";
|
||||
import AddDiskSpaceCheck from "@/components/modals/checks/AddDiskSpaceCheck";
|
||||
import EditDiskSpaceCheck from "@/components/modals/checks/EditDiskSpaceCheck";
|
||||
import DiskSpaceCheck from "@/components/modals/checks/DiskSpaceCheck";
|
||||
import AddPingCheck from "@/components/modals/checks/AddPingCheck";
|
||||
import EditPingCheck from "@/components/modals/checks/EditPingCheck";
|
||||
import AddCpuLoadCheck from "@/components/modals/checks/AddCpuLoadCheck";
|
||||
import EditCpuLoadCheck from "@/components/modals/checks/EditCpuLoadCheck";
|
||||
import AddMemCheck from "@/components/modals/checks/AddMemCheck";
|
||||
import EditMemCheck from "@/components/modals/checks/EditMemCheck";
|
||||
import AddWinSvcCheck from "@/components/modals/checks/AddWinSvcCheck";
|
||||
import EditWinSvcCheck from "@/components/modals/checks/EditWinSvcCheck";
|
||||
import WinSvcCheck from "@/components/modals/checks/WinSvcCheck";
|
||||
import AddScriptCheck from "@/components/modals/checks/AddScriptCheck";
|
||||
import EditScriptCheck from "@/components/modals/checks/EditScriptCheck";
|
||||
import AddEventLogCheck from "@/components/modals/checks/AddEventLogCheck";
|
||||
@@ -225,16 +223,14 @@ export default {
|
||||
name: "PolicyChecksTab",
|
||||
components: {
|
||||
PolicyStatus,
|
||||
AddDiskSpaceCheck,
|
||||
EditDiskSpaceCheck,
|
||||
DiskSpaceCheck,
|
||||
AddPingCheck,
|
||||
EditPingCheck,
|
||||
AddCpuLoadCheck,
|
||||
EditCpuLoadCheck,
|
||||
AddMemCheck,
|
||||
EditMemCheck,
|
||||
AddWinSvcCheck,
|
||||
EditWinSvcCheck,
|
||||
WinSvcCheck,
|
||||
AddScriptCheck,
|
||||
EditScriptCheck,
|
||||
AddEventLogCheck,
|
||||
@@ -286,10 +282,10 @@ export default {
|
||||
this.dialogComponent = component;
|
||||
this.showDialog = true;
|
||||
},
|
||||
showEditDialog(category) {
|
||||
switch (category) {
|
||||
showEditDialog(check) {
|
||||
switch (check.check_type) {
|
||||
case "diskspace":
|
||||
this.dialogComponent = "EditDiskSpaceCheck";
|
||||
this.dialogComponent = "DiskSpaceCheck";
|
||||
break;
|
||||
case "ping":
|
||||
this.dialogComponent = "EditPingCheck";
|
||||
@@ -301,7 +297,7 @@ export default {
|
||||
this.dialogComponent = "EditMemCheck";
|
||||
break;
|
||||
case "winsvc":
|
||||
this.dialogComponent = "EditWinSvcCheck";
|
||||
this.dialogComponent = "WinSvcCheck";
|
||||
break;
|
||||
case "script":
|
||||
this.dialogComponent = "EditScriptCheck";
|
||||
@@ -313,6 +309,7 @@ export default {
|
||||
return null;
|
||||
}
|
||||
|
||||
this.editCheckPK = check.id;
|
||||
this.showDialog = true;
|
||||
|
||||
},
|
||||
@@ -320,15 +317,15 @@ export default {
|
||||
this.showDialog = false;
|
||||
this.dialogComponent = null;
|
||||
},
|
||||
deleteCheck(pk, check_type) {
|
||||
deleteCheck(check) {
|
||||
this.$q
|
||||
.dialog({
|
||||
title: `Delete ${check_type} check`,
|
||||
title: `Delete ${check.check_type} check`,
|
||||
ok: { label: "Delete", color: "negative" },
|
||||
cancel: true,
|
||||
})
|
||||
.onOk(() => {
|
||||
const data = { pk: pk, checktype: check_type };
|
||||
const data = { pk: check.pk, checktype: check.check_type };
|
||||
this.$store
|
||||
.dispatch("deleteCheck", data)
|
||||
.then(r => {
|
||||
|
||||
Reference in New Issue
Block a user