2021-06-30 13:04:58 +00:00
|
|
|
<template>
|
2021-07-13 04:16:11 +00:00
|
|
|
<span class="badge rounded-pill" :class=" 'bg-' + color ">{{ text }}</span>
|
2021-06-30 13:04:58 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
2022-06-01 23:32:05 +00:00
|
|
|
/** Current status of monitor */
|
2022-04-30 01:51:14 +00:00
|
|
|
status: {
|
|
|
|
type: Number,
|
|
|
|
default: 0,
|
|
|
|
}
|
2021-06-30 13:04:58 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
color() {
|
|
|
|
if (this.status === 0) {
|
2021-10-08 02:51:03 +00:00
|
|
|
return "danger";
|
2021-07-27 18:03:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (this.status === 1) {
|
2021-10-08 02:51:03 +00:00
|
|
|
return "primary";
|
2021-07-27 18:03:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (this.status === 2) {
|
2021-10-08 02:51:03 +00:00
|
|
|
return "warning";
|
2021-06-30 13:04:58 +00:00
|
|
|
}
|
2021-07-27 17:47:13 +00:00
|
|
|
|
2022-01-23 14:22:00 +00:00
|
|
|
if (this.status === 3) {
|
|
|
|
return "maintenance";
|
|
|
|
}
|
|
|
|
|
2021-10-08 02:51:03 +00:00
|
|
|
return "secondary";
|
2021-06-30 13:04:58 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
text() {
|
|
|
|
if (this.status === 0) {
|
2021-08-24 10:26:44 +00:00
|
|
|
return this.$t("Down");
|
2021-07-27 18:03:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (this.status === 1) {
|
2021-08-24 10:26:44 +00:00
|
|
|
return this.$t("Up");
|
2021-07-27 18:03:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (this.status === 2) {
|
2021-08-24 10:26:44 +00:00
|
|
|
return this.$t("Pending");
|
2021-06-30 13:04:58 +00:00
|
|
|
}
|
2021-07-27 17:47:13 +00:00
|
|
|
|
2022-01-23 14:22:00 +00:00
|
|
|
if (this.status === 3) {
|
|
|
|
return this.$t("Maintenance");
|
|
|
|
}
|
|
|
|
|
2021-08-24 10:26:44 +00:00
|
|
|
return this.$t("Unknown");
|
2021-06-30 13:04:58 +00:00
|
|
|
},
|
2021-07-27 17:47:13 +00:00
|
|
|
},
|
2021-10-08 02:51:03 +00:00
|
|
|
};
|
2021-06-30 13:04:58 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
2021-07-13 04:16:11 +00:00
|
|
|
span {
|
2021-10-08 02:51:03 +00:00
|
|
|
min-width: 64px;
|
2021-07-13 04:16:11 +00:00
|
|
|
}
|
2021-06-30 13:04:58 +00:00
|
|
|
</style>
|