From 2dd10792ecd4c995df5cc3131cfdc1826f522dc5 Mon Sep 17 00:00:00 2001 From: chenghua Date: Fri, 18 Feb 2022 12:08:04 +0800 Subject: [PATCH 01/10] =?UTF-8?q?feature:=20=E6=96=B0=E5=A2=9Econtroller?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=85=A5=E5=8F=82=E9=99=90=E5=AE=9A=E4=BF=AE?= =?UTF-8?q?=E9=A5=B0=E7=AC=A6=20#I4U9BT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/controller/AccountController.java | 2 +- .../usthe/manager/controller/AppController.java | 4 ++-- .../manager/controller/MonitorController.java | 4 ++-- .../manager/controller/MonitorsController.java | 14 +++++++------- .../manager/controller/NoticeConfigController.java | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/manager/src/main/java/com/usthe/manager/controller/AccountController.java b/manager/src/main/java/com/usthe/manager/controller/AccountController.java index a8284d6..7d53d29 100644 --- a/manager/src/main/java/com/usthe/manager/controller/AccountController.java +++ b/manager/src/main/java/com/usthe/manager/controller/AccountController.java @@ -91,7 +91,7 @@ public class AccountController { @ApiOperation(value = "TOKEN刷新", notes = "使用刷新TOKEN重新获取TOKEN") public ResponseEntity>> refreshToken( @ApiParam(value = "刷新TOKEN", example = "xxx") - @PathVariable("refreshToken") @NotNull String refreshToken) { + @PathVariable("refreshToken") @NotNull final String refreshToken) { String userId; boolean isRefresh; try { diff --git a/manager/src/main/java/com/usthe/manager/controller/AppController.java b/manager/src/main/java/com/usthe/manager/controller/AppController.java index d6e1a96..48f544b 100644 --- a/manager/src/main/java/com/usthe/manager/controller/AppController.java +++ b/manager/src/main/java/com/usthe/manager/controller/AppController.java @@ -36,7 +36,7 @@ public class AppController { @GetMapping(path = "/{app}/params") @ApiOperation(value = "查询监控类型的参数结构", notes = "根据app查询指定监控类型的需要输入参数的结构") public ResponseEntity>> queryAppParamDefines( - @ApiParam(value = "监控类型名称", example = "api") @PathVariable("app") String app) { + @ApiParam(value = "监控类型名称", example = "api") @PathVariable("app") final String app) { List paramDefines = appService.getAppParamDefines(app.toLowerCase()); return ResponseEntity.ok(new Message<>(paramDefines)); } @@ -44,7 +44,7 @@ public class AppController { @GetMapping(path = "/{app}/define") @ApiOperation(value = "查询监控类型的结构定义", notes = "根据app查询指定监控类型的定义结构") public ResponseEntity> queryAppDefine( - @ApiParam(value = "监控类型名称", example = "api") @PathVariable("app") String app) { + @ApiParam(value = "监控类型名称", example = "api") @PathVariable("app") final String app) { Job define = appService.getAppDefine(app.toLowerCase()); return ResponseEntity.ok(new Message<>(define)); } diff --git a/manager/src/main/java/com/usthe/manager/controller/MonitorController.java b/manager/src/main/java/com/usthe/manager/controller/MonitorController.java index 7588326..ef3e7ec 100644 --- a/manager/src/main/java/com/usthe/manager/controller/MonitorController.java +++ b/manager/src/main/java/com/usthe/manager/controller/MonitorController.java @@ -64,7 +64,7 @@ public class MonitorController { @GetMapping(path = "/{id}") @ApiOperation(value = "查询监控", notes = "根据监控ID获取监控信息") public ResponseEntity> getMonitor( - @ApiParam(value = "监控ID", example = "6565463543") @PathVariable("id") long id) { + @ApiParam(value = "监控ID", example = "6565463543") @PathVariable("id") final long id) { // 获取监控信息 MonitorDto monitorDto = monitorService.getMonitorDto(id); Message.MessageBuilder messageBuilder = Message.builder(); @@ -79,7 +79,7 @@ public class MonitorController { @DeleteMapping(path = "/{id}") @ApiOperation(value = "删除监控", notes = "根据监控ID删除监控应用,监控不存在也是删除成功") public ResponseEntity> deleteMonitor( - @ApiParam(value = "监控ID", example = "6565463543") @PathVariable("id") long id) { + @ApiParam(value = "监控ID", example = "6565463543") @PathVariable("id") final long id) { // 删除监控,监控不存在或删除成功都返回成功 monitorService.deleteMonitor(id); return ResponseEntity.ok(new Message<>("Delete success")); diff --git a/manager/src/main/java/com/usthe/manager/controller/MonitorsController.java b/manager/src/main/java/com/usthe/manager/controller/MonitorsController.java index c807c32..53be6f6 100644 --- a/manager/src/main/java/com/usthe/manager/controller/MonitorsController.java +++ b/manager/src/main/java/com/usthe/manager/controller/MonitorsController.java @@ -44,12 +44,12 @@ public class MonitorsController { @GetMapping @ApiOperation(value = "查询监控列表", notes = "根据查询过滤项获取监控信息列表") public ResponseEntity>> getMonitors( - @ApiParam(value = "监控ID", example = "6565463543") @RequestParam(required = false) List ids, - @ApiParam(value = "监控类型", example = "linux") @RequestParam(required = false) String app, - @ApiParam(value = "监控名称,模糊查询", example = "linux-127.0.0.1") @RequestParam(required = false) String name, - @ApiParam(value = "监控Host,模糊查询", example = "127.0.0.1") @RequestParam(required = false) String host, - @ApiParam(value = "排序字段,默认id", example = "name") @RequestParam(defaultValue = "id") String sort, - @ApiParam(value = "排序方式,asc:升序,desc:降序", example = "desc") @RequestParam(defaultValue = "desc") String order, + @ApiParam(value = "监控ID", example = "6565463543") @RequestParam(required = false) final List ids, + @ApiParam(value = "监控类型", example = "linux") @RequestParam(required = false) final String app, + @ApiParam(value = "监控名称,模糊查询", example = "linux-127.0.0.1") @RequestParam(required = false) final String name, + @ApiParam(value = "监控Host,模糊查询", example = "127.0.0.1") @RequestParam(required = false) final String host, + @ApiParam(value = "排序字段,默认id", example = "name") @RequestParam(defaultValue = "id") final String sort, + @ApiParam(value = "排序方式,asc:升序,desc:降序", example = "desc") @RequestParam(defaultValue = "desc") final String order, @ApiParam(value = "列表当前分页", example = "0") @RequestParam(defaultValue = "0") int pageIndex, @ApiParam(value = "列表分页数量", example = "8") @RequestParam(defaultValue = "8") int pageSize) { @@ -94,7 +94,7 @@ public class MonitorsController { @GetMapping(path = "/{app}") @ApiOperation(value = "查询指定监控类型的监控列表", notes = "根据查询过滤指定监控类型的所有获取监控信息列表") public ResponseEntity>> getAppMonitors( - @ApiParam(value = "监控类型", example = "linux") @PathVariable(required = false) String app) { + @ApiParam(value = "监控类型", example = "linux") @PathVariable(required = false) final String app) { List monitors = monitorService.getAppMonitors(app); Message> message = new Message<>(monitors); return ResponseEntity.ok(message); diff --git a/manager/src/main/java/com/usthe/manager/controller/NoticeConfigController.java b/manager/src/main/java/com/usthe/manager/controller/NoticeConfigController.java index c498941..2aaf181 100644 --- a/manager/src/main/java/com/usthe/manager/controller/NoticeConfigController.java +++ b/manager/src/main/java/com/usthe/manager/controller/NoticeConfigController.java @@ -57,7 +57,7 @@ public class NoticeConfigController { @DeleteMapping(path = "/receiver/{id}") @ApiOperation(value = "删除指定接收人", notes = "删除已存在的接收人信息") public ResponseEntity> deleteNoticeReceiver( - @ApiParam(value = "接收人ID", example = "6565463543") @PathVariable("id") Long receiverId) { + @ApiParam(value = "接收人ID", example = "6565463543") @PathVariable("id") final Long receiverId) { // 不存在或删除成功都返回成功 noticeConfigService.deleteReceiver(receiverId); return ResponseEntity.ok(new Message<>("Delete success")); @@ -66,7 +66,7 @@ public class NoticeConfigController { @GetMapping(path = "/receivers") @ApiOperation(value = "查询消息通知接收人", notes = "根据查询过滤项获取消息通知接收人列表") public ResponseEntity>> getReceivers( - @ApiParam(value = "接收人名称,模糊查询", example = "tom") @RequestParam(required = false) String name) { + @ApiParam(value = "接收人名称,模糊查询", example = "tom") @RequestParam(required = false) final String name) { Specification specification = (root, query, criteriaBuilder) -> { Predicate predicate = criteriaBuilder.conjunction(); @@ -99,7 +99,7 @@ public class NoticeConfigController { @DeleteMapping(path = "/rule/{id}") @ApiOperation(value = "删除指定通知策略", notes = "删除已存在的通知策略信息") public ResponseEntity> deleteNoticeRule( - @ApiParam(value = "通知策略ID", example = "6565463543") @PathVariable("id") Long ruleId) { + @ApiParam(value = "通知策略ID", example = "6565463543") @PathVariable("id") final Long ruleId) { // 不存在或删除成功都返回成功 noticeConfigService.deleteNoticeRule(ruleId); return ResponseEntity.ok(new Message<>("Delete success")); @@ -108,7 +108,7 @@ public class NoticeConfigController { @GetMapping(path = "/rules") @ApiOperation(value = "查询消息通知策略", notes = "根据查询过滤项获取消息通知策略列表") public ResponseEntity>> getRules( - @ApiParam(value = "接收人名称,模糊查询", example = "rule1") @RequestParam(required = false) String name) { + @ApiParam(value = "接收人名称,模糊查询", example = "rule1") @RequestParam(required = false) final String name) { Specification specification = (root, query, criteriaBuilder) -> { Predicate predicate = criteriaBuilder.conjunction(); From cf965672b326374d7516881131d584e4dcc7e68f Mon Sep 17 00:00:00 2001 From: chenghua Date: Sat, 19 Feb 2022 19:07:37 +0800 Subject: [PATCH 02/10] =?UTF-8?q?feature:=20=E6=96=B0=E5=A2=9E=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E5=91=8A=E8=AD=A6=E6=A8=A1=E7=89=88=20#I4U9BT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/pom.xml | 11 + .../component/alerter/DispatchAlarm.java | 38 ++- .../usthe/manager/service/MailService.java | 24 ++ .../manager/service/impl/MailServiceImpl.java | 39 +++ manager/src/main/resources/application.yml | 20 +- .../main/resources/templates/mailAlarm.html | 323 ++++++++++++++++++ web-app/package.json | 9 +- 7 files changed, 439 insertions(+), 25 deletions(-) create mode 100644 manager/src/main/java/com/usthe/manager/service/MailService.java create mode 100644 manager/src/main/java/com/usthe/manager/service/impl/MailServiceImpl.java create mode 100644 manager/src/main/resources/templates/mailAlarm.html diff --git a/manager/pom.xml b/manager/pom.xml index 3e644b5..036f300 100644 --- a/manager/pom.xml +++ b/manager/pom.xml @@ -52,6 +52,16 @@ spring-boot-configuration-processor true + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + net.sourceforge.nekohtml + nekohtml + 1.9.22 + org.springframework.boot @@ -108,6 +118,7 @@ sureness.yml banner.txt define/** + **/*.html diff --git a/manager/src/main/java/com/usthe/manager/component/alerter/DispatchAlarm.java b/manager/src/main/java/com/usthe/manager/component/alerter/DispatchAlarm.java index 8ae7f77..4551d8a 100644 --- a/manager/src/main/java/com/usthe/manager/component/alerter/DispatchAlarm.java +++ b/manager/src/main/java/com/usthe/manager/component/alerter/DispatchAlarm.java @@ -7,17 +7,19 @@ import com.usthe.alert.service.AlertService; import com.usthe.common.util.CommonConstants; import com.usthe.common.entity.manager.Monitor; import com.usthe.common.entity.manager.NoticeReceiver; +import com.usthe.manager.service.MailService; import com.usthe.manager.service.MonitorService; import com.usthe.manager.service.NoticeConfigService; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.mail.SimpleMailMessage; import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.stereotype.Component; import org.springframework.web.client.ResourceAccessException; import org.springframework.web.client.RestTemplate; +import javax.mail.internet.MimeMessage; import java.util.Date; import java.util.List; @@ -37,10 +39,11 @@ public class DispatchAlarm { private NoticeConfigService noticeConfigService; private JavaMailSender javaMailSender; private RestTemplate restTemplate; + private MailService mailService; public DispatchAlarm(AlerterWorkerPool workerPool, AlerterDataQueue dataQueue, - JavaMailSender javaMailSender,NoticeConfigService noticeConfigService, - AlertService alertService, MonitorService monitorService, RestTemplate restTemplate) { + JavaMailSender javaMailSender, NoticeConfigService noticeConfigService, + AlertService alertService, MonitorService monitorService, RestTemplate restTemplate, MailService mailService) { this.workerPool = workerPool; this.dataQueue = dataQueue; this.alertService = alertService; @@ -48,6 +51,7 @@ public class DispatchAlarm { this.noticeConfigService = noticeConfigService; this.javaMailSender = javaMailSender; this.restTemplate = restTemplate; + this.mailService = mailService; startDispatch(); } @@ -137,19 +141,21 @@ public class DispatchAlarm { } } - private void sendEmailAlert(NoticeReceiver receiver, Alert alert) { - SimpleMailMessage message = new SimpleMailMessage(); - message.setSubject("TanCloud探云-监控告警"); - message.setFrom("gongchao@tancloud.cn"); - message.setTo(receiver.getEmail()); - message.setSentDate(new Date()); - message.setText("探云TanCloud-监控告警\n" + - "告警目标对象: " + alert.getTarget() + "\n" + - "所属监控ID: " + alert.getMonitorId() + "\n" + - "所属监控名称: " + alert.getMonitorName() + "\n" + - "告警级别: " + alert.getPriority() + "\n" + - "告警详情: \n" + alert.getContent()); - javaMailSender.send(message); + + private void sendEmailAlert(final NoticeReceiver receiver,final Alert alert){ + try{ + MimeMessage mimeMessage = javaMailSender.createMimeMessage(); + MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage,true,"UTF-8"); + messageHelper.setSubject("TanCloud探云-监控告警"); //设置邮件主题 + messageHelper.setFrom("gongchao@tancloud.cn"); //设置发件人Email + messageHelper.setTo(receiver.getEmail()); //设定收件人Email + messageHelper.setSentDate(new Date()); + String process = mailService.buildHTMLTemplate(alert); + messageHelper.setText(process,true); //设置邮件内容模版 + javaMailSender.send(mimeMessage); + }catch (Exception e){ + log.error("[邮箱告警] error,Exception information={}",e); + } } private List matchReceiverByNoticeRules(Alert alert) { diff --git a/manager/src/main/java/com/usthe/manager/service/MailService.java b/manager/src/main/java/com/usthe/manager/service/MailService.java new file mode 100644 index 0000000..3fb835b --- /dev/null +++ b/manager/src/main/java/com/usthe/manager/service/MailService.java @@ -0,0 +1,24 @@ +package com.usthe.manager.service; + +import com.usthe.common.entity.alerter.Alert; +import lombok.extern.slf4j.Slf4j; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Service; + +/** + * 邮箱发送服务 + * + * @author 花城 + * @version 1.0 + * @date 2022/2/19 6:11 下午 + * @Description + */ +public interface MailService { + + /** + * 构建告警邮件模版 + * @param alert 告警信息 + * @return 邮件内容 + */ + String buildHTMLTemplate(Alert alert); +} diff --git a/manager/src/main/java/com/usthe/manager/service/impl/MailServiceImpl.java b/manager/src/main/java/com/usthe/manager/service/impl/MailServiceImpl.java new file mode 100644 index 0000000..8f37032 --- /dev/null +++ b/manager/src/main/java/com/usthe/manager/service/impl/MailServiceImpl.java @@ -0,0 +1,39 @@ +package com.usthe.manager.service.impl; + +import com.usthe.common.entity.alerter.Alert; +import com.usthe.manager.service.MailService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.thymeleaf.TemplateEngine; +import org.thymeleaf.context.Context; + +import javax.annotation.Resource; + +/** + * 邮箱发送服务接口实现类 + * + * @author 花城 + * @version 1.0 + * @date 2022/2/19 6:13 下午 + * @Description + */ +@Slf4j +@Service +public class MailServiceImpl implements MailService { + + @Resource + private TemplateEngine templateEngine; + + @Override + public String buildHTMLTemplate(final Alert alert) { + //引入thymeleaf上下文参数渲染页面 + Context context = new Context(); + context.setVariable("target",alert.getTarget()); + context.setVariable("ID",alert.getMonitorId()); + context.setVariable("name",alert.getMonitorName()); + context.setVariable("priority",alert.getPriority()); + context.setVariable("content",alert.getContent()); + return templateEngine.process("mailAlarm", context); + } +} diff --git a/manager/src/main/resources/application.yml b/manager/src/main/resources/application.yml index f199836..00d7058 100644 --- a/manager/src/main/resources/application.yml +++ b/manager/src/main/resources/application.yml @@ -27,9 +27,9 @@ spring: on-profile: prod datasource: driver-class-name: com.mysql.cj.jdbc.Driver - username: admin - password: admin - url: jdbc:mysql://localhost:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&useSSL=false + username: root + password: wang1027 + url: jdbc:mysql://121.40.113.44:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&useSSL=false platform: mysql hikari: max-lifetime: 120000 @@ -38,8 +38,8 @@ spring: mail: host: smtp.exmail.qq.com - username: example@tancloud.cn - password: example + username: gongchao@tancloud.cn + password: C7Roz9Qe3eGkiVM9 port: 465 default-encoding: UTF-8 properties: @@ -48,6 +48,16 @@ spring: socketFactoryClass: javax.net.ssl.SSLSocketFactory ssl: enable: true + debug: false + + thymeleaf: + prefix: classpath:/templates/ #prefix:指定模板所在的目录 + check-template-location: true #check-tempate-location: 检查模板路径是否存在 + cache: false #cache: 是否缓存,开发模式下设置为false,避免改了模板还要重启服务器,线上设置为true,可以提高性能。 + suffix: .html + #encoding: UTF-8 + #content-type: text/html + mode: LEGACYHTML5 warehouse: store: diff --git a/manager/src/main/resources/templates/mailAlarm.html b/manager/src/main/resources/templates/mailAlarm.html new file mode 100644 index 0000000..3589c4f --- /dev/null +++ b/manager/src/main/resources/templates/mailAlarm.html @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + +
+
+


