mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-13 10:04:42 +08:00
fix: Optimize snapshot synchronization options (#9579)
This commit is contained in:
parent
485aa99dea
commit
da0f6acd01
1 changed files with 17 additions and 4 deletions
|
@ -2,8 +2,14 @@
|
|||
<DrawerPro v-model="drawerVisible" :header="$t('setting.importSnapshot')" @close="handleClose" size="small">
|
||||
<el-form ref="formRef" label-position="top" :model="form" :rules="rules" v-loading="loading">
|
||||
<el-form-item :label="$t('setting.backupAccount')" prop="from">
|
||||
<el-select v-model="form.backupAccountID" @change="loadFiles" clearable>
|
||||
<el-option v-for="item in backupOptions" :key="item.label" :value="item.id" :label="item.label" />
|
||||
<el-select @change="loadFiles()" v-model="form.backupAccountID" clearable>
|
||||
<div v-for="item in backupOptions" :key="item.id">
|
||||
<el-option v-if="item.type !== $t('setting.LOCAL')" :value="item.id" :label="item.name">
|
||||
{{ item.name }}
|
||||
<el-tag class="tagClass" type="primary">{{ item.type }}</el-tag>
|
||||
</el-option>
|
||||
<el-option v-else :value="item.id" :label="item.type" />
|
||||
</div>
|
||||
</el-select>
|
||||
<div v-if="form.backupAccountID === 0">
|
||||
<span class="import-help">{{ $t('setting.importHelper') }}</span>
|
||||
|
@ -128,8 +134,8 @@ const loadBackups = async () => {
|
|||
for (const item of res.data) {
|
||||
backupOptions.value.push({
|
||||
id: item.id,
|
||||
label: i18n.global.t('setting.' + item.type),
|
||||
value: item.type,
|
||||
type: i18n.global.t('setting.' + item.type),
|
||||
name: item.name,
|
||||
});
|
||||
}
|
||||
})
|
||||
|
@ -162,4 +168,11 @@ defineExpose({
|
|||
.import-link-help:hover {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.tagClass {
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
font-size: 12px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Add table
Reference in a new issue