From b8368518ee37cee71ef282a5df9fcb08f658d852 Mon Sep 17 00:00:00 2001 From: sadnub Date: Sat, 23 Jan 2021 17:05:11 -0500 Subject: [PATCH] migrations fix and finishing up automation manager rework --- src/components/AgentTable.vue | 19 +- src/components/AlertsManager.vue | 26 +- .../automation/AutomationManager.vue | 58 ++-- .../automation/PolicyAutomatedTasksTab.vue | 185 +++++++------ src/components/automation/PolicyChecksTab.vue | 114 ++++---- .../automation/modals/PolicyAdd.vue | 261 ++++++++---------- .../automation/modals/PolicyForm.vue | 172 ++++++------ .../automation/modals/PolicyStatus.vue | 42 +-- .../automation/modals/RelationsView.vue | 216 ++++++++------- .../modals/alerts/AlertTemplateAdd.vue | 4 +- .../modals/alerts/AlertTemplateForm.vue | 2 +- src/components/modals/checks/CpuLoadCheck.vue | 10 +- .../modals/checks/DiskSpaceCheck.vue | 10 +- .../modals/checks/EventLogCheck.vue | 4 +- src/components/modals/checks/MemCheck.vue | 4 +- src/components/modals/checks/PingCheck.vue | 4 +- src/components/modals/checks/ScriptCheck.vue | 9 +- src/components/modals/checks/WinSvcCheck.vue | 4 +- .../modals/tasks/AddAutomatedTask.vue | 15 +- src/store/alerts.js | 34 --- src/store/automation.js | 106 ------- src/store/index.js | 16 +- src/views/Dashboard.vue | 38 +-- 23 files changed, 615 insertions(+), 738 deletions(-) delete mode 100644 src/store/alerts.js delete mode 100644 src/store/automation.js diff --git a/src/components/AgentTable.vue b/src/components/AgentTable.vue index bb76cfd..9be63c9 100644 --- a/src/components/AgentTable.vue +++ b/src/components/AgentTable.vue @@ -217,7 +217,7 @@ - + @@ -339,10 +339,6 @@ - - - - @@ -379,7 +375,6 @@ export default { EditAgent, RebootLater, PendingActions, - PolicyAdd, SendCommand, AgentRecovery, RunScript, @@ -395,10 +390,8 @@ export default { showSendCommand: false, showEditAgentModal: false, showRebootLaterModal: false, - showPolicyAddModal: false, showAgentRecovery: false, showRunScript: false, - policyAddPk: null, showPendingActions: false, pendingActionAgentPk: null, favoriteScripts: [], @@ -671,9 +664,13 @@ export default { return "agent-normal"; } }, - showPolicyAdd(pk) { - this.policyAddPk = pk; - this.showPolicyAddModal = true; + showPolicyAdd(agent) { + this.$q.dialog({ + component: PolicyAdd, + parent: this, + type: "agent", + object: agent, + }); }, toggleMaintenance(agent) { let data = { diff --git a/src/components/AlertsManager.vue b/src/components/AlertsManager.vue index 51dd14f..1f53998 100644 --- a/src/components/AlertsManager.vue +++ b/src/components/AlertsManager.vue @@ -15,26 +15,26 @@ - {{ props.name }} + {{ props.col.label }} @@ -74,9 +74,9 @@ @@ -173,7 +173,7 @@ export default { mixins: [mixins], data() { return { - selected: [], + selectedTemplate: null, templates: [], columns: [ { name: "is_active", label: "Active", field: "is_active", align: "left" }, @@ -225,7 +225,7 @@ export default { }); }, clearRow() { - this.selected = []; + this.selectedTemplate = null; }, refresh() { this.getTemplates(); @@ -292,8 +292,8 @@ export default { this.notifyError("An Error occured while editing the template"); }); }, - rowSelectedClass(id, selected) { - if (selected.length !== 0 && selected[0].id === id) return this.$q.dark.isActive ? "highlight-dark" : "highlight"; + rowSelectedClass(id, selectedTemplate) { + if (selectedTemplate && selectedTemplate.id === id) return this.$q.dark.isActive ? "highlight-dark" : "highlight"; }, show() { this.$refs.dialog.show(); diff --git a/src/components/automation/AutomationManager.vue b/src/components/automation/AutomationManager.vue index 09044a2..f1100ec 100644 --- a/src/components/automation/AutomationManager.vue +++ b/src/components/automation/AutomationManager.vue @@ -1,6 +1,6 @@