From f0f8ef1136614bd3c5251815eed27c140d33e6b0 Mon Sep 17 00:00:00 2001 From: sadnub Date: Fri, 16 Apr 2021 21:54:36 -0400 Subject: [PATCH 1/6] add UI for blocking policy inheritance on client, site, and agent --- src/components/automation/modals/PolicyAdd.vue | 18 ++++++++++++++++-- src/store/index.js | 4 +++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/components/automation/modals/PolicyAdd.vue b/src/components/automation/modals/PolicyAdd.vue index c65108e..81c6166 100644 --- a/src/components/automation/modals/PolicyAdd.vue +++ b/src/components/automation/modals/PolicyAdd.vue @@ -50,6 +50,10 @@ label="Policy" > + + + This {{ type }} will not inherit from higher policies + No Automation Policies have been setup. Go to Settings > Automation Manager @@ -85,6 +89,7 @@ export default { selectedWorkstationPolicy: null, selectedServerPolicy: null, selectedAgentPolicy: null, + blockInheritance: false, options: [], }; }, @@ -94,13 +99,17 @@ export default { if (this.type === "client" || this.type === "site") { if ( this.object.workstation_policy === this.selectedWorkstationPolicy && - this.object.server_policy === this.selectedServerPolicy + this.object.server_policy === this.selectedServerPolicy && + this.object.blockInheritance === this.blockInheritance ) { this.hide(); return; } } else if (this.type === "agent") { - if (this.object.policy === this.selectedAgentPolicy) { + if ( + this.object.policy === this.selectedAgentPolicy && + this.object.block_policy_inheritance === this.blockInheritance + ) { this.hide(); return; } @@ -118,6 +127,7 @@ export default { pk: this.object.id, server_policy: this.selectedServerPolicy, workstation_policy: this.selectedWorkstationPolicy, + block_policy_inheritance: this.blockInheritance, }, }; } else if (this.type === "site") { @@ -127,6 +137,7 @@ export default { pk: this.object.id, server_policy: this.selectedServerPolicy, workstation_policy: this.selectedWorkstationPolicy, + block_policy_inheritance: this.blockInheritance, }, }; } else if (this.type === "agent") { @@ -134,6 +145,7 @@ export default { data = { id: this.object.id, policy: this.selectedAgentPolicy, + block_policy_inheritance: this.blockInheritance, }; } @@ -186,8 +198,10 @@ export default { if (this.type !== "agent") { this.selectedServerPolicy = this.object.server_policy; this.selectedWorkstationPolicy = this.object.workstation_policy; + this.blockInheritance = this.object.blockInheritance; } else { this.selectedAgentPolicy = this.object.policy; + this.blockInheritance = this.object.block_policy_inheritance; } }, }; diff --git a/src/store/index.js b/src/store/index.js index 26e0d29..f98fd36 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -257,7 +257,8 @@ export default function () { client: client.id, server_policy: site.server_policy, workstation_policy: site.workstation_policy, - alert_template: site.alert_template + alert_template: site.alert_template, + blockInheritance: site.block_policy_inheritance } if (site.maintenance_mode) { siteNode["color"] = "green" } @@ -276,6 +277,7 @@ export default function () { server_policy: client.server_policy, workstation_policy: client.workstation_policy, alert_template: client.alert_template, + blockInheritance: client.block_policy_inheritance, children: childSites } From a4cffd96b73d20492411309cc3e9927bf4e6fffd Mon Sep 17 00:00:00 2001 From: sadnub Date: Wed, 21 Apr 2021 12:58:17 -0400 Subject: [PATCH 2/6] policy task and check rework. Added basic collector task implementation --- src/components/AutomatedTasksTab.vue | 20 ++++++++++++- .../automation/PolicyAutomatedTasksTab.vue | 16 ++++++++++ .../automation/modals/PolicyStatus.vue | 2 ++ .../modals/tasks/AddAutomatedTask.vue | 30 +++++++++++++++++++ 4 files changed, 67 insertions(+), 1 deletion(-) diff --git a/src/components/AutomatedTasksTab.vue b/src/components/AutomatedTasksTab.vue index c4d99e7..babc374 100644 --- a/src/components/AutomatedTasksTab.vue +++ b/src/components/AutomatedTasksTab.vue @@ -60,6 +60,14 @@ + + @@ -170,6 +178,13 @@ This task is managed by a policy + + + + + The task updates a custom field on the agent + + @@ -199,6 +214,8 @@ Will sync on next agent checkin Synced with agent Pending deletion on agent + Waiting for task creation on agent + state.automatedTasks, }), tasks() { - return this.automatedTasks.autotasks; + return this.automatedTasks.autotasks.filter(task => task.sync_status !== "pendingdeletion"); }, }, }; diff --git a/src/components/automation/PolicyAutomatedTasksTab.vue b/src/components/automation/PolicyAutomatedTasksTab.vue index 30a6fe1..90a3943 100644 --- a/src/components/automation/PolicyAutomatedTasksTab.vue +++ b/src/components/automation/PolicyAutomatedTasksTab.vue @@ -61,6 +61,15 @@ + + +