Browse Source

[Fix-4674][UI] create warning instance and click Submit , without validate the required parameters (#4767)

* fix wareningInstance create instance validate parameter.

* rerun e2e test.
pull/3/MERGE
zhuangchong 4 years ago committed by GitHub
parent
commit
5e193cf414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 48
      dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.vue
  2. 1
      dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
  3. 1
      dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

48
dolphinscheduler-ui/src/js/conf/home/pages/security/pages/warningInstance/_source/createWarningInstance.vue

@ -129,28 +129,36 @@
}) })
}, },
_submit () { _submit () {
this.$f.rule.forEach(item => { this.$f.validate((valid) => {
item.title = item.name if (valid) {
}) this.$f.rule.forEach(item => {
let param = { item.title = item.name
instanceName: this.instanceName, })
pluginDefineId: this.pluginDefineId, let param = {
pluginInstanceParams: JSON.stringify(this.$f.rule) instanceName: this.instanceName,
} pluginDefineId: this.pluginDefineId,
if (this.item) { pluginInstanceParams: JSON.stringify(this.$f.rule)
param.alertPluginInstanceId = this.item.id }
param.pluginDefineId = null if (this.item) {
} param.alertPluginInstanceId = this.item.id
this.$refs.popover.spinnerLoading = true param.pluginDefineId = null
this.store.dispatch(`security/${this.item ? 'updateAlertPluginInstance' : 'createAlertPluginInstance'}`, param).then(res => { }
this.$refs.popover.spinnerLoading = false this.$refs.popover.spinnerLoading = true
this.$emit('onUpdate') this.store.dispatch(`security/${this.item ? 'updateAlertPluginInstance' : 'createAlertPluginInstance'}`, param).then(res => {
this.$message.success(res.msg) this.$refs.popover.spinnerLoading = false
}).catch(e => { this.$emit('onUpdate')
this.$message.error(e.msg || '') this.$message.success(res.msg)
this.$refs.popover.spinnerLoading = false }).catch(e => {
this.$message.error(e.msg || '')
this.$refs.popover.spinnerLoading = false
})
} else {
this.$message.warning(`${i18n.$t('Instance parameter exception')}`)
this.$refs.popover.spinnerLoading = false
}
}) })
}, },
close () { close () {
this.$emit('close') this.$emit('close')
} }

1
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js

@ -222,6 +222,7 @@ export default {
'Alarm instance name': 'Alarm instance name', 'Alarm instance name': 'Alarm instance name',
'Select plugin': 'Select plugin', 'Select plugin': 'Select plugin',
'Please enter group name': 'Please enter group name', 'Please enter group name': 'Please enter group name',
'Instance parameter exception': 'Instance parameter exception',
'Group Type': 'Group Type', 'Group Type': 'Group Type',
'Alarm plugin instance': 'Alarm plugin instance', 'Alarm plugin instance': 'Alarm plugin instance',
Remarks: 'Remarks', Remarks: 'Remarks',

1
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

@ -222,6 +222,7 @@ export default {
'Alarm instance name': '告警实例名称', 'Alarm instance name': '告警实例名称',
'Select plugin': '选择插件', 'Select plugin': '选择插件',
'Please enter group name': '请输入组名称', 'Please enter group name': '请输入组名称',
'Instance parameter exception': '实例参数异常',
'Group Type': '组类型', 'Group Type': '组类型',
'Alarm plugin instance': '告警插件实例', 'Alarm plugin instance': '告警插件实例',
Remarks: '备注', Remarks: '备注',

Loading…
Cancel
Save