mirror of
https://github.com/hi2shark/nazhua.git
synced 2026-01-11 22:50:42 +08:00
🐛 fix: 修正分组下不存在服务器时,servers对象不存在导致分组异常问题
This commit is contained in:
parent
d99225eca7
commit
b16fd1ac15
@ -20,9 +20,9 @@
|
||||
>
|
||||
<div class="left-box">
|
||||
<server-option-box
|
||||
v-if="showTag && tagOptions.length"
|
||||
v-if="showTag && serverGroupOptions.length"
|
||||
v-model="filterFormData.tag"
|
||||
:options="tagOptions"
|
||||
:options="serverGroupOptions"
|
||||
/>
|
||||
</div>
|
||||
<div class="right-box">
|
||||
@ -158,13 +158,21 @@ const showTag = computed(() => {
|
||||
const serverList = computed(() => store.state.serverList);
|
||||
// 服务器总数
|
||||
const serverCount = computed(() => store.state.serverCount);
|
||||
|
||||
const tagOptions = computed(() => store.state.serverGroup.map((i) => ({
|
||||
// 分组标签
|
||||
const serverGroupOptions = computed(() => {
|
||||
const options = [];
|
||||
store.state.serverGroup.forEach((i) => {
|
||||
if (i.servers && i.servers.length > 0) {
|
||||
options.push({
|
||||
key: uuid(),
|
||||
label: i.name,
|
||||
value: i.name,
|
||||
title: `${i.servers.length}台`,
|
||||
})));
|
||||
});
|
||||
}
|
||||
});
|
||||
return options;
|
||||
});
|
||||
|
||||
const onlineOptions = computed(() => {
|
||||
if (serverCount.value?.total !== serverCount.value?.online) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user