diff --git a/src/components/AgentTable.vue b/src/components/AgentTable.vue index 220934c..1c900e8 100644 --- a/src/components/AgentTable.vue +++ b/src/components/AgentTable.vue @@ -1,29 +1,35 @@ --> @@ -50,8 +58,8 @@ - - + + Edit {{ props.row.hostname }} @@ -63,8 +71,8 @@ v-close-popup @click.stop.prevent="takeControl(props.row.id)" > - - + + Take Control @@ -76,25 +84,25 @@ v-close-popup @click="toggleSendCommand(props.row.id, props.row.hostname)" > - - + + Send Command - - + + Remote Background - + - - + + Patch Management @@ -113,13 +121,19 @@ - + + + + + + + Run Checks - - + + Reboot @@ -151,14 +165,20 @@ - - + + + + Remove Agent - Quit + Close @@ -199,12 +219,20 @@ {{ props.row.antivirus }} - --> + --> - + Agent overdue - + Agent offline @@ -215,7 +243,6 @@ {{ bootTime(props.row.boot_time) }} - @@ -260,7 +287,7 @@ import EditAgent from "@/components/modals/agents/EditAgent"; export default { name: "AgentTable", props: ["frame", "columns", "tab", "filter", "userName"], - components: {EditAgent}, + components: { EditAgent }, mixins: [mixins], data() { return { @@ -282,18 +309,18 @@ export default { this.$store.commit("setActiveRow", pk); this.$q.loading.show(); // give time for store to change active row - setTimeout(()=>{ + setTimeout(() => { this.$q.loading.hide(); this.showEditAgentModal = true; }, 500); }, runPatchStatusScan(pk, hostname) { - axios.get(`/winupdate/${pk}/runupdatescan/`).then(r => { - this.notifySuccess(`Scan will be run shortly on ${hostname}`) - }) + axios.get(`/winupdate/${pk}/runupdatescan/`).then(r => { + this.notifySuccess(`Scan will be run shortly on ${hostname}`); + }); }, agentEdited() { - this.$emit("refreshEdit") + this.$emit("refreshEdit"); }, takeControl(pk) { const url = this.$router.resolve(`/takecontrol/${pk}`).href; @@ -311,44 +338,55 @@ export default { "scrollbars=no,location=no,status=no,toolbar=no,menubar=no,width=1280,height=826" ); }, + runChecks(pk) { + axios + .get(`/checks/runchecks/${pk}/`) + .then(r => this.notifySuccess(`Checks will now be re-run on ${r.data}`)) + .catch(e => this.notifyError("Something went wrong")); + }, removeAgent(pk, hostname) { - this.$q.dialog({ - title: "Are you sure?", - message: `Delete agent ${hostname}`, - cancel: true, - persistent: true - }) - .onOk(() => { - this.$q.dialog({ - title: `Please type ${hostname} to confirm`, - prompt: {model: '', type: 'text'}, + this.$q + .dialog({ + title: "Are you sure?", + message: `Delete agent ${hostname}`, cancel: true, - persistent: true, - html: true - }).onOk((hostnameConfirm) => { - if (hostnameConfirm !== hostname) { - this.$q.notify({ - message: "ERROR: Please type the correct hostname", - color: "red" - }) - } else { - const data = {pk: pk}; - axios.delete("/agents/uninstallagent/", {data: data}).then(r => { - this.$q.notify({ - message: `${hostname} will now be uninstalled!`, - color: "green" - }) - }) - .catch(e => { - this.$q.notify({ - message: e.response.data.error, - color: "info", - timeout: 4000 - }) - }) - } + persistent: true }) - }) + .onOk(() => { + this.$q + .dialog({ + title: `Please type ${hostname} to confirm`, + prompt: { model: "", type: "text" }, + cancel: true, + persistent: true, + html: true + }) + .onOk(hostnameConfirm => { + if (hostnameConfirm !== hostname) { + this.$q.notify({ + message: "ERROR: Please type the correct hostname", + color: "red" + }); + } else { + const data = { pk: pk }; + axios + .delete("/agents/uninstallagent/", { data: data }) + .then(r => { + this.$q.notify({ + message: `${hostname} will now be uninstalled!`, + color: "green" + }); + }) + .catch(e => { + this.$q.notify({ + message: e.response.data.error, + color: "info", + timeout: 4000 + }); + }); + } + }); + }); }, rebootNow(pk, hostname) { this.$q @@ -370,7 +408,7 @@ export default { }, rebootLater() { // TODO implement this - console.log('reboot later') + console.log("reboot later"); }, toggleSendCommand(pk, hostname) { this.sendCommandToggle = true; @@ -436,12 +474,12 @@ export default { }); }, agentClass(status) { - if (status === 'offline') { - return 'agent-offline' - } else if (status === 'overdue') { - return 'agent-overdue' + if (status === "offline") { + return "agent-offline"; + } else if (status === "overdue") { + return "agent-overdue"; } else { - return 'agent-normal' + return "agent-normal"; } } }, @@ -477,11 +515,13 @@ export default { .highlight { background-color: #c9e6ff; } + .agent-offline { - background: gray !important + background: gray !important; } + .agent-overdue { - background: red !important + background: red !important; } diff --git a/src/components/ChecksTab.vue b/src/components/ChecksTab.vue index 3c8cc5d..80367c6 100644 --- a/src/components/ChecksTab.vue +++ b/src/components/ChecksTab.vue @@ -6,21 +6,39 @@ + + + Disk Space Check + + + Ping Check + + + CPU Load Check + + + Memory Check + + + Windows Service Check + + + Script Check @@ -91,15 +109,15 @@ @@ -143,7 +161,7 @@ output {{ props.row.more_info }} @@ -217,6 +235,9 @@ :agentpk="checks.pk" /> + + + @@ -236,6 +257,7 @@ import AddWinSvcCheck from "@/components/modals/checks/AddWinSvcCheck"; import EditWinSvcCheck from "@/components/modals/checks/EditWinSvcCheck"; import AddScriptCheck from "@/components/modals/checks/AddScriptCheck"; import EditScriptCheck from "@/components/modals/checks/EditScriptCheck"; +import ScriptOutput from "@/components/modals/checks/ScriptOutput"; export default { name: "ChecksTab", @@ -251,7 +273,8 @@ export default { AddWinSvcCheck, EditWinSvcCheck, AddScriptCheck, - EditScriptCheck + EditScriptCheck, + ScriptOutput }, mixins: [mixins], data() { @@ -268,7 +291,9 @@ export default { showEditWinSvcCheck: false, showAddScriptCheck: false, showEditScriptCheck: false, + showScriptOutput: false, editCheckPK: null, + scriptInfo: {}, columns: [ { name: "smsalert", field: "text_alert", align: "left" }, { name: "emailalert", field: "email_alert", align: "left" }, @@ -317,12 +342,16 @@ export default { moreInfo(name, output) { this.$q.dialog({ title: `${name} output`, - style: "width: 80vw; max-width: 90vw", + style: "width: 35vw; max-width: 50vw", message: `
${output}
`, html: true, dark: true }); }, + scriptMoreInfo(props) { + this.scriptInfo = props; + this.showScriptOutput = true; + }, editCheck(category) { switch (category) { case "diskspace": diff --git a/src/components/modals/checks/AddDiskSpaceCheck.vue b/src/components/modals/checks/AddDiskSpaceCheck.vue index e400341..0a9ecda 100644 --- a/src/components/modals/checks/AddDiskSpaceCheck.vue +++ b/src/components/modals/checks/AddDiskSpaceCheck.vue @@ -1,38 +1,47 @@ \ No newline at end of file diff --git a/src/components/modals/checks/EditDiskSpaceCheck.vue b/src/components/modals/checks/EditDiskSpaceCheck.vue index 831097b..343f3d8 100644 --- a/src/components/modals/checks/EditDiskSpaceCheck.vue +++ b/src/components/modals/checks/EditDiskSpaceCheck.vue @@ -1,33 +1,42 @@ \ No newline at end of file diff --git a/src/components/modals/checks/ScriptOutput.vue b/src/components/modals/checks/ScriptOutput.vue new file mode 100644 index 0000000..58aed1c --- /dev/null +++ b/src/components/modals/checks/ScriptOutput.vue @@ -0,0 +1,42 @@ + + + \ No newline at end of file