uptime-kuma/src/components/Status.vue

43 lines
769 B
Vue
Raw Normal View History

2021-06-30 13:04:58 +00:00
<template>
2021-07-11 22:26:33 +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: {
status: Number
},
computed: {
color() {
if (this.status === 0) {
return "danger"
} else if (this.status === 1) {
return "primary"
} else {
return "secondary"
}
},
text() {
if (this.status === 0) {
return "Down"
} else if (this.status === 1) {
return "Up"
} else {
return "Unknown"
}
},
}
}
</script>
<style scoped>
2021-07-11 22:26:33 +00:00
span {
width: 45px;
}
.badge {
color: #0a0a0a;
}
2021-06-30 13:04:58 +00:00
</style>