agent table is now responsive when dragging splitter

This commit is contained in:
wh1te909
2020-08-28 04:17:59 +00:00
parent 4207abdcfa
commit 2b14f2aa88
13 changed files with 110 additions and 74 deletions

View File

@@ -3,6 +3,7 @@
<q-table
dense
class="agents-tbl-sticky"
:style="{'max-height': agentTableHeight}"
:data="filter"
:columns="columns"
row-key="id"
@@ -387,7 +388,7 @@ export default {
}, 500);
},
runPatchStatusScan(pk, hostname) {
axios.get(`/winupdate/${pk}/runupdatescan/`).then((r) => {
axios.get(`/winupdate/${pk}/runupdatescan/`).then(r => {
this.notifySuccess(`Scan will be run shortly on ${hostname}`);
});
},
@@ -395,11 +396,11 @@ export default {
this.$q.loading.show();
this.$axios
.get(`/winupdate/${pk}/installnow/`)
.then((r) => {
.then(r => {
this.$q.loading.hide();
this.notifySuccess(r.data);
})
.catch((e) => {
.catch(e => {
this.$q.loading.hide();
this.notifyError(e.response.data, 5000);
});
@@ -422,8 +423,8 @@ export default {
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"));
.then(r => this.notifySuccess(`Checks will now be re-run on ${r.data}`))
.catch(e => this.notifyError("Something went wrong"));
},
removeAgent(pk, name) {
this.$q
@@ -432,18 +433,18 @@ export default {
prompt: {
model: "",
type: "text",
isValid: (val) => val === name,
isValid: val => val === name,
},
cancel: true,
ok: { label: "Uninstall", color: "negative" },
persistent: true,
html: true,
})
.onOk((val) => {
.onOk(val => {
const data = { pk: pk };
this.$axios
.delete("/agents/uninstall/", { data: data })
.then((r) => {
.then(r => {
this.notifySuccess(r.data);
setTimeout(() => {
location.reload();
@@ -456,7 +457,7 @@ export default {
this.$q.loading.show();
this.$axios
.get(`/agents/${pk}/ping/`)
.then((r) => {
.then(r => {
this.$q.loading.hide();
if (r.data.status === "offline") {
this.$q
@@ -479,7 +480,7 @@ export default {
this.notifyError("Something went wrong");
}
})
.catch((e) => {
.catch(e => {
this.$q.loading.hide();
this.notifyError("Something went wrong");
});
@@ -494,7 +495,7 @@ export default {
})
.onOk(() => {
const data = { pk: pk, action: "rebootnow" };
axios.post("/agents/poweraction/", data).then((r) => {
axios.post("/agents/poweraction/", data).then(r => {
this.$q.dialog({
title: `Restarting ${hostname}`,
message: `${hostname} will now be restarted`,
@@ -520,14 +521,14 @@ export default {
const alertColor = alert_action ? "positive" : "warning";
axios
.post("/agents/overdueaction/", data)
.then((r) => {
.then(r => {
this.$q.notify({
color: alertColor,
icon: "fas fa-check-circle",
message: `Overdue ${category} alerts ${action} on ${r.data}`,
});
})
.catch((e) => this.notifyError(e.response.data.error));
.catch(e => this.notifyError(e.response.data.error));
},
agentClass(status) {
if (status === "offline") {
@@ -546,18 +547,18 @@ export default {
this.$q.loading.show();
this.$axios
.get(`/agents/${pk}/meshcentral/`)
.then((r) => {
.then(r => {
this.$q.loading.hide();
openURL(r.data.webrdp);
})
.catch((e) => {
.catch(e => {
this.$q.loading.hide();
this.notifyError(e.response.data);
});
},
},
computed: {
...mapGetters(["selectedAgentPk"]),
...mapGetters(["selectedAgentPk", "agentTableHeight"]),
selectedRow() {
return this.$store.state.selectedRow;
},