diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/warningGroups.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/warningGroups.vue new file mode 100644 index 0000000000..30bcc522fb --- /dev/null +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/warningGroups.vue @@ -0,0 +1,76 @@ +/* + * 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/dag/_source/formModel/tasks/sql.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue index 706edcda6a..169ebf87de 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 @@ -51,10 +51,17 @@ type="input" size="small" v-model="title" + :disabled="isDetails" :placeholder="$t('Please enter the title of email')"> + +
*{{$t('Alarm group')}}
+
+ +
+
{{$t('SQL Parameter')}}
@@ -142,6 +149,7 @@ import mDatasource from './_source/datasource' import mLocalParams from './_source/localParams' import mStatementList from './_source/statementList' + import mWarningGroups from './_source/warningGroups' import disabledState from '@/module/mixin/disabledState' import codemirror from '@/conf/home/pages/resource/pages/file/pages/_source/codemirror' @@ -176,7 +184,8 @@ // Post statements postStatements: [], item: '', - scriptBoxDialog: false + scriptBoxDialog: false, + groupId: null } }, mixins: [disabledState], @@ -245,16 +254,16 @@ if (!this.$refs.refDs._verifDatasource()) { return false } - if (this.sqlType === 0 && !this.showType.length) { + if (this.sqlType === '0' && !this.showType.length) { this.$message.warning(`${i18n.$t('One form or attachment must be selected')}`) return false } - if (this.sqlType === 0 && !this.title) { + if (this.sqlType === '0' && !this.title) { this.$message.warning(`${i18n.$t('Mail subject required')}`) return false } - if (this.sqlType === 0 && !this.receivers.length) { - this.$message.warning(`${i18n.$t('Recipient required')}`) + if (this.sqlType === '0' && (this.groupId === '' || this.groupId === null)) { + this.$message.warning(`${i18n.$t('Alarm group required')}`) return false } // udfs Subcomponent verification Verification only if the data type is HIVE @@ -287,6 +296,7 @@ udfs: this.udfs, sqlType: this.sqlType, title: this.title, + groupId: this.groupId, showType: (() => { /** * Special processing return order TABLE,ATTACHMENT @@ -347,6 +357,7 @@ udfs: this.udfs, sqlType: this.sqlType, title: this.title, + groupId: this.groupId, showType: (() => { let showType = this.showType if (showType.length === 2 && showType[0] === 'ATTACHMENT') { @@ -377,6 +388,7 @@ } if (val !== 0) { this.title = '' + this.groupId = null } }, // Listening data source @@ -411,6 +423,7 @@ this.preStatements = o.params.preStatements || [] this.postStatements = o.params.postStatements || [] this.title = o.params.title || '' + this.groupId = o.params.groupId } }, mounted () { @@ -436,6 +449,7 @@ udfs: this.udfs, sqlType: this.sqlType, title: this.title, + groupId: this.groupId, showType: (() => { let showType = this.showType if (showType.length === 2 && showType[0] === 'ATTACHMENT') { @@ -451,6 +465,6 @@ } } }, - components: { mListBox, mDatasource, mLocalParams, mUdfs, mSqlType, mStatementList, mScriptBox } + components: { mListBox, mDatasource, mLocalParams, mUdfs, mSqlType, mStatementList, mScriptBox, mWarningGroups } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/startingParam/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/startingParam/index.vue index bcc91524ff..de42199a1a 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/startingParam/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/startingParam/index.vue @@ -26,7 +26,7 @@
  • {{$t('Process priority')}}:{{startupParam.processInstancePriority}}
  • {{$t('Worker group')}}:{{startupParam.workerGroup}}
  • {{$t('Notification strategy')}}:{{_rtWarningType(startupParam.warningType)}}
  • -
  • {{$t('Notification group')}}:{{_rtNotifyGroupName(startupParam.warningGroupId)}}
  • +
  • {{$t('Alarm group')}}:{{_rtNotifyGroupName(startupParam.warningGroupId)}}
  • diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue index d9acb38453..65510bf69b 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue @@ -42,7 +42,7 @@ methods: { ...mapMutations('dag', ['resetParams', 'setIsDetails']), ...mapActions('dag', ['getProcessList', 'getProjectList', 'getResourcesList', 'getProcessDetails', 'getResourcesListJar']), - ...mapActions('security', ['getTenantList', 'getWorkerGroupsAll']), + ...mapActions('security', ['getTenantList', 'getWorkerGroupsAll', 'getAlarmGroupsAll']), /** * init */ @@ -64,6 +64,8 @@ this.getResourcesListJar(), // get worker group list this.getWorkerGroupsAll(), + // get alarm group list + this.getAlarmGroupsAll(), this.getTenantList() ]).then((data) => { let item = data[0] diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/index.vue index d232e2dd86..81d129a47e 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/index.vue @@ -41,7 +41,7 @@ methods: { ...mapMutations('dag', ['resetParams']), ...mapActions('dag', ['getProcessList', 'getProjectList', 'getResourcesList', 'getResourcesListJar', 'getResourcesListJar']), - ...mapActions('security', ['getTenantList', 'getWorkerGroupsAll']), + ...mapActions('security', ['getTenantList', 'getWorkerGroupsAll', 'getAlarmGroupsAll']), /** * init */ @@ -63,6 +63,8 @@ this.getResourcesListJar(), // get worker group list this.getWorkerGroupsAll(), + // get alarm group list + this.getAlarmGroupsAll(), this.getTenantList() ]).then((data) => { this.isLoading = false diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue index 0727d12eed..f9561bd52c 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue @@ -44,7 +44,7 @@ methods: { ...mapMutations('dag', ['setIsDetails', 'resetParams']), ...mapActions('dag', ['getProcessList', 'getProjectList', 'getResourcesList', 'getInstancedetail', 'getResourcesListJar']), - ...mapActions('security', ['getTenantList', 'getWorkerGroupsAll']), + ...mapActions('security', ['getTenantList', 'getWorkerGroupsAll', 'getAlarmGroupsAll']), /** * init */ @@ -66,6 +66,8 @@ this.getResourcesListJar(), // get worker group list this.getWorkerGroupsAll(), + // get alarm group list + this.getAlarmGroupsAll(), this.getTenantList() ]).then((data) => { let item = data[0] 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 64c3f880b5..32612213ac 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 @@ -129,6 +129,7 @@ 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 e2ab711528..e9f615d340 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 @@ -78,15 +78,16 @@
    - {{$t('Notification group')}} + {{$t('Alarm group')}}
    - + @@ -263,7 +264,6 @@ }) }, _getGlobalParams () { - this.setIsDetails(true) this.store.dispatch('dag/getProcessDetails', this.startData.id).then(res => { this.definitionGlobalParams = _.cloneDeep(this.store.state.dag.globalParams) this.udpList = _.cloneDeep(this.store.state.dag.globalParams) 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 9405d264a4..97df05d7bc 100644 --- a/dolphinscheduler-ui/src/js/conf/home/store/security/actions.js +++ b/dolphinscheduler-ui/src/js/conf/home/store/security/actions.js @@ -600,6 +600,19 @@ export default { }) }) }, + /** + * get alarm groups all + */ + getAlarmGroupsAll ({ state }, payload) { + return new Promise((resolve, reject) => { + io.get('alert-group/list', payload, res => { + state.alarmGroupsListAll = res.data + resolve(res) + }).catch(e => { + reject(e) + }) + }) + }, saveWorkerGroups ({ state }, payload) { return new Promise((resolve, reject) => { io.post('worker-group/save', payload, res => { diff --git a/dolphinscheduler-ui/src/js/conf/home/store/security/state.js b/dolphinscheduler-ui/src/js/conf/home/store/security/state.js index f3533265a9..a959d9431f 100644 --- a/dolphinscheduler-ui/src/js/conf/home/store/security/state.js +++ b/dolphinscheduler-ui/src/js/conf/home/store/security/state.js @@ -16,5 +16,6 @@ */ export default { workerGroupsListAll: [], + alarmGroupsListAll: [], tenantAllList: [] } 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 168258a9f6..34145e7132 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js @@ -207,6 +207,8 @@ export default { 'UDF resources': 'UDF resources', 'UDF resources directory': 'UDF resources directory', 'Please select UDF resources directory': 'Please select UDF resources directory', + 'Alarm group': 'Alarm group', + 'Alarm group required': 'Alarm group required', 'Edit alarm group': 'Edit alarm group', 'Create alarm group': 'Create alarm group', 'Create Alarm Instance': 'Create Alarm Instance', 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 fb3bd3fb5b..7cafa9dec1 100755 --- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js +++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js @@ -207,6 +207,8 @@ export default { 'UDF resources': 'UDF资源', 'UDF resources directory': 'UDF资源目录', 'Please select UDF resources directory': '请选择UDF资源目录', + 'Alarm group': '告警组', + 'Alarm group required': '告警组必填', 'Edit alarm group': '编辑告警组', 'Create alarm group': '创建告警组', 'Create Alarm Instance': '创建告警实例',