diff --git a/frontend/src/components/StateDot.vue b/frontend/src/components/StateDot.vue index 9a6f5d2c1f590796458cc0a0690052b3201d915c..94f717754ad30ba8ed65ce2aa9caee33d0055550 100644 --- a/frontend/src/components/StateDot.vue +++ b/frontend/src/components/StateDot.vue @@ -1,8 +1,14 @@ @@ -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 @@ diff --git a/frontend/src/views/Cluster/Cluster.vue b/frontend/src/views/Cluster/Cluster.vue index bc687cb09d4ecf968e4066e5e5a9b3e07b290933..7a227c011fd6557d20b296a50f29b7fdc59570c6 100644 --- a/frontend/src/views/Cluster/Cluster.vue +++ b/frontend/src/views/Cluster/Cluster.vue @@ -9,7 +9,7 @@
+ v-model:selectedData="selectedMachines"> @@ -118,7 +113,7 @@ function updateDepartmentMachines(departID: number) { uuids.push(resp.data[i].uuid) } // let result = resp - getMachineTags({ "uuids": uuids }).then((resp:any) => { + getMachineTags({ "uuids": uuids }).then((resp: any) => { if (resp.code != 200) { ElMessage.error("failed to get machine tags: " + resp.msg) }