You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by le...@apache.org on 2021/10/31 13:16:22 UTC
[dolphinscheduler] branch dev updated: make alert instance page
display more friendly (#6635)
This is an automated email from the ASF dual-hosted git repository.
leonbao pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 86c8511 make alert instance page display more friendly (#6635)
86c8511 is described below
commit 86c85114b23317b9f791e091101fa6289e9d6b7c
Author: jon-qj <39...@users.noreply.github.com>
AuthorDate: Sun Oct 31 21:16:10 2021 +0800
make alert instance page display more friendly (#6635)
* make alert instance page display more friendly
* Update EmailAlertChannelTest.java
---
.../dingtalk/DingTalkAlertChannelFactory.java | 2 +-
.../alert/dingtalk/DingTalkParamsConstants.java | 22 +++++++++-----
.../alert/email/EmailAlertChannelFactory.java | 2 +-
.../plugin/alert/email/MailParamsConstants.java | 24 +++++++--------
.../plugin/alert/email/MailSender.java | 22 +++++++-------
.../plugin/alert/email/EmailAlertChannelTest.java | 22 +++++++-------
.../plugin/alert/email/MailUtilsTest.java | 8 ++---
.../alert/feishu/FeiShuAlertChannelFactory.java | 2 +-
.../plugin/alert/feishu/FeiShuParamsConstants.java | 24 +++++++--------
.../plugin/alert/http/HttpAlertChannelFactory.java | 10 +++----
.../plugin/alert/http/HttpAlertConstants.java | 20 +++++++++----
.../plugin/alert/http/HttpSender.java | 10 +++----
.../plugin/alert/http/HttpSenderTest.java | 10 +++----
.../plugin/alert/script/ScriptParamsConstants.java | 6 ++--
.../plugin/alert/slack/SlackParamsConstants.java | 4 +--
.../alert/wechat/WeChatAlertChannelFactory.java | 2 +-
.../alert/wechat/WeChatAlertParamsConstants.java | 12 ++++----
.../plugin/alert/wechat/WeChatSender.java | 4 +--
.../plugin/alert/wechat/WeChatSenderTest.java | 4 +--
.../alert/plugin/EmailAlertPluginTest.java | 6 ++--
.../dolphinscheduler/spi/alert/AlertConstants.java | 4 ++-
.../src/js/module/i18n/locale/en_US.js | 32 ++++++++++++++++++--
.../src/js/module/i18n/locale/zh_CN.js | 34 ++++++++++++++++++++--
23 files changed, 179 insertions(+), 107 deletions(-)
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkAlertChannelFactory.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkAlertChannelFactory.java
index 61518b6..38eb8d1 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkAlertChannelFactory.java
+++ b/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();
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_NO, STRING_FALSE, false))
.setValue(STRING_TRUE)
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkParamsConstants.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkParamsConstants.java
index e94da80..5f8688a 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkParamsConstants.java
+++ b/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 {
- static final String DING_TALK_PROXY_ENABLE = "isEnableProxy";
- static final String DING_TALK_WEB_HOOK = "webhook";
+ static final String DING_TALK_PROXY_ENABLE = "$t('isEnableProxy')";
+ 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 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_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 DING_TALK_PORT = "port";
+
+ static final String DING_TALK_PORT = "$t('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 DING_TALK_PASSWORD = "password";
+
+ static final String DING_TALK_PASSWORD = "$t('password')";
static final String NAME_DING_TALK_PASSWORD = "Password";
private DingTalkParamsConstants() {
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelFactory.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelFactory.java
index 2eefb49..54865f5 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelFactory.java
+++ b/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())
.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.TEXT.getDescp(), ShowType.TEXT.getDescp(), false))
.addParamsOptions(new ParamsOptions(ShowType.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.getDescp(), false))
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailParamsConstants.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailParamsConstants.java
index 9b49b47..d3ccf04 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailParamsConstants.java
+++ b/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 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 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 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 MAIL_SENDER = "mail.sender";
+ public static final String MAIL_SENDER = "$t('mailSender')";
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 MAIL_USER = "mail.user";
- public static final String NAME_MAIL_USER = "user";
+ public static final String MAIL_USER = "$t('mailUser')";
+ public static final String NAME_MAIL_USER = "User";
- public static final String MAIL_PASSWD = "mail.passwd";
- public static final String NAME_MAIL_PASSWD = "passwd";
+ public static final String MAIL_PASSWD = "$t('mailPasswd')";
+ 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 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 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";
}
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java
index 33701de..c37dc3d 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java
+++ b/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);
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(","));
@@ -99,33 +99,33 @@ public class MailSender {
}
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);
- requireNonNull(mailSmtpPort, MailParamsConstants.MAIL_SMTP_PORT + mustNotNull);
+ requireNonNull(mailSmtpPort, MailParamsConstants.NAME_MAIL_SMTP_PORT + mustNotNull);
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);
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);
- requireNonNull(mailPasswd, MailParamsConstants.MAIL_PASSWD + mustNotNull);
+ requireNonNull(mailPasswd, MailParamsConstants.NAME_MAIL_PASSWD + mustNotNull);
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);
- 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);
- requireNonNull(sslTrust, MailParamsConstants.MAIL_SMTP_SSL_TRUST + mustNotNull);
+ requireNonNull(sslTrust, MailParamsConstants.NAME_MAIL_SMTP_SSL_TRUST + mustNotNull);
- showType = config.get(AlertConstants.SHOW_TYPE);
- requireNonNull(showType, AlertConstants.SHOW_TYPE + mustNotNull);
+ showType = config.get(AlertConstants.NAME_SHOW_TYPE);
+ requireNonNull(showType, AlertConstants.NAME_SHOW_TYPE + mustNotNull);
xlsFilePath = config.get(EmailConstants.XLS_FILE_PATH);
if (StringUtils.isBlank(xlsFilePath)) {
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelTest.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelTest.java
index 9a87709..8d599c8 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/EmailAlertChannelTest.java
+++ b/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() {
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")
.addValidate(Validate.newBuilder().setRequired(true).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())
.setValue("smtp.126.com")
.build();
- InputParam mailSmtpPort = InputParam.newBuilder("serverPort", "smtp.port")
+ InputParam mailSmtpPort = InputParam.newBuilder(MailParamsConstants.NAME_MAIL_SMTP_PORT, "smtp.port")
.addValidate(Validate.newBuilder()
.setRequired(true)
.build())
.setValue("25")
.build();
- InputParam mailSender = InputParam.newBuilder("sender", "sender")
+ InputParam mailSender = InputParam.newBuilder(MailParamsConstants.NAME_MAIL_SENDER, "sender")
.addValidate(Validate.newBuilder().setRequired(true).build())
.setValue("dolphinscheduler@126.com")
.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("NO", "false", false))
.addValidate(Validate.newBuilder().setRequired(true).build())
.setValue("false")
.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")
.setValue("dolphinscheduler@126.com")
.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")
.setValue("escheduler123")
.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("NO", "false", false))
.addValidate(Validate.newBuilder().setRequired(true).build())
.setValue("true")
.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("NO", "false", false))
.addValidate(Validate.newBuilder().setRequired(true).build())
.setValue("true")
.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())
.setValue("smtp.126.com")
.build();
@@ -140,7 +140,7 @@ public class EmailAlertChannelTest {
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.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)
.setValue(ShowType.TABLE.getDescp())
.addValidate(Validate.newBuilder().setRequired(true).build())
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/MailUtilsTest.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/MailUtilsTest.java
index 5b0b084..e748e71 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/MailUtilsTest.java
+++ b/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_PLUGIN_DEFAULT_EMAIL_RECEIVERS, "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();
mailSender = new MailSender(emailConfig);
}
@@ -113,7 +113,7 @@ public class MailUtilsTest {
public void testSendTableMail() {
String title = "Mysql Exception";
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.sendMails(title, content);
}
@@ -121,7 +121,7 @@ public class MailUtilsTest {
@Test
public void testAttachmentFile() throws Exception {
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.sendMails("gaojing", content);
}
@@ -129,7 +129,7 @@ public class MailUtilsTest {
@Test
public void testTableAttachmentFile() throws Exception {
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.sendMails("gaojing", content);
}
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-feishu/src/main/java/org/apache/dolphinscheduler/plugin/alert/feishu/FeiShuAlertChannelFactory.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-feishu/src/main/java/org/apache/dolphinscheduler/plugin/alert/feishu/FeiShuAlertChannelFactory.java
index 6eb3376..142c0aa 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-feishu/src/main/java/org/apache/dolphinscheduler/plugin/alert/feishu/FeiShuAlertChannelFactory.java
+++ b/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();
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_NO, STRING_FALSE, false))
.setValue(STRING_TRUE)
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-feishu/src/main/java/org/apache/dolphinscheduler/plugin/alert/feishu/FeiShuParamsConstants.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-feishu/src/main/java/org/apache/dolphinscheduler/plugin/alert/feishu/FeiShuParamsConstants.java
index 0b3c329..133c1fc 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-feishu/src/main/java/org/apache/dolphinscheduler/plugin/alert/feishu/FeiShuParamsConstants.java
+++ b/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");
}
- 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";
}
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertChannelFactory.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertChannelFactory.java
index d54885e..2dda641 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertChannelFactory.java
+++ b/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
public List<PluginParams> getParams() {
- InputParam url = InputParam.newBuilder(HttpAlertConstants.URL, HttpAlertConstants.URL)
+ InputParam url = InputParam.newBuilder(HttpAlertConstants.NAME_URL, HttpAlertConstants.URL)
.addValidate(Validate.newBuilder()
.setRequired(true)
.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()
.setRequired(true)
.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()
.setRequired(true)
.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()
.setRequired(true)
.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()
.setRequired(true)
.build())
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertConstants.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertConstants.java
index 965860d..2e1bcf6 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpAlertConstants.java
+++ b/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() {
}
- 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";
}
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java
index 7b91904..803ecf9 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java
+++ b/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) {
- url = paramsMap.get(HttpAlertConstants.URL);
- headerParams = paramsMap.get(HttpAlertConstants.HEADER_PARAMS);
- bodyParams = paramsMap.get(HttpAlertConstants.BODY_PARAMS);
- contentField = paramsMap.get(HttpAlertConstants.CONTENT_FIELD);
- requestType = paramsMap.get(HttpAlertConstants.REQUEST_TYPE);
+ url = paramsMap.get(HttpAlertConstants.NAME_URL);
+ headerParams = paramsMap.get(HttpAlertConstants.NAME_HEADER_PARAMS);
+ bodyParams = paramsMap.get(HttpAlertConstants.NAME_BODY_PARAMS);
+ contentField = paramsMap.get(HttpAlertConstants.NAME_CONTENT_FIELD);
+ requestType = paramsMap.get(HttpAlertConstants.NAME_REQUEST_TYPE);
}
public AlertResult send(String msg) {
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/test/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSenderTest.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/test/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSenderTest.java
index d59c4d4..1101933 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-http/src/test/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSenderTest.java
+++ b/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() {
Map<String, String> paramsMap = new HashMap<>();
- paramsMap.put(HttpAlertConstants.URL, "http://www.baidu.com");
- paramsMap.put(HttpAlertConstants.REQUEST_TYPE, "POST");
- paramsMap.put(HttpAlertConstants.HEADER_PARAMS, "{\"Content-Type\":\"application/json\"}");
- paramsMap.put(HttpAlertConstants.BODY_PARAMS, "{\"number\":\"13457654323\"}");
- paramsMap.put(HttpAlertConstants.CONTENT_FIELD, "content");
+ paramsMap.put(HttpAlertConstants.NAME_URL, "http://www.baidu.com");
+ paramsMap.put(HttpAlertConstants.NAME_REQUEST_TYPE, "POST");
+ paramsMap.put(HttpAlertConstants.NAME_HEADER_PARAMS, "{\"Content-Type\":\"application/json\"}");
+ paramsMap.put(HttpAlertConstants.NAME_BODY_PARAMS, "{\"number\":\"13457654323\"}");
+ paramsMap.put(HttpAlertConstants.NAME_CONTENT_FIELD, "content");
HttpSender httpSender = new HttpSender(paramsMap);
AlertResult alertResult = httpSender.send("Fault tolerance warning");
Assert.assertEquals("true", alertResult.getStatus());
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptParamsConstants.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptParamsConstants.java
index 5b096d5..7552036 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptParamsConstants.java
+++ b/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");
}
- static final String SCRIPT_TYPE = "type";
+ static final String SCRIPT_TYPE = "$t('scriptType')";
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 SCRIPT_USER_PARAMS = "user.params";
+ static final String SCRIPT_USER_PARAMS = "$t('userParams')";
static final String NAME_SCRIPT_USER_PARAMS = "userParams";
}
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-slack/src/main/java/org/apache/dolphinscheduler/plugin/alert/slack/SlackParamsConstants.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-slack/src/main/java/org/apache/dolphinscheduler/plugin/alert/slack/SlackParamsConstants.java
index fd191c5..d0ec160 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-slack/src/main/java/org/apache/dolphinscheduler/plugin/alert/slack/SlackParamsConstants.java
+++ b/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_BOT = "Username";
+ public static final String SLACK_BOT = "$t('Username')";
public static final String SLACK_BOT_NAME = "username";
public static final String TEXT = "text";
public static final String ATTACHMENT = "attachments";
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactory.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactory.java
index 25b1318..a5f7aa1 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactory.java
+++ b/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();
- 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.TEXT.getDescp(), ShowType.TEXT.getDescp(), false))
.setValue(ShowType.TABLE.getDescp())
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertParamsConstants.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertParamsConstants.java
index c254b27..17bc783 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertParamsConstants.java
+++ b/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());
}
- 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 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 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 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 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 ENTERPRISE_WE_CHAT_USERS = "users";
+ static final String ENTERPRISE_WE_CHAT_USERS = "$t('users')";
static final String NAME_ENTERPRISE_WE_CHAT_USERS = "users";
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSender.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSender.java
index 6944da6..7499b00 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSender.java
+++ b/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 weChatTokenUrl = WeChatAlertConstants.WE_CHAT_TOKEN_URL;
weChatUserSendMsg = config.get(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_USER_SEND_MSG);
- showType = config.get(AlertConstants.SHOW_TYPE);
- requireNonNull(showType, AlertConstants.SHOW_TYPE + MUST_NOT_NULL);
+ showType = config.get(AlertConstants.NAME_SHOW_TYPE);
+ requireNonNull(showType, AlertConstants.NAME_SHOW_TYPE + MUST_NOT_NULL);
weChatTokenUrlReplace = weChatTokenUrl
.replace(CORP_ID_REGEX, weChatCorpId)
.replace(SECRET_REGEX, weChatSecret);
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/test/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSenderTest.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/test/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSenderTest.java
index 61010eb..79e76ff 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-wechat/src/test/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSenderTest.java
+++ b/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_TEAM_SEND_MSG, "msg");
- weChatConfig.put(AlertConstants.SHOW_TYPE, ShowType.TABLE.getDescp());
+ weChatConfig.put(AlertConstants.NAME_SHOW_TYPE, ShowType.TABLE.getDescp());
}
@Test
@@ -80,7 +80,7 @@ public class WeChatSenderTest {
@Test
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);
AlertResult alertResult = weChatSender.sendEnterpriseWeChat("test", content);
Assert.assertEquals("false", alertResult.getStatus());
diff --git a/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPluginTest.java b/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPluginTest.java
index 5c31225..17fc872 100644
--- a/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/plugin/EmailAlertPluginTest.java
+++ b/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 address", "192.168.xx.xx");
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("database client connections", "190");
@@ -87,7 +87,7 @@ public class EmailAlertPluginTest {
map2.put("mysql address", "192.168.xx.xx");
map2.put("port", "3306");
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");
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.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.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)
.setValue(ShowType.TABLE.getDescp())
.addValidate(Validate.newBuilder().setRequired(true).build())
diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/alert/AlertConstants.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/alert/AlertConstants.java
index b1eee2a..ca6d5c4 100644
--- a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/alert/AlertConstants.java
+++ b/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 {
/** 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";
}
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 f2164e2..2369d41 100755
--- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
+++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
@@ -420,8 +420,6 @@ export default {
'Notification strategy': 'Notification strategy',
'Notification group': '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?',
'Schedule date': 'Schedule date',
'Mode of execution': 'Mode of execution',
@@ -712,5 +710,33 @@ export default {
condition: 'condition',
'The condition content cannot be empty': 'The condition content cannot be empty',
'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'
}
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 82330ee..1cf8cbc 100644
--- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
+++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
@@ -419,8 +419,7 @@ export default {
'Notification strategy': '通知策略',
'Notification group': '通知组',
'Please select a notification group': '请选择通知组',
- receivers: '收件人',
- receiverCcs: '抄送人',
+
'Whether it is a complement process?': '是否补数',
'Schedule date': '调度日期',
'Mode of execution': '执行方式',
@@ -711,5 +710,34 @@ export default {
condition: '条件',
'The condition content cannot be empty': '条件内容不能为空',
'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: '内容展示类型'
}