From 500147fa7e2279e8069c531fc163a07a85629446 Mon Sep 17 00:00:00 2001 From: break60 <790061044@qq.com> Date: Fri, 22 Jan 2021 21:56:21 +0800 Subject: [PATCH] [Feature-#3826][UI]Alert SPI (#4441) * [Improvement-3878]Tenant list delete user name * [Improvement-3878][ui]Fix the list style * [Improvement][ui] List vacancy optimization and icon icon repair * Add font-awesome license and delete ans-ui license * Introduce remixicon * Plug-in front-end function * optimization --- .../LICENSE-@form-create-element-ui | 21 ++ dolphinscheduler-ui/package.json | 1 + dolphinscheduler-ui/src/js/conf/home/index.js | 2 + .../pages/dag/_source/formModel/tasks/sql.vue | 55 +---- .../dag/_source/formModel/tasks/sqoop.vue | 1 - .../definition/pages/list/_source/list.vue | 27 +-- .../definition/pages/list/_source/start.vue | 31 +-- .../definition/pages/list/_source/timing.vue | 26 +-- .../pages/definition/timing/_source/list.vue | 27 +-- .../warningGroups/_source/createWarning.vue | 32 +-- .../pages/warningGroups/_source/list.vue | 55 +---- .../security/pages/warningGroups/index.vue | 14 +- .../_source/createWarningInstance.vue | 197 ++++++++++++++++++ .../pages/warningInstance/_source/list.vue | 107 ++++++++++ .../security/pages/warningInstance/index.vue | 169 +++++++++++++++ .../src/js/conf/home/router/index.js | 11 +- .../js/conf/home/store/security/actions.js | 94 ++++++++- .../components/secondaryMenu/_source/menu.js | 9 + .../src/js/module/i18n/locale/en_US.js | 9 +- .../src/js/module/i18n/locale/zh_CN.js | 6 + 20 files changed, 663 insertions(+), 231 deletions(-) create mode 100644 dolphinscheduler-dist/release-docs/licenses/ui-licenses/LICENSE-@form-create-element-ui create mode 100644 dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.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-dist/release-docs/licenses/ui-licenses/LICENSE-@form-create-element-ui b/dolphinscheduler-dist/release-docs/licenses/ui-licenses/LICENSE-@form-create-element-ui new file mode 100644 index 0000000000..468a05fc1d --- /dev/null +++ b/dolphinscheduler-dist/release-docs/licenses/ui-licenses/LICENSE-@form-create-element-ui @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 xaboy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/dolphinscheduler-ui/package.json b/dolphinscheduler-ui/package.json index acc40b6f52..74558c856f 100644 --- a/dolphinscheduler-ui/package.json +++ b/dolphinscheduler-ui/package.json @@ -13,6 +13,7 @@ "build:release": "npm run clean && cross-env NODE_ENV=production PUBLIC_PATH=/dolphinscheduler/ui webpack --config ./build/webpack.config.release.js" }, "dependencies": { + "@form-create/element-ui": "^1.0.18", "@riophae/vue-treeselect": "^0.4.0", "axios": "^0.16.2", "bootstrap": "3.3.7", diff --git a/dolphinscheduler-ui/src/js/conf/home/index.js b/dolphinscheduler-ui/src/js/conf/home/index.js index 42295b24a2..c1bcdff63d 100644 --- a/dolphinscheduler-ui/src/js/conf/home/index.js +++ b/dolphinscheduler-ui/src/js/conf/home/index.js @@ -38,6 +38,7 @@ import 'bootstrap/dist/css/bootstrap.min.css' import 'bootstrap/dist/js/bootstrap.min.js' import 'canvg/dist/browser/canvg.min.js' import 'remixicon/fonts/remixicon.css' +import formCreate from '@form-create/element-ui' // Component internationalization const useOpt = i18n.globalScope.LOCALE === 'en_US' ? { locale: locale } : {} @@ -46,6 +47,7 @@ i18n.globalScope.LOCALE === 'en_US' ? Vue.use(ElementUI, { locale }) : Vue.use(E // Vue.use(ans) Vue.use(useOpt) +Vue.use(formCreate) sync(store, router) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue index 7e3ae465c8..706edcda6a 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue @@ -55,18 +55,6 @@ - -
*{{$t('Recipient')}}
-
- -
-
- -
{{$t('Cc')}}
-
- -
-
{{$t('SQL Parameter')}}
@@ -155,7 +143,6 @@ import mLocalParams from './_source/localParams' import mStatementList from './_source/statementList' import disabledState from '@/module/mixin/disabledState' - import mEmail from '@/conf/home/pages/projects/pages/definition/pages/list/_source/email' import codemirror from '@/conf/home/pages/resource/pages/file/pages/_source/codemirror' let editor @@ -188,10 +175,6 @@ preStatements: [], // Post statements postStatements: [], - // recipients - receivers: [], - // copy to - receiversCc: [], item: '', scriptBoxDialog: false } @@ -274,14 +257,6 @@ this.$message.warning(`${i18n.$t('Recipient required')}`) return false } - // receivers Subcomponent verification - if (this.sqlType === 0 && !this.$refs.refEmail._manualEmail()) { - return false - } - // receiversCc Subcomponent verification - if (this.sqlType === 0 && !this.$refs.refCc._manualEmail()) { - return false - } // udfs Subcomponent verification Verification only if the data type is HIVE if (this.type === 'HIVE') { if (!this.$refs.refUdfs._verifUdfs()) { @@ -312,8 +287,6 @@ udfs: this.udfs, sqlType: this.sqlType, title: this.title, - receivers: this.receivers.join(','), - receiversCc: this.receiversCc.join(','), showType: (() => { /** * Special processing return order TABLE,ATTACHMENT @@ -366,19 +339,6 @@ return editor }, - _getReceiver () { - let param = {} - let current = this.router.history.current - if (current.name === 'projects-definition-details') { - param.processDefinitionId = current.params.id - } else { - param.processInstanceId = current.params.id - } - this.store.dispatch('dag/getReceiver', param).then(res => { - this.receivers = res.receivers && res.receivers.split(',') || [] - this.receiversCc = res.receiversCc && res.receiversCc.split(',') || [] - }) - }, _cacheParams () { this.$emit('on-cache-params', { type: this.type, @@ -387,8 +347,6 @@ udfs: this.udfs, sqlType: this.sqlType, title: this.title, - receivers: this.receivers.join(','), - receiversCc: this.receiversCc.join(','), showType: (() => { let showType = this.showType if (showType.length === 2 && showType[0] === 'ATTACHMENT') { @@ -419,8 +377,6 @@ } if (val !== 0) { this.title = '' - this.receivers = [] - this.receiversCc = [] } }, // Listening data source @@ -455,13 +411,6 @@ this.preStatements = o.params.preStatements || [] this.postStatements = o.params.postStatements || [] this.title = o.params.title || '' - this.receivers = o.params.receivers && o.params.receivers.split(',') || [] - this.receiversCc = o.params.receiversCc && o.params.receiversCc.split(',') || [] - } - // read tasks from cache - if (!_.some(this.store.state.dag.cacheTasks, { id: this.createNodeId }) && - this.router.history.current.name !== 'definition-create') { - this._getReceiver() } }, mounted () { @@ -487,8 +436,6 @@ udfs: this.udfs, sqlType: this.sqlType, title: this.title, - receivers: this.receivers.join(','), - receiversCc: this.receiversCc.join(','), showType: (() => { let showType = this.showType if (showType.length === 2 && showType[0] === 'ATTACHMENT') { @@ -504,6 +451,6 @@ } } }, - components: { mListBox, mDatasource, mLocalParams, mUdfs, mSqlType, mStatementList, mEmail, mScriptBox } + components: { mListBox, mDatasource, mLocalParams, mUdfs, mSqlType, mStatementList, mScriptBox } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue index 25133934c5..7819b23fc1 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue @@ -1175,7 +1175,6 @@ } if (val !== 0) { this.title = '' - this.receivers = [] } }, // Listening data source diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue index c3b779936c..1aee167cbc 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue @@ -177,8 +177,6 @@ timingDialog: false, timingData: { item: {}, - receiversD: [], - receiversCcD: [], type: '' }, relatedItemsDialog: false, @@ -191,7 +189,7 @@ pageSize: Number }, methods: { - ...mapActions('dag', ['editProcessState', 'getStartCheck', 'getReceiver', 'deleteDefinition', 'batchDeleteDefinition', 'exportDefinition', 'getProcessDefinitionVersionsPage', 'copyProcess', 'switchProcessDefinitionVersion', 'deleteProcessDefinitionVersion', 'moveProcess']), + ...mapActions('dag', ['editProcessState', 'getStartCheck', 'deleteDefinition', 'batchDeleteDefinition', 'exportDefinition', 'getProcessDefinitionVersionsPage', 'copyProcess', 'switchProcessDefinitionVersion', 'deleteProcessDefinitionVersion', 'moveProcess']), ...mapActions('security', ['getWorkerGroupsAll']), selectable (row, index) { @@ -226,30 +224,13 @@ closeStart () { this.startDialog = false }, - /** - * get emial - */ - _getReceiver (id) { - return new Promise((resolve, reject) => { - this.getReceiver({ processDefinitionId: id }).then(res => { - resolve({ - receivers: res.receivers && res.receivers.split(',') || [], - receiversCc: res.receiversCc && res.receiversCc.split(',') || [] - }) - }) - }) - }, /** * timing */ _timing (item) { - this._getReceiver(item.id).then(res => { - this.timingData.item = item - this.timingData.receiversD = res.receivers - this.timingData.receiversCcD = res.receiversCc - this.timingData.type = 'timing' - this.timingDialog = true - }) + this.timingData.item = item + this.timingData.type = 'timing' + this.timingDialog = true }, onUpdateTiming () { this._onUpdate() diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue index 0cf2391981..e2ab711528 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue @@ -99,22 +99,6 @@ -
-
- {{$t('Recipient')}} -
-
- -
-
-
-
- {{$t('Cc')}} -
-
- -
-
{{$t('Complement Data')}} @@ -181,7 +165,6 @@ diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue index 51c2787704..526abfb16e 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue @@ -136,22 +136,6 @@
-
-
- {{$t('Recipient')}} -
-
- -
-
-
-
- {{$t('Cc')}} -
-
- -
-
{{$t('Cancel')}} {{spinnerLoading ? 'Loading...' : (timingData.item.crontab ? $t('Edit') : $t('Create'))}} @@ -159,9 +143,7 @@
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue index b566976c3e..7081e3055d 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue @@ -124,16 +124,14 @@ list: [], timingDialog: false, timingData: { - item: {}, - receiversD: [], - receiversCcD: [] + item: {} } } }, props: { }, methods: { - ...mapActions('dag', ['getScheduleList', 'scheduleOffline', 'scheduleOnline', 'getReceiver', 'deleteTiming']), + ...mapActions('dag', ['getScheduleList', 'scheduleOffline', 'scheduleOnline', 'deleteTiming']), /** * delete */ @@ -228,29 +226,12 @@ this.$message.error(e.msg || '') }) }, - /** - * get email - */ - _getReceiver (id) { - return new Promise((resolve, reject) => { - this.getReceiver({ processDefinitionId: id }).then(res => { - resolve({ - receivers: res.receivers && res.receivers.split(',') || [], - receiversCc: res.receiversCc && res.receiversCc.split(',') || [] - }) - }) - }) - }, /** * timing */ _editTiming (item) { - this._getReceiver(item.processDefinitionId).then(res => { - this.timingData.item = item - this.timingData.receiversD = res.receivers - this.timingData.receiversCcD = res.receiversCc - this.timingDialog = true - }) + this.timingData.item = item + this.timingDialog = true }, onUpdateTiming () { this.pageNo = 1 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..6ae8c517b4 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,14 +36,14 @@ - + @@ -64,6 +64,7 @@ diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/index.vue index 8368a04773..53b4783a53 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningGroups/index.vue @@ -23,7 +23,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', ['queryAlertGroupListPaging', 'queryAllAlertPluginInstance']), /** * Inquire */ @@ -110,6 +111,11 @@ this._create(item) }, _create (item) { + this.queryAllAlertPluginInstance().then(res => { + this.allAlertPluginInstance = res + }).catch(e => { + this.$message.error(e.msg) + }) this.item = item this.createWarningDialog = true }, @@ -130,7 +136,7 @@ this.isLeft = true } this.isLoading = !flag - this.getAlertgroupP(this.searchParams).then(res => { + this.queryAlertGroupListPaging(this.searchParams).then(res => { if (this.searchParams.pageNo > 1 && res.totalList.length === 0) { this.searchParams.pageNo = this.searchParams.pageNo - 1 } else { diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.vue new file mode 100644 index 0000000000..73ef61f53c --- /dev/null +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.vue @@ -0,0 +1,197 @@ +/* + * 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..5a8cf2ad1b --- /dev/null +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/list.vue @@ -0,0 +1,107 @@ +/* + * 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..54a8177e9e --- /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 6b815260c9..8d205b81c8 100644 --- a/dolphinscheduler-ui/src/js/conf/home/router/index.js +++ b/dolphinscheduler-ui/src/js/conf/home/router/index.js @@ -387,7 +387,8 @@ const router = new Router({ name: 'users-manage', component: resolve => require(['../pages/security/pages/users/index'], resolve), meta: { - title: `${i18n.$t('User Manage')}` + title: `${i18n.$t('User Manage')}`, + refresh_in_switched_tab: false } }, { @@ -398,6 +399,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..9405d264a4 100644 --- a/dolphinscheduler-ui/src/js/conf/home/store/security/actions.js +++ b/dolphinscheduler-ui/src/js/conf/home/store/security/actions.js @@ -43,6 +43,12 @@ export default { groupName: payload.groupName }, api: 'alert-group/verify-group-name' + }, + alarmInstance: { + param: { + alertInstanceName: payload.instanceName + }, + api: 'alert-plugin-instance/verify-alert-instance-name' } } @@ -340,9 +346,9 @@ export default { }) }, /** - * Paging query alarm group list + * queryAlertGroupListPaging */ - getAlertgroupP ({ state }, payload) { + queryAlertGroupListPaging ({ state }, payload) { return new Promise((resolve, reject) => { io.get('alert-group/list-paging', payload, res => { resolve(res.data) @@ -351,6 +357,54 @@ export default { }) }) }, + /** + * queryAlertPluginInstanceListPaging + */ + queryAlertPluginInstanceListPaging ({ state }, payload) { + return new Promise((resolve, reject) => { + io.get('alert-plugin-instance/list-paging', payload, res => { + resolve(res.data) + }).catch(e => { + reject(e) + }) + }) + }, + /** + * queryUiPlugins + */ + getPlugins ({ state }, payload) { + return new Promise((resolve, reject) => { + io.post('ui-plugins/queryUiPluginsByType', payload, res => { + resolve(res.data) + }).catch(e => { + reject(e) + }) + }) + }, + /** + * queryUiPluginById + */ + getUiPluginById ({ state }, payload) { + return new Promise((resolve, reject) => { + io.post('ui-plugins/queryUiPluginDetailById', 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 */ @@ -375,6 +429,30 @@ export default { }) }) }, + /** + * create alert plugin instance operation + */ + createAlertPluginInstance ({ state }, payload) { + return new Promise((resolve, reject) => { + io.post('alert-plugin-instance/create', payload, res => { + resolve(res) + }).catch(e => { + reject(e) + }) + }) + }, + /** + * update alert plugin instance operation + */ + updateAlertPluginInstance ({ state }, payload) { + return new Promise((resolve, reject) => { + io.get('alert-plugin-instance/update', payload, res => { + resolve(res) + }).catch(e => { + reject(e) + }) + }) + }, /** * update an alarm group. */ @@ -399,6 +477,18 @@ export default { }) }) }, + /** + * delete alert plugin instance operation + */ + deletAelertPluginInstance ({ state }, payload) { + return new Promise((resolve, reject) => { + io.get('alert-plugin-instance/delete', payload, res => { + resolve(res) + }).catch(e => { + reject(e) + }) + }) + }, /** * Master 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 c8216d41a5..168258a9f6 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js @@ -184,15 +184,14 @@ export default { 'Last heartbeat time': 'Last heartbeat time', 'Edit Tenant': 'Edit Tenant', 'OS Tenant Code': 'OS Tenant Code', - Queue: 'Yarn Queue', 'Tenant Name': 'Tenant Name', + Queue: 'Yarn Queue', 'Please select a queue': 'default is tenant association queue', 'Please enter the os tenant code in English': 'Please enter the os tenant code in English', 'Please enter os tenant code in English': 'Please enter os tenant code in English', 'Please enter os tenant code': 'Please enter os tenant code', 'Please enter tenant Name': 'Please enter tenant Name', 'The os tenant code. Only letters or a combination of letters and numbers are allowed': 'The os tenant code. Only letters or a combination of letters and numbers are allowed', - 'The os tenant code cannot be all numbers': 'The os tenant code cannot be all numbers', 'Edit User': 'Edit User', Tenant: 'Tenant', Email: 'Email', @@ -210,9 +209,14 @@ export default { 'Please select UDF resources directory': 'Please select UDF resources directory', 'Edit alarm group': 'Edit alarm group', 'Create alarm group': 'Create alarm group', + 'Create Alarm Instance': 'Create Alarm Instance', + 'Edit Alarm Instance': 'Edit Alarm Instance', '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', @@ -370,6 +374,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 2aa94cc4d1..fb3bd3fb5b 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js @@ -209,9 +209,14 @@ export default { 'Please select UDF resources directory': '请选择UDF资源目录', 'Edit alarm group': '编辑告警组', 'Create alarm group': '创建告警组', + 'Create Alarm Instance': '创建告警实例', + 'Edit Alarm Instance': '编辑告警实例', 'Group Name': '组名称', + 'Alarm instance name': '告警实例名称', + 'Select plugin': '选择插件', 'Please enter group name': '请输入组名称', 'Group Type': '组类型', + 'Alarm plugin instance': '告警插件实例', Remarks: '备注', SMS: '短信', 'Managing Users': '管理用户', @@ -369,6 +374,7 @@ export default { 'Process definition': '工作流定义', 'Task record': '任务记录', 'Warning group manage': '告警组管理', + 'Warning instance manage': '告警实例管理', 'Servers manage': '服务管理', 'UDF manage': 'UDF管理', 'Resource manage': '资源管理',