feat: chinese localization for backup page

This commit is contained in:
root 2026-04-26 21:16:31 +08:00
parent 96c19bba05
commit 0145548095
3 changed files with 30 additions and 30 deletions

View file

@ -1 +1 @@
v1.8.0.3 v1.8.0.4

View file

@ -110,7 +110,7 @@
<a-tab-pane key="7" :style="{ paddingTop: '20px' }"> <a-tab-pane key="7" :style="{ paddingTop: '20px' }">
<template #tab> <template #tab>
<a-icon type="database"></a-icon> <a-icon type="database"></a-icon>
<span>Backup</span> <span>备份</span>
</template> </template>
{{ template "backup.html" . }} {{ template "backup.html" . }}
</a-tab-pane> </a-tab-pane>
@ -261,10 +261,10 @@
}, },
backupList: [], backupList: [],
backupColumns: [ backupColumns: [
{ title: 'Filename', dataIndex: 'filename', key: 'filename' }, { title: '文件名', dataIndex: 'filename', key: 'filename' },
{ title: 'Timestamp', dataIndex: 'timestamp', key: 'timestamp', scopedSlots: { customRender: 'timestamp' } }, { title: '时间', dataIndex: 'timestamp', key: 'timestamp', scopedSlots: { customRender: 'timestamp' } },
{ title: 'Size', dataIndex: 'size', key: 'size', scopedSlots: { customRender: 'size' } }, { title: '大小', dataIndex: 'size', key: 'size', scopedSlots: { customRender: 'size' } },
{ title: 'Actions', key: 'action', scopedSlots: { customRender: 'action' } } { title: '操作', key: 'action', scopedSlots: { customRender: 'action' } }
], ],
backupLoading: false, backupLoading: false,
backupCreating: false, backupCreating: false,
@ -472,7 +472,7 @@
.then(msg => { .then(msg => {
this.backupList = msg.obj || []; this.backupList = msg.obj || [];
}).catch(err => { }).catch(err => {
this.$message.error('Failed to load backups'); this.$message.error('加载备份列表失败');
}).finally(() => { }).finally(() => {
this.backupLoading = false; this.backupLoading = false;
}); });
@ -481,10 +481,10 @@
this.backupCreating = true; this.backupCreating = true;
HttpUtil.post("/panel/api/server/backup") HttpUtil.post("/panel/api/server/backup")
.then(msg => { .then(msg => {
this.$message.success('Backup created successfully'); this.$message.success('备份创建成功');
this.fetchBackups(); this.fetchBackups();
}).catch(err => { }).catch(err => {
this.$message.error('Backup failed'); this.$message.error('备份失败');
}).finally(() => { }).finally(() => {
this.backupCreating = false; this.backupCreating = false;
}); });
@ -492,16 +492,16 @@
restoreBackup(filename) { restoreBackup(filename) {
HttpUtil.post("/panel/api/server/restore/" + filename) HttpUtil.post("/panel/api/server/restore/" + filename)
.then(msg => { .then(msg => {
this.$message.success('Restore completed'); this.$message.success('恢复完成');
this.fetchBackups(); this.fetchBackups();
}).catch(err => { }).catch(err => {
this.$message.error('Restore failed'); this.$message.error('恢复失败');
}); });
}, },
deleteBackup(filename) { deleteBackup(filename) {
HttpUtil.post("/panel/api/server/deleteBackup/" + filename) HttpUtil.post("/panel/api/server/deleteBackup/" + filename)
.then(msg => { .then(msg => {
this.$message.success('Backup deleted'); this.$message.success('备份已删除');
this.fetchBackups(); this.fetchBackups();
}).catch(err => { }).catch(err => {
this.$message.error('Delete failed'); this.$message.error('Delete failed');

View file

@ -1,33 +1,33 @@
<div> <div>
<a-row :gutter="[16, 16]" :style="{ marginTop: '16px' }"> <a-row :gutter="[16, 16]" :style="{ marginTop: '16px' }">
<a-col :span="24"> <a-col :span="24">
<a-card :title="'Backup Configuration'" size="small"> <a-card :title="'备份配置'" size="small">
<a-form-model :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" label-align="left"> <a-form-model :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" label-align="left">
<a-row :gutter="[16, 16]"> <a-row :gutter="[16, 16]">
<a-col :xs="24" :sm="12"> <a-col :xs="24" :sm="12">
<a-form-model-item :label="'Enable Scheduled Backup'"> <a-form-model-item :label="'启用定时备份'">
<a-switch v-model="allSetting.backupEnabled"></a-switch> <a-switch v-model="allSetting.backupEnabled"></a-switch>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xs="24" :sm="12"> <a-col :xs="24" :sm="12">
<a-form-model-item :label="'Frequency'"> <a-form-model-item :label="'备份频率'">
<a-select v-model="allSetting.backupFrequency" :disabled="!allSetting.backupEnabled"> <a-select v-model="allSetting.backupFrequency" :disabled="!allSetting.backupEnabled">
<a-select-option value="hourly">Every Hour</a-select-option> <a-select-option value="hourly">每小时</a-select-option>
<a-select-option value="every12h">Every 12 Hours</a-select-option> <a-select-option value="every12h">每12小时</a-select-option>
<a-select-option value="daily">Every Day</a-select-option> <a-select-option value="daily">每天</a-select-option>
<a-select-option value="weekly">Every Week</a-select-option> <a-select-option value="weekly">每周</a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xs="24" :sm="12" <a-col :xs="24" :sm="12"
v-if="allSetting.backupFrequency === 'daily' || allSetting.backupFrequency === 'weekly'"> v-if="allSetting.backupFrequency === 'daily' || allSetting.backupFrequency === 'weekly'">
<a-form-model-item :label="'Hour (0-23)'"> <a-form-model-item :label="'时间点 (0-23时)'">
<a-input-number v-model="allSetting.backupHour" :min="0" :max="23" <a-input-number v-model="allSetting.backupHour" :min="0" :max="23"
:disabled="!allSetting.backupEnabled"></a-input-number> :disabled="!allSetting.backupEnabled"></a-input-number>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xs="24" :sm="12"> <a-col :xs="24" :sm="12">
<a-form-model-item :label="'Max Backups (1-100)'"> <a-form-model-item :label="'最多保留 (1-100份)'">
<a-input-number v-model="allSetting.backupMaxCount" :min="1" :max="100" <a-input-number v-model="allSetting.backupMaxCount" :min="1" :max="100"
:disabled="!allSetting.backupEnabled"></a-input-number> :disabled="!allSetting.backupEnabled"></a-input-number>
</a-form-model-item> </a-form-model-item>
@ -37,17 +37,17 @@
</a-card> </a-card>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-card :title="'Manual Operations'" size="small"> <a-card :title="'手动操作'" size="small">
<a-space> <a-space>
<a-button type="primary" icon="plus" @click="createBackup" :loading="backupCreating"> <a-button type="primary" icon="plus" @click="createBackup" :loading="backupCreating">
Create Backup Now 立即备份
</a-button> </a-button>
</a-space> </a-space>
</a-card> </a-card>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-card size="small"> <a-card size="small">
<span slot="title">Backup List <span slot="title">备份列表
<a-badge :count="backupList.length" :number-style="{ backgroundColor: '#52c41a' }" <a-badge :count="backupList.length" :number-style="{ backgroundColor: '#52c41a' }"
:style="{ marginLeft: '8px' }" /> :style="{ marginLeft: '8px' }" />
</span> </span>
@ -61,14 +61,14 @@
</template> </template>
<template slot="action" slot-scope="text, record"> <template slot="action" slot-scope="text, record">
<a-space> <a-space>
<a-button size="small" icon="download" @click="downloadBackup(record.filename)">Download</a-button> <a-button size="small" icon="download" @click="downloadBackup(record.filename)">下载</a-button>
<a-popconfirm :title="'Restore will stop the panel temporarily. Continue?'" ok-text="Yes" <a-popconfirm :title="'恢复将暂时停止面板,确定继续?'" ok-text="确定"
cancel-text="No" @confirm="restoreBackup(record.filename)"> cancel-text="取消" @confirm="restoreBackup(record.filename)">
<a-button size="small" type="danger" icon="redo">Restore</a-button> <a-button size="small" type="danger" icon="redo">恢复</a-button>
</a-popconfirm> </a-popconfirm>
<a-popconfirm title="Delete this backup?" ok-text="Yes" cancel-text="No" <a-popconfirm title="删除此备份?" ok-text="确定" cancel-text="取消"
@confirm="deleteBackup(record.filename)"> @confirm="deleteBackup(record.filename)">
<a-button size="small" icon="delete">Delete</a-button> <a-button size="small" icon="delete">删除</a-button>
</a-popconfirm> </a-popconfirm>
</a-space> </a-space>
</template> </template>