diff --git a/src/api/ne/neConfigBackup.ts b/src/api/ne/neConfigBackup.ts new file mode 100644 index 00000000..4c96b485 --- /dev/null +++ b/src/api/ne/neConfigBackup.ts @@ -0,0 +1,83 @@ +import { request } from '@/plugins/http-fetch'; + +/** + * 网元配置文件备份记录列表 + * @param query 查询参数 + * @returns object + */ +export function listNeConfigBackup(query: Record) { + return request({ + url: '/ne/config/backup/list', + method: 'get', + params: query, + }); +} + +/** + * 网元配置文件备份记录修改 + * @param data 数据 { id, name, remark } + * @returns object + */ +export function updateNeConfigBackup(data: Record) { + return request({ + url: '/ne/config/backup', + method: 'put', + data: data, + }); +} + +/** + * 网元配置文件备份记录下载 + * @param id 记录ID + * @returns object + */ +export async function downNeConfigBackup(id: string) { + return await request({ + url: '/ne/config/backup/download', + method: 'get', + params: { id }, + responseType: 'blob', + timeout: 180_000, + }); +} + +/** + * 网元配置文件备份记录删除 + * @param id 记录ID + * @returns object + */ +export async function delNeConfigBackup(id: string) { + return request({ + url: '/ne/config/backup', + method: 'delete', + params: { id }, + }); +} + +/** + * 网元配置文件备份导出 + * @param data 数据 { neType, neId } + * @returns object + */ +export function exportNeConfigBackup(data: Record) { + return request({ + url: '/ne/config/backup/export', + method: 'post', + data: data, + responseType: 'blob', + timeout: 180_000, + }); +} + +/** + * 网元配置文件备份导入 + * @param data 数据 { neType, neId, type, path } + * @returns object + */ +export function importNeConfigBackup(data: Record) { + return request({ + url: '/ne/config/backup/import', + method: 'post', + data: data, + }); +} \ No newline at end of file diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 88c1364c..48339c5d 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -668,9 +668,8 @@ export default { local:'Local File', localUpload:'Local Upload', exportTip:'Confirm that you want to export the network element configuration file?', - exportMsg:'Exported successfully, please download from [Backup Management].', - filePlease: "Please upload a file", - fileNamePlease: 'Please select the server file', + exportMsg:'Exporting Network Element Configuration Information to a File Succeeded', + pathPlease: 'No Backup File Found', }, }, neHost: { @@ -781,6 +780,11 @@ export default { syncNeDone: 'Synchronization to network element terminals complete', saveOk: 'Save Success!', }, + neConfigBackup: { + name: "Name", + downTip: 'Confirmed to download the backup file [{txt}]?', + title: "Modify Backup {txt}", + }, neQuickSetup: { stepPrev: 'Previous', stepPrevTip: 'Confirm that you want to abandon the current change and return to the previous step?', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 374af28a..6b9acb97 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -668,9 +668,8 @@ export default { local:'本地文件', localUpload:'本地上传', exportTip:'确认要导出网元配置信息到文件?', - exportMsg:'导出成功,请到【备份管理】进行下载', - filePlease: "请上传文件", - fileNamePlease: '请选择服务器文件', + exportMsg:'导出网元配置信息到文件成功', + pathPlease: '未发现文件', }, }, neHost: { @@ -781,6 +780,11 @@ export default { syncNeDone: '同步到网元终端完成', saveOk: '保存成功!', }, + neConfigBackup: { + name: "名称", + downTip: '确认要下载备份文件【{txt}】吗?', + title: "修改备份信息 {txt}", + }, neQuickSetup: { stepPrev: '上一步', stepPrevTip: '确认要放弃当前变更返回上一步吗?', diff --git a/src/views/ne/neInfo/components/BackConfModal.vue b/src/views/ne/neInfo/components/BackConfModal.vue index 3d6615dd..b211cbbd 100644 --- a/src/views/ne/neInfo/components/BackConfModal.vue +++ b/src/views/ne/neInfo/components/BackConfModal.vue @@ -1,15 +1,17 @@