fix(X-Pack): 阈值告警-混合类型图表禁用

This commit is contained in:
fit2cloud-chenyw 2024-09-04 11:47:32 +08:00
parent b6c1c7ca75
commit 5d948d6bea
2 changed files with 4 additions and 1 deletions

View File

@ -199,6 +199,9 @@ public class ChartViewThresholdManage {
thresholdTemplate = convertStyle(thresholdTemplate.replace("[触发告警]", s)); thresholdTemplate = convertStyle(thresholdTemplate.replace("[触发告警]", s));
List<Map<String, Object>> tableRow = (List<Map<String, Object>>) data.get("tableRow"); List<Map<String, Object>> tableRow = (List<Map<String, Object>>) data.get("tableRow");
List<DatasetTableFieldDTO> fields = (List<DatasetTableFieldDTO>) data.get("fields"); List<DatasetTableFieldDTO> fields = (List<DatasetTableFieldDTO>) data.get("fields");
if (CollectionUtils.isEmpty(fields)) {
return new ThresholdCheckVO(false, null, String.format("当前图表类型[%s]暂不支持阈值告警!", chart.getType()), null);
}
Map<Long, DatasetTableFieldDTO> fieldMap = fields.stream().collect(Collectors.toMap(DatasetTableFieldDTO::getId, item -> item)); Map<Long, DatasetTableFieldDTO> fieldMap = fields.stream().collect(Collectors.toMap(DatasetTableFieldDTO::getId, item -> item));
FilterTreeObj filterTreeObj = JsonUtil.parseObject(thresholdRules, FilterTreeObj.class); FilterTreeObj filterTreeObj = JsonUtil.parseObject(thresholdRules, FilterTreeObj.class);
List<Map<String, Object>> rows = filterRows(tableRow, filterTreeObj, fieldMap); List<Map<String, Object>> rows = filterRows(tableRow, filterTreeObj, fieldMap);

@ -1 +1 @@
Subproject commit f13cef680d79dcc02bd6ef7aa08d65765a749eb9 Subproject commit 321bac2953ac01b12ae69a4e9beb050e0895f965