Skip to content

Commit

Permalink
fix: 解决列表设置导致的浏览器抖动问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ssongliu committed Dec 8, 2023
1 parent bd2003c commit 999f2d8
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 27 deletions.
4 changes: 3 additions & 1 deletion backend/app/service/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,9 @@ func updateDNS(list []string) error {
}
}
for _, item := range list {
newFile += fmt.Sprintf("nameserver %s \n", item)
if len(item) != 0 {
newFile += fmt.Sprintf("nameserver %s \n", item)
}
}
file, err := os.OpenFile(defaultDNSPath, os.O_WRONLY|os.O_TRUNC, 0640)
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/container/compose/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
<div class="search-button">
<el-input
v-model="searchName"
clearable
@clear="search()"
suffix-icon="Search"
@keyup.enter="search()"
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/container/container/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
<div class="search-button">
<el-input
v-model="searchName"
clearable
@clear="search()"
suffix-icon="Search"
@keyup.enter="search()"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/container/container/upgrade/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
:closable="false"
type="error"
/>
<el-form @submit.prevent ref="formRef" v-loading="loading" :model="form" label-position="top">
<el-form @submit.prevent ref="formRef" :model="form" label-position="top">
<el-form-item :label="$t('container.oldImage')" prop="oldImage">
<el-tooltip placement="top-start" :content="form.imageName" v-if="form.imageName.length > 50">
<el-tag>{{ form.imageName.substring(0, 50) }}...:{{ form.oldTag }}</el-tag>
Expand Down
21 changes: 10 additions & 11 deletions frontend/src/views/container/image/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<div class="search-button">
<el-input
v-model="searchName"
clearable
@clear="search()"
suffix-icon="Search"
@keyup.enter="search()"
Expand Down Expand Up @@ -196,7 +195,7 @@ const loadRepos = async () => {
};
const onDelete = (row: Container.ImageInfo) => {
let names = row.tags;
let names = row.tags || [row.id.replaceAll('sha256:', '').substring(0, 12)];
opRef.value.acceptParams({
title: i18n.global.t('commons.button.delete'),
names: names,
Expand Down Expand Up @@ -243,7 +242,7 @@ const buttons = [
label: i18n.global.t('container.tag'),
click: (row: Container.ImageInfo) => {
let params = {
itemName: row.tags.length !== 0 ? row.tags[0].split(':')[0] : '',
itemName: row.tags && row.tags?.length !== 0 ? row.tags[0].split(':')[0] : '',
repos: repos.value,
sourceID: row.id,
};
Expand Down Expand Up @@ -273,16 +272,16 @@ const buttons = [
{
label: i18n.global.t('commons.button.delete'),
click: async (row: Container.ImageInfo) => {
if (!row.tags?.length || row.tags.length <= 1) {
if (row.tags && row.tags.length > 1) {
let params = {
id: row.id,
isUsed: row.isUsed,
tags: row.tags,
};
dialogDeleteRef.value!.acceptParams(params);
} else {
onDelete(row);
return;
}
let params = {
id: row.id,
isUsed: row.isUsed,
tags: row.tags,
};
dialogDeleteRef.value!.acceptParams(params);
},
},
];
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/container/network/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<div class="search-button">
<el-input
v-model="searchName"
clearable
@clear="search()"
suffix-icon="Search"
@keyup.enter="search()"
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/container/repo/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<div class="search-button">
<el-input
v-model="searchName"
clearable
@clear="search()"
suffix-icon="Search"
@keyup.enter="search()"
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/container/template/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<div class="search-button">
<el-input
v-model="searchName"
clearable
@clear="search()"
suffix-icon="Search"
@keyup.enter="search()"
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/container/volume/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<div class="search-button">
<el-input
v-model="searchName"
clearable
@clear="search()"
suffix-icon="Search"
@keyup.enter="search()"
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/cronjob/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<div class="search-button">
<el-input
v-model="searchName"
clearable
@clear="search()"
suffix-icon="Search"
@keyup.enter="search()"
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/views/database/mysql/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="goDashboard('phpMyAdmin')">phpMyAdmin</el-dropdown-item>
<el-dropdown-item @click="goDashboard('Adminer')" divided>Adminer</el-dropdown-item>
<el-dropdown-item icon="Position" @click="goDashboard('phpMyAdmin')">
phpMyAdmin
</el-dropdown-item>
<el-dropdown-item icon="Position" @click="goDashboard('Adminer')" divided>
Adminer
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/host/firewall/ip/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<div class="search-button">
<el-input
v-model="searchName"
clearable
suffix-icon="Search"
@change="search()"
:placeholder="$t('commons.button.search')"
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/host/firewall/port/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
<div class="search-button">
<el-input
v-model="searchName"
clearable
suffix-icon="Search"
@change="search()"
:placeholder="$t('commons.button.search')"
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/host/ssh/log/log.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<el-input
v-model="searchInfo"
@clear="search()"
clearable
suffix-icon="Search"
@keyup.enter="search()"
@change="search()"
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/log/operation/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<div class="search-button">
<el-input
v-model="searchName"
clearable
@clear="search()"
suffix-icon="Search"
@keyup.enter="search()"
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/setting/snapshot/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<div class="search-button">
<el-input
v-model="searchName"
clearable
@clear="search()"
suffix-icon="Search"
@keyup.enter="search()"
Expand Down

0 comments on commit 999f2d8

Please sign in to comment.