Browse Source

make alert instance page display more friendly (#6635)

* make alert instance page display more friendly

* Update EmailAlertChannelTest.java
3.0.0/version-upgrade
jon-qj 3 years ago committed by GitHub
parent
commit
86c85114b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkAlertChannelFactory.java
  2. 22
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkParamsConstants.java
  3. 2
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelFactory.java
  4. 24
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailParamsConstants.java
  5. 22
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java
  6. 22
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelTest.java
  7. 8
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/MailUtilsTest.java
  8. 2
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-feishu/src/main/java/org/apache/dolphinscheduler/plugin/alert/feishu/FeiShuAlertChannelFactory.java
  9. 24
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-feishu/src/main/java/org/apache/dolphinscheduler/plugin/alert/feishu/FeiShuParamsConstants.java
  10. 10
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertChannelFactory.java
  11. 20
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertConstants.java
  12. 10
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java
  13. 10
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/test/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSenderTest.java
  14. 6
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptParamsConstants.java
  15. 4
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-slack/src/main/java/org/apache/dolphinscheduler/plugin/alert/slack/SlackParamsConstants.java
  16. 2
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactory.java
  17. 12
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertParamsConstants.java
  18. 4
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSender.java
  19. 4
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/test/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSenderTest.java
  20. 6
      dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPluginTest.java
  21. 4
      dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/alert/AlertConstants.java
  22. 32
      dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
  23. 34
      dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

2
dolphinscheduler-alert-plugin/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkAlertChannelFactory.java

@ -56,7 +56,7 @@ public class DingTalkAlertChannelFactory implements AlertChannelFactory {
.build()) .build())
.build(); .build();
RadioParam isEnableProxy = RadioParam isEnableProxy =
RadioParam.newBuilder(DingTalkParamsConstants.NAME_DING_TALK_PROXY_ENABLE, DingTalkParamsConstants.NAME_DING_TALK_PROXY_ENABLE) RadioParam.newBuilder(DingTalkParamsConstants.NAME_DING_TALK_PROXY_ENABLE, DingTalkParamsConstants.DING_TALK_PROXY_ENABLE)
.addParamsOptions(new ParamsOptions(STRING_YES, STRING_TRUE, false)) .addParamsOptions(new ParamsOptions(STRING_YES, STRING_TRUE, false))
.addParamsOptions(new ParamsOptions(STRING_NO, STRING_FALSE, false)) .addParamsOptions(new ParamsOptions(STRING_NO, STRING_FALSE, false))
.setValue(STRING_TRUE) .setValue(STRING_TRUE)

22
dolphinscheduler-alert-plugin/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkParamsConstants.java

