feat: 完成网站备份前端样式

pull/54/head
ssongliu 2022-11-28 14:09:19 +08:00 committed by ssongliu
parent 319345731e
commit b66108ab4a
5 changed files with 36 additions and 5 deletions

View File

@ -32,6 +32,7 @@ export default {
init: 'Init',
verify: 'Verify',
saveAndEnable: 'Save and enable',
import: 'import',
},
search: {
timeStart: 'Time start',
@ -199,7 +200,7 @@ export default {
noMysql: 'No {0} database is detected, please go to App Store and click Install!',
goInstall: 'Go to install',
source: 'Source',
backup: 'Database backup',
backup: 'Backup',
permission: 'Permission',
permissionLocal: 'Local server',
permissionForIP: 'IP',

View File

@ -33,6 +33,7 @@ export default {
init: '',
verify: '',
saveAndEnable: '',
import: '',
},
search: {
timeStart: '',
@ -200,7 +201,7 @@ export default {
noMysql: ' {0} ',
goInstall: '',
source: '',
backup: '',
backup: '',
permission: '',
permissionLocal: '',
permissionForIP: ' IP',

View File

@ -3,7 +3,7 @@
<el-dialog v-model="upVisiable" :destroy-on-close="true" :close-on-click-modal="false" width="70%">
<template #header>
<div class="card-header">
<span>{{ $t('database.backup') }}</span>
<span>{{ $t('commons.button.import') }}</span>
</div>
</template>
<el-upload

View File

@ -8,7 +8,6 @@
<el-tab-pane :label="$t('website.security')" name="safety">
<Safety :key="id" :id="id" v-if="index === 'safety'"></Safety>
</el-tab-pane>
<el-tab-pane :label="$t('website.backup')">反代</el-tab-pane>
<el-tab-pane :label="$t('website.source')" name="resource">
<Resource :key="id" :id="id" v-if="index === 'resource'"></Resource>
</el-tab-pane>

View File

@ -32,7 +32,8 @@
</template>
</el-table-column>
<fu-table-operations
:ellipsis="1"
:ellipsis="10"
width="260px"
:buttons="buttons"
:label="$t('commons.table.operate')"
fixed="right"
@ -48,12 +49,16 @@
<CreateWebSite ref="createRef" @close="search"></CreateWebSite>
<DeleteWebsite ref="deleteRef" @close="search"></DeleteWebsite>
<WebSiteGroup ref="groupRef"></WebSiteGroup>
<UploadDialog ref="uploadRef" />
<BackupRecords ref="dialogBackupRef" />
</LayoutContent>
</div>
</template>
<script lang="ts" setup>
import LayoutContent from '@/layout/layout-content.vue';
import BackupRecords from '@/views/database/mysql/backup/index.vue';
import UploadDialog from '@/views/database/mysql/upload/index.vue';
import ComplexTable from '@/components/complex-table/index.vue';
import { onMounted, reactive, ref } from '@vue/runtime-core';
import CreateWebSite from './create/index.vue';
@ -103,6 +108,15 @@ const openConfig = (id: number) => {
router.push({ name: 'WebsiteConfig', params: { id: id, tab: 'basic' } });
};
const uploadRef = ref();
const dialogBackupRef = ref();
const onOpenBackupDialog = async (dbName: string) => {
let params = {
mysqlName: 'test',
dbName: dbName,
};
dialogBackupRef.value!.acceptParams(params);
};
const buttons = [
{
label: i18n.global.t('website.config'),
@ -110,6 +124,22 @@ const buttons = [
openConfig(row.id);
},
},
{
label: i18n.global.t('database.backupList'),
click: (row: WebSite.WebSite) => {
onOpenBackupDialog(row.primaryDomain);
},
},
{
label: i18n.global.t('database.loadBackup'),
click: (row: WebSite.WebSite) => {
let params = {
mysqlName: 'test',
dbName: row.primaryDomain,
};
uploadRef.value!.acceptParams(params);
},
},
{
label: i18n.global.t('app.delete'),
click: function (row: WebSite.WebSite) {