1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

feat: Optimize style and description (#7393)

This commit is contained in:
2024-12-17 20:46:11 +08:00 committed by GitHub
parent 6275eec918
commit 3b38b9d86b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 249 additions and 126 deletions

View File

@ -52,9 +52,14 @@
</span> </span>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item v-if="globalStore.isIntl" command="en">
English
</el-dropdown-item>
<el-dropdown-item command="zh">中文(简体)</el-dropdown-item> <el-dropdown-item command="zh">中文(简体)</el-dropdown-item>
<el-dropdown-item command="tw">中文(繁體)</el-dropdown-item> <el-dropdown-item command="tw">中文(繁體)</el-dropdown-item>
<el-dropdown-item command="en">English</el-dropdown-item> <el-dropdown-item v-if="!globalStore.isIntl" command="en">
English
</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>

View File

@ -2,7 +2,7 @@
<div v-loading="loading"> <div v-loading="loading">
<LayoutContent :title="$t('setting.panel')" :divider="true"> <LayoutContent :title="$t('setting.panel')" :divider="true">
<template #main> <template #main>
<el-form :model="form" :label-position="mobile ? 'top' : 'left'" label-width="150px"> <el-form :model="form" :label-position="mobile ? 'top' : 'left'" label-width="auto">
<el-row> <el-row>
<el-col :span="1"><br /></el-col> <el-col :span="1"><br /></el-col>
<el-col :xs="24" :sm="20" :md="15" :lg="12" :xl="12"> <el-col :xs="24" :sm="20" :md="15" :lg="12" :xl="12">

View File

@ -137,14 +137,16 @@
</div> </div>
</div> </div>
<div v-if="scanStatus === 'scanned'"> <div v-if="scanStatus === 'scanned'">
<div> <div class="flex flex-row justify-between items-center gap-2">
<el-text class="clean_title"> <div>
{{ $t('clean.totalScan') }} {{ computeSize(totalSize) }} <el-text class="clean_title">
</el-text> {{ $t('clean.totalScan') }} {{ computeSize(totalSize) }}
<div class="mt-4">
<el-text type="info">
{{ $t('clean.selectScan') }} {{ computeSize(selectSize) }}
</el-text> </el-text>
<div class="mt-4">
<el-text type="info">
{{ $t('clean.selectScan') }} {{ computeSize(selectSize) }}
</el-text>
</div>
</div> </div>
<div class="large_button"> <div class="large_button">
<el-button type="primary" size="large" @click="onSubmitClean"> <el-button type="primary" size="large" @click="onSubmitClean">
@ -152,124 +154,191 @@
</el-button> </el-button>
</div> </div>
</div> </div>
<el-collapse v-model="activeNames" class="mt-5"> <div class="tree-container">
<el-collapse-item :title="$t('clean.system')" name="system"> <el-collapse v-model="activeNames" class="tree-collapse">
<el-tree <el-collapse-item :title="$t('clean.system')" name="system">
ref="systemRef" <el-tree
:data="cleanData.systemClean" ref="systemRef"
node-key="id" :data="cleanData.systemClean"
:default-checked-keys="systemDefaultCheck" node-key="id"
show-checkbox :default-checked-keys="systemDefaultCheck"
:props="defaultProps" show-checkbox
@check-change="onChange" :props="defaultProps"
> @check-change="onChange"
<template #default="{ node, data }"> class="responsive-tree"
<div class="float-left"> >
<span>{{ load18n(data.label) }}</span> <template #default="{ node, data }">
</div> <div class="tree-node">
<div class="ml-4 float-left"> <el-tooltip
<span v-if="data.size">{{ computeSize(data.size) }}</span> effect="dark"
</div> :content="load18n(data.label)"
<div class="ml-4 float-left"> placement="top"
<span>{{ loadTag(node, data) }}</span> >
</div> <span class="tree-node-label">{{ load18n(data.label) }}</span>
</template> </el-tooltip>
</el-tree> <span class="tree-node-size" v-if="data.size">
</el-collapse-item> {{ computeSize(data.size) }}
</span>
<el-tooltip
effect="dark"
:content="loadTag(node, data)"
placement="top"
>
<span class="tree-node-tooltip">
{{ loadTag(node, data) }}
</span>
</el-tooltip>
</div>
</template>
</el-tree>
</el-collapse-item>
<el-collapse-item :title="$t('clean.containerTrash')" name="container_trash"> <el-collapse-item :title="$t('clean.containerTrash')" name="container_trash">
<el-tree <el-tree
ref="containerRef" ref="containerRef"
:data="cleanData.containerClean" :data="cleanData.containerClean"
node-key="id" node-key="id"
:default-checked-keys="containerDefaultCheck" :default-checked-keys="containerDefaultCheck"
show-checkbox show-checkbox
:props="defaultProps" :props="defaultProps"
@check-change="onChange" @check-change="onChange"
> class="responsive-tree"
<template #default="{ node, data }"> >
<div class="float-left"> <template #default="{ node, data }">
<span>{{ load18n(data.label) }}</span> <div class="tree-node">
</div> <el-tooltip
<div class="ml-4 float-left"> effect="dark"
<span v-if="data.size">{{ computeSize(data.size) }}</span> :content="load18n(data.label)"
</div> placement="top"
<div class="ml-4 float-left"> >
<span>{{ loadTag(node, data) }}</span> <span class="tree-node-label">{{ load18n(data.label) }}</span>
</div> </el-tooltip>
</template> <span class="tree-node-size" v-if="data.size">
</el-tree> {{ computeSize(data.size) }}
</el-collapse-item> </span>
<el-collapse-item :title="$t('clean.upload')" name="upload"> <el-tooltip
<el-tree effect="dark"
ref="uploadRef" :content="loadTag(node, data)"
:data="cleanData.uploadClean" placement="top"
node-key="id" >
:default-checked-keys="uploadDefaultCheck" <span class="tree-node-tooltip">
show-checkbox {{ loadTag(node, data) }}
:props="defaultProps" </span>
@check-change="onChange" </el-tooltip>
> </div>
<template #default="{ node, data }"> </template>
<div class="float-left"> </el-tree>
<span>{{ load18n(data.label) }}</span> </el-collapse-item>
</div> <el-collapse-item :title="$t('clean.upload')" name="upload">
<div class="ml-4 float-left"> <el-tree
<span v-if="data.size">{{ computeSize(data.size) }}</span> ref="uploadRef"
</div> :data="cleanData.uploadClean"
<div class="ml-4 float-left"> node-key="id"
<span>{{ loadTag(node, data) }}</span> :default-checked-keys="uploadDefaultCheck"
</div> show-checkbox
</template> :props="defaultProps"
</el-tree> @check-change="onChange"
</el-collapse-item> class="responsive-tree"
<el-collapse-item :title="$t('clean.download')" name="download"> >
<el-tree <template #default="{ node, data }">
ref="downloadRef" <div class="tree-node">
:data="cleanData.downloadClean" <el-tooltip
node-key="id" effect="dark"
:default-checked-keys="downloadDefaultCheck" :content="load18n(data.label)"
show-checkbox placement="top"
:props="defaultProps" >
@check-change="onChange" <span class="tree-node-label">{{ load18n(data.label) }}</span>
> </el-tooltip>
<template #default="{ node, data }"> <span class="tree-node-size" v-if="data.size">
<div class="float-left"> {{ computeSize(data.size) }}
<span>{{ load18n(data.label) }}</span> </span>
</div> <el-tooltip
<div class="ml-4 float-left"> effect="dark"
<span v-if="data.size">{{ computeSize(data.size) }}</span> :content="loadTag(node, data)"
</div> placement="top"
<div class="ml-4 float-left"> >
<span>{{ loadTag(node, data) }}</span> <span class="tree-node-tooltip">
</div> {{ loadTag(node, data) }}
</template> </span>
</el-tree> </el-tooltip>
</el-collapse-item> </div>
<el-collapse-item :title="$t('clean.systemLog')" name="system_log"> </template>
<el-tree </el-tree>
ref="systemLogRef" </el-collapse-item>
:data="cleanData.systemLogClean" <el-collapse-item :title="$t('clean.download')" name="download">
node-key="id" <el-tree
:default-checked-keys="systemLogDefaultCheck" ref="downloadRef"
show-checkbox :data="cleanData.downloadClean"
:props="defaultProps" node-key="id"
@check-change="onChange" :default-checked-keys="downloadDefaultCheck"
> show-checkbox
<template #default="{ node, data }"> :props="defaultProps"
<div class="float-left"> @check-change="onChange"
<span>{{ load18n(data.label) }}</span> class="responsive-tree"
</div> >
<div class="ml-4 float-left"> <template #default="{ node, data }">
<span v-if="data.size">{{ computeSize(data.size) }}</span> <div class="tree-node">
</div> <el-tooltip
<div class="ml-4 float-left"> effect="dark"
<span>{{ loadTag(node, data) }}</span> :content="load18n(data.label)"
</div> placement="top"
</template> >
</el-tree> <span class="tree-node-label">{{ load18n(data.label) }}</span>
</el-collapse-item> </el-tooltip>
</el-collapse> <span class="tree-node-size" v-if="data.size">
{{ computeSize(data.size) }}
</span>
<el-tooltip
effect="dark"
:content="loadTag(node, data)"
placement="top"
>
<span class="tree-node-tooltip">
{{ loadTag(node, data) }}
</span>
</el-tooltip>
</div>
</template>
</el-tree>
</el-collapse-item>
<el-collapse-item :title="$t('clean.systemLog')" name="system_log">
<el-tree
ref="systemLogRef"
:data="cleanData.systemLogClean"
node-key="id"
:default-checked-keys="systemLogDefaultCheck"
show-checkbox
:props="defaultProps"
@check-change="onChange"
class="responsive-tree"
>
<template #default="{ node, data }">
<div class="tree-node">
<el-tooltip
effect="dark"
:content="load18n(data.label)"
placement="top"
>
<span class="tree-node-label">{{ load18n(data.label) }}</span>
</el-tooltip>
<span class="tree-node-size" v-if="data.size">
{{ computeSize(data.size) }}
</span>
<el-tooltip
effect="dark"
:content="loadTag(node, data)"
placement="top"
>
<span class="tree-node-tooltip">
{{ loadTag(node, data) }}
</span>
</el-tooltip>
</div>
</template>
</el-tree>
</el-collapse-item>
</el-collapse>
</div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -642,4 +711,53 @@ onMounted(() => {
float: right; float: right;
margin-right: 15px; margin-right: 15px;
} }
.tree-container {
width: 100%;
display: flex;
flex-direction: column;
height: 100%;
overflow: auto;
}
.tree-collapse {
flex: 1;
overflow: hidden;
}
.responsive-tree {
width: 100%;
max-height: 100%;
overflow: auto;
}
.tree-node {
display: flex;
align-items: center;
justify-content: start;
gap: 1rem;
width: 100%;
overflow: hidden;
}
.tree-node-label {
flex-shrink: 0;
max-width: 60%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.tree-node-size {
flex-shrink: 0;
max-width: 25%;
white-space: nowrap;
}
.tree-node-tooltip {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
}
</style> </style>