@ -23,19 +23,25 @@ package org.apache.dolphinscheduler.plugin.alert.dingtalk;
public class DingTalkParamsConstants { public class DingTalkParamsConstants {
static final String DING_TALK_PROXY_ENABLE = "isEnableProxy"; static final String DING_TALK_PROXY_ENABLE = "$t('isEnableProxy')";
static final String DING_TALK_WEB_HOOK = "webhook"; static final String NAME_DING_TALK_PROXY_ENABLE = "IsEnableProxy";
static final String DING_TALK_WEB_HOOK = "$t('webhook')";
static final String NAME_DING_TALK_WEB_HOOK = "WebHook"; static final String NAME_DING_TALK_WEB_HOOK = "WebHook";
static final String DING_TALK_KEYWORD = "keyword";
static final String DING_TALK_KEYWORD = "$t('keyword')";
static final String NAME_DING_TALK_KEYWORD = "Keyword"; static final String NAME_DING_TALK_KEYWORD = "Keyword";
static final String NAME_DING_TALK_PROXY_ENABLE = "IsEnableProxy";
static final String DING_TALK_PROXY = "proxy"; static final String DING_TALK_PROXY = "$t('proxy')";
static final String NAME_DING_TALK_PROXY = "Proxy"; static final String NAME_DING_TALK_PROXY = "Proxy";
static final String DING_TALK_PORT = "port";
static final String DING_TALK_PORT = "$t('port')";
static final String NAME_DING_TALK_PORT = "Port"; static final String NAME_DING_TALK_PORT = "Port";
static final String DING_TALK_USER = "user";
static final String DING_TALK_USER = "$t('user')";
static final String NAME_DING_TALK_USER = "User"; static final String NAME_DING_TALK_USER = "User";
static final String DING_TALK_PASSWORD = "password";
static final String DING_TALK_PASSWORD = "$t('password')";
static final String NAME_DING_TALK_PASSWORD = "Password"; static final String NAME_DING_TALK_PASSWORD = "Password";
private DingTalkParamsConstants() { private DingTalkParamsConstants() {

2
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelFactory.java

@ -108,7 +108,7 @@ public class EmailAlertChannelFactory implements AlertChannelFactory {
.addValidate(Validate.newBuilder().setRequired(true).build()) .addValidate(Validate.newBuilder().setRequired(true).build())
.build(); .build();
RadioParam showType = RadioParam.newBuilder(AlertConstants.SHOW_TYPE, AlertConstants.SHOW_TYPE) RadioParam showType = RadioParam.newBuilder(AlertConstants.NAME_SHOW_TYPE, AlertConstants.SHOW_TYPE)
.addParamsOptions(new ParamsOptions(ShowType.TABLE.getDescp(), ShowType.TABLE.getDescp(), false)) .addParamsOptions(new ParamsOptions(ShowType.TABLE.getDescp(), ShowType.TABLE.getDescp(), false))
.addParamsOptions(new ParamsOptions(ShowType.TEXT.getDescp(), ShowType.TEXT.getDescp(), false)) .addParamsOptions(new ParamsOptions(ShowType.TEXT.getDescp(), ShowType.TEXT.getDescp(), false))
.addParamsOptions(new ParamsOptions(ShowType.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.getDescp(), false)) .addParamsOptions(new ParamsOptions(ShowType.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.getDescp(), false))

24
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailParamsConstants.java

@ -32,34 +32,34 @@ public class MailParamsConstants {
public static final String PLUGIN_DEFAULT_EMAIL_RECEIVERCCS = "$t('receiverCcs')"; public static final String PLUGIN_DEFAULT_EMAIL_RECEIVERCCS = "$t('receiverCcs')";
public static final String NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERCCS = "receiverCcs"; public static final String NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERCCS = "receiverCcs";
public static final String MAIL_PROTOCOL = "transport.protocol"; public static final String MAIL_PROTOCOL = "$t('transportProtocol')";
public static final String NAME_MAIL_PROTOCOL = "mail.protocol"; public static final String NAME_MAIL_PROTOCOL = "mail.protocol";
public static final String MAIL_SMTP_HOST = "mail.smtp.host"; public static final String MAIL_SMTP_HOST = "$t('mailSmtpHost')";
public static final String NAME_MAIL_SMTP_HOST = "serverHost"; public static final String NAME_MAIL_SMTP_HOST = "serverHost";
public static final String MAIL_SMTP_PORT = "mail.smtp.port"; public static final String MAIL_SMTP_PORT = "$t('mailSmtpPort')";
public static final String NAME_MAIL_SMTP_PORT = "serverPort"; public static final String NAME_MAIL_SMTP_PORT = "serverPort";
public static final String MAIL_SENDER = "mail.sender"; public static final String MAIL_SENDER = "$t('mailSender')";
public static final String NAME_MAIL_SENDER = "sender"; public static final String NAME_MAIL_SENDER = "sender";
public static final String MAIL_SMTP_AUTH = "mail.smtp.auth"; public static final String MAIL_SMTP_AUTH = "$t('mailSmtpAuth')";
public static final String NAME_MAIL_SMTP_AUTH = "enableSmtpAuth"; public static final String NAME_MAIL_SMTP_AUTH = "enableSmtpAuth";
public static final String MAIL_USER = "mail.user"; public static final String MAIL_USER = "$t('mailUser')";
public static final String NAME_MAIL_USER = "user"; public static final String NAME_MAIL_USER = "User";
public static final String MAIL_PASSWD = "mail.passwd"; public static final String MAIL_PASSWD = "$t('mailPasswd')";
public static final String NAME_MAIL_PASSWD = "passwd"; public static final String NAME_MAIL_PASSWD = "Password";
public static final String MAIL_SMTP_STARTTLS_ENABLE = "mail.smtp.starttls.enable"; public static final String MAIL_SMTP_STARTTLS_ENABLE = "$t('mailSmtpStarttlsEnable')";
public static final String NAME_MAIL_SMTP_STARTTLS_ENABLE = "starttlsEnable"; public static final String NAME_MAIL_SMTP_STARTTLS_ENABLE = "starttlsEnable";
public static final String MAIL_SMTP_SSL_ENABLE = "mail.smtp.ssl.enable"; public static final String MAIL_SMTP_SSL_ENABLE = "$t('mailSmtpSslEnable')";
public static final String NAME_MAIL_SMTP_SSL_ENABLE = "sslEnable"; public static final String NAME_MAIL_SMTP_SSL_ENABLE = "sslEnable";
public static final String MAIL_SMTP_SSL_TRUST = "mail.smtp.ssl.trust"; public static final String MAIL_SMTP_SSL_TRUST = "$t('mailSmtpSslTrust')";
public static final String NAME_MAIL_SMTP_SSL_TRUST = "smtpSslTrust"; public static final String NAME_MAIL_SMTP_SSL_TRUST = "smtpSslTrust";
} }

22
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java

@ -86,7 +86,7 @@ public class MailSender {
String receiversConfig = config.get(MailParamsConstants.NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERS); String receiversConfig = config.get(MailParamsConstants.NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERS);
if (receiversConfig == null || "".equals(receiversConfig)) { if (receiversConfig == null || "".equals(receiversConfig)) {
throw new AlertEmailException(MailParamsConstants.PLUGIN_DEFAULT_EMAIL_RECEIVERS + mustNotNull); throw new AlertEmailException(MailParamsConstants.NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERS + mustNotNull);
} }
receivers = Arrays.asList(receiversConfig.split(",")); receivers = Arrays.asList(receiversConfig.split(","));
@ -99,33 +99,33 @@ public class MailSender {
} }
mailSmtpHost = config.get(MailParamsConstants.NAME_MAIL_SMTP_HOST); mailSmtpHost = config.get(MailParamsConstants.NAME_MAIL_SMTP_HOST);
requireNonNull(mailSmtpHost, MailParamsConstants.MAIL_SMTP_HOST + mustNotNull); requireNonNull(mailSmtpHost, MailParamsConstants.NAME_MAIL_SMTP_HOST + mustNotNull);
mailSmtpPort = config.get(MailParamsConstants.NAME_MAIL_SMTP_PORT); mailSmtpPort = config.get(MailParamsConstants.NAME_MAIL_SMTP_PORT);
requireNonNull(mailSmtpPort, MailParamsConstants.MAIL_SMTP_PORT + mustNotNull); requireNonNull(mailSmtpPort, MailParamsConstants.NAME_MAIL_SMTP_PORT + mustNotNull);
mailSenderEmail = config.get(MailParamsConstants.NAME_MAIL_SENDER); mailSenderEmail = config.get(MailParamsConstants.NAME_MAIL_SENDER);
requireNonNull(mailSenderEmail, MailParamsConstants.MAIL_SENDER + mustNotNull); requireNonNull(mailSenderEmail, MailParamsConstants.NAME_MAIL_SENDER + mustNotNull);
enableSmtpAuth = config.get(MailParamsConstants.NAME_MAIL_SMTP_AUTH); enableSmtpAuth = config.get(MailParamsConstants.NAME_MAIL_SMTP_AUTH);
mailUser = config.get(MailParamsConstants.NAME_MAIL_USER); mailUser = config.get(MailParamsConstants.NAME_MAIL_USER);
requireNonNull(mailUser, MailParamsConstants.MAIL_USER + mustNotNull); requireNonNull(mailUser, MailParamsConstants.NAME_MAIL_USER + mustNotNull);
mailPasswd = config.get(MailParamsConstants.NAME_MAIL_PASSWD); mailPasswd = config.get(MailParamsConstants.NAME_MAIL_PASSWD);
requireNonNull(mailPasswd, MailParamsConstants.MAIL_PASSWD + mustNotNull); requireNonNull(mailPasswd, MailParamsConstants.NAME_MAIL_PASSWD + mustNotNull);
mailUseStartTLS = config.get(MailParamsConstants.NAME_MAIL_SMTP_STARTTLS_ENABLE); mailUseStartTLS = config.get(MailParamsConstants.NAME_MAIL_SMTP_STARTTLS_ENABLE);
requireNonNull(mailUseStartTLS, MailParamsConstants.MAIL_SMTP_STARTTLS_ENABLE + mustNotNull); requireNonNull(mailUseStartTLS, MailParamsConstants.NAME_MAIL_SMTP_STARTTLS_ENABLE + mustNotNull);
mailUseSSL = config.get(MailParamsConstants.NAME_MAIL_SMTP_SSL_ENABLE); mailUseSSL = config.get(MailParamsConstants.NAME_MAIL_SMTP_SSL_ENABLE);
requireNonNull(mailUseSSL, MailParamsConstants.MAIL_SMTP_SSL_ENABLE + mustNotNull); requireNonNull(mailUseSSL, MailParamsConstants.NAME_MAIL_SMTP_SSL_ENABLE + mustNotNull);
sslTrust = config.get(MailParamsConstants.NAME_MAIL_SMTP_SSL_TRUST); sslTrust = config.get(MailParamsConstants.NAME_MAIL_SMTP_SSL_TRUST);
requireNonNull(sslTrust, MailParamsConstants.MAIL_SMTP_SSL_TRUST + mustNotNull); requireNonNull(sslTrust, MailParamsConstants.NAME_MAIL_SMTP_SSL_TRUST + mustNotNull);
showType = config.get(AlertConstants.SHOW_TYPE); showType = config.get(AlertConstants.NAME_SHOW_TYPE);
requireNonNull(showType, AlertConstants.SHOW_TYPE + mustNotNull); requireNonNull(showType, AlertConstants.NAME_SHOW_TYPE + mustNotNull);
xlsFilePath = config.get(EmailConstants.XLS_FILE_PATH); xlsFilePath = config.get(EmailConstants.XLS_FILE_PATH);
if (StringUtils.isBlank(xlsFilePath)) { if (StringUtils.isBlank(xlsFilePath)) {

22
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelTest.java

@ -77,60 +77,60 @@ public class EmailAlertChannelTest {
public String getEmailAlertParams() { public String getEmailAlertParams() {
List<PluginParams> paramsList = new ArrayList<>(); List<PluginParams> paramsList = new ArrayList<>();
InputParam receivesParam = InputParam.newBuilder("receivers", "receivers") InputParam receivesParam = InputParam.newBuilder(MailParamsConstants.NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERS, "receivers")
.setValue("540957506@qq.com") .setValue("540957506@qq.com")
.addValidate(Validate.newBuilder().setRequired(true).build()) .addValidate(Validate.newBuilder().setRequired(true).build())
.build(); .build();
InputParam mailSmtpHost = InputParam.newBuilder("serverHost", "smtp.host") InputParam mailSmtpHost = InputParam.newBuilder(MailParamsConstants.NAME_MAIL_SMTP_HOST, "smtp.host")
.addValidate(Validate.newBuilder().setRequired(true).build()) .addValidate(Validate.newBuilder().setRequired(true).build())
.setValue("smtp.126.com") .setValue("smtp.126.com")
.build(); .build();
InputParam mailSmtpPort = InputParam.newBuilder("serverPort", "smtp.port") InputParam mailSmtpPort = InputParam.newBuilder(MailParamsConstants.NAME_MAIL_SMTP_PORT, "smtp.port")
.addValidate(Validate.newBuilder() .addValidate(Validate.newBuilder()
.setRequired(true) .setRequired(true)
.build()) .build())
.setValue("25") .setValue("25")
.build(); .build();
InputParam mailSender = InputParam.newBuilder("sender", "sender") InputParam mailSender = InputParam.newBuilder(MailParamsConstants.NAME_MAIL_SENDER, "sender")
.addValidate(Validate.newBuilder().setRequired(true).build()) .addValidate(Validate.newBuilder().setRequired(true).build())
.setValue("dolphinscheduler@126.com") .setValue("dolphinscheduler@126.com")
.build(); .build();
RadioParam enableSmtpAuth = RadioParam.newBuilder("enableSmtpAuth", "smtp.auth") RadioParam enableSmtpAuth = RadioParam.newBuilder(MailParamsConstants.NAME_MAIL_SMTP_AUTH, "smtp.auth")
.addParamsOptions(new ParamsOptions("YES", "true", false)) .addParamsOptions(new ParamsOptions("YES", "true", false))
.addParamsOptions(new ParamsOptions("NO", "false", false)) .addParamsOptions(new ParamsOptions("NO", "false", false))
.addValidate(Validate.newBuilder().setRequired(true).build()) .addValidate(Validate.newBuilder().setRequired(true).build())
.setValue("false") .setValue("false")
.build(); .build();
InputParam mailUser = InputParam.newBuilder("user", "user") InputParam mailUser = InputParam.newBuilder(MailParamsConstants.NAME_MAIL_USER, "user")
.setPlaceholder("if enable use authentication, you need input user") .setPlaceholder("if enable use authentication, you need input user")
.setValue("dolphinscheduler@126.com") .setValue("dolphinscheduler@126.com")
.build(); .build();
PasswordParam mailPassword = PasswordParam.newBuilder("passwd", "passwd") PasswordParam mailPassword = PasswordParam.newBuilder(MailParamsConstants.NAME_MAIL_PASSWD, "passwd")
.setPlaceholder("if enable use authentication, you need input password") .setPlaceholder("if enable use authentication, you need input password")
.setValue("escheduler123") .setValue("escheduler123")
.build(); .build();
RadioParam enableTls = RadioParam.newBuilder("starttlsEnable", "starttls.enable") RadioParam enableTls = RadioParam.newBuilder(MailParamsConstants.NAME_MAIL_SMTP_STARTTLS_ENABLE, "starttls.enable")
.addParamsOptions(new ParamsOptions("YES", "true", false)) .addParamsOptions(new ParamsOptions("YES", "true", false))
.addParamsOptions(new ParamsOptions("NO", "false", false)) .addParamsOptions(new ParamsOptions("NO", "false", false))
.addValidate(Validate.newBuilder().setRequired(true).build()) .addValidate(Validate.newBuilder().setRequired(true).build())
.setValue("true") .setValue("true")
.build(); .build();
RadioParam enableSsl = RadioParam.newBuilder("sslEnable", "smtp.ssl.enable") RadioParam enableSsl = RadioParam.newBuilder(MailParamsConstants.NAME_MAIL_SMTP_SSL_ENABLE, "smtp.ssl.enable")
.addParamsOptions(new ParamsOptions("YES", "true", false)) .addParamsOptions(new ParamsOptions("YES", "true", false))
.addParamsOptions(new ParamsOptions("NO", "false", false)) .addParamsOptions(new ParamsOptions("NO", "false", false))
.addValidate(Validate.newBuilder().setRequired(true).build()) .addValidate(Validate.newBuilder().setRequired(true).build())
.setValue("true") .setValue("true")
.build(); .build();
InputParam sslTrust = InputParam.newBuilder("smtpSslTrust", "smtp.ssl.trust") InputParam sslTrust = InputParam.newBuilder(MailParamsConstants.NAME_MAIL_SMTP_SSL_TRUST, "smtp.ssl.trust")
.addValidate(Validate.newBuilder().setRequired(true).build()) .addValidate(Validate.newBuilder().setRequired(true).build())
.setValue("smtp.126.com") .setValue("smtp.126.com")
.build(); .build();
@ -140,7 +140,7 @@ public class EmailAlertChannelTest {
emailShowTypeList.add(new ParamsOptions(ShowType.TEXT.getDescp(), ShowType.TEXT.getDescp(), false)); emailShowTypeList.add(new ParamsOptions(ShowType.TEXT.getDescp(), ShowType.TEXT.getDescp(), false));
emailShowTypeList.add(new ParamsOptions(ShowType.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.getDescp(), false)); emailShowTypeList.add(new ParamsOptions(ShowType.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.getDescp(), false));
emailShowTypeList.add(new ParamsOptions(ShowType.TABLEATTACHMENT.getDescp(), ShowType.TABLEATTACHMENT.getDescp(), false)); emailShowTypeList.add(new ParamsOptions(ShowType.TABLEATTACHMENT.getDescp(), ShowType.TABLEATTACHMENT.getDescp(), false));
RadioParam showType = RadioParam.newBuilder(AlertConstants.SHOW_TYPE, "showType") RadioParam showType = RadioParam.newBuilder(AlertConstants.NAME_SHOW_TYPE, "showType")
.setOptions(emailShowTypeList) .setOptions(emailShowTypeList)
.setValue(ShowType.TABLE.getDescp()) .setValue(ShowType.TABLE.getDescp())
.addValidate(Validate.newBuilder().setRequired(true).build()) .addValidate(Validate.newBuilder().setRequired(true).build())

8
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/MailUtilsTest.java

@ -59,7 +59,7 @@ public class MailUtilsTest {
emailConfig.put(MailParamsConstants.NAME_MAIL_SMTP_SSL_TRUST, "false"); emailConfig.put(MailParamsConstants.NAME_MAIL_SMTP_SSL_TRUST, "false");
emailConfig.put(MailParamsConstants.NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERS, "347801120@qq.com"); emailConfig.put(MailParamsConstants.NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERS, "347801120@qq.com");
emailConfig.put(MailParamsConstants.NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERCCS, "347801120@qq.com"); emailConfig.put(MailParamsConstants.NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERCCS, "347801120@qq.com");
emailConfig.put(AlertConstants.SHOW_TYPE, ShowType.TEXT.getDescp()); emailConfig.put(AlertConstants.NAME_SHOW_TYPE, ShowType.TEXT.getDescp());
alertTemplate = new DefaultHTMLTemplate(); alertTemplate = new DefaultHTMLTemplate();
mailSender = new MailSender(emailConfig); mailSender = new MailSender(emailConfig);
} }
@ -113,7 +113,7 @@ public class MailUtilsTest {
public void testSendTableMail() { public void testSendTableMail() {
String title = "Mysql Exception"; String title = "Mysql Exception";
String content = list2String(); String content = list2String();
emailConfig.put(AlertConstants.SHOW_TYPE, ShowType.TABLE.getDescp()); emailConfig.put(AlertConstants.NAME_SHOW_TYPE, ShowType.TABLE.getDescp());
mailSender = new MailSender(emailConfig); mailSender = new MailSender(emailConfig);
mailSender.sendMails(title, content); mailSender.sendMails(title, content);
} }
@ -121,7 +121,7 @@ public class MailUtilsTest {
@Test @Test
public void testAttachmentFile() throws Exception { public void testAttachmentFile() throws Exception {
String content = list2String(); String content = list2String();
emailConfig.put(AlertConstants.SHOW_TYPE, ShowType.ATTACHMENT.getDescp()); emailConfig.put(AlertConstants.NAME_SHOW_TYPE, ShowType.ATTACHMENT.getDescp());
mailSender = new MailSender(emailConfig); mailSender = new MailSender(emailConfig);
mailSender.sendMails("gaojing", content); mailSender.sendMails("gaojing", content);
} }
@ -129,7 +129,7 @@ public class MailUtilsTest {
@Test @Test
public void testTableAttachmentFile() throws Exception { public void testTableAttachmentFile() throws Exception {
String content = list2String(); String content = list2String();
emailConfig.put(AlertConstants.SHOW_TYPE, ShowType.TABLEATTACHMENT.getDescp()); emailConfig.put(AlertConstants.NAME_SHOW_TYPE, ShowType.TABLEATTACHMENT.getDescp());
mailSender = new MailSender(emailConfig); mailSender = new MailSender(emailConfig);
mailSender.sendMails("gaojing", content); mailSender.sendMails("gaojing", content);
} }

2
dolphinscheduler-alert-plugin/dolphinscheduler-alert-feishu/src/main/java/org/apache/dolphinscheduler/plugin/alert/feishu/FeiShuAlertChannelFactory.java

@ -48,7 +48,7 @@ public class FeiShuAlertChannelFactory implements AlertChannelFactory {
.build()) .build())
.build(); .build();
RadioParam isEnableProxy = RadioParam isEnableProxy =
RadioParam.newBuilder(FeiShuParamsConstants.NAME_FEI_SHU_PROXY_ENABLE, FeiShuParamsConstants.NAME_FEI_SHU_PROXY_ENABLE) RadioParam.newBuilder(FeiShuParamsConstants.NAME_FEI_SHU_PROXY_ENABLE, FeiShuParamsConstants.FEI_SHU_PROXY_ENABLE)
.addParamsOptions(new ParamsOptions(STRING_YES, STRING_TRUE, false)) .addParamsOptions(new ParamsOptions(STRING_YES, STRING_TRUE, false))
.addParamsOptions(new ParamsOptions(STRING_NO, STRING_FALSE, false)) .addParamsOptions(new ParamsOptions(STRING_NO, STRING_FALSE, false))
.setValue(STRING_TRUE) .setValue(STRING_TRUE)

24
dolphinscheduler-alert-plugin/dolphinscheduler-alert-feishu/src/main/java/org/apache/dolphinscheduler/plugin/alert/feishu/FeiShuParamsConstants.java

@ -23,27 +23,27 @@ public class FeiShuParamsConstants {
throw new IllegalStateException("Utility class"); throw new IllegalStateException("Utility class");
} }
static final String WEB_HOOK = "webhook"; static final String WEB_HOOK = "$t('webhook')";
static final String NAME_WEB_HOOK = "webHook"; static final String NAME_WEB_HOOK = "WebHook";
public static final String FEI_SHU_PROXY_ENABLE = "isEnableProxy"; public static final String FEI_SHU_PROXY_ENABLE = "$t('isEnableProxy')";
static final String NAME_FEI_SHU_PROXY_ENABLE = "isEnableProxy"; static final String NAME_FEI_SHU_PROXY_ENABLE = "IsEnableProxy";
static final String FEI_SHU_PROXY = "proxy"; static final String FEI_SHU_PROXY = "$t('proxy')";
static final String NAME_FEI_SHU_PROXY = "proxy"; static final String NAME_FEI_SHU_PROXY = "Proxy";
static final String FEI_SHU_PORT = "port"; static final String FEI_SHU_PORT = "$t('port')";
static final String NAME_FEI_SHU_PORT = "port"; static final String NAME_FEI_SHU_PORT = "Port";
static final String FEI_SHU_USER = "user"; static final String FEI_SHU_USER = "$t('user')";
static final String NAME_FEI_SHU_USER = "user"; static final String NAME_FEI_SHU_USER = "User";
static final String FEI_SHU_PASSWORD = "password"; static final String FEI_SHU_PASSWORD = "$t('password')";
static final String NAME_FEI_SHU_PASSWORD = "password"; static final String NAME_FEI_SHU_PASSWORD = "Password";
} }

10
dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertChannelFactory.java

@ -38,31 +38,31 @@ public class HttpAlertChannelFactory implements AlertChannelFactory {
@Override @Override
public List<PluginParams> getParams() { public List<PluginParams> getParams() {
InputParam url = InputParam.newBuilder(HttpAlertConstants.URL, HttpAlertConstants.URL) InputParam url = InputParam.newBuilder(HttpAlertConstants.NAME_URL, HttpAlertConstants.URL)
.addValidate(Validate.newBuilder() .addValidate(Validate.newBuilder()
.setRequired(true) .setRequired(true)
.build()) .build())
.build(); .build();
InputParam headerParams = InputParam.newBuilder(HttpAlertConstants.HEADER_PARAMS, HttpAlertConstants.HEADER_PARAMS) InputParam headerParams = InputParam.newBuilder(HttpAlertConstants.NAME_HEADER_PARAMS, HttpAlertConstants.HEADER_PARAMS)
.addValidate(Validate.newBuilder() .addValidate(Validate.newBuilder()
.setRequired(true) .setRequired(true)
.build()) .build())
.build(); .build();
InputParam bodyParams = InputParam.newBuilder(HttpAlertConstants.BODY_PARAMS, HttpAlertConstants.BODY_PARAMS) InputParam bodyParams = InputParam.newBuilder(HttpAlertConstants.NAME_BODY_PARAMS, HttpAlertConstants.BODY_PARAMS)
.addValidate(Validate.newBuilder() .addValidate(Validate.newBuilder()
.setRequired(true) .setRequired(true)
.build()) .build())
.build(); .build();
InputParam contentField = InputParam.newBuilder(HttpAlertConstants.CONTENT_FIELD, HttpAlertConstants.CONTENT_FIELD) InputParam contentField = InputParam.newBuilder(HttpAlertConstants.NAME_CONTENT_FIELD, HttpAlertConstants.CONTENT_FIELD)
.addValidate(Validate.newBuilder() .addValidate(Validate.newBuilder()
.setRequired(true) .setRequired(true)
.build()) .build())
.build(); .build();
InputParam requestType = InputParam.newBuilder(HttpAlertConstants.REQUEST_TYPE, HttpAlertConstants.REQUEST_TYPE) InputParam requestType = InputParam.newBuilder(HttpAlertConstants.NAME_REQUEST_TYPE, HttpAlertConstants.REQUEST_TYPE)
.addValidate(Validate.newBuilder() .addValidate(Validate.newBuilder()
.setRequired(true) .setRequired(true)
.build()) .build())

20
dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertConstants.java

@ -22,14 +22,24 @@ public class HttpAlertConstants {
private HttpAlertConstants() { private HttpAlertConstants() {
} }
public static final String URL = "url"; public static final String URL = "$t('url')";
public static final String HEADER_PARAMS = "headerParams"; public static final String NAME_URL = "url";
public static final String BODY_PARAMS = "bodyParams"; public static final String HEADER_PARAMS = "$t('headerParams')";
public static final String CONTENT_FIELD = "contentField"; public static final String NAME_HEADER_PARAMS = "headerParams";
public static final String REQUEST_TYPE = "requestType"; public static final String BODY_PARAMS = "$t('bodyParams')";
public static final String NAME_BODY_PARAMS = "bodyParams";
public static final String CONTENT_FIELD = "$t('contentField')";
public static final String NAME_CONTENT_FIELD = "contentField";
public static final String REQUEST_TYPE = "$t('requestType')";
public static final String NAME_REQUEST_TYPE = "requestType";
} }

10
dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java

@ -75,11 +75,11 @@ public class HttpSender {
public HttpSender(Map<String, String> paramsMap) { public HttpSender(Map<String, String> paramsMap) {
url = paramsMap.get(HttpAlertConstants.URL); url = paramsMap.get(HttpAlertConstants.NAME_URL);
headerParams = paramsMap.get(HttpAlertConstants.HEADER_PARAMS); headerParams = paramsMap.get(HttpAlertConstants.NAME_HEADER_PARAMS);
bodyParams = paramsMap.get(HttpAlertConstants.BODY_PARAMS); bodyParams = paramsMap.get(HttpAlertConstants.NAME_BODY_PARAMS);
contentField = paramsMap.get(HttpAlertConstants.CONTENT_FIELD); contentField = paramsMap.get(HttpAlertConstants.NAME_CONTENT_FIELD);
requestType = paramsMap.get(HttpAlertConstants.REQUEST_TYPE); requestType = paramsMap.get(HttpAlertConstants.NAME_REQUEST_TYPE);
} }
public AlertResult send(String msg) { public AlertResult send(String msg) {

10
dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/test/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSenderTest.java

@ -34,11 +34,11 @@ public class HttpSenderTest {
public void sendTest() { public void sendTest() {
Map<String, String> paramsMap = new HashMap<>(); Map<String, String> paramsMap = new HashMap<>();
paramsMap.put(HttpAlertConstants.URL, "http://www.baidu.com"); paramsMap.put(HttpAlertConstants.NAME_URL, "http://www.baidu.com");
paramsMap.put(HttpAlertConstants.REQUEST_TYPE, "POST"); paramsMap.put(HttpAlertConstants.NAME_REQUEST_TYPE, "POST");
paramsMap.put(HttpAlertConstants.HEADER_PARAMS, "{\"Content-Type\":\"application/json\"}"); paramsMap.put(HttpAlertConstants.NAME_HEADER_PARAMS, "{\"Content-Type\":\"application/json\"}");
paramsMap.put(HttpAlertConstants.BODY_PARAMS, "{\"number\":\"13457654323\"}"); paramsMap.put(HttpAlertConstants.NAME_BODY_PARAMS, "{\"number\":\"13457654323\"}");
paramsMap.put(HttpAlertConstants.CONTENT_FIELD, "content"); paramsMap.put(HttpAlertConstants.NAME_CONTENT_FIELD, "content");
HttpSender httpSender = new HttpSender(paramsMap); HttpSender httpSender = new HttpSender(paramsMap);
AlertResult alertResult = httpSender.send("Fault tolerance warning"); AlertResult alertResult = httpSender.send("Fault tolerance warning");
Assert.assertEquals("true", alertResult.getStatus()); Assert.assertEquals("true", alertResult.getStatus());

6
dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptParamsConstants.java

@ -26,15 +26,15 @@ public class ScriptParamsConstants {
throw new IllegalStateException("Utility class"); throw new IllegalStateException("Utility class");
} }
static final String SCRIPT_TYPE = "type"; static final String SCRIPT_TYPE = "$t('scriptType')";
static final String NAME_SCRIPT_TYPE = "type"; static final String NAME_SCRIPT_TYPE = "type";
static final String SCRIPT_PATH = "path"; static final String SCRIPT_PATH = "$t('scriptPath')";
static final String NAME_SCRIPT_PATH = "path"; static final String NAME_SCRIPT_PATH = "path";
static final String SCRIPT_USER_PARAMS = "user.params"; static final String SCRIPT_USER_PARAMS = "$t('userParams')";
static final String NAME_SCRIPT_USER_PARAMS = "userParams"; static final String NAME_SCRIPT_USER_PARAMS = "userParams";
} }

4
dolphinscheduler-alert-plugin/dolphinscheduler-alert-slack/src/main/java/org/apache/dolphinscheduler/plugin/alert/slack/SlackParamsConstants.java

@ -23,9 +23,9 @@ public class SlackParamsConstants {
} }
public static final String SLACK_WEB_HOOK_URL = "WebHook"; public static final String SLACK_WEB_HOOK_URL = "$t('webhook')";
public static final String SLACK_WEN_HOOK_URL_NAME = "webHook"; public static final String SLACK_WEN_HOOK_URL_NAME = "webHook";
public static final String SLACK_BOT = "Username"; public static final String SLACK_BOT = "$t('Username')";
public static final String SLACK_BOT_NAME = "username"; public static final String SLACK_BOT_NAME = "username";
public static final String TEXT = "text"; public static final String TEXT = "text";
public static final String ATTACHMENT = "attachments"; public static final String ATTACHMENT = "attachments";

2
dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactory.java

@ -77,7 +77,7 @@ public class WeChatAlertChannelFactory implements AlertChannelFactory {
.build()) .build())
.build(); .build();
RadioParam showType = RadioParam.newBuilder(AlertConstants.SHOW_TYPE, AlertConstants.SHOW_TYPE) RadioParam showType = RadioParam.newBuilder(AlertConstants.NAME_SHOW_TYPE, AlertConstants.SHOW_TYPE)
.addParamsOptions(new ParamsOptions(ShowType.TABLE.getDescp(), ShowType.TABLE.getDescp(), false)) .addParamsOptions(new ParamsOptions(ShowType.TABLE.getDescp(), ShowType.TABLE.getDescp(), false))
.addParamsOptions(new ParamsOptions(ShowType.TEXT.getDescp(), ShowType.TEXT.getDescp(), false)) .addParamsOptions(new ParamsOptions(ShowType.TEXT.getDescp(), ShowType.TEXT.getDescp(), false))
.setValue(ShowType.TABLE.getDescp()) .setValue(ShowType.TABLE.getDescp())

12
dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertParamsConstants.java

@ -26,31 +26,31 @@ public class WeChatAlertParamsConstants {
throw new IllegalStateException(WeChatAlertParamsConstants.class.getName()); throw new IllegalStateException(WeChatAlertParamsConstants.class.getName());
} }
static final String ENTERPRISE_WE_CHAT_CORP_ID = "corp.id"; static final String ENTERPRISE_WE_CHAT_CORP_ID = "$t('corpId')";
static final String NAME_ENTERPRISE_WE_CHAT_CORP_ID = "corpId"; static final String NAME_ENTERPRISE_WE_CHAT_CORP_ID = "corpId";
static final String ENTERPRISE_WE_CHAT_SECRET = "secret"; static final String ENTERPRISE_WE_CHAT_SECRET = "$t('secret')";
static final String NAME_ENTERPRISE_WE_CHAT_SECRET = "secret"; static final String NAME_ENTERPRISE_WE_CHAT_SECRET = "secret";
static final String ENTERPRISE_WE_CHAT_TEAM_SEND_MSG = "team.send.msg"; static final String ENTERPRISE_WE_CHAT_TEAM_SEND_MSG = "$t('teamSendMsg')";
static final String NAME_ENTERPRISE_WE_CHAT_TEAM_SEND_MSG = "teamSendMsg"; static final String NAME_ENTERPRISE_WE_CHAT_TEAM_SEND_MSG = "teamSendMsg";
static final String ENTERPRISE_WE_CHAT_USER_SEND_MSG = "user.send.msg"; static final String ENTERPRISE_WE_CHAT_USER_SEND_MSG = "$t('userSendMsg')";
static final String NAME_ENTERPRISE_WE_CHAT_USER_SEND_MSG = "userSendMsg"; static final String NAME_ENTERPRISE_WE_CHAT_USER_SEND_MSG = "userSendMsg";
static final String ENTERPRISE_WE_CHAT_AGENT_ID = "agent.id"; static final String ENTERPRISE_WE_CHAT_AGENT_ID = "$t('agentId')";
static final String NAME_ENTERPRISE_WE_CHAT_AGENT_ID = "agentId"; static final String NAME_ENTERPRISE_WE_CHAT_AGENT_ID = "agentId";
static final String ENTERPRISE_WE_CHAT_USERS = "users"; static final String ENTERPRISE_WE_CHAT_USERS = "$t('users')";
static final String NAME_ENTERPRISE_WE_CHAT_USERS = "users"; static final String NAME_ENTERPRISE_WE_CHAT_USERS = "users";

4
dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSender.java

@ -85,8 +85,8 @@ public class WeChatSender {
String weChatSecret = config.get(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_SECRET); String weChatSecret = config.get(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_SECRET);
String weChatTokenUrl = WeChatAlertConstants.WE_CHAT_TOKEN_URL; String weChatTokenUrl = WeChatAlertConstants.WE_CHAT_TOKEN_URL;
weChatUserSendMsg = config.get(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_USER_SEND_MSG); weChatUserSendMsg = config.get(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_USER_SEND_MSG);
showType = config.get(AlertConstants.SHOW_TYPE); showType = config.get(AlertConstants.NAME_SHOW_TYPE);
requireNonNull(showType, AlertConstants.SHOW_TYPE + MUST_NOT_NULL); requireNonNull(showType, AlertConstants.NAME_SHOW_TYPE + MUST_NOT_NULL);
weChatTokenUrlReplace = weChatTokenUrl weChatTokenUrlReplace = weChatTokenUrl
.replace(CORP_ID_REGEX, weChatCorpId) .replace(CORP_ID_REGEX, weChatCorpId)
.replace(SECRET_REGEX, weChatSecret); .replace(SECRET_REGEX, weChatSecret);

4
dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/test/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSenderTest.java

@ -67,7 +67,7 @@ public class WeChatSenderTest {
); );
weChatConfig.put(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_USERS, "Kris"); weChatConfig.put(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_USERS, "Kris");
weChatConfig.put(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_TEAM_SEND_MSG, "msg"); weChatConfig.put(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_TEAM_SEND_MSG, "msg");
weChatConfig.put(AlertConstants.SHOW_TYPE, ShowType.TABLE.getDescp()); weChatConfig.put(AlertConstants.NAME_SHOW_TYPE, ShowType.TABLE.getDescp());
} }
@Test @Test
@ -80,7 +80,7 @@ public class WeChatSenderTest {
@Test @Test
public void testSendWeChatTextMsg() { public void testSendWeChatTextMsg() {
weChatConfig.put(AlertConstants.SHOW_TYPE, ShowType.TEXT.getDescp()); weChatConfig.put(AlertConstants.NAME_SHOW_TYPE, ShowType.TEXT.getDescp());
WeChatSender weChatSender = new WeChatSender(weChatConfig); WeChatSender weChatSender = new WeChatSender(weChatConfig);
AlertResult alertResult = weChatSender.sendEnterpriseWeChat("test", content); AlertResult alertResult = weChatSender.sendEnterpriseWeChat("test", content);
Assert.assertEquals("false", alertResult.getStatus()); Assert.assertEquals("false", alertResult.getStatus());

6
dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPluginTest.java

@ -78,7 +78,7 @@ public class EmailAlertPluginTest {
map1.put("mysql service name", "mysql200"); map1.put("mysql service name", "mysql200");
map1.put("mysql address", "192.168.xx.xx"); map1.put("mysql address", "192.168.xx.xx");
map1.put("port", "3306"); map1.put("port", "3306");
map1.put(AlertConstants.SHOW_TYPE, ShowType.TEXT.getDescp()); map1.put(AlertConstants.NAME_SHOW_TYPE, ShowType.TEXT.getDescp());
map1.put("no index of number", "80"); map1.put("no index of number", "80");
map1.put("database client connections", "190"); map1.put("database client connections", "190");
@ -87,7 +87,7 @@ public class EmailAlertPluginTest {
map2.put("mysql address", "192.168.xx.xx"); map2.put("mysql address", "192.168.xx.xx");
map2.put("port", "3306"); map2.put("port", "3306");
map2.put("no index of number", "10"); map2.put("no index of number", "10");
map1.put(AlertConstants.SHOW_TYPE, ShowType.TABLE.getDescp()); map1.put(AlertConstants.NAME_SHOW_TYPE, ShowType.TABLE.getDescp());
map2.put("database client connections", "90"); map2.put("database client connections", "90");
List<LinkedHashMap<String, Object>> maps = new ArrayList<>(); List<LinkedHashMap<String, Object>> maps = new ArrayList<>();
@ -216,7 +216,7 @@ public class EmailAlertPluginTest {
emailShowTypeList.add(new ParamsOptions(ShowType.TEXT.getDescp(), ShowType.TEXT.getDescp(), false)); emailShowTypeList.add(new ParamsOptions(ShowType.TEXT.getDescp(), ShowType.TEXT.getDescp(), false));
emailShowTypeList.add(new ParamsOptions(ShowType.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.getDescp(), false)); emailShowTypeList.add(new ParamsOptions(ShowType.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.getDescp(), false));
emailShowTypeList.add(new ParamsOptions(ShowType.TABLEATTACHMENT.getDescp(), ShowType.TABLEATTACHMENT.getDescp(), false)); emailShowTypeList.add(new ParamsOptions(ShowType.TABLEATTACHMENT.getDescp(), ShowType.TABLEATTACHMENT.getDescp(), false));
RadioParam showType = RadioParam.newBuilder(AlertConstants.SHOW_TYPE, "showType") RadioParam showType = RadioParam.newBuilder(AlertConstants.NAME_SHOW_TYPE, "showType")
.setOptions(emailShowTypeList) .setOptions(emailShowTypeList)
.setValue(ShowType.TABLE.getDescp()) .setValue(ShowType.TABLE.getDescp())
.addValidate(Validate.newBuilder().setRequired(true).build()) .addValidate(Validate.newBuilder().setRequired(true).build())

4
dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/alert/AlertConstants.java

@ -20,5 +20,7 @@ package org.apache.dolphinscheduler.spi.alert;
public class AlertConstants { public class AlertConstants {
/** the field name of alert show type **/ /** the field name of alert show type **/
public static final String SHOW_TYPE = "show_type"; public static final String SHOW_TYPE = "$t('showType')";
public static final String NAME_SHOW_TYPE = "showType";
} }

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

@ -420,8 +420,6 @@ export default {
'Notification strategy': 'Notification strategy', 'Notification strategy': 'Notification strategy',
'Notification group': 'Notification group', 'Notification group': 'Notification group',
'Please select a notification group': 'Please select a notification group', 'Please select a notification group': 'Please select a notification group',
receivers: 'receivers',
receiverCcs: 'receiverCcs',
'Whether it is a complement process?': 'Whether it is a complement process?', 'Whether it is a complement process?': 'Whether it is a complement process?',
'Schedule date': 'Schedule date', 'Schedule date': 'Schedule date',
'Mode of execution': 'Mode of execution', 'Mode of execution': 'Mode of execution',
@ -712,5 +710,33 @@ export default {
condition: 'condition', condition: 'condition',
'The condition content cannot be empty': 'The condition content cannot be empty', 'The condition content cannot be empty': 'The condition content cannot be empty',
'Reference from': 'Reference from', 'Reference from': 'Reference from',
'No more...': 'No more...' 'No more...': 'No more...',
IsEnableProxy: 'Enable Proxy',
WebHook: 'WebHook',
Keyword: 'Keyword',
Proxy: 'Proxy',
receivers: 'Receivers',
receiverCcs: 'ReceiverCcs',
transportProtocol: 'Transport Protocol',
serverHost: 'SMTP Host',
serverPort: 'SMTP Port',
sender: 'Sender',
enableSmtpAuth: 'SMTP Auth',
starttlsEnable: 'SMTP STARTTLS Enable',
sslEnable: 'SMTP SSL Enable',
smtpSslTrust: 'SMTP SSL Trust',
url: 'URL',
requestType: 'Request Type',
headerParams: 'Headers',
bodyParams: 'Body',
contentField: 'Content Field',
path: 'Script Path',
userParams: 'User Params',
corpId: 'CorpId',
secret: 'Secret',
userSendMsg: 'UserSendMsg',
agentId: 'AgentId',
users: 'Users',
Username: 'Username',
showType: 'Show Type'
} }

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

@ -419,8 +419,7 @@ export default {
'Notification strategy': '通知策略', 'Notification strategy': '通知策略',
'Notification group': '通知组', 'Notification group': '通知组',
'Please select a notification group': '请选择通知组', 'Please select a notification group': '请选择通知组',
receivers: '收件人',
receiverCcs: '抄送人',
'Whether it is a complement process?': '是否补数', 'Whether it is a complement process?': '是否补数',
'Schedule date': '调度日期', 'Schedule date': '调度日期',
'Mode of execution': '执行方式', 'Mode of execution': '执行方式',
@ -711,5 +710,34 @@ export default {
condition: '条件', condition: '条件',
'The condition content cannot be empty': '条件内容不能为空', 'The condition content cannot be empty': '条件内容不能为空',
'Reference from': '使用已有任务', 'Reference from': '使用已有任务',
'No more...': '没有更多了...' 'No more...': '没有更多了...',
IsEnableProxy: '启用代理',
WebHook: 'Web钩子',
Keyword: '密钥',
Proxy: '代理',
receivers: '收件人',
receiverCcs: '抄送人',
transportProtocol: '邮件协议',
serverHost: 'SMTP服务器',
serverPort: 'SMTP端口',
sender: '发件人',
enableSmtpAuth: '请求认证',
starttlsEnable: 'STARTTLS连接',
sslEnable: 'SSL连接',
smtpSslTrust: 'SSL证书信任',
url: 'URL',
requestType: '请求方式',
headerParams: '请求头',
bodyParams: '请求体',
contentField: '内容字段',
path: '脚本路径',
userParams: '自定义参数',
corpId: '企业ID',
secret: '密钥',
teamSendMsg: '群发信息',
userSendMsg: '群员信息',
agentId: '应用ID',
users: '群员',
Username: '用户名',
showType: '内容展示类型'
} }

Loading…
Cancel
Save