diff --git a/src/components/AutomatedTasksTab.vue b/src/components/AutomatedTasksTab.vue index c28f865..cf79b5b 100644 --- a/src/components/AutomatedTasksTab.vue +++ b/src/components/AutomatedTasksTab.vue @@ -59,11 +59,11 @@ Edit + clickable + v-close-popup + @click="deleteTask(props.row.name, props.row.id)" + v-if="!props.row.managed_by_policy" + > diff --git a/src/components/ChecksTab.vue b/src/components/ChecksTab.vue index 3f22791..b1c3551 100644 --- a/src/components/ChecksTab.vue +++ b/src/components/ChecksTab.vue @@ -92,10 +92,10 @@ - diff --git a/src/components/automation/AutomationManager.vue b/src/components/automation/AutomationManager.vue index 5f546df..8b4e872 100644 --- a/src/components/automation/AutomationManager.vue +++ b/src/components/automation/AutomationManager.vue @@ -74,7 +74,6 @@ - Enable Policy @@ -87,19 +86,14 @@ - - {{ col.label }} - - + {{ col.label }} - + - + - - No Policies - + No Policies @@ -108,9 +102,9 @@ - @@ -174,9 +168,7 @@ - {{ `Show Relations (${props.row.clients_count + props.row.sites_count + props.row.agents_count}+)` }} - + >{{ `Show Relations (${props.row.clients_count + props.row.sites_count + props.row.agents_count}+)` }} @@ -189,29 +181,17 @@ - - + + - + - + @@ -251,18 +231,18 @@ export default { name: "desc", label: "Description", field: "desc", - align: "left", + align: "left" }, { name: "actions", label: "Actions", field: "actions", - align: "left", + align: "left" } ], pagination: { rowsPerPage: 9999 - }, + } }; }, methods: { @@ -323,26 +303,26 @@ export default { this.showPolicyFormModal = true; }, showPolicyOverview() { - this.showPolicyOverviewModal = true + this.showPolicyOverviewModal = true; this.clearRow(); }, toggleCheckbox(policy, type) { let text = ""; if (type === "Active") { - text = policy.active ? "Policy enabled successfully" : "Policy disabled successfully"; + text = policy.active ? "Policy enabled successfully" : "Policy disabled successfully"; } else if (type === "Enforced") { - text = policy.enforced ? "Policy enforced successfully" : "Policy enforcement disabled"; + text = policy.enforced ? "Policy enforced successfully" : "Policy enforcement disabled"; } - const data ={ + const data = { id: policy.id, name: policy.name, desc: policy.desc, active: policy.active, enforced: policy.enforced - } - + }; + this.$store .dispatch("automation/editPolicy", data) .then(response => { diff --git a/src/components/automation/PolicyAutomatedTasksTab.vue b/src/components/automation/PolicyAutomatedTasksTab.vue index ee4d83e..3faf24e 100644 --- a/src/components/automation/PolicyAutomatedTasksTab.vue +++ b/src/components/automation/PolicyAutomatedTasksTab.vue @@ -11,7 +11,7 @@ ref="add" @click="showAddAutomatedTask = true" /> - - + - - Click on a policy to see the tasks - - - There are no tasks added to this policy - + Click on a policy to see the tasks + There are no tasks added to this policy @@ -54,9 +50,9 @@ - @@ -65,9 +61,9 @@ Run task now - @@ -76,8 +72,8 @@ Edit - Delete - - See Status - + >See Status {{ props.row.assigned_check.name }} @@ -135,16 +129,13 @@ - + - @@ -160,7 +151,7 @@ import PolicyStatus from "@/components/automation/modals/PolicyStatus"; export default { name: "PolicyAutomatedTasksTab", - components: { + components: { AddAutomatedTask, PolicyStatus }, @@ -242,7 +233,7 @@ export default { persistent: true }) .onOk(() => { - this.$store + this.$store .dispatch("deleteAutoTask", pk) .then(r => { this.$store.dispatch("automation/loadPolicyAutomatedTasks", this.selectedPolicy); @@ -256,7 +247,7 @@ export default { ...mapGetters({ tasks: "automation/tasks", selectedPolicy: "automation/selectedPolicyPk" - }), + }) } }; diff --git a/src/components/automation/PolicyChecksTab.vue b/src/components/automation/PolicyChecksTab.vue index 1bd21c5..c5b0143 100644 --- a/src/components/automation/PolicyChecksTab.vue +++ b/src/components/automation/PolicyChecksTab.vue @@ -57,14 +57,14 @@ - diff --git a/src/components/automation/modals/PolicyAdd.vue b/src/components/automation/modals/PolicyAdd.vue index 82544c8..4badf10 100644 --- a/src/components/automation/modals/PolicyAdd.vue +++ b/src/components/automation/modals/PolicyAdd.vue @@ -1,39 +1,36 @@ - + Edit policy assigned to {{ type }} - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -48,17 +45,17 @@ export default { type: { required: true, type: String, - validator: function (value) { + validator: function(value) { // The value must match one of these strings return ["agent", "site", "client"].includes(value); - } + } } }, data() { return { selected: null, options: [] - } + }; }, computed: { ...mapGetters({ @@ -70,8 +67,7 @@ export default { this.$q.loading.show(); let data = {}; - data.pk = this.pk, - data.type = this.type; + (data.pk = this.pk), (data.type = this.type); data.policy = this.selected === null ? 0 : this.selected.value; this.$store @@ -83,7 +79,7 @@ export default { }) .catch(e => { this.$q.loading.hide(); - this.$q.notify(notifyErrorConfig("Something went wrong!")) + this.$q.notify(notifyErrorConfig("Something went wrong!")); }); }, getPolicies() { @@ -93,23 +89,22 @@ export default { this.options = this.policies.map(policy => ({ label: policy.name, value: policy.id - })) + })); }) .catch(e => { this.$q.loading.hide(); this.$q.notify(notifyErrorConfig("Add error occured while loading")); - });; - + }); }, getRelation(pk, type) { this.$store - .dispatch("automation/getRelatedPolicies", {pk, type}) + .dispatch("automation/getRelatedPolicies", { pk, type }) .then(r => { if (r.data.id !== undefined) { this.selected = { label: r.data.name, value: r.data.id - } + }; } }) .catch(e => { @@ -121,5 +116,5 @@ export default { this.getPolicies(); this.getRelation(this.pk, this.type); } -} +}; \ No newline at end of file diff --git a/src/components/automation/modals/PolicyForm.vue b/src/components/automation/modals/PolicyForm.vue index 42beafa..421f498 100644 --- a/src/components/automation/modals/PolicyForm.vue +++ b/src/components/automation/modals/PolicyForm.vue @@ -61,17 +61,14 @@ export default { getPolicy() { this.$q.loading.show(); - this.$store - .dispatch("automation/loadPolicy", this.pk) - .then(r => { + this.$store.dispatch("automation/loadPolicy", this.pk).then(r => { + this.$q.loading.hide(); - this.$q.loading.hide(); - - this.name = r.data.name; - this.desc = r.data.desc; - this.active = r.data.active; - this.enforced = r.data.enforced; - }); + this.name = r.data.name; + this.desc = r.data.desc; + this.active = r.data.active; + this.enforced = r.data.enforced; + }); }, submit() { if (!this.name) { diff --git a/src/components/automation/modals/PolicyStatus.vue b/src/components/automation/modals/PolicyStatus.vue index 8ea3724..8e7531c 100644 --- a/src/components/automation/modals/PolicyStatus.vue +++ b/src/components/automation/modals/PolicyStatus.vue @@ -1,5 +1,5 @@ - + {{ this.title }} @@ -21,11 +21,9 @@ - + - - There are no agents applied to this policy - + There are no agents applied to this policy @@ -44,9 +42,7 @@ Awaiting First Synchronization - - - + Failing @@ -61,7 +57,9 @@ class="ping-cell" >output - + - + @@ -117,7 +112,7 @@ export default { type: { required: true, type: String, - validator: function (value) { + validator: function(value) { // The value must match one of these strings return ["task", "check"].includes(value); } @@ -150,11 +145,11 @@ export default { pagination: { rowsPerPage: 9999 } - } + }; }, computed: { - title () { - return this.item.readable_desc ? this.item.readable_desc + " Status" : this.item.name + " Status" + title() { + return this.item.readable_desc ? this.item.readable_desc + " Status" : this.item.name + " Status"; } }, methods: { @@ -164,7 +159,7 @@ export default { .dispatch("automation/loadCheckStatus", { checkpk: this.item.id }) .then(r => { this.$q.loading.hide(); - this.tableData = r.data + this.tableData = r.data; }) .catch(e => { this.$q.loading.hide(); @@ -177,20 +172,20 @@ export default { .dispatch("automation/loadAutomatedTaskStatus", { taskpk: this.item.id }) .then(r => { this.$q.loading.hide(); - this.tableData = r.data + this.tableData = r.data; }) .catch(e => { this.$q.loading.hide(); // TODO: Return Error message from api and display - });; + }); }, closeEventLogOutput() { - this.showEventLogOutput = false; + this.showEventLogOutput = false; this.evtLogdata = {}; }, closeScriptOutput() { - this.showScriptOutput = false; - this.scriptInfo = {} + this.showScriptOutput = false; + this.scriptInfo = {}; }, pingInfo(check) { this.$q.dialog({ @@ -207,16 +202,14 @@ export default { eventLogMoreInfo(check) { this.evtLogData = check; this.showEventLogOutput = true; - }, + } }, mounted() { if (this.type === "task") { this.getTaskData(); - } - else { + } else { this.getCheckData(); - } - + } } -} +}; diff --git a/src/components/automation/modals/RelationsView.vue b/src/components/automation/modals/RelationsView.vue index f78f82d..93faceb 100644 --- a/src/components/automation/modals/RelationsView.vue +++ b/src/components/automation/modals/RelationsView.vue @@ -51,7 +51,10 @@ {{ item.hostname }} - {{ item.client }} {{ item.site }} + + {{ item.client }} + {{ item.site }} + @@ -72,9 +75,9 @@ export default { }, data() { return { - tab: 'clients', + tab: "clients", related: {} - } + }; }, mounted() { this.$q.loading.show(); @@ -83,11 +86,11 @@ export default { .dispatch("automation/getRelated", this.policy.id) .then(r => { this.$q.loading.hide(); - this.related = r.data + this.related = r.data; }) .catch(e => { this.$q.loading.hide(); }); } -} +}; \ No newline at end of file diff --git a/src/components/modals/coresettings/EditCoreSettings.vue b/src/components/modals/coresettings/EditCoreSettings.vue index d60d602..0a7a9ae 100644 --- a/src/components/modals/coresettings/EditCoreSettings.vue +++ b/src/components/modals/coresettings/EditCoreSettings.vue @@ -148,32 +148,17 @@ Username: - + Mesh Site: - + Mesh Token: - + diff --git a/src/components/modals/tasks/AddAutomatedTask.vue b/src/components/modals/tasks/AddAutomatedTask.vue index 8c1d326..ade66c9 100644 --- a/src/components/modals/tasks/AddAutomatedTask.vue +++ b/src/components/modals/tasks/AddAutomatedTask.vue @@ -191,9 +191,9 @@ export default { computed: { ...mapGetters(["selectedAgentPk", "scripts"]), checks() { - return this.policypk ? this.$store.state.automation.checks : this.$store.state.agentChecks.filter( - check => check.managed_by_policy === false - ); + return this.policypk + ? this.$store.state.automation.checks + : this.$store.state.agentChecks.filter(check => check.managed_by_policy === false); }, checksOptions() { const r = []; diff --git a/src/mixins/dropdown_formatter.js b/src/mixins/dropdown_formatter.js index 4c38678..6dbba54 100644 --- a/src/mixins/dropdown_formatter.js +++ b/src/mixins/dropdown_formatter.js @@ -2,17 +2,17 @@ export default { methods: { formatClients(clients) { return clients.map(client => ({ - label: client.client, - value: client.id - }) + label: client.client, + value: client.id + }) ); }, formatSites(sites) { return sites.map(site => ({ - label: site.site, - value: site.id, - client: site.client_name - }) + label: site.site, + value: site.id, + client: site.client_name + }) ); } }