fix: 解决列表设置导致的浏览器抖动问题 (#3236)

pull/3249/head
ssongliu 2023-12-08 18:16:07 +08:00 committed by GitHub
parent 0fe9a87ea0
commit 5f60ea3f81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 20 additions and 27 deletions

View File

@ -326,7 +326,9 @@ func updateDNS(list []string) error {
} }
} }
for _, item := range list { 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) file, err := os.OpenFile(defaultDNSPath, os.O_WRONLY|os.O_TRUNC, 0640)
if err != nil { if err != nil {

View File

@ -36,7 +36,6 @@
<div class="search-button"> <div class="search-button">
<el-input <el-input
v-model="searchName" v-model="searchName"
clearable
@clear="search()" @clear="search()"
suffix-icon="Search" suffix-icon="Search"
@keyup.enter="search()" @keyup.enter="search()"

View File

@ -44,7 +44,6 @@
<div class="search-button"> <div class="search-button">
<el-input <el-input
v-model="searchName" v-model="searchName"
clearable
@clear="search()" @clear="search()"
suffix-icon="Search" suffix-icon="Search"
@keyup.enter="search()" @keyup.enter="search()"

View File

@ -13,7 +13,7 @@
:closable="false" :closable="false"
type="error" 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-form-item :label="$t('container.oldImage')" prop="oldImage">
<el-tooltip placement="top-start" :content="form.imageName" v-if="form.imageName.length > 50"> <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> <el-tag>{{ form.imageName.substring(0, 50) }}...:{{ form.oldTag }}</el-tag>

View File

@ -28,7 +28,6 @@
<div class="search-button"> <div class="search-button">
<el-input <el-input
v-model="searchName" v-model="searchName"
clearable
@clear="search()" @clear="search()"
suffix-icon="Search" suffix-icon="Search"
@keyup.enter="search()" @keyup.enter="search()"
@ -196,7 +195,7 @@ const loadRepos = async () => {
}; };
const onDelete = (row: Container.ImageInfo) => { const onDelete = (row: Container.ImageInfo) => {
let names = row.tags; let names = row.tags || [row.id.replaceAll('sha256:', '').substring(0, 12)];
opRef.value.acceptParams({ opRef.value.acceptParams({
title: i18n.global.t('commons.button.delete'), title: i18n.global.t('commons.button.delete'),
names: names, names: names,
@ -243,7 +242,7 @@ const buttons = [
label: i18n.global.t('container.tag'), label: i18n.global.t('container.tag'),
click: (row: Container.ImageInfo) => { click: (row: Container.ImageInfo) => {
let params = { 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, repos: repos.value,
sourceID: row.id, sourceID: row.id,
}; };
@ -273,16 +272,16 @@ const buttons = [
{ {
label: i18n.global.t('commons.button.delete'), label: i18n.global.t('commons.button.delete'),
click: async (row: Container.ImageInfo) => { 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); onDelete(row);
return;
} }
let params = {
id: row.id,
isUsed: row.isUsed,
tags: row.tags,
};
dialogDeleteRef.value!.acceptParams(params);
}, },
}, },
]; ];

View File

@ -25,7 +25,6 @@
<div class="search-button"> <div class="search-button">
<el-input <el-input
v-model="searchName" v-model="searchName"
clearable
@clear="search()" @clear="search()"
suffix-icon="Search" suffix-icon="Search"
@keyup.enter="search()" @keyup.enter="search()"

View File

@ -19,7 +19,6 @@
<div class="search-button"> <div class="search-button">
<el-input <el-input
v-model="searchName" v-model="searchName"
clearable
@clear="search()" @clear="search()"
suffix-icon="Search" suffix-icon="Search"
@keyup.enter="search()" @keyup.enter="search()"

View File

@ -22,7 +22,6 @@
<div class="search-button"> <div class="search-button">
<el-input <el-input
v-model="searchName" v-model="searchName"
clearable
@clear="search()" @clear="search()"
suffix-icon="Search" suffix-icon="Search"
@keyup.enter="search()" @keyup.enter="search()"

View File

@ -25,7 +25,6 @@
<div class="search-button"> <div class="search-button">
<el-input <el-input
v-model="searchName" v-model="searchName"
clearable
@clear="search()" @clear="search()"
suffix-icon="Search" suffix-icon="Search"
@keyup.enter="search()" @keyup.enter="search()"

View File

@ -32,7 +32,6 @@
<div class="search-button"> <div class="search-button">
<el-input <el-input
v-model="searchName" v-model="searchName"
clearable
@clear="search()" @clear="search()"
suffix-icon="Search" suffix-icon="Search"
@keyup.enter="search()" @keyup.enter="search()"

View File

@ -96,8 +96,12 @@
</el-button> </el-button>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item @click="goDashboard('phpMyAdmin')">phpMyAdmin</el-dropdown-item> <el-dropdown-item icon="Position" @click="goDashboard('phpMyAdmin')">
<el-dropdown-item @click="goDashboard('Adminer')" divided>Adminer</el-dropdown-item> phpMyAdmin
</el-dropdown-item>
<el-dropdown-item icon="Position" @click="goDashboard('Adminer')" divided>
Adminer
</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>

View File

@ -34,7 +34,6 @@
<div class="search-button"> <div class="search-button">
<el-input <el-input
v-model="searchName" v-model="searchName"
clearable
suffix-icon="Search" suffix-icon="Search"
@change="search()" @change="search()"
:placeholder="$t('commons.button.search')" :placeholder="$t('commons.button.search')"

View File

@ -66,7 +66,6 @@
<div class="search-button"> <div class="search-button">
<el-input <el-input
v-model="searchName" v-model="searchName"
clearable
suffix-icon="Search" suffix-icon="Search"
@change="search()" @change="search()"
:placeholder="$t('commons.button.search')" :placeholder="$t('commons.button.search')"

View File

@ -22,7 +22,6 @@
<el-input <el-input
v-model="searchInfo" v-model="searchInfo"
@clear="search()" @clear="search()"
clearable
suffix-icon="Search" suffix-icon="Search"
@keyup.enter="search()" @keyup.enter="search()"
@change="search()" @change="search()"

View File

@ -19,7 +19,6 @@
<div class="search-button"> <div class="search-button">
<el-input <el-input
v-model="searchName" v-model="searchName"
clearable
@clear="search()" @clear="search()"
suffix-icon="Search" suffix-icon="Search"
@keyup.enter="search()" @keyup.enter="search()"

View File

@ -19,7 +19,6 @@
<div class="search-button"> <div class="search-button">
<el-input <el-input
v-model="searchName" v-model="searchName"
clearable
@clear="search()" @clear="search()"
suffix-icon="Search" suffix-icon="Search"
@keyup.enter="search()" @keyup.enter="search()"