2021-06-30 06:04:58 -07:00
|
|
|
<template>
|
2021-07-12 21:16:11 -07:00
|
|
|
<span class="badge rounded-pill" :class=" 'bg-' + color ">{{ text }}</span>
|
2021-06-30 06:04:58 -07:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
2021-07-27 10:47:13 -07:00
|
|
|
status: Number,
|
2021-06-30 06:04:58 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
color() {
|
|
|
|
if (this.status === 0) {
|
|
|
|
return "danger"
|
2021-07-27 10:47:13 -07:00
|
|
|
} if (this.status === 1) {
|
2021-06-30 06:04:58 -07:00
|
|
|
return "primary"
|
2021-07-27 10:47:13 -07:00
|
|
|
} if (this.status === 2) {
|
2021-07-19 09:23:06 -07:00
|
|
|
return "warning"
|
2021-06-30 06:04:58 -07:00
|
|
|
}
|
2021-07-27 10:47:13 -07:00
|
|
|
return "secondary"
|
|
|
|
|
2021-06-30 06:04:58 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
text() {
|
|
|
|
if (this.status === 0) {
|
|
|
|
return "Down"
|
2021-07-27 10:47:13 -07:00
|
|
|
} if (this.status === 1) {
|
2021-06-30 06:04:58 -07:00
|
|
|
return "Up"
|
2021-07-27 10:47:13 -07:00
|
|
|
} if (this.status === 2) {
|
2021-07-19 09:23:06 -07:00
|
|
|
return "Pending"
|
2021-06-30 06:04:58 -07:00
|
|
|
}
|
2021-07-27 10:47:13 -07:00
|
|
|
return "Unknown"
|
|
|
|
|
2021-06-30 06:04:58 -07:00
|
|
|
},
|
2021-07-27 10:47:13 -07:00
|
|
|
},
|
2021-06-30 06:04:58 -07:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
2021-07-12 21:16:11 -07:00
|
|
|
span {
|
2021-07-19 09:23:06 -07:00
|
|
|
width: 54px;
|
2021-07-12 21:16:11 -07:00
|
|
|
}
|
2021-06-30 06:04:58 -07:00
|
|
|
</style>
|