💄 update null status

This commit is contained in:
chaos-zhu 2024-07-29 09:17:44 +08:00
parent 707c87455a
commit a95caf6d2f
2 changed files with 12 additions and 2 deletions

View File

@ -25,6 +25,7 @@
autocomplete="off" autocomplete="off"
:trigger-on-focus="false" :trigger-on-focus="false"
clearable clearable
autofocus
/> />
</el-form-item> </el-form-item>
<el-form-item prop="pwd" label="密码"> <el-form-item prop="pwd" label="密码">

View File

@ -7,7 +7,12 @@
</el-button> </el-button>
</div> </div>
<div class="server_group_collapse"> <div class="server_group_collapse">
<el-collapse v-model="activeGroup"> <div v-if="isNoHost">
<el-empty description="暂无实例">
<el-button type="primary" @click="hostFormVisible = true">添加第一台实例配置</el-button>
</el-empty>
</div>
<el-collapse v-else v-model="activeGroup">
<el-collapse-item v-for="(servers, groupName) in groupHostList" :key="groupName" :name="groupName"> <el-collapse-item v-for="(servers, groupName) in groupHostList" :key="groupName" :name="groupName">
<template #title> <template #title>
<div class="group_title"> <div class="group_title">
@ -37,7 +42,7 @@
</template> </template>
<script setup> <script setup>
import { ref, onBeforeUnmount, getCurrentInstance, computed, watch } from 'vue' import { ref, getCurrentInstance, computed, watch } from 'vue'
import HostCard from './components/host-card.vue' import HostCard from './components/host-card.vue'
import HostForm from './components/host-form.vue' import HostForm from './components/host-form.vue'
@ -95,6 +100,8 @@ watch(groupHostList, () => {
deep: false deep: false
}) })
let isNoHost = computed(() => Object.keys(groupHostList.value).length === 0)
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -105,6 +112,7 @@ watch(groupHostList, () => {
align-items: center; align-items: center;
justify-content: end; justify-content: end;
} }
.server_group_collapse { .server_group_collapse {
.group_title { .group_title {
margin: 0 15px; margin: 0 15px;
@ -112,6 +120,7 @@ watch(groupHostList, () => {
font-weight: 600; font-weight: 600;
line-height: 22px; line-height: 22px;
} }
.host_card_container { .host_card_container {
padding-top: 25px; padding-top: 25px;
} }