From 8322127373b0de5823e552cbb907c2a160633dab Mon Sep 17 00:00:00 2001 From: Josh Krawczyk Date: Mon, 6 Apr 2020 14:21:52 -0400 Subject: [PATCH 1/5] Initial Commit --- src/components/AlertsIcon.vue | 86 +++++++ src/components/AutomationManager.vue | 217 ++++++++++++++++++ src/components/FileBar.vue | 15 +- .../modals/alerts/AlertsOverview.vue | 53 +++++ .../modals/automation/AddPolicy.vue | 66 ++++++ .../modals/automation/EditPolicy.vue | 79 +++++++ .../modals/automation/PolicyOverview.vue | 7 + src/store/alerts.js | 29 +++ src/store/store.js | 22 +- src/views/Dashboard.vue | 11 +- 10 files changed, 579 insertions(+), 6 deletions(-) create mode 100644 src/components/AlertsIcon.vue create mode 100644 src/components/AutomationManager.vue create mode 100644 src/components/modals/alerts/AlertsOverview.vue create mode 100644 src/components/modals/automation/AddPolicy.vue create mode 100644 src/components/modals/automation/EditPolicy.vue create mode 100644 src/components/modals/automation/PolicyOverview.vue create mode 100644 src/store/alerts.js diff --git a/src/components/AlertsIcon.vue b/src/components/AlertsIcon.vue new file mode 100644 index 0000000..5375ee7 --- /dev/null +++ b/src/components/AlertsIcon.vue @@ -0,0 +1,86 @@ + + + \ No newline at end of file diff --git a/src/components/AutomationManager.vue b/src/components/AutomationManager.vue new file mode 100644 index 0000000..c106a84 --- /dev/null +++ b/src/components/AutomationManager.vue @@ -0,0 +1,217 @@ + + + + + \ No newline at end of file diff --git a/src/components/FileBar.vue b/src/components/FileBar.vue index ab55d3b..759689e 100644 --- a/src/components/FileBar.vue +++ b/src/components/FileBar.vue @@ -40,6 +40,10 @@ Script Manager + + + Automation Manager + Global Settings @@ -75,6 +79,9 @@ + + + @@ -86,6 +93,8 @@ import AddSite from "@/components/modals/clients/AddSite"; import UpdateAgents from "@/components/modals/agents/UpdateAgents"; import ScriptManager from "@/components/ScriptManager"; import EditCoreSettings from "@/components/modals/coresettings/EditCoreSettings"; +import AutomationManager from "@/components/AutomationManager"; + export default { name: "FileBar", components: { @@ -94,7 +103,8 @@ export default { AddSite, UpdateAgents, ScriptManager, - EditCoreSettings + EditCoreSettings, + AutomationManager }, props: ["clients"], data() { @@ -111,6 +121,9 @@ export default { }, showScriptManager() { this.$store.commit("TOGGLE_SCRIPT_MANAGER", true); + }, + showAutomationManager() { + this.$store.commit("TOGGLE_AUTOMATION_MANAGER", true); } } }; diff --git a/src/components/modals/alerts/AlertsOverview.vue b/src/components/modals/alerts/AlertsOverview.vue new file mode 100644 index 0000000..1ede6f0 --- /dev/null +++ b/src/components/modals/alerts/AlertsOverview.vue @@ -0,0 +1,53 @@ + + + diff --git a/src/components/modals/automation/AddPolicy.vue b/src/components/modals/automation/AddPolicy.vue new file mode 100644 index 0000000..a444b37 --- /dev/null +++ b/src/components/modals/automation/AddPolicy.vue @@ -0,0 +1,66 @@ + + + \ No newline at end of file diff --git a/src/components/modals/automation/EditPolicy.vue b/src/components/modals/automation/EditPolicy.vue new file mode 100644 index 0000000..8810fc2 --- /dev/null +++ b/src/components/modals/automation/EditPolicy.vue @@ -0,0 +1,79 @@ + + + \ No newline at end of file diff --git a/src/components/modals/automation/PolicyOverview.vue b/src/components/modals/automation/PolicyOverview.vue new file mode 100644 index 0000000..3dfec97 --- /dev/null +++ b/src/components/modals/automation/PolicyOverview.vue @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/store/alerts.js b/src/store/alerts.js new file mode 100644 index 0000000..d8d3e11 --- /dev/null +++ b/src/store/alerts.js @@ -0,0 +1,29 @@ +export default { + namespaced: true, + state: { + alerts: [], + }, + + getters:{ + getAlerts(state) { + return state.alerts; + }, + getUncheckedAlerts(state) { + //filter for non-dismissed active alerts + } + }, + + mutation: { + SET_ALERTS(state, alerts) { + state.alerts = alerts; + }, + }, + + actions: { + getAlerts(context) { + axios.get(`/alerts/getAlerts/`).then(r => { + context.commit("SET_ALERTS", r.data); + }); + } + } +} \ No newline at end of file diff --git a/src/store/store.js b/src/store/store.js index 7f0c573..85475e6 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -4,12 +4,14 @@ import axios from "axios"; import { Notify } from "quasar"; import router from "../router"; import logModule from "./logs"; +import alertsModule from "./alerts"; Vue.use(Vuex); export const store = new Vuex.Store({ modules: { - logs: logModule + logs: logModule, + alerts: alertsModule }, state: { username: localStorage.getItem("user_name") || null, @@ -25,7 +27,9 @@ export const store = new Vuex.Store({ treeLoading: false, installedSoftware: [], scripts: [], - toggleScriptManager: false + toggleScriptManager: false, + policies: [], + toggleAutomationManager: false }, getters: { loggedIn(state) { @@ -55,9 +59,15 @@ export const store = new Vuex.Store({ }, scripts(state) { return state.scripts; + }, + policies(state) { + return state.policies; } }, mutations: { + TOGGLE_AUTOMATION_MANAGER(state, action) { + state.toggleAutomationManager = action; + }, TOGGLE_SCRIPT_MANAGER(state, action) { state.toggleScriptManager = action; }, @@ -103,9 +113,17 @@ export const store = new Vuex.Store({ }, SET_SCRIPTS(state, scripts) { state.scripts = scripts; + }, + SET_POLICIES(state, policies) { + state.policies = policies; } }, actions: { + getPolicies(context) { + axios.get("/automation/policies/").then(r => { + context.commit("SET_POLICIES", r.data); + }) + }, getScripts(context) { axios.get("/checks/getscripts/").then(r => { context.commit("SET_SCRIPTS", r.data); diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index ba9629c..f54429a 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -6,6 +6,9 @@ Tactical RMM + + + @@ -88,11 +91,13 @@ import { mapState, mapGetters } from 'vuex'; import FileBar from "@/components/FileBar"; import AgentTable from "@/components/AgentTable"; import SubTableTabs from "@/components/SubTableTabs"; +import AlertsIcon from "@/components/AlertsIcon"; export default { components: { FileBar, AgentTable, - SubTableTabs + SubTableTabs, + AlertsIcon }, data() { return { @@ -171,7 +176,7 @@ export default { sortable: true, align: "left" } - ] + ], }; }, methods: { @@ -242,7 +247,7 @@ export default { //this.$store.commit("destroySubTable"); this.$store.commit("AGENT_TABLE_LOADING", false); }); - }, + } }, computed: { ...mapState({ From efef7020e484c2f8034ffc2a03f9af243dff7e21 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 10 Apr 2020 01:10:49 +0000 Subject: [PATCH 2/5] add missing import --- src/components/modals/alerts/AlertsOverview.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/modals/alerts/AlertsOverview.vue b/src/components/modals/alerts/AlertsOverview.vue index 1ede6f0..2eda780 100644 --- a/src/components/modals/alerts/AlertsOverview.vue +++ b/src/components/modals/alerts/AlertsOverview.vue @@ -22,8 +22,11 @@ + + + diff --git a/src/components/ChecksTab.vue b/src/components/ChecksTab.vue index 80367c6..19af94e 100644 --- a/src/components/ChecksTab.vue +++ b/src/components/ChecksTab.vue @@ -166,6 +166,7 @@ {{ props.row.more_info }} {{ props.row.last_run }} + {{ props.row.assigned_task }} @@ -311,7 +312,8 @@ export default { label: "Date / Time", field: "last_run", align: "left" - } + }, + { name: "assignedtasks", label: "Assigned Tasks", field: "assigned_task", align: "left" }, ], pagination: { rowsPerPage: 9999 @@ -338,6 +340,7 @@ export default { }, onRefresh(id) { this.$store.dispatch("loadChecks", id); + this.$store.dispatch("loadAutomatedTasks", id); }, moreInfo(name, output) { this.$q.dialog({ @@ -390,6 +393,7 @@ export default { .delete("checks/deletestandardcheck/", { data: data }) .then(r => { this.$store.dispatch("loadChecks", this.checks.pk); + this.$store.dispatch("loadAutomatedTasks", this.checks.pk); this.notifySuccess("Check was deleted!"); }) .catch(e => this.notifyError(e.response.data.error)); diff --git a/src/components/SoftwareTab.vue b/src/components/SoftwareTab.vue index 9b8ee52..fd51947 100644 --- a/src/components/SoftwareTab.vue +++ b/src/components/SoftwareTab.vue @@ -1,5 +1,6 @@