-
-
- {{ stateText }}
+
+
+ {{ runStateText }}
+
+
+
+
+
+ {{ maintStateText }}
@@ -12,15 +18,37 @@ import { computed } from 'vue';
const props = defineProps({
- state: {
- type: Number,
- default: 1,
- }
+ // 主机运行状态
+ runstatus: {
+ type: String,
+ default: ""
+ },
+ // 主机维护状态
+ maintstatus: {
+ type: String,
+ default: ""
+ },
})
-const stateText = computed(() => {
- return props.state == 1 ? '在线' : props.state == 3 ? '未分配' : '离线'
+const runDotClass = computed(() => {
+ return props.runstatus === 'online' ? 'online' : props.runstatus === 'offline' ? 'offline' : 'unSet';
+})
+const runTextClass = computed(() => {
+ return props.runstatus === 'online' ? 'onlineText' : props.runstatus === 'offline' ? 'offlineText' : 'unsetText';
+})
+const runStateText = computed(() => {
+ return props.runstatus === 'online' ? '在线' : props.runstatus === 'offline' ? '离线' : '未知';
+})
+const maintDotClass = computed(() => {
+ return props.maintstatus === 'normal' ? 'online' : props.maintstatus === 'maintenance' ? 'unSet' : 'offline';
})
+const maintTextClass = computed(() => {
+ return props.maintstatus == 'normal' ? 'online' : props.maintstatus === 'maintenance' ? 'unsetText' : 'offlineText';
+})
+const maintStateText = computed(() => {
+ return props.maintstatus == 'normal' ? '正常' : props.maintstatus === 'maintenance' ? '维护中' : '未知';
+})
+
\ No newline at end of file
diff --git a/frontend/src/views/Batch/Detail.vue b/frontend/src/views/Batch/Detail.vue
index f5337887f49fcced66da8d2ffe674cd0428c792b..3bf920eb1326b0632c64c32ccf401de034561071 100644
--- a/frontend/src/views/Batch/Detail.vue
+++ b/frontend/src/views/Batch/Detail.vue
@@ -35,7 +35,7 @@