add policy sync to automation manager

This commit is contained in:
sadnub
2021-03-03 22:03:04 -05:00
parent c0195f2aa9
commit ddab9f119c

View File

@@ -127,6 +127,13 @@
<q-item-section>Policy Exclusions</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="syncPolicies(props.row)">
<q-item-section side>
<q-icon name="sync" />
</q-item-section>
<q-item-section>Sync Policies</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="showPatchPolicyForm(props.row)">
<q-item-section side>
<q-icon name="system_update" />
@@ -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 = "";