+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ TanCloud探云-监控告警 +

+
+
+

+ 告警通知 +

+
+
+

+ Alarm notification +

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ TanCloud探云 +

+
+
+
+ +
+
+
+
+


+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 告警目标对象:
+     所属监控ID:
+     所属监控名称:
+     告警级别:
+     告警详情:
+
+

+

+
+

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+


+


+ +
+
+ + + + + + + \ No newline at end of file diff --git a/web-app/package.json b/web-app/package.json index a18c9d8..19ad2ce 100644 --- a/web-app/package.json +++ b/web-app/package.json @@ -41,6 +41,7 @@ "@delon/util": "^12.4.2", "ajv": "^8.6.2", "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0", "echarts": "^5.2.2", "ng-alain": "^12.4.2", "ng-zorro-antd": "^12.0.2", @@ -84,12 +85,12 @@ "ng-alain-plugin-theme": "^12.0.0", "prettier": "^2.2.1", "source-map-explorer": "^2.5.2", - "stylelint": "^13.13.1", + "stylelint": "^14.5.1", "stylelint-config-prettier": "^8.0.2", - "stylelint-config-rational-order": "^0.1.2", - "stylelint-config-standard": "^22.0.0", + "stylelint-config-rational-order": "^0.0.4", + "stylelint-config-standard": "^25.0.0", "stylelint-declaration-block-no-ignored-properties": "^2.4.0", - "stylelint-order": "^4.1.0", + "stylelint-order": "^5.0.0", "typescript": "~4.3.5" }, "lint-staged": { From fcfc9a2aa2a6ffb27f4d3b00de34ac6384710ead Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Sat, 19 Feb 2022 13:48:17 +0000 Subject: [PATCH 03/10] =?UTF-8?q?Update=20manager/src/main/resources/appli?= =?UTF-8?q?cation.yml=20=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/src/main/resources/application.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/src/main/resources/application.yml b/manager/src/main/resources/application.yml index 00d7058..b682ce0 100644 --- a/manager/src/main/resources/application.yml +++ b/manager/src/main/resources/application.yml @@ -38,8 +38,8 @@ spring: mail: host: smtp.exmail.qq.com - username: gongchao@tancloud.cn - password: C7Roz9Qe3eGkiVM9 + username: example@tancloud.cn + password: example port: 465 default-encoding: UTF-8 properties: From 7bc237b7db72060fd7b175231b49970ef047c76c Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Sat, 19 Feb 2022 13:48:35 +0000 Subject: [PATCH 04/10] =?UTF-8?q?Update=20manager/src/main/resources/appli?= =?UTF-8?q?cation.yml=20=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/src/main/resources/application.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manager/src/main/resources/application.yml b/manager/src/main/resources/application.yml index b682ce0..cff7e0f 100644 --- a/manager/src/main/resources/application.yml +++ b/manager/src/main/resources/application.yml @@ -27,9 +27,9 @@ spring: on-profile: prod datasource: driver-class-name: com.mysql.cj.jdbc.Driver - username: root - password: wang1027 - url: jdbc:mysql://121.40.113.44:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&useSSL=false + username: admin + password: admin + url: jdbc:mysql://localhost:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&useSSL=false platform: mysql hikari: max-lifetime: 120000 From d5c1ab11b0d61a00564cb643bfdb32cccad79c98 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Sat, 19 Feb 2022 13:49:17 +0000 Subject: [PATCH 05/10] =?UTF-8?q?Update=20web-app/package.json=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E6=9C=AC=E5=9C=B0=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-app/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/web-app/package.json b/web-app/package.json index 19ad2ce..356b6b1 100644 --- a/web-app/package.json +++ b/web-app/package.json @@ -41,7 +41,6 @@ "@delon/util": "^12.4.2", "ajv": "^8.6.2", "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.1.0", "echarts": "^5.2.2", "ng-alain": "^12.4.2", "ng-zorro-antd": "^12.0.2", From dce144ef04db2ab2265c4000edcb992d2674c7e0 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Sat, 19 Feb 2022 13:49:41 +0000 Subject: [PATCH 06/10] Update web-app/package.json --- web-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web-app/package.json b/web-app/package.json index 356b6b1..8f17abc 100644 --- a/web-app/package.json +++ b/web-app/package.json @@ -89,7 +89,7 @@ "stylelint-config-rational-order": "^0.0.4", "stylelint-config-standard": "^25.0.0", "stylelint-declaration-block-no-ignored-properties": "^2.4.0", - "stylelint-order": "^5.0.0", + "stylelint-order": "^4.1.0", "typescript": "~4.3.5" }, "lint-staged": { From 8a90851f5e1255d09a6204ba436478bfa91f0468 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Sat, 19 Feb 2022 13:49:52 +0000 Subject: [PATCH 07/10] Update web-app/package.json --- web-app/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web-app/package.json b/web-app/package.json index 8f17abc..a5f9b95 100644 --- a/web-app/package.json +++ b/web-app/package.json @@ -86,8 +86,8 @@ "source-map-explorer": "^2.5.2", "stylelint": "^14.5.1", "stylelint-config-prettier": "^8.0.2", - "stylelint-config-rational-order": "^0.0.4", - "stylelint-config-standard": "^25.0.0", + "stylelint-config-rational-order": "^0.1.2", + "stylelint-config-standard": "^22.0.0", "stylelint-declaration-block-no-ignored-properties": "^2.4.0", "stylelint-order": "^4.1.0", "typescript": "~4.3.5" From c40af85f50899945a0936db31dea3aac5ddb760e Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Sat, 19 Feb 2022 13:50:04 +0000 Subject: [PATCH 08/10] Update web-app/package.json --- web-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web-app/package.json b/web-app/package.json index a5f9b95..a18c9d8 100644 --- a/web-app/package.json +++ b/web-app/package.json @@ -84,7 +84,7 @@ "ng-alain-plugin-theme": "^12.0.0", "prettier": "^2.2.1", "source-map-explorer": "^2.5.2", - "stylelint": "^14.5.1", + "stylelint": "^13.13.1", "stylelint-config-prettier": "^8.0.2", "stylelint-config-rational-order": "^0.1.2", "stylelint-config-standard": "^22.0.0", From 62c37972d43df2b093bf159f5cb999f0e95c8b35 Mon Sep 17 00:00:00 2001 From: chenghua Date: Sat, 19 Feb 2022 21:51:50 +0800 Subject: [PATCH 09/10] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=B3=A8=E9=87=8A=EF=BC=8C=E4=BB=A5=E5=8F=8A=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=BE=93=E5=87=BA=20#I4U9BT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/component/alerter/DispatchAlarm.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/manager/src/main/java/com/usthe/manager/component/alerter/DispatchAlarm.java b/manager/src/main/java/com/usthe/manager/component/alerter/DispatchAlarm.java index 4551d8a..fcc3ed0 100644 --- a/manager/src/main/java/com/usthe/manager/component/alerter/DispatchAlarm.java +++ b/manager/src/main/java/com/usthe/manager/component/alerter/DispatchAlarm.java @@ -146,15 +146,18 @@ public class DispatchAlarm { try{ MimeMessage mimeMessage = javaMailSender.createMimeMessage(); MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage,true,"UTF-8"); - messageHelper.setSubject("TanCloud探云-监控告警"); //设置邮件主题 - messageHelper.setFrom("gongchao@tancloud.cn"); //设置发件人Email - messageHelper.setTo(receiver.getEmail()); //设定收件人Email + messageHelper.setSubject("TanCloud探云-监控告警"); + //设置发件人Email + messageHelper.setFrom("gongchao@tancloud.cn"); + //设定收件人Email + messageHelper.setTo(receiver.getEmail()); messageHelper.setSentDate(new Date()); + //构建邮件模版 String process = mailService.buildHTMLTemplate(alert); messageHelper.setText(process,true); //设置邮件内容模版 javaMailSender.send(mimeMessage); }catch (Exception e){ - log.error("[邮箱告警] error,Exception information={}",e); + log.error("[邮箱告警] error,Exception information={}",e.getMessage()); } } From a7c7bc6bf9a12064bf77547f19d51296e59f7f52 Mon Sep 17 00:00:00 2001 From: chenghua Date: Sat, 19 Feb 2022 22:31:32 +0800 Subject: [PATCH 10/10] =?UTF-8?q?feature:=20=E9=82=AE=E4=BB=B6=E9=99=84?= =?UTF-8?q?=E5=8A=A0TanCloud=E5=AE=98=E7=BD=91=E5=A4=96=E9=93=BE=20#I4U9BT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/usthe/manager/component/alerter/DispatchAlarm.java | 3 ++- manager/src/main/resources/templates/mailAlarm.html | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/manager/src/main/java/com/usthe/manager/component/alerter/DispatchAlarm.java b/manager/src/main/java/com/usthe/manager/component/alerter/DispatchAlarm.java index fcc3ed0..55ecc44 100644 --- a/manager/src/main/java/com/usthe/manager/component/alerter/DispatchAlarm.java +++ b/manager/src/main/java/com/usthe/manager/component/alerter/DispatchAlarm.java @@ -154,7 +154,8 @@ public class DispatchAlarm { messageHelper.setSentDate(new Date()); //构建邮件模版 String process = mailService.buildHTMLTemplate(alert); - messageHelper.setText(process,true); //设置邮件内容模版 + //设置邮件内容模版 + messageHelper.setText(process,true); javaMailSender.send(mimeMessage); }catch (Exception e){ log.error("[邮箱告警] error,Exception information={}",e.getMessage()); diff --git a/manager/src/main/resources/templates/mailAlarm.html b/manager/src/main/resources/templates/mailAlarm.html index 3589c4f..888dc07 100644 --- a/manager/src/main/resources/templates/mailAlarm.html +++ b/manager/src/main/resources/templates/mailAlarm.html @@ -178,6 +178,7 @@ style="display: flex;justify-content: flex-start;align-items: center;flex-direction: column;width: 100%;">
+
@@ -198,6 +199,7 @@
+
@@ -248,6 +250,7 @@
+
@@ -309,7 +312,7 @@
-


+

TanCloud探云