mirror of
https://github.com/jpros/tacticalrmm-web.git
synced 2026-02-28 23:31:54 +00:00
cleanup some mixins UI
This commit is contained in:
@@ -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") {
|
||||
|
||||
@@ -163,6 +163,7 @@
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import mixins from "@/mixins/mixins";
|
||||
|
||||
export default {
|
||||
name: "Services",
|
||||
@@ -255,18 +256,10 @@ export default {
|
||||
.then(r => {
|
||||
this.serviceDetailsModal = false;
|
||||
this.refreshServices();
|
||||
this.$q.notify({
|
||||
color: "green",
|
||||
icon: "fas fa-check-circle",
|
||||
message: `Service ${name} was edited!`
|
||||
});
|
||||
this.notifySuccess(`Service ${name} was edited!`);
|
||||
})
|
||||
.catch(err => {
|
||||
this.$q.notify({
|
||||
color: "red",
|
||||
icon: "fas fa-times-circle",
|
||||
message: err.response.data.error
|
||||
});
|
||||
this.notifyError(err.response.data.error);
|
||||
});
|
||||
},
|
||||
startupTypeChanged() {
|
||||
@@ -298,11 +291,7 @@ export default {
|
||||
.catch(err => {
|
||||
this.serviceDetailVisible = false;
|
||||
this.serviceDetailsModal = false;
|
||||
this.$q.notify({
|
||||
color: "red",
|
||||
icon: "fas fa-times-circle",
|
||||
message: err.response.data.error
|
||||
});
|
||||
this.notifyError(err.response.data.error);
|
||||
});
|
||||
},
|
||||
serviceAction(name, action, fullname) {
|
||||
@@ -334,19 +323,11 @@ export default {
|
||||
.then(r => {
|
||||
this.refreshServices();
|
||||
this.serviceDetailsModal = false;
|
||||
this.$q.notify({
|
||||
color: "green",
|
||||
icon: "fas fa-check-circle",
|
||||
message: `Service ${fullname} was ${status}!`
|
||||
});
|
||||
this.notifySuccess(`Service ${fullname} was ${status}!`);
|
||||
})
|
||||
.catch(err => {
|
||||
this.$q.loading.hide();
|
||||
this.$q.notify({
|
||||
color: "red",
|
||||
icon: "fas fa-times-circle",
|
||||
message: err.response.data.error
|
||||
});
|
||||
this.notifyError(err.response.data.error);
|
||||
});
|
||||
},
|
||||
async getServices() {
|
||||
@@ -367,11 +348,7 @@ export default {
|
||||
})
|
||||
.catch(err => {
|
||||
this.$q.loading.hide();
|
||||
this.$q.notify({
|
||||
color: "red",
|
||||
icon: "fas fa-times-circle",
|
||||
message: err.response.data.error
|
||||
});
|
||||
this.notifyError(err.response.data.error);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -27,15 +27,25 @@ export default {
|
||||
},
|
||||
notifySuccess(msg) {
|
||||
Notify.create({
|
||||
color: "green",
|
||||
icon: "fas fa-check-circle",
|
||||
type: "positive",
|
||||
message: msg
|
||||
});
|
||||
},
|
||||
notifyError(msg) {
|
||||
Notify.create({
|
||||
color: "red",
|
||||
icon: "fas fa-times-circle",
|
||||
type: "negative",
|
||||
message: msg
|
||||
});
|
||||
},
|
||||
notifyWarning(msg) {
|
||||
Notify.create({
|
||||
type: "warning",
|
||||
message: msg
|
||||
});
|
||||
},
|
||||
notifyInfo(msg) {
|
||||
Notify.create({
|
||||
type: "info",
|
||||
message: msg
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user