From a833d95286b3bc723b195bc3496402bd718627d4 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Mon, 30 Oct 2023 13:47:58 +0800 Subject: [PATCH 1/8] support alarm webhook custom notice template json content --- .../alert/calculate/CalculateAlarm.java | 5 +- .../main/resources/alerter_en_US.properties | 2 + .../main/resources/alerter_zh_CN.properties | 2 + .../common/constants/CommonConstants.java | 2 +- home/docs/help/alert_webhook.md | 55 +++++++++---------- .../current/help/alert_webhook.md | 55 +++++++++---------- .../impl/AbstractAlertNotifyHandlerImpl.java | 32 ++++++----- .../DingTalkRobotAlertNotifyHandlerImpl.java | 6 -- .../DiscordBotAlertNotifyHandlerImpl.java | 5 -- .../impl/EmailAlertNotifyHandlerImpl.java | 7 +-- .../impl/FlyBookAlertNotifyHandlerImpl.java | 5 -- .../HuaweiCloudSmnAlertNotifyHandlerImpl.java | 5 -- .../ServerChanAlertNotifyHandlerImpl.java | 11 ---- .../impl/SlackAlertNotifyHandlerImpl.java | 5 -- .../impl/SmsAlertNotifyHandlerImpl.java | 3 +- .../TelegramBotAlertNotifyHandlerImpl.java | 5 -- .../impl/WeChatAlertNotifyHandlerImpl.java | 2 +- .../impl/WeWorkAppAlertNotifyHandlerImpl.java | 23 +------- .../WeWorkRobotAlertNotifyHandlerImpl.java | 5 -- .../impl/WebHookAlertNotifyHandlerImpl.java | 7 ++- .../resources/templates/2-webhookTemplate.txt | 15 +++++ 21 files changed, 106 insertions(+), 151 deletions(-) create mode 100644 manager/src/main/resources/templates/2-webhookTemplate.txt diff --git a/alerter/src/main/java/org/dromara/hertzbeat/alert/calculate/CalculateAlarm.java b/alerter/src/main/java/org/dromara/hertzbeat/alert/calculate/CalculateAlarm.java index 1e52a2b40cb..0b88515689e 100644 --- a/alerter/src/main/java/org/dromara/hertzbeat/alert/calculate/CalculateAlarm.java +++ b/alerter/src/main/java/org/dromara/hertzbeat/alert/calculate/CalculateAlarm.java @@ -261,7 +261,7 @@ private void afterThresholdRuleMatch(long currentTimeMilli, long monitorId, Stri Map tags = new HashMap<>(6); tags.put(CommonConstants.TAG_MONITOR_ID, String.valueOf(monitorId)); tags.put(CommonConstants.TAG_MONITOR_APP, app); - tags.put(CommonConstants.TAG_POLICY_ID, String.valueOf(define.getId())); + tags.put(CommonConstants.TAG_THRESHOLD_ID, String.valueOf(define.getId())); if (!CollectionUtils.isEmpty(define.getTags())) { for (TagItem tagItem : define.getTags()) { fieldValueMap.put(tagItem.getName(), tagItem.getValue()); @@ -270,7 +270,6 @@ private void afterThresholdRuleMatch(long currentTimeMilli, long monitorId, Stri } Alert alert = Alert.builder() .tags(tags) - .alertDefineId(define.getId()) .priority(define.getPriority()) .status(ALERT_STATUS_CODE_PENDING) .target(app + "." + metrics + "." + define.getField()) @@ -320,7 +319,7 @@ private void handlerAvailableMetrics(long monitorId, String app, CollectRep.Metr Map tags = new HashMap<>(6); tags.put(CommonConstants.TAG_MONITOR_ID, String.valueOf(monitorId)); tags.put(CommonConstants.TAG_MONITOR_APP, app); - tags.put(CommonConstants.TAG_POLICY_ID, String.valueOf(avaAlertDefine.getId())); + tags.put(CommonConstants.TAG_THRESHOLD_ID, String.valueOf(avaAlertDefine.getId())); tags.put("metrics", CommonConstants.AVAILABILITY); tags.put("code", metricsData.getCode().name()); Map valueMap = tags.entrySet().stream() diff --git a/alerter/src/main/resources/alerter_en_US.properties b/alerter/src/main/resources/alerter_en_US.properties index ce9216ab4cc..e6b82b0aa52 100644 --- a/alerter/src/main/resources/alerter_en_US.properties +++ b/alerter/src/main/resources/alerter_en_US.properties @@ -21,6 +21,8 @@ alerter.notify.monitorId = Monitor ID alerter.notify.monitorName = Monitor Name alerter.notify.priority = Alert Priority alerter.notify.triggerTime = Alert Trigger Time +alerter.notify.times = Alert Trigger Times +alerter.notify.tags = Alert Labels alerter.notify.content = Alert Content alerter.notify.console = Console Login alerter.priority.0 = Emergency Alert diff --git a/alerter/src/main/resources/alerter_zh_CN.properties b/alerter/src/main/resources/alerter_zh_CN.properties index 656bf8fd806..56331c4bd7f 100644 --- a/alerter/src/main/resources/alerter_zh_CN.properties +++ b/alerter/src/main/resources/alerter_zh_CN.properties @@ -21,6 +21,8 @@ alerter.notify.monitorId = 所属监控ID alerter.notify.monitorName = 所属监控名称 alerter.notify.priority = 告警级别 alerter.notify.triggerTime = 告警触发时间 +alerter.notify.times = 告警触发次数 +alerter.notify.tags = 告警标签 alerter.notify.content = 内容详情 alerter.notify.console = 登入控制台 alerter.priority.0 = 紧急告警 diff --git a/common/src/main/java/org/dromara/hertzbeat/common/constants/CommonConstants.java b/common/src/main/java/org/dromara/hertzbeat/common/constants/CommonConstants.java index 4426eb7b6ea..0c6c11673ff 100644 --- a/common/src/main/java/org/dromara/hertzbeat/common/constants/CommonConstants.java +++ b/common/src/main/java/org/dromara/hertzbeat/common/constants/CommonConstants.java @@ -250,7 +250,7 @@ public interface CommonConstants { /** * 内有标签: policyId 告警阈值规则ID */ - String TAG_POLICY_ID = "policyId"; + String TAG_THRESHOLD_ID = "thresholdId"; /** * 内有标签: app 监控类型 diff --git a/home/docs/help/alert_webhook.md b/home/docs/help/alert_webhook.md index 0a7af9ada21..adc1b6f12f8 100644 --- a/home/docs/help/alert_webhook.md +++ b/home/docs/help/alert_webhook.md @@ -24,37 +24,36 @@ keywords: [open source monitoring tool, open source alerter, open source webhook Content format:JSON ```json { - "id":76456, - "target":"available", - "alertDefineId":232, - "priority":0, - "content":"监控紧急可用性告警: UN_CONNECTABLE", - "tag": { - "monitorId": 3543534545, - "monitorName":"API_poetry.didi.top" - }, - "status":0, - "times":1, - "gmtCreate":"2022-02-25T13:32:13", - "gmtUpdate":"2022-02-25T13:32:13" + "alarmId": 76456, + "target": "${target}", + "thresholdId": 33455, + "priority": 0, + "content": "udp_port monitoring availability alert, code is FAIL", + "status": 0, + "times": 1, + "triggerTime": "2022-02-25T13:32:13", + "tags": { + "app": "windows", + "monitorId": "180427708350720", + "metrics": "availability", + "code": "UN_CONNECTABLE", + "thresholdId": "112", + "monitorName": "WINDOWS_192.168.124.12" + } } ``` -| | | -|-----|-----| -| id | integer($int64) title: Alarm record entity primary key index ID | -| target | string title: Alert target object: monitor availability-available metrics-app.metrics.field | -| alertDefineId integer($int64) title: Alarm definition ID associated with the alarm | -| priority | string($byte) title: Alarm level 0: high-emergency-critical alarm-red 1: medium-critical-critical alarm-orange 2: low-warning-warning alarm-yellow | -| content | string title: The actual content of the alarm notification | -| status | string($byte) title: Alarm status: 0-normal alarm (to be processed) 1-threshold triggered but not reached the number of alarms 2-recovered alarm 3-processed | -| times | integer($int32) title: Alarm threshold trigger times | -| firstTriggerTime | integer($int64) title: Alarm trigger time (timestamp in milliseconds) | -| lastTriggerTime | integer($int64) title: Alarm trigger time (timestamp in milliseconds) | -| nextEvalInterval | integer($int64) title: Alarm evaluation interval (milliseconds) | -| tags | example: {key1:value1} | -| gmtCreate | string($date-time) title: Record the latest creation time (timestamp in milliseconds) | -| gmtUpdate | string($date-time) | +| | | +|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| alarmId | integer($int64) title: Alarm record entity primary key index ID 告警记录实体主键索引ID | +| target | string title: Alert target object: monitor availability-available metrics-app.metrics.field 告警目标对象: 监控可用性-available 指标-app.metrics.field | +| thresholdId | integer($int64) title: Alarm definition ID associated with the alarm 告警关联的告警定义ID | +| priority | string($byte) title: Alarm level 0: high-emergency-critical alarm-red 1: medium-critical-critical alarm-orange 2: low-warning-warning alarm-yellow 告警级别 0:高-emergency-紧急告警-红色 1:中-critical-严重告警-橙色 2:低-warning-警告告警-黄色 | +| content | string title: The actual content of the alarm notification 告警通知实际内容 | +| status | string($byte) title: Alarm status: 0-normal alarm (to be processed) 1-threshold triggered but not reached the number of alarms 2-recovered alarm 3-processed 告警状态: 0-正常告警(待处理) 1-阈值触发但未达到告警次数 2-恢复告警 3-已处理 | +| times | integer($int32) title: Alarm threshold trigger times 告警阈值触发次数 | +| triggerTime | integer($int64) title: Alarm trigger time (timestamp in milliseconds) 首次告警触发时间(毫秒时间戳) | +| tags | example: {key1:value1} | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/alert_webhook.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/alert_webhook.md index f02526bc2a1..61ed1dc99b5 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/alert_webhook.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/alert_webhook.md @@ -24,37 +24,36 @@ keywords: [告警 Webhook 回调通知, 开源告警系统, 开源监控告警 内容格式:JSON ```json { - "id":76456, - "target":"available", - "alertDefineId":232, - "priority":0, - "content":"监控紧急可用性告警: UN_CONNECTABLE", - "tag": { - "monitorId": 3543534545, - "monitorName":"API_poetry.didi.top" - }, - "status":0, - "times":1, - "gmtCreate":"2022-02-25T13:32:13", - "gmtUpdate":"2022-02-25T13:32:13" + "alarmId": 76456, + "target": "${target}", + "thresholdId": 33455, + "priority": 0, + "content": "udp_port monitoring availability alert, code is FAIL", + "status": 0, + "times": 1, + "triggerTime": "2022-02-25T13:32:13", + "tags": { + "app": "windows", + "monitorId": "180427708350720", + "metrics": "availability", + "code": "UN_CONNECTABLE", + "thresholdId": "112", + "monitorName": "WINDOWS_192.168.124.12" + } } ``` -| | | -|-----|-----| -| id | integer($int64) title: Alarm record entity primary key index ID 告警记录实体主键索引ID | -| target | string title: Alert target object: monitor availability-available metrics-app.metrics.field 告警目标对象: 监控可用性-available 指标-app.metrics.field | -| alertDefineId integer($int64) title: Alarm definition ID associated with the alarm 告警关联的告警定义ID | -| priority | string($byte) title: Alarm level 0: high-emergency-critical alarm-red 1: medium-critical-critical alarm-orange 2: low-warning-warning alarm-yellow 告警级别 0:高-emergency-紧急告警-红色 1:中-critical-严重告警-橙色 2:低-warning-警告告警-黄色 | -| content | string title: The actual content of the alarm notification 告警通知实际内容 | -| status | string($byte) title: Alarm status: 0-normal alarm (to be processed) 1-threshold triggered but not reached the number of alarms 2-recovered alarm 3-processed 告警状态: 0-正常告警(待处理) 1-阈值触发但未达到告警次数 2-恢复告警 3-已处理 | -| times | integer($int32) title: Alarm threshold trigger times 告警阈值触发次数 | -| firstTriggerTime | integer($int64) title: Alarm trigger time (timestamp in milliseconds) 首次告警触发时间(毫秒时间戳) | -| lastTriggerTime | integer($int64) title: Alarm trigger time (timestamp in milliseconds) 最近告警触发时间(毫秒时间戳) | -| nextEvalInterval | integer($int64) title: Alarm evaluation interval (milliseconds) 告警评估时间间隔(单位毫秒) | -| tags | example: {key1:value1} | -| gmtCreate | string($date-time) title: Record the latest creation time (timestamp in milliseconds) 记录最新创建时间(毫秒时间戳) | -| gmtUpdate |string($date-time) title: 记录最新修改时间(毫秒时间戳) | +| | | +|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| alarmId | integer($int64) title: Alarm record entity primary key index ID 告警记录实体主键索引ID | +| target | string title: Alert target object: monitor availability-available metrics-app.metrics.field 告警目标对象: 监控可用性-available 指标-app.metrics.field | +| thresholdId | integer($int64) title: Alarm definition ID associated with the alarm 告警关联的告警定义ID | +| priority | string($byte) title: Alarm level 0: high-emergency-critical alarm-red 1: medium-critical-critical alarm-orange 2: low-warning-warning alarm-yellow 告警级别 0:高-emergency-紧急告警-红色 1:中-critical-严重告警-橙色 2:低-warning-警告告警-黄色 | +| content | string title: The actual content of the alarm notification 告警通知实际内容 | +| status | string($byte) title: Alarm status: 0-normal alarm (to be processed) 1-threshold triggered but not reached the number of alarms 2-recovered alarm 3-processed 告警状态: 0-正常告警(待处理) 1-阈值触发但未达到告警次数 2-恢复告警 3-已处理 | +| times | integer($int32) title: Alarm threshold trigger times 告警阈值触发次数 | +| triggerTime | integer($int64) title: Alarm trigger time (timestamp in milliseconds) 首次告警触发时间(毫秒时间戳) | +| tags | example: {key1:value1} | ### webhook通知常见问题 diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/AbstractAlertNotifyHandlerImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/AbstractAlertNotifyHandlerImpl.java index b755b338d92..9aaee14da1f 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/AbstractAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/AbstractAlertNotifyHandlerImpl.java @@ -22,9 +22,11 @@ import freemarker.template.TemplateException; import lombok.extern.slf4j.Slf4j; import org.dromara.hertzbeat.alert.AlerterProperties; +import org.dromara.hertzbeat.common.constants.CommonConstants; import org.dromara.hertzbeat.common.entity.alerter.Alert; import org.dromara.hertzbeat.common.entity.manager.NoticeTemplate; import org.dromara.hertzbeat.common.support.event.SystemConfigChangeEvent; +import org.dromara.hertzbeat.common.util.JsonUtil; import org.dromara.hertzbeat.common.util.ResourceBundleUtil; import org.dromara.hertzbeat.manager.component.alerter.AlertNotifyHandler; import org.dromara.hertzbeat.manager.service.NoticeConfigService; @@ -65,35 +67,46 @@ protected String renderContent(NoticeTemplate noticeTemplate, Alert alert) throw StringTemplateLoader stringLoader = new StringTemplateLoader(); freemarker.template.Template templateRes; Configuration cfg = new Configuration(Configuration.VERSION_2_3_0); - Map model = new HashMap<>(16); + Map model = new HashMap<>(16); model.put("title", bundle.getString("alerter.notify.title")); if (alert.getTags() != null) { - String monitorId = alert.getTags().get("monitorId"); + String monitorId = alert.getTags().get(CommonConstants.TAG_MONITOR_ID); if (monitorId != null) { model.put("monitorId", monitorId); } - String monitorName = alert.getTags().get("monitorName"); + String monitorName = alert.getTags().get(CommonConstants.TAG_MONITOR_NAME); if (monitorName != null) { model.put("monitorName", monitorName); } + String thresholdId = alert.getTags().get(CommonConstants.TAG_THRESHOLD_ID); + if (thresholdId != null) { + model.put("thresholdId", thresholdId); + } } - + + model.put("alarmId", alert.getId()); + model.put("status", alert.getStatus()); model.put("monitorIdLabel", bundle.getString("alerter.notify.monitorId")); model.put("monitorNameLabel", bundle.getString("alerter.notify.monitorName")); model.put("target", alert.getTarget()); model.put("targetLabel", bundle.getString("alerter.notify.target")); model.put("priorityLabel", bundle.getString("alerter.notify.priority")); model.put("priority", bundle.getString("alerter.priority." + alert.getPriority())); + model.put("priorityValue", alert.getPriority()); model.put("triggerTimeLabel", bundle.getString("alerter.notify.triggerTime")); model.put("triggerTime", DTF.format(Instant.ofEpochMilli(alert.getLastAlarmTime()).atZone(ZoneId.systemDefault()).toLocalDateTime())); + model.put("timesLabel", bundle.getString("alerter.notify.times")); + model.put("times", alert.getTimes()); model.put("contentLabel", bundle.getString("alerter.notify.content")); model.put("content", alert.getContent()); + model.put("tagsLabel", bundle.getString("alerter.notify.tags")); + model.put("tags", alert.getTags()); if (noticeTemplate == null) { noticeTemplate = noticeConfigService.getDefaultNoticeTemplateByType(type()); } if (noticeTemplate == null) { - log.error("{} does not have mapping default notice template. type: {}.", templateName(), type()); + log.error("alert does not have mapping default notice template. type: {}.", type()); throw new NullPointerException(type() + " does not have mapping default notice template"); } String templateName = "freeMakerTemplate"; @@ -104,15 +117,6 @@ protected String renderContent(NoticeTemplate noticeTemplate, Alert alert) throw return template.replaceAll("((\r\n)|\n)[\\s\t ]*(\\1)+", "$1"); } - - /** - * Get the Thymeleaf template name - * 获取Thymeleaf模板名称 - * - * @return Thymeleaf模板名称 - */ - protected abstract String templateName(); - @EventListener(SystemConfigChangeEvent.class) public void onEvent(SystemConfigChangeEvent event) { log.info("{} receive system config change event: {}.", this.getClass().getName(), event.getSource()); diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/DingTalkRobotAlertNotifyHandlerImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/DingTalkRobotAlertNotifyHandlerImpl.java index 60e2e60b89d..4b8e6d9568f 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/DingTalkRobotAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/DingTalkRobotAlertNotifyHandlerImpl.java @@ -74,12 +74,6 @@ public byte type() { return 5; } - @Override - protected String templateName() { - return "alertNotifyDingTalkRobot"; - - } - /** * 钉钉机器人请求消息体 * diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/DiscordBotAlertNotifyHandlerImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/DiscordBotAlertNotifyHandlerImpl.java index df8926c9f48..e713bbb38ec 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/DiscordBotAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/DiscordBotAlertNotifyHandlerImpl.java @@ -63,11 +63,6 @@ public byte type() { return 9; } - @Override - protected String templateName() { - return "alertNotifyDiscordBot"; - } - @Data @Builder private static class DiscordNotifyDTO { diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/EmailAlertNotifyHandlerImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/EmailAlertNotifyHandlerImpl.java index a57e7a0a6cc..3f4aa388dbd 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/EmailAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/EmailAlertNotifyHandlerImpl.java @@ -45,7 +45,6 @@ /** * @author Musk.Chen - * */ @Component @RequiredArgsConstructor @@ -113,7 +112,7 @@ public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate, Alert a props.put("mail.smtp.ssl.enable", sslEnable); } } catch (Exception e) { - log.error("Type not found {}",e.getMessage()); + log.error("Type not found {}", e.getMessage()); } MimeMessage mimeMessage = javaMailSender.createMimeMessage(); MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage, true, "UTF-8"); @@ -124,7 +123,7 @@ public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate, Alert a messageHelper.setTo(receiver.getEmail()); messageHelper.setSentDate(new Date()); //Build email templates 构建邮件模版 - String process = mailService.buildAlertHtmlTemplate(alert,noticeTemplate); + String process = mailService.buildAlertHtmlTemplate(alert, noticeTemplate); //Set Email Content Template 设置邮件内容模版 messageHelper.setText(process, true); javaMailSender.send(mimeMessage); @@ -143,4 +142,4 @@ public void onEvent(SystemConfigChangeEvent event) { log.info("{} receive system config change event: {}.", this.getClass().getName(), event.getSource()); this.bundle = ResourceBundleUtil.getBundle("alerter"); } -} \ No newline at end of file +} diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/FlyBookAlertNotifyHandlerImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/FlyBookAlertNotifyHandlerImpl.java index 65b8817c21e..6b480bf1a67 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/FlyBookAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/FlyBookAlertNotifyHandlerImpl.java @@ -95,11 +95,6 @@ public byte type() { return 6; } - @Override - protected String templateName() { - return "alertNotifyFlyBook"; - } - @Data private static class FlyBookWebHookDto { private static final String MARKDOWN = "post"; diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/HuaweiCloudSmnAlertNotifyHandlerImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/HuaweiCloudSmnAlertNotifyHandlerImpl.java index 1c96e39bdab..3ff2b64789f 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/HuaweiCloudSmnAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/HuaweiCloudSmnAlertNotifyHandlerImpl.java @@ -85,9 +85,4 @@ private SmnClient getSmnClient(NoticeReceiver receiver) { public byte type() { return 11; } - - @Override - protected String templateName() { - return "alertNotifySmn"; - } } diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/ServerChanAlertNotifyHandlerImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/ServerChanAlertNotifyHandlerImpl.java index 019a4bd20cb..bd567189774 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/ServerChanAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/ServerChanAlertNotifyHandlerImpl.java @@ -60,17 +60,6 @@ public byte type() { return 12; } - /** - * Get the Thymeleaf template name - * 获取Thymeleaf模板名称 - * - * @return Thymeleaf模板名称 - */ - @Override - protected String templateName() { - return "alertNotifyServerChan"; - } - @Data private static class ServerChanWebHookDto { private static final String MARKDOWN = "markdown"; diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/SlackAlertNotifyHandlerImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/SlackAlertNotifyHandlerImpl.java index 27b2adb5e03..d93f02f2eab 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/SlackAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/SlackAlertNotifyHandlerImpl.java @@ -81,11 +81,6 @@ public byte type() { return 8; } - @Override - protected String templateName() { - return "alertNotifySlack"; - } - @Data @Builder private static class SlackNotifyDTO { diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/SmsAlertNotifyHandlerImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/SmsAlertNotifyHandlerImpl.java index c37929d9b94..71d8df6739e 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/SmsAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/SmsAlertNotifyHandlerImpl.java @@ -25,7 +25,6 @@ import org.dromara.hertzbeat.common.entity.manager.NoticeTemplate; import org.dromara.hertzbeat.common.service.TencentSmsClient; import org.dromara.hertzbeat.common.util.ResourceBundleUtil; -import org.dromara.hertzbeat.manager.component.alerter.AlertNotifyHandler; import org.dromara.hertzbeat.manager.support.exception.AlertNoticeException; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; @@ -39,7 +38,7 @@ @RequiredArgsConstructor @Slf4j @ConditionalOnProperty("common.sms.tencent.app-id") -final class SmsAlertNotifyHandlerImpl implements AlertNotifyHandler { +final class SmsAlertNotifyHandlerImpl extends AbstractAlertNotifyHandlerImpl { private final TencentSmsClient tencentSmsClient; diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/TelegramBotAlertNotifyHandlerImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/TelegramBotAlertNotifyHandlerImpl.java index f38e67334ba..038bf82b816 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/TelegramBotAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/TelegramBotAlertNotifyHandlerImpl.java @@ -81,11 +81,6 @@ public byte type() { return 7; } - @Override - protected String templateName() { - return "alertNotifyTelegramBot"; - } - @Data @Builder private static class TelegramBotNotifyDTO { diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeChatAlertNotifyHandlerImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeChatAlertNotifyHandlerImpl.java index bb2f2f37748..214f3d69e98 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeChatAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeChatAlertNotifyHandlerImpl.java @@ -25,7 +25,7 @@ /** * @author Musk.Chen */ -final class WeChatAlertNotifyHandlerImpl implements AlertNotifyHandler { +final class WeChatAlertNotifyHandlerImpl extends AbstractAlertNotifyHandlerImpl { @Override public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate, Alert alert) { // todo diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeWorkAppAlertNotifyHandlerImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeWorkAppAlertNotifyHandlerImpl.java index e8cd5b63a3e..661e04663aa 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeWorkAppAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeWorkAppAlertNotifyHandlerImpl.java @@ -2,11 +2,9 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.dromara.hertzbeat.common.constants.CommonConstants; import org.dromara.hertzbeat.common.entity.alerter.Alert; import org.dromara.hertzbeat.common.entity.manager.NoticeReceiver; import org.dromara.hertzbeat.common.entity.manager.NoticeTemplate; -import org.dromara.hertzbeat.common.util.JsonUtil; import org.dromara.hertzbeat.manager.pojo.dto.WeChatAppDTO; import org.dromara.hertzbeat.manager.pojo.dto.WeChatAppReq; import org.dromara.hertzbeat.manager.support.exception.AlertNoticeException; @@ -17,12 +15,11 @@ import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; -import java.util.HashMap; -import java.util.Map; import java.util.Objects; /** * WeChat app alert notify impl + * * @author hdd */ @Component @@ -48,7 +45,7 @@ public class WeWorkAppAlertNotifyHandlerImpl extends AbstractAlertNotifyHandlerI private final RestTemplate restTemplate; @Override - public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate,Alert alert) throws AlertNoticeException { + public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate, Alert alert) throws AlertNoticeException { String corpId = receiver.getCorpId(); Integer agentId = receiver.getAgentId(); String appSecret = receiver.getAppSecret(); @@ -58,7 +55,7 @@ public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate,Alert al if (Objects.nonNull(entityResponse.getBody())) { String accessToken = entityResponse.getBody().getAccessToken(); WeChatAppDTO.MarkdownDTO markdown = new WeChatAppDTO.MarkdownDTO(); - markdown.setContent(renderContent(noticeTemplate,alert)); + markdown.setContent(renderContent(noticeTemplate, alert)); WeChatAppDTO weChatAppDTO = WeChatAppDTO.builder() .toUser(DEFAULT_ALL) .msgType(WeChatAppDTO.MARKDOWN) @@ -83,18 +80,4 @@ public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate,Alert al public byte type() { return 10; } - - - private String generateContent(Alert alert){ - Map contentMap = new HashMap<>(8); - contentMap.put("alertDefineId",alert.getAlertDefineId()); - contentMap.put("content",alert.getContent()); - contentMap.put("monitorName",alert.getTags().get(CommonConstants.TAG_MONITOR_NAME)); - return JsonUtil.toJson(contentMap); - } - - @Override - protected String templateName() { - return "alertNotifyWeWorkApp"; - } } diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeWorkRobotAlertNotifyHandlerImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeWorkRobotAlertNotifyHandlerImpl.java index 578762b8476..34a118b3421 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeWorkRobotAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WeWorkRobotAlertNotifyHandlerImpl.java @@ -72,9 +72,4 @@ public byte type() { return 4; } - @Override - protected String templateName() { - return "alertNotifyWeWorkRobot"; - } - } diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WebHookAlertNotifyHandlerImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WebHookAlertNotifyHandlerImpl.java index f91dbc9bb30..331e4e0b136 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WebHookAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/component/alerter/impl/WebHookAlertNotifyHandlerImpl.java @@ -22,7 +22,6 @@ import org.dromara.hertzbeat.common.entity.alerter.Alert; import org.dromara.hertzbeat.common.entity.manager.NoticeReceiver; import org.dromara.hertzbeat.common.entity.manager.NoticeTemplate; -import org.dromara.hertzbeat.manager.component.alerter.AlertNotifyHandler; import org.dromara.hertzbeat.manager.support.exception.AlertNoticeException; import org.springframework.http.*; import org.springframework.stereotype.Component; @@ -34,7 +33,8 @@ @Component @RequiredArgsConstructor @Slf4j -final class WebHookAlertNotifyHandlerImpl implements AlertNotifyHandler { +final class WebHookAlertNotifyHandlerImpl extends AbstractAlertNotifyHandlerImpl { + private final RestTemplate restTemplate; @Override @@ -42,7 +42,8 @@ public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate, Alert a try { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); - HttpEntity alertHttpEntity = new HttpEntity<>(alert, headers); + String webhookJson = renderContent(noticeTemplate, alert); + HttpEntity alertHttpEntity = new HttpEntity<>(webhookJson, headers); ResponseEntity entity = restTemplate.postForEntity(receiver.getHookUrl(), alertHttpEntity, String.class); if (entity.getStatusCode().value() < HttpStatus.BAD_REQUEST.value()) { log.debug("Send WebHook: {} Success", receiver.getHookUrl()); diff --git a/manager/src/main/resources/templates/2-webhookTemplate.txt b/manager/src/main/resources/templates/2-webhookTemplate.txt new file mode 100644 index 00000000000..4f4f880970c --- /dev/null +++ b/manager/src/main/resources/templates/2-webhookTemplate.txt @@ -0,0 +1,15 @@ +{ + "alarmId": ${alarmId}, + "target": "${target}", + <#if (thresholdId??)>"thresholdId": ${thresholdId}, + "priority": ${priorityValue}, + "content": "${content}", + "status": ${status}, + "times": ${times}, + "triggerTime": "${triggerTime}", + "tags": { + <#list tags as key,value> + "${key}": "${value}", + + } +} From 0f8ed7b48bffed21f48cc58bd124e563637384b1 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Mon, 30 Oct 2023 16:23:21 +0800 Subject: [PATCH 2/8] add media friend --- home/docs/others/media.md | 57 +++++++++++++++++++ .../current/others/media.md | 57 +++++++++++++++++++ home/sidebars.json | 1 + 3 files changed, 115 insertions(+) create mode 100644 home/docs/others/media.md create mode 100644 home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/media.md diff --git a/home/docs/others/media.md b/home/docs/others/media.md new file mode 100644 index 00000000000..296e4ae532f --- /dev/null +++ b/home/docs/others/media.md @@ -0,0 +1,57 @@ +--- +id: media +title: Media Friend +sidebar_label: Media Friend +--- + +## 我们推荐的公众号 + + + + + + +
+ +
+ Dromara +
+ Dromara开源社区,好玩有趣的百宝箱开源社区! +
+ +
+ TanCloud +
+ 探云-开源的高性能全托管监控云服务! +
+ +
+
+
+
+
+
+
+
+
+
+
+
+ +> 感谢以上媒体公众号对 HertzBeat 项目的推荐,如果您也是媒体运营者,欢迎互相推荐。 + +### 相互推荐哇,支持开源项目 + +#### HertzBeat作为一个新兴项目,迫切需要一定的途径进行项目推广。如果您也是媒体公众号运营者,欢迎您将HertzBeat推荐给您的粉丝: + +1. 推荐文案参考: [MarkDown源内容](https://gitee.com/dromara/hertzbeat/raw/master/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/introduce.md) [网页文章](https://hertzbeat.com/zh-cn/docs/) [图片资源](https://gitee.com/dromara/hertzbeat/tree/master/home/static/img/home) +2. 在文章底部或内容中留下项目GitHub仓库链接 +3. 文章需要是 `1000+` 的阅读量 + +#### 作为回报,HertzBeat将: + +1. 在官网文档 [推荐媒体] 处永久留下您的媒体公众号二维码和介绍 +2. 在官方交流群里@全体成员推荐您的公众号一次 +3. 您媒体公众号的新推文章都可以将分享到HertzBeat交流群中增加阅读量(为避免频繁推送连接,请不要超过一周三次) + +欢迎您有意愿加微信`tan-cloud`和我们联系,非常期待您的推荐,感谢对开源的支持。 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/media.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/media.md new file mode 100644 index 00000000000..c5b9edc03ec --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/media.md @@ -0,0 +1,57 @@ +--- +id: media +title: 媒体推荐 +sidebar_label: 媒体推荐 +--- + +## 我们推荐的公众号 + + + + + + +
+ +
+ Dromara +
+ Dromara开源社区,好玩有趣的百宝箱开源社区! +
+ +
+ TanCloud +
+ 探云-开源的高性能全托管监控云服务! +
+ +
+
+
+
+
+
+
+
+
+
+
+
+ +> 感谢以上媒体公众号对 HertzBeat 项目的推荐,如果您也是媒体运营者,欢迎互相推荐。 + +### 相互推荐哇,支持开源项目 + +#### HertzBeat作为一个新兴项目,迫切需要一定的途径进行项目推广。如果您也是媒体公众号运营者,欢迎您将HertzBeat推荐给您的粉丝: + +1. 推荐文案参考: [MarkDown源内容](https://gitee.com/dromara/hertzbeat/raw/master/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/introduce.md) [网页文章](https://hertzbeat.com/zh-cn/docs/) [图片资源](https://gitee.com/dromara/hertzbeat/tree/master/home/static/img/home) +2. 在文章底部或内容中留下项目GitHub仓库链接 +3. 文章需要是 `1000+` 的阅读量 + +#### 作为回报,HertzBeat将: + +1. 在官网文档 [推荐媒体] 处永久留下您的媒体公众号二维码和介绍 +2. 在官方交流群里@全体成员推荐您的公众号一次 +3. 您媒体公众号的新推文章都可以将分享到HertzBeat交流群中增加阅读量(为避免频繁推送连接,请不要超过一周三次) + +欢迎您有意愿加微信`tan-cloud`和我们联系,非常期待您的推荐,感谢对开源的支持。 diff --git a/home/sidebars.json b/home/sidebars.json index b18409e9f1d..810a8b1e916 100644 --- a/home/sidebars.json +++ b/home/sidebars.json @@ -194,6 +194,7 @@ "type": "category", "label": "Others", "items": [ + "others/media", "others/developer", "others/contributing", "others/contact", From 695702f57212be1d7117658e3a2081cd2ff1f036 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Mon, 30 Oct 2023 21:12:56 +0800 Subject: [PATCH 3/8] update --- home/docs/others/private.md | 4 ++-- .../current/others/private.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/home/docs/others/private.md b/home/docs/others/private.md index 3c773ef4b7f..ea55a0d7ea0 100644 --- a/home/docs/others/private.md +++ b/home/docs/others/private.md @@ -6,12 +6,12 @@ sidebar_label: Enterprise :::tip **Open source does not mean completely free. If you [modify HertzBeat's logo, name, copyright](https://github.com/dromara/hertzbeat/blob/master/NOTICE), etc., please ask us for authorization, otherwise there will be [legal risks](legal).** -**Open source is based on mutual trust, please don't let developers chill.** +**Open source is based on mutual trust, please don't let developers chill. We will pursue all illegal gains of individuals and teams who undermine open source and profit from it.** ::: HertzBeat monitoring products are divided into open source community version and enterprise version. The enterprise version **provides more enterprise-level features such as user management and log auditing**. The maintenance team quickly responds to enterprise needs. -## HertzBeat Licensed Version (paid) +## HertzBeat Licensed Version (Paid) We provide the community open source version of the monitoring product HertzBeat, which can be used by individuals and businesses for free, **Requires complete reservation of copyright, Logo, trademark, footer copyright statement, and attribution statement**. In some cases, enterprises need to modify the copyright LOGO and attribution statement based on the open source version for secondary development. We have launched **HertzBeat Authorized Version** for such needs. diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/private.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/private.md index f532ac410a6..305afc88f13 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/private.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/private.md @@ -6,7 +6,7 @@ sidebar_label: 企业版 :::tip **开源不等同于免费,如果您基于HertzBeat二次开发修改了[logo,名称,版权](https://github.com/dromara/hertzbeat/blob/master/NOTICE)等,请找我们授权,否则会有[法律风险](legal)。** -**我们有权利追诉破坏开源并因此获利的团队个人的全部违法所得,也欢迎给我们[提供侵权线索](legal)。** +**请清清白白做人,我们必追诉破坏开源并因此获利的团队个人的全部违法所得,也欢迎给我们[提供侵权线索](legal)。** ::: --- @@ -42,8 +42,8 @@ HertzBeat监控产品分开源社区版本和企业版本,企业版本提供 如果您企业需要基于hertzbeat新增适配一款目前还没有的监控类型,或对您企业的内部服务定制化适配监控,我们提供定制化监控服务,根据复杂度收费1000元-5000元不等。 -- 快速答疑群: 1000元/1月 +- 快速答疑群: 2000元/1月 为您团队专门拉一个答疑小群,快速响应群内的各种问题。 -> **请您理解我们这些付费点,开源不代表什么都免费,我们也是全职在做开源这件事情,因为爱和理想,但我们也需要面包和大米来保证开源这件事能持续下去,而不是做着做着就中断了。** +> **开源不代表什么都免费,我们也是全职在做开源这件事情,因为爱和理想,但我们也需要面包来保证开源这件事能持续下去。** From 27bf68d607182326f21a241001315741aca2799c Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Tue, 31 Oct 2023 09:45:10 +0800 Subject: [PATCH 4/8] add deploy to gitee doc --- home/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/home/README.md b/home/README.md index 9179556bd7a..56adc254742 100644 --- a/home/README.md +++ b/home/README.md @@ -42,3 +42,9 @@ USE_SSH=true yarn deploy ``` If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. + +### Deployment to Gitee + +```console +GITHUB_HOST=gitee.com USE_SSH=true yarn deploy +``` From dd1241db5e54ed5eec1bb8b3c737fcd001b3c78b Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Tue, 31 Oct 2023 10:07:14 +0800 Subject: [PATCH 5/8] update doc --- README.md | 2 +- README_CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b0c134352a6..1cc818ec04f 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ [![Twitter](https://img.shields.io/twitter/follow/hertzbeat1024?logo=twitter)](https://twitter.com/hertzbeat1024) [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCri75zfWX0GHqJFPENEbLow?logo=youtube&label=YouTube%20Channel)](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow) -**Home: [hertzbeat.dromara.org](https://hertzbeat.dromara.org) | [hertzbeat.com](https://hertzbeat.com)** +**Home: [hertzbeat.dromara.org](https://hertzbeat.dromara.org) Global | [hertzbeat.com](https://hertzbeat.com) China** **Cloud: [console.tancloud.cn](https://console.tancloud.cn)** diff --git a/README_CN.md b/README_CN.md index 88de3baffcb..9524bb740e8 100644 --- a/README_CN.md +++ b/README_CN.md @@ -19,7 +19,7 @@ [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCri75zfWX0GHqJFPENEbLow?logo=youtube&label=YouTube%20Channel)](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow) -**官网: [hertzbeat.dromara.org](https://hertzbeat.dromara.org) | [hertzbeat.com](https://hertzbeat.com)** +**官网: [hertzbeat.dromara.org](https://hertzbeat.dromara.org) 全球网络 | [hertzbeat.com](https://hertzbeat.com) 中国网络** **云服务: [console.tancloud.cn](https://console.tancloud.cn)** From 289e6e8dd28ba1ded5b147b595c64f12b241768b Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Tue, 31 Oct 2023 23:29:51 +0800 Subject: [PATCH 6/8] update --- .../templates/{1-emailTemplate.html => 1-EmailTemplate.html} | 0 .../{10-weWorkAppTemplate.txt => 10-WeWorkAppTemplate.txt} | 0 .../templates/{11-smnTemplate.txt => 11-SmnTemplate.txt} | 0 .../{12-serverChanTemplate.txt => 12-ServerChanTemplate.txt} | 0 .../{2-webhookTemplate.txt => 2-WebhookTemplate.txt} | 0 .../{4-weWorkRobotTemplate.txt => 4-WeWorkRobotTemplate.txt} | 0 ...-dingTalkRobotTemplate.txt => 5-DingTalkRobotTemplate.txt} | 0 ...{6-flyBookRobotTemplate.txt => 6-FlyBookRobotTemplate.txt} | 0 .../{7-telegramBotTemplate.txt => 7-TelegramBotTemplate.txt} | 0 .../templates/{8-slackTemplate.txt => 8-SlackTemplate.txt} | 0 .../{9-discordBotTemplate.txt => 9-DiscordBotTemplate.txt} | 0 .../app/routes/alert/alert-notice/alert-notice.component.ts | 4 ++-- 12 files changed, 2 insertions(+), 2 deletions(-) rename manager/src/main/resources/templates/{1-emailTemplate.html => 1-EmailTemplate.html} (100%) rename manager/src/main/resources/templates/{10-weWorkAppTemplate.txt => 10-WeWorkAppTemplate.txt} (100%) rename manager/src/main/resources/templates/{11-smnTemplate.txt => 11-SmnTemplate.txt} (100%) rename manager/src/main/resources/templates/{12-serverChanTemplate.txt => 12-ServerChanTemplate.txt} (100%) rename manager/src/main/resources/templates/{2-webhookTemplate.txt => 2-WebhookTemplate.txt} (100%) rename manager/src/main/resources/templates/{4-weWorkRobotTemplate.txt => 4-WeWorkRobotTemplate.txt} (100%) rename manager/src/main/resources/templates/{5-dingTalkRobotTemplate.txt => 5-DingTalkRobotTemplate.txt} (100%) rename manager/src/main/resources/templates/{6-flyBookRobotTemplate.txt => 6-FlyBookRobotTemplate.txt} (100%) rename manager/src/main/resources/templates/{7-telegramBotTemplate.txt => 7-TelegramBotTemplate.txt} (100%) rename manager/src/main/resources/templates/{8-slackTemplate.txt => 8-SlackTemplate.txt} (100%) rename manager/src/main/resources/templates/{9-discordBotTemplate.txt => 9-DiscordBotTemplate.txt} (100%) diff --git a/manager/src/main/resources/templates/1-emailTemplate.html b/manager/src/main/resources/templates/1-EmailTemplate.html similarity index 100% rename from manager/src/main/resources/templates/1-emailTemplate.html rename to manager/src/main/resources/templates/1-EmailTemplate.html diff --git a/manager/src/main/resources/templates/10-weWorkAppTemplate.txt b/manager/src/main/resources/templates/10-WeWorkAppTemplate.txt similarity index 100% rename from manager/src/main/resources/templates/10-weWorkAppTemplate.txt rename to manager/src/main/resources/templates/10-WeWorkAppTemplate.txt diff --git a/manager/src/main/resources/templates/11-smnTemplate.txt b/manager/src/main/resources/templates/11-SmnTemplate.txt similarity index 100% rename from manager/src/main/resources/templates/11-smnTemplate.txt rename to manager/src/main/resources/templates/11-SmnTemplate.txt diff --git a/manager/src/main/resources/templates/12-serverChanTemplate.txt b/manager/src/main/resources/templates/12-ServerChanTemplate.txt similarity index 100% rename from manager/src/main/resources/templates/12-serverChanTemplate.txt rename to manager/src/main/resources/templates/12-ServerChanTemplate.txt diff --git a/manager/src/main/resources/templates/2-webhookTemplate.txt b/manager/src/main/resources/templates/2-WebhookTemplate.txt similarity index 100% rename from manager/src/main/resources/templates/2-webhookTemplate.txt rename to manager/src/main/resources/templates/2-WebhookTemplate.txt diff --git a/manager/src/main/resources/templates/4-weWorkRobotTemplate.txt b/manager/src/main/resources/templates/4-WeWorkRobotTemplate.txt similarity index 100% rename from manager/src/main/resources/templates/4-weWorkRobotTemplate.txt rename to manager/src/main/resources/templates/4-WeWorkRobotTemplate.txt diff --git a/manager/src/main/resources/templates/5-dingTalkRobotTemplate.txt b/manager/src/main/resources/templates/5-DingTalkRobotTemplate.txt similarity index 100% rename from manager/src/main/resources/templates/5-dingTalkRobotTemplate.txt rename to manager/src/main/resources/templates/5-DingTalkRobotTemplate.txt diff --git a/manager/src/main/resources/templates/6-flyBookRobotTemplate.txt b/manager/src/main/resources/templates/6-FlyBookRobotTemplate.txt similarity index 100% rename from manager/src/main/resources/templates/6-flyBookRobotTemplate.txt rename to manager/src/main/resources/templates/6-FlyBookRobotTemplate.txt diff --git a/manager/src/main/resources/templates/7-telegramBotTemplate.txt b/manager/src/main/resources/templates/7-TelegramBotTemplate.txt similarity index 100% rename from manager/src/main/resources/templates/7-telegramBotTemplate.txt rename to manager/src/main/resources/templates/7-TelegramBotTemplate.txt diff --git a/manager/src/main/resources/templates/8-slackTemplate.txt b/manager/src/main/resources/templates/8-SlackTemplate.txt similarity index 100% rename from manager/src/main/resources/templates/8-slackTemplate.txt rename to manager/src/main/resources/templates/8-SlackTemplate.txt diff --git a/manager/src/main/resources/templates/9-discordBotTemplate.txt b/manager/src/main/resources/templates/9-DiscordBotTemplate.txt similarity index 100% rename from manager/src/main/resources/templates/9-discordBotTemplate.txt rename to manager/src/main/resources/templates/9-DiscordBotTemplate.txt diff --git a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.ts b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.ts index 7de5465917c..f194cfbe241 100644 --- a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.ts +++ b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.ts @@ -521,10 +521,10 @@ export class AlertNoticeComponent implements OnInit { label = `${label}Discord Bot`; break; case 10: - label = `${label}weChatApp`; + label = `${label}WeChatApp`; break; case 11: - label = `${label}smn`; + label = `${label}SMN`; break; case 12: label = `${label}ServerChan`; From 03524b93de1afb11959981636ad251edf93a5030 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Wed, 1 Nov 2023 10:10:11 +0800 Subject: [PATCH 7/8] update huaweicloud smn --- .../{11-SmnTemplate.txt => 11-HuaweiCloudSmnTemplate.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename manager/src/main/resources/templates/{11-SmnTemplate.txt => 11-HuaweiCloudSmnTemplate.txt} (100%) diff --git a/manager/src/main/resources/templates/11-SmnTemplate.txt b/manager/src/main/resources/templates/11-HuaweiCloudSmnTemplate.txt similarity index 100% rename from manager/src/main/resources/templates/11-SmnTemplate.txt rename to manager/src/main/resources/templates/11-HuaweiCloudSmnTemplate.txt From a8e775098303e0da71f7fd81e3f2176e843d432b Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Wed, 1 Nov 2023 14:45:48 +0800 Subject: [PATCH 8/8] update --- .../docusaurus-plugin-content-docs/current/others/private.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/private.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/private.md index 305afc88f13..673e74fdcca 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/private.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/private.md @@ -6,7 +6,7 @@ sidebar_label: 企业版 :::tip **开源不等同于免费,如果您基于HertzBeat二次开发修改了[logo,名称,版权](https://github.com/dromara/hertzbeat/blob/master/NOTICE)等,请找我们授权,否则会有[法律风险](legal)。** -**请清清白白做人,我们必追诉破坏开源并因此获利的团队个人的全部违法所得,也欢迎给我们[提供侵权线索](legal)。** +**干干净净做人,我们必追诉破坏开源并因此获利的团队个人的全部违法所得,也欢迎给我们[提供侵权线索](legal)。** ::: ---