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: {
|
|
|
|
status: Number
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
color() {
|
|
|
|
if (this.status === 0) {
|
|
|
|
return "danger"
|
|
|
|
} else if (this.status === 1) {
|
|
|
|
return "primary"
|
2021-07-19 16:23:06 +00:00
|
|
|
} else if (this.status === 2) {
|
|
|
|
return "warning"
|
2021-06-30 13:04:58 +00:00
|
|
|
} else {
|
|
|
|
return "secondary"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
text() {
|
|
|
|
if (this.status === 0) {
|
|
|
|
return "Down"
|
|
|
|
} else if (this.status === 1) {
|
|
|
|
return "Up"
|
2021-07-19 16:23:06 +00:00
|
|
|
} else if (this.status === 2) {
|
|
|
|
return "Pending"
|
2021-06-30 13:04:58 +00:00
|
|
|
} else {
|
|
|
|
return "Unknown"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
2021-07-13 04:16:11 +00:00
|
|
|
span {
|
2021-07-19 16:23:06 +00:00
|
|
|
width: 54px;
|
2021-07-13 04:16:11 +00:00
|
|
|
}
|
2021-06-30 13:04:58 +00:00
|
|
|
</style>
|