mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-10-01 01:25:45 -04:00
2b42c3c828
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
56 lines
1.0 KiB
Vue
56 lines
1.0 KiB
Vue
<template>
|
|
<span class="badge rounded-pill" :class=" 'bg-' + color ">{{ text }}</span>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
props: {
|
|
/** Current status of monitor */
|
|
status: {
|
|
type: Number,
|
|
default: 0,
|
|
}
|
|
},
|
|
|
|
computed: {
|
|
color() {
|
|
if (this.status === 0) {
|
|
return "danger";
|
|
}
|
|
|
|
if (this.status === 1) {
|
|
return "primary";
|
|
}
|
|
|
|
if (this.status === 2) {
|
|
return "warning";
|
|
}
|
|
|
|
return "secondary";
|
|
},
|
|
|
|
text() {
|
|
if (this.status === 0) {
|
|
return this.$t("Down");
|
|
}
|
|
|
|
if (this.status === 1) {
|
|
return this.$t("Up");
|
|
}
|
|
|
|
if (this.status === 2) {
|
|
return this.$t("Pending");
|
|
}
|
|
|
|
return this.$t("Unknown");
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style scoped>
|
|
span {
|
|
min-width: 64px;
|
|
}
|
|
</style>
|