From e16a3406e46dd4036d56cb7cf5dd01963193c1aa Mon Sep 17 00:00:00 2001 From: keran <213539@qq.com> Date: Sun, 19 May 2019 22:30:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA=E7=9A=84?= =?UTF-8?q?=E6=B5=81=E7=A8=8B(=E5=85=88=E5=BC=B9=E7=AA=97=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4),=E6=9C=AA=E4=BF=AE=E6=94=B9=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/console-fe/src/locales/en-US.js | 2 + .../static/console-fe/src/locales/zh-CN.js | 2 + .../ConfigurationManagement.js | 61 ++++++++++++++----- 3 files changed, 51 insertions(+), 14 deletions(-) diff --git a/console/src/main/resources/static/console-fe/src/locales/en-US.js b/console/src/main/resources/static/console-fe/src/locales/en-US.js index 27bbfc252..744ec4c2c 100644 --- a/console/src/main/resources/static/console-fe/src/locales/en-US.js +++ b/console/src/main/resources/static/console-fe/src/locales/en-US.js @@ -225,6 +225,8 @@ const I18N_CONF = { operation: 'Operation', export: 'Export query results', import: 'Import', + importSucc: 'Import success', + uploadBtn: 'Upload File', }, NewConfig: { newListingMain: 'Create Configuration', diff --git a/console/src/main/resources/static/console-fe/src/locales/zh-CN.js b/console/src/main/resources/static/console-fe/src/locales/zh-CN.js index 54ef1dde8..05e306ea1 100644 --- a/console/src/main/resources/static/console-fe/src/locales/zh-CN.js +++ b/console/src/main/resources/static/console-fe/src/locales/zh-CN.js @@ -224,6 +224,8 @@ const I18N_CONF = { operation: '操作', export: '导出查询结果', import: '导入配置', + importSucc: '导入成功', + uploadBtn: '上传文件', }, NewConfig: { newListingMain: '新建配置', diff --git a/console/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js b/console/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js index 1c7bd9215..f0a4f84b4 100644 --- a/console/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js +++ b/console/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js @@ -669,24 +669,60 @@ class ConfigurationManagement extends React.Component { } exportData() { - let url = 'v1/cs/configs?export=true&group=' + this.group + '&appName=' + this.appName; + let url = + 'v1/cs/configs?export=true&group=' + + this.group + + '&tenant=' + + getParams('namespace') + + '&appName=' + + this.appName + + '&ids='; window.location.href = url; } - render() { + importData() { const { locale = {} } = this.props; + const self = this; const uploadProps = { accept: 'application/zip', - onStart(file) { - console.log('onStart', file, file.name); - }, + action: 'v1/cs/configs?import=true&namespace=' + getParams('namespace'), onSuccess(ret) { - console.log('onSuccess', ret); + Dialog.show({ + title: locale.importSucc, + content: