Skip to content

Commit 864d2da

Browse files
committed
feat(alert-detail): update alert detail link and improve timestamp filter logic
1 parent 840afb7 commit 864d2da

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

backend/src/main/java/com/park/utmstack/service/impl/UtmAlertServiceImpl.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,9 @@ public void checkForNewAlerts() {
7979
UtmAlertLast initialDate = lastAlertRepository.findById(1L)
8080
.orElse(new UtmAlertLast(Instant.now().atZone(ZoneOffset.UTC).toInstant().minus(1, ChronoUnit.HOURS)));
8181

82-
Instant ts = initialDate.getLastAlertTimestamp();
83-
String formatted = ts.truncatedTo(ChronoUnit.MILLIS).toString();
84-
8582
List<FilterType> filters = new ArrayList<>();
8683
filters.add(new FilterType(Constants.alertStatus, OperatorType.IS, AlertStatus.OPEN.getCode()));
87-
filters.add(new FilterType(Constants.timestamp, OperatorType.IS_GREATER_THAN, formatted));
84+
filters.add(new FilterType(Constants.timestamp, OperatorType.IS_GREATER_THAN, initialDate.getLastAlertTimestamp().toString()));
8885

8986
SearchRequest.Builder srb = new SearchRequest.Builder();
9087
srb.query(SearchUtil.toQuery(filters))
@@ -118,7 +115,7 @@ public void checkForNewAlerts() {
118115
}
119116

120117
String[] addressToNotify = emails.replace(" ", "").split(",");
121-
mailService.sendAlertEmail(Arrays.asList(addressToNotify), alert, alert.getEvents());
118+
// mailService.sendAlertEmail(Arrays.asList(addressToNotify), alert, alert.getEvents());
122119
}
123120

124121
alertResponseRuleService.evaluateRules(alerts);

backend/src/main/resources/templates/mail/fragments/alert-detail-fragment.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
<tr style="font-family:Roboto, sans-serif;font-size: 13px">
134134
<td style="font-weight: bold;vertical-align: top;" colspan="2">
135135
<div style="font-family:Roboto, sans-serif;font-size: 13px">
136-
<a th:href="${baseUrl} + '/confirm-identity/' + ${alert.getId()}">
136+
<a th:href="${baseUrl} + '/data/alert/detail/' + ${alert.getId()}">
137137
View Alert Detail
138138
</a>
139139
</div>

0 commit comments

Comments
 (0)