mirror of
https://github.com/louislam/dockge.git
synced 2026-05-21 14:02:17 +00:00
Init (#1)
This commit is contained in:
54
frontend/src/components/Uptime.vue
Normal file
54
frontend/src/components/Uptime.vue
Normal file
@@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<span :class="className">{{ statusName }}</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { statusColor, statusNameShort } from "../../../backend/util-common";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
stack: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
fixedWidth: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
uptime() {
|
||||
return "0.00%";
|
||||
return this.$t("notAvailableShort");
|
||||
},
|
||||
|
||||
color() {
|
||||
return statusColor(this.stack?.status);
|
||||
},
|
||||
|
||||
statusName() {
|
||||
return this.$t(statusNameShort(this.stack?.status));
|
||||
},
|
||||
|
||||
className() {
|
||||
let className = `badge rounded-pill bg-${this.color}`;
|
||||
|
||||
if (this.fixedWidth) {
|
||||
className += " fixed-width";
|
||||
}
|
||||
return className;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.badge {
|
||||
min-width: 62px;
|
||||
}
|
||||
|
||||
.fixed-width {
|
||||
width: 62px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user