feat: 下载离线包改为从OSS下载

This commit is contained in:
zhengkunwang223 2023-02-17 15:13:55 +08:00 committed by ssongliu
parent 974dc56a16
commit 795e64151a
19 changed files with 75 additions and 84 deletions

View file

@ -745,10 +745,12 @@ export default {
thirdParty: 'Third-party account',
createBackupAccount: 'Create {0} backup account',
noTypeForCreate: 'No backup type is currently created',
serverDisk: 'Server disks',
LOCAL: 'Server disks',
currentPath: 'Current path',
OSS: 'Ali OSS',
S3: 'Amazon S3',
MINIO: 'MINIO',
SFTP: 'SFTP',
backupAccount: 'Backup account',
loadBucket: 'Get bucket',
accountName: 'Account name',
@ -759,7 +761,7 @@ export default {
password: 'Password',
path: 'Path',
safe: 'Safe',
safe: 'Security',
safeEntrance: 'Security entrance',
safeEntranceHelper:
'Panel management portal. You can log in to the panel only through a specified security portal, for example: onepanel',

View file

@ -751,10 +751,12 @@ export default {
thirdParty: '第三方账号',
createBackupAccount: '添加 {0} 备份账号',
noTypeForCreate: '当前无可创建备份类型',
serverDisk: '服务器磁盘',
LOCAL: '服务器磁盘',
currentPath: '当前路径',
OSS: '阿里云 OSS',
S3: '亚马逊 S3 云存储',
MINIO: 'MINIO',
SFTP: 'SFTP',
backupAccount: '备份账号',
loadBucket: '获取桶',
accountName: '账户名称',
@ -816,7 +818,7 @@ export default {
monitor: '监控',
enableMonitor: '监控状态',
storeDays: '过期时间 ()',
storeDays: 'Retention days (days)',
cleanMonitor: '清空监控记录',
message: '通知',

View file

@ -12,7 +12,7 @@
</el-form-item>
<el-form-item :label="$t('container.from')">
<el-radio-group v-model="form.from">
<el-radio label="edit">{{ $t('container.edit') }}</el-radio>
<el-radio label="edit">{{ $t('commons.button.edit') }}</el-radio>
<el-radio label="path">{{ $t('container.pathSelect') }}</el-radio>
<el-radio label="template">{{ $t('container.composeTemplate') }}</el-radio>
</el-radio-group>

View file

@ -3,35 +3,31 @@
<div class="app-content" style="margin-top: 20px">
<el-card class="app-card">
<el-row :gutter="20">
<el-col :lg="3" :xl="2">
<div>
<el-tag effect="dark" type="success">{{ composeName }}</el-tag>
</div>
</el-col>
<el-col :lg="8" :xl="12">
<div v-if="createdBy === '1Panel'">
<el-button link type="primary" @click="onComposeOperate('start')">
{{ $t('container.start') }}
</el-button>
<el-divider direction="vertical" />
<el-button link type="primary" @click="onComposeOperate('stop')">
{{ $t('container.stop') }}
</el-button>
<el-divider direction="vertical" />
<el-button link type="primary" @click="onComposeOperate('down')">
{{ $t('container.remove') }}
</el-button>
</div>
<div v-else>
<el-alert
style="margin-top: -5px"
:closable="false"
show-icon
:title="$t('container.composeDetailHelper')"
type="info"
/>
</div>
</el-col>
<div>
<el-tag effect="dark" type="success">{{ composeName }}</el-tag>
</div>
<div v-if="createdBy === '1Panel'">
<el-button link type="primary" @click="onComposeOperate('start')">
{{ $t('container.start') }}
</el-button>
<el-divider direction="vertical" />
<el-button link type="primary" @click="onComposeOperate('stop')">
{{ $t('container.stop') }}
</el-button>
<el-divider direction="vertical" />
<el-button link type="primary" @click="onComposeOperate('down')">
{{ $t('container.remove') }}
</el-button>
</div>
<div v-else>
<el-alert
style="margin-top: -5px; margin-left: 50px"
:closable="false"
show-icon
:title="$t('container.composeDetailHelper')"
type="info"
/>
</div>
</el-row>
</el-card>
</div>

View file

@ -195,6 +195,9 @@ const buttons = [
click: (row: Container.ComposeInfo) => {
onEdit(row);
},
disabled: (row: any) => {
return row.createdBy !== '1Panel';
},
},
{
label: i18n.global.t('commons.button.delete'),

View file

@ -4,7 +4,7 @@
<DrawerHeader :header="$t('commons.button.log')" :back="handleClose" />
</template>
<div>
<el-select @change="searchLogs" style="width: 10%; float: left" v-model="logSearch.mode">
<el-select @change="searchLogs" style="width: 30%; float: left" v-model="logSearch.mode">
<el-option v-for="item in timeOptions" :key="item.label" :value="item.value" :label="item.label" />
</el-select>
<div style="margin-left: 20px; float: left">

View file

@ -104,7 +104,7 @@
</el-table-column>
<el-table-column :min-width="80" :label="$t('cronjob.target')" prop="targetDir">
<template #default="{ row }">
{{ loadBackupName(row.targetDir) }}
{{ row.targetDir }}
</template>
</el-table-column>
<fu-table-operations
@ -133,7 +133,6 @@ import { loadZero } from '@/utils/util';
import { onMounted, reactive, ref } from 'vue';
import RouterButton from '@/components/router-button/index.vue';
import { deleteCronjob, getCronjobPage, handleOnce, updateStatus } from '@/api/modules/cronjob';
import { loadBackupName } from '@/views/setting/helper';
import i18n from '@/lang';
import { Cronjob } from '@/api/interface/cronjob';
import { useDeleteData } from '@/hooks/use-delete-data';
@ -175,7 +174,7 @@ const search = async () => {
data.value = res.data.items || [];
for (const item of data.value) {
if (item.targetDir !== '-') {
item.targetDir = loadBackupName(item.targetDir);
item.targetDir = i18n.global.t('setting.' + item.targetDir);
}
}
paginationConfig.total = res.data.total;

View file

@ -160,7 +160,6 @@
<script lang="ts" setup>
import { reactive, ref } from 'vue';
import { Rules } from '@/global/form-rules';
import { loadBackupName } from '@/views/setting/helper';
import FileList from '@/components/file-list/index.vue';
import { getBackupList } from '@/api/modules/setting';
import i18n from '@/lang';
@ -324,7 +323,7 @@ const loadBackups = async () => {
dialogData.value.rowData!.targetDirID = item.id;
}
}
backupOptions.value.push({ label: loadBackupName(item.type), value: item.id });
backupOptions.value.push({ label: i18n.global.t('setting.' + item.type), value: item.id });
}
};

View file

@ -162,7 +162,7 @@
</el-col>
<el-col :span="8" v-if="isBackup()">
<el-form-item :label="$t('cronjob.target')">
{{ loadBackupName(dialogData.rowData!.targetDir) }}
{{ dialogData.rowData!.targetDir }}
<el-button
v-if="currentRecord?.status! !== 'Failed'"
type="primary"
@ -273,7 +273,6 @@
import { reactive, ref } from 'vue';
import { Cronjob } from '@/api/interface/cronjob';
import { loadZero } from '@/utils/util';
import { loadBackupName } from '@/views/setting/helper';
import { searchRecords, download, handleOnce, updateStatus } from '@/api/modules/cronjob';
import { dateFormat, dateFormatForName } from '@/utils/util';
import i18n from '@/lang';

View file

@ -75,9 +75,9 @@
</el-col>
</el-row>
</div>
<Status v-if="activeName === 'status'" ref="statusRef" />
<Variables v-if="activeName === 'tuning'" ref="variablesRef" />
<div v-if="activeName === 'port'">
<Status v-show="activeName === 'status'" ref="statusRef" />
<Variables v-show="activeName === 'tuning'" ref="variablesRef" />
<div v-show="activeName === 'port'">
<el-form :model="baseInfo" ref="panelFormRef" label-width="120px">
<el-row>
<el-col :span="1"><br /></el-col>
@ -95,8 +95,8 @@
</el-row>
</el-form>
</div>
<ContainerLog v-if="activeName === 'log'" ref="dialogContainerLogRef" />
<SlowLog v-if="activeName === 'slowLog'" ref="slowLogRef" />
<ContainerLog v-show="activeName === 'log'" ref="dialogContainerLogRef" />
<SlowLog v-show="activeName === 'slowLog'" ref="slowLogRef" />
</template>
</LayoutContent>

View file

@ -1,14 +1,16 @@
<template>
<el-dialog v-model="dialogVisiable" :destroy-on-close="true" :close-on-click-modal="false" width="30%">
<el-drawer v-model="dialogVisiable" :destroy-on-close="true" :close-on-click-modal="false" size="30%">
<template #header>
<div class="card-header">
<span>{{ $t('database.requirepass') }}</span>
</div>
<DrawerHeader :header="$t('database.requirepass')" :back="handleClose" />
</template>
<el-form v-loading="loading" ref="formRef" :model="form" label-width="80px">
<el-form-item :label="$t('database.requirepass')" :rules="Rules.requiredInput" prop="password">
<el-input type="password" show-password clearable v-model="form.password" />
</el-form-item>
<el-row type="flex" justify="center">
<el-col :span="22">
<el-form-item :label="$t('database.requirepass')" :rules="Rules.requiredInput" prop="password">
<el-input type="password" show-password clearable v-model="form.password" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<ConfirmDialog ref="confirmDialogRef" @confirm="onSubmit"></ConfirmDialog>
@ -23,7 +25,7 @@
</el-button>
</span>
</template>
</el-dialog>
</el-drawer>
</template>
<script lang="ts" setup>
@ -35,6 +37,7 @@ import { changeRedisPassword } from '@/api/modules/database';
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
import { GetAppPassword } from '@/api/modules/app';
import { MsgSuccess } from '@/utils/message';
import DrawerHeader from '@/components/drawer-header/index.vue';
const loading = ref(false);
@ -55,6 +58,9 @@ const acceptParams = (): void => {
loadPassword();
dialogVisiable.value = true;
};
const handleClose = () => {
dialogVisiable.value = false;
};
const loadPassword = async () => {
const res = await GetAppPassword('redis');

View file

@ -1,6 +1,6 @@
<template>
<div v-show="settingShow">
<LayoutContent :title="'Redis' + $t('database.setting')" :reload="true">
<LayoutContent :title="'Redis ' + $t('database.setting')" :reload="true">
<template #buttons>
<el-button type="primary" :plain="activeName !== 'conf'" @click="changeTab('conf')">
{{ $t('database.confChange') }}

View file

@ -5,7 +5,7 @@
:destroy-on-close="true"
:close-on-click-modal="false"
:before-close="handleClose"
size="30%"
size="40%"
>
<template #header>
<DrawerHeader :header="$t('file.download')" :back="handleClose" />

View file

@ -4,7 +4,7 @@
:destroy-on-close="true"
:close-on-click-modal="false"
:before-close="handleClose"
size="30%"
size="40%"
>
<template #header>
<DrawerHeader :header="title" :back="handleClose" />

View file

@ -9,7 +9,7 @@
<template #header>
<svg-icon style="font-size: 7px" iconName="p-file-folder"></svg-icon>
<span style="font-size: 16px; font-weight: 500">
&nbsp;{{ $t('setting.serverDisk') }}
&nbsp;{{ $t('setting.LOCAL') }}
</span>
<div style="float: right">
<el-button round @click="onOpenDialog('edit', 'local', localData)">
@ -86,7 +86,7 @@
<el-card style="height: 265px">
<template #header>
<svg-icon style="font-size: 7px" iconName="p-oss"></svg-icon>
<span style="font-size: 16px; font-weight: 500">&nbsp;OSS</span>
<span style="font-size: 16px; font-weight: 500">&nbsp;{{ $t('setting.OSS') }}</span>
<div style="float: right">
<el-button round :disabled="ossData.id === 0" @click="onBatchDelete(ossData)">
{{ $t('commons.button.delete') }}
@ -135,7 +135,7 @@
<el-card style="height: 265px">
<template #header>
<svg-icon style="font-size: 7px" iconName="p-minio"></svg-icon>
<span style="font-size: 16px; font-weight: 500">&nbsp;MIMIO</span>
<span style="font-size: 16px; font-weight: 500">&nbsp;MINIO</span>
<div style="float: right">
<el-button :disabled="minioData.id === 0" round @click="onBatchDelete(minioData)">
{{ $t('commons.button.delete') }}

View file

@ -7,7 +7,7 @@
<el-row type="flex" justify="center">
<el-col :span="22">
<el-form-item :label="$t('commons.table.type')" prop="type" :rules="Rules.requiredSelect">
<el-tag>{{ dialogData.rowData!.type }}</el-tag>
<el-tag>{{ $t('setting.' + dialogData.rowData!.type) }}</el-tag>
</el-form-item>
<el-form-item
v-if="dialogData.rowData!.type === 'LOCAL'"

View file

@ -1,17 +0,0 @@
import i18n from '@/lang';
export const loadBackupName = (type: string) => {
switch (type) {
case 'OSS':
return i18n.global.t('setting.OSS');
break;
case 'S3':
return i18n.global.t('setting.S3');
break;
case 'LOCAL':
return i18n.global.t('setting.serverDisk');
break;
default:
return type;
}
};

View file

@ -49,7 +49,6 @@ import i18n from '@/lang';
import DrawerHeader from '@/components/drawer-header/index.vue';
import { snapshotImport } from '@/api/modules/setting';
import { getBackupList, getFilesFromBackup } from '@/api/modules/setting';
import { loadBackupName } from '../../helper';
import { Rules } from '@/global/form-rules';
import { MsgSuccess } from '@/utils/message';
@ -106,7 +105,7 @@ const loadBackups = async () => {
backupOptions.value = [];
for (const item of res.data) {
if (item.type !== 'LOCAL' && item.id !== 0) {
backupOptions.value.push({ label: loadBackupName(item.type), value: item.type });
backupOptions.value.push({ label: i18n.global.t('setting' + item.type), value: item.type });
}
}
};

View file

@ -47,7 +47,11 @@
fix
/>
<el-table-column prop="version" :label="$t('app.version')" />
<el-table-column :label="$t('setting.backupAccount')" min-width="80" prop="from" />
<el-table-column :label="$t('setting.backupAccount')" min-width="80" prop="from">
<template #default="{ row }">
{{ $t('setting.' + row.from) }}
</template>
</el-table-column>
<el-table-column :label="$t('commons.table.status')" min-width="80" prop="status">
<template #default="{ row }">
<el-tag v-if="row.status === 'Success'" type="success">
@ -158,7 +162,6 @@ import LayoutContent from '@/layout/layout-content.vue';
import RecoverStatus from '@/views/setting/snapshot/status/index.vue';
import SnapshotImport from '@/views/setting/snapshot/import/index.vue';
import { getBackupList } from '@/api/modules/setting';
import { loadBackupName } from '../helper';
import { MsgSuccess } from '@/utils/message';
const loading = ref(false);
@ -231,7 +234,7 @@ const loadBackups = async () => {
backupOptions.value = [];
for (const item of res.data) {
if (item.type !== 'LOCAL' && item.id !== 0) {
backupOptions.value.push({ label: loadBackupName(item.type), value: item.type });
backupOptions.value.push({ label: i18n.global.t('setting.' + item.type), value: item.type });
}
}
};