From e977f16f0dfd7c08b734e2413a0971384201d104 Mon Sep 17 00:00:00 2001 From: break60 <790061044@qq.com> Date: Tue, 12 Jan 2021 20:28:26 +0800 Subject: [PATCH] fix --- dolphinscheduler-ui/src/js/conf/home/index.js | 4 +- .../warningGroups/_source/createWarning.vue | 5 +- .../security/pages/warningGroups/index.vue | 12 +- .../warningInstance/_source/createWarning.vue | 192 ++++++++++++++++++ .../pages/warningInstance/_source/list.vue | 131 ++++++++++++ .../security/pages/warningInstance/index.vue | 169 +++++++++++++++ .../src/js/conf/home/router/index.js | 8 + .../js/conf/home/store/security/actions.js | 36 ++++ .../components/secondaryMenu/_source/menu.js | 9 + .../src/js/module/i18n/locale/en_US.js | 4 + .../src/js/module/i18n/locale/zh_CN.js | 4 + 11 files changed, 568 insertions(+), 6 deletions(-) create mode 100644 dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarning.vue create mode 100644 dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/list.vue create mode 100644 dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/index.vue diff --git a/dolphinscheduler-ui/src/js/conf/home/index.js b/dolphinscheduler-ui/src/js/conf/home/index.js index 37515ad497..c1bcdff63d 100644 --- a/dolphinscheduler-ui/src/js/conf/home/index.js +++ b/dolphinscheduler-ui/src/js/conf/home/index.js @@ -46,7 +46,9 @@ const useOpt = i18n.globalScope.LOCALE === 'en_US' ? { locale: locale } : {} i18n.globalScope.LOCALE === 'en_US' ? Vue.use(ElementUI, { locale }) : Vue.use(ElementUI) // Vue.use(ans) -Vue.use(useOpt, formCreate) +Vue.use(useOpt) +Vue.use(formCreate) + sync(store, router) Vue.config.devtools = true diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/_source/createWarning.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/_source/createWarning.vue index 184fe8ab5f..b317096e18 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/_source/createWarning.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/_source/createWarning.vue @@ -36,7 +36,7 @@ - + @@ -83,13 +83,14 @@ isLeft: true, isADMIN: store.state.user.userInfo.userType === 'ADMIN_USER', createWarningDialog: false, - item: {} + item: {}, + allAlertPluginInstance: [] } }, mixins: [listUrlParamHandle], props: {}, methods: { - ...mapActions('security', ['getAlertgroupP']), + ...mapActions('security', ['getAlertgroupP', 'queryAllAlertPluginInstance']), /** * Inquire */ @@ -110,6 +111,11 @@ this._create(item) }, _create (item) { + this.queryAllAlertPluginInstance().then(res => { + this.allAlertPluginInstance = res.data + }).catch(e => { + this.$message.error(e.msg) + }) this.item = item this.createWarningDialog = true }, diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarning.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarning.vue new file mode 100644 index 0000000000..9bdea2543e --- /dev/null +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarning.vue @@ -0,0 +1,192 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/list.vue new file mode 100644 index 0000000000..a06e868e15 --- /dev/null +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/list.vue @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/index.vue new file mode 100644 index 0000000000..72f0b7d629 --- /dev/null +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/index.vue @@ -0,0 +1,169 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + diff --git a/dolphinscheduler-ui/src/js/conf/home/router/index.js b/dolphinscheduler-ui/src/js/conf/home/router/index.js index cf9b8b51d4..9b81b66783 100644 --- a/dolphinscheduler-ui/src/js/conf/home/router/index.js +++ b/dolphinscheduler-ui/src/js/conf/home/router/index.js @@ -398,6 +398,14 @@ const router = new Router({ title: `${i18n.$t('Warning group manage')}` } }, + { + path: '/security/warning-Instance', + name: 'warning-instance-manage', + component: resolve => require(['../pages/security/pages/warningInstance/index'], resolve), + meta: { + title: `${i18n.$t('Warning instance manage')}` + } + }, { path: '/security/queue', name: 'queue-manage', diff --git a/dolphinscheduler-ui/src/js/conf/home/store/security/actions.js b/dolphinscheduler-ui/src/js/conf/home/store/security/actions.js index 363dee7e39..f92608396c 100644 --- a/dolphinscheduler-ui/src/js/conf/home/store/security/actions.js +++ b/dolphinscheduler-ui/src/js/conf/home/store/security/actions.js @@ -351,6 +351,42 @@ export default { }) }) }, + /** + * queryUiPlugins + */ + getPlugins ({ state }, payload) { + return new Promise((resolve, reject) => { + io.post('ui-plugins/queryUiPluginsByType', payload, res => { + resolve(res.data) + }).catch(e => { + reject(e) + }) + }) + }, + /** + * queryUiPluginsByID + */ + getUiPluginsByID ({ state }, payload) { + return new Promise((resolve, reject) => { + io.post('ui-plugins/queryUiPluginsByID', payload, res => { + resolve(res.data) + }).catch(e => { + reject(e) + }) + }) + }, + /** + * queryAll alert-plugin-instance + */ + queryAllAlertPluginInstance ({ state }, payload) { + return new Promise((resolve, reject) => { + io.post('alert-plugin-instance/queryAll', payload, res => { + resolve(res.data) + }).catch(e => { + reject(e) + }) + }) + }, /** * Alarm group list */ diff --git a/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js b/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js index 2ce1a3c690..daaf918665 100644 --- a/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js +++ b/dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js @@ -109,6 +109,15 @@ const menu = { icon: 'el-icon-warning', children: [] }, + { + name: `${i18n.$t('Warning instance manage')}`, + id: 2, + path: 'warning-instance-manage', + isOpen: true, + enabled: true, + icon: 'ri-spam-fill', + children: [] + }, { name: `${i18n.$t('Worker group manage')}`, id: 4, diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js index bfe27fda61..39d30eecdf 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js @@ -210,8 +210,11 @@ export default { 'Edit alarm group': 'Edit alarm group', 'Create alarm group': 'Create alarm group', 'Group Name': 'Group Name', + 'Alarm instance name': 'Alarm instance name', + 'Select plugin': 'Select plugin', 'Please enter group name': 'Please enter group name', 'Group Type': 'Group Type', + 'Alarm plugin instance': 'Alarm plugin instance', Remarks: 'Remarks', SMS: 'SMS', 'Managing Users': 'Managing Users', @@ -369,6 +372,7 @@ export default { 'Process definition': 'Process definition', 'Task record': 'Task record', 'Warning group manage': 'Warning group manage', + 'Warning instance manage': 'Warning instance manage', 'Servers manage': 'Servers manage', 'UDF manage': 'UDF manage', 'Resource manage': 'Resource manage', diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js index dc68d826e4..b6dccdb3bc 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js @@ -209,8 +209,11 @@ export default { 'Edit alarm group': '编辑告警组', 'Create alarm group': '创建告警组', 'Group Name': '组名称', + 'Alarm instance name': '告警实例名称', + 'Select plugin': '选择插件', 'Please enter group name': '请输入组名称', 'Group Type': '组类型', + 'Alarm plugin instance': '告警插件实例', Remarks: '备注', SMS: '短信', 'Managing Users': '管理用户', @@ -368,6 +371,7 @@ export default { 'Process definition': '工作流定义', 'Task record': '任务记录', 'Warning group manage': '告警组管理', + 'Warning instance manage': '告警实例管理', 'Servers manage': '服务管理', 'UDF manage': 'UDF管理', 'Resource manage': '资源管理',