From 4a6ea2b105fc0f26fc52217b1829a059fd960cae Mon Sep 17 00:00:00 2001 From: sadnub Date: Wed, 9 Sep 2020 13:10:29 -0400 Subject: [PATCH] Allow bulk resetting agent policies from settings UI. Modified agent edit serializer to fix errors --- src/components/modals/agents/EditAgent.vue | 6 +- .../modals/coresettings/EditCoreSettings.vue | 15 +++ .../modals/coresettings/ResetPatchPolicy.vue | 118 ++++++++++++++++++ src/store/automation.js | 3 + src/store/index.js | 2 +- 5 files changed, 139 insertions(+), 5 deletions(-) create mode 100644 src/components/modals/coresettings/ResetPatchPolicy.vue diff --git a/src/components/modals/agents/EditAgent.vue b/src/components/modals/agents/EditAgent.vue index de816a3..6a128a4 100644 --- a/src/components/modals/agents/EditAgent.vue +++ b/src/components/modals/agents/EditAgent.vue @@ -170,7 +170,7 @@ export default { }, methods: { getAgentInfo() { - axios.get(`/agents/${this.selectedAgentPk}/agentdetail/`).then(r => { + axios.get(`/agents/${this.selectedAgentPk}/agenteditdetails/`).then(r => { this.agent = r.data; this.allTimezones = Object.freeze(r.data.all_timezones); @@ -206,9 +206,7 @@ export default { data.time_zone = this.timezone; } - delete data.services; - delete data.disks; - delete data.local_ip; + delete data.all_timezones; axios .patch("/agents/editagent/", data) diff --git a/src/components/modals/coresettings/EditCoreSettings.vue b/src/components/modals/coresettings/EditCoreSettings.vue index cdac38d..d191fc8 100644 --- a/src/components/modals/coresettings/EditCoreSettings.vue +++ b/src/components/modals/coresettings/EditCoreSettings.vue @@ -38,6 +38,11 @@ class="col-6" /> + +
Reset Patch Policy on Agents:
+
+ +
@@ -191,18 +196,25 @@ + + + + \ No newline at end of file diff --git a/src/store/automation.js b/src/store/automation.js index c436b91..1e091ff 100644 --- a/src/store/automation.js +++ b/src/store/automation.js @@ -98,6 +98,9 @@ export default { }, deletePatchPolicy(context, pk) { return axios.delete(`/automation/winupdatepolicy/${pk}/`) + }, + resetPatchPolicies(context, data) { + return axios.patch("/automation/winupdatepolicy/reset/", data) } } } diff --git a/src/store/index.js b/src/store/index.js index 3e12d97..d156050 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -197,7 +197,7 @@ export default function () { }); }, loadClients(context) { - return axios.get("/clients/listclients/"); + return axios.get("/clients/clients/"); }, loadSites(context) { return axios.get("/clients/listsites/");