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 {
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 {

View File

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

View File

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

View File

@ -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>

View File

@ -28,7 +28,6 @@
<div class="search-button">
<el-input
v-model="searchName"
clearable
@clear="search()"
suffix-icon="Search"
@keyup.enter="search()"
@ -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,
@ -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,
};
@ -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);
},
},
];

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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>

View File

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

View File

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

View File

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

View File

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

View File

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