From d58b1f022f727c229c93e1daed04fd34b57ab590 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Tue, 3 Dec 2019 20:33:23 +0800 Subject: [PATCH] feat: support update application.yaml. --- src/api/admin.js | 25 +++++ .../system/developer/DeveloperOptions.vue | 12 ++- .../developer/tabs/ApplicationConfig.vue | 95 +++++++++++++++++++ .../system/developer/tabs/OptionsList.vue | 8 +- 4 files changed, 136 insertions(+), 4 deletions(-) create mode 100644 src/views/system/developer/tabs/ApplicationConfig.vue diff --git a/src/api/admin.js b/src/api/admin.js index b56391ed..c1da276e 100644 --- a/src/api/admin.js +++ b/src/api/admin.js @@ -82,4 +82,29 @@ adminApi.updateAdminAssets = () => { timeout: 600 * 1000 }) } + +adminApi.getApplicationConfig = () => { + return service({ + url: `${baseUrl}/spring/application.yaml`, + method: 'get' + }) +} + +adminApi.updateApplicationConfig = content => { + return service({ + url: `${baseUrl}/spring/application.yaml/update`, + params: { + content: content + }, + method: 'put' + }) +} + +adminApi.restartApplication = () => { + return service({ + url: `${baseUrl}/spring/restart`, + method: 'post' + }) +} + export default adminApi diff --git a/src/views/system/developer/DeveloperOptions.vue b/src/views/system/developer/DeveloperOptions.vue index 7a1052f6..e43f3afc 100644 --- a/src/views/system/developer/DeveloperOptions.vue +++ b/src/views/system/developer/DeveloperOptions.vue @@ -21,10 +21,16 @@ - 系统变量 + 系统变量 + + + 配置文件 + + + 设置 @@ -50,12 +56,14 @@ import Environment from './tabs/Environment' import RuntimeLogs from './tabs/RuntimeLogs' import SettingsForm from './tabs/SettingsForm' import OptionsList from './tabs/OptionsList' +import ApplicationConfig from './tabs/ApplicationConfig' export default { components: { Environment, RuntimeLogs, SettingsForm, - OptionsList + OptionsList, + ApplicationConfig }, computed: { ...mapGetters(['options']) diff --git a/src/views/system/developer/tabs/ApplicationConfig.vue b/src/views/system/developer/tabs/ApplicationConfig.vue new file mode 100644 index 00000000..2a99b3b1 --- /dev/null +++ b/src/views/system/developer/tabs/ApplicationConfig.vue @@ -0,0 +1,95 @@ + + + diff --git a/src/views/system/developer/tabs/OptionsList.vue b/src/views/system/developer/tabs/OptionsList.vue index 0c34da8e..253295bd 100644 --- a/src/views/system/developer/tabs/OptionsList.vue +++ b/src/views/system/developer/tabs/OptionsList.vue @@ -170,7 +170,11 @@ - + @@ -211,7 +215,7 @@ const columns = [ { title: '操作', dataIndex: 'action', - width: '180px', + width: '120px', scopedSlots: { customRender: 'action' } } ]