From ddab9f119c79f0ae29b1e8407f2a59d52fecbf7a Mon Sep 17 00:00:00 2001 From: sadnub Date: Wed, 3 Mar 2021 22:03:04 -0500 Subject: [PATCH] add policy sync to automation manager --- .../automation/AutomationManager.vue | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/components/automation/AutomationManager.vue b/src/components/automation/AutomationManager.vue index 029d6bb..b7f5532 100644 --- a/src/components/automation/AutomationManager.vue +++ b/src/components/automation/AutomationManager.vue @@ -127,6 +127,13 @@ Policy Exclusions + + + + + Sync Policies + + @@ -450,6 +457,24 @@ export default { this.refresh(); }); }, + syncPolicies(policy) { + this.$q.loading.show(); + + const data = { + policy: policy.id, + }; + + this.$axios + .post(`/automation/sync/`, data) + .then(r => { + this.$q.loading.hide(); + this.notifySuccess("Sync request sent successfully. The task will be run on all affected agents"); + }) + .catch(error => { + this.$q.loading.hide(); + this.notifyError("An Error occured while sending policy sync request"); + }); + }, toggleCheckbox(policy, type) { this.$q.loading.show(); let text = "";