cleanup some mixins UI

This commit is contained in:
wh1te909
2020-04-11 08:29:56 +00:00
parent f8fcf00339
commit c30913d931
3 changed files with 26 additions and 59 deletions

View File

@@ -363,27 +363,13 @@ export default {
})
.onOk(hostnameConfirm => {
if (hostnameConfirm !== hostname) {
this.$q.notify({
message: "ERROR: Please type the correct hostname",
color: "red"
});
this.notifyError("ERROR: Please type the correct hostname");
} 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
});
});
.then(r => this.notifySuccess(`${hostname} will now be uninstalled!`))
.catch(e => this.notifyInfo(e.response.data.error));
}
});
});
@@ -438,11 +424,7 @@ export default {
})
.catch(err => {
this.loadingSendCMD = false;
this.$q.notify({
color: "red",
icon: "fas fa-times-circle",
message: err.response.data
});
this.notifyError(err.response.data);
});
},
agentRowSelected(pk) {
@@ -469,9 +451,7 @@ export default {
message: `Overdue ${category} alerts ${action} on ${r.data}`
});
})
.catch(e => {
console.log(e.response.data.error);
});
.catch(e => this.notifyError(e.response.data.error));
},
agentClass(status) {
if (status === "offline") {