forked from github/dataease
perf(X-Pack): 阈值告警管理页面
This commit is contained in:
parent
cf47e87fb9
commit
a391a5db29
4
core/core-frontend/src/assets/svg/clock.svg
Normal file
4
core/core-frontend/src/assets/svg/clock.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg width="15" height="14" viewBox="0 0 15 14" fill="" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.9334 6.99998C14.9334 10.6819 11.9486 13.6666 8.2667 13.6666C6.14687 13.6666 4.25813 12.6773 3.03706 11.1351L4.09643 10.325C5.07368 11.549 6.5786 12.3333 8.2667 12.3333C11.2122 12.3333 13.6 9.9455 13.6 6.99998C13.6 4.05446 11.2122 1.66665 8.2667 1.66665C5.62404 1.66665 3.43029 3.58868 3.00711 6.11109H3.47752C3.7615 6.11109 3.93088 6.42759 3.77336 6.66387L2.65994 8.334C2.5192 8.5451 2.209 8.5451 2.06826 8.334L0.954845 6.66387C0.79732 6.42759 0.966704 6.11109 1.25068 6.11109H1.65878C2.09335 2.84944 4.88619 0.333313 8.2667 0.333313C11.9486 0.333313 14.9334 3.31808 14.9334 6.99998Z" fill=""/>
|
||||
<path d="M8.6667 6.77776V4.68887C8.6667 4.4925 8.50751 4.33331 8.31115 4.33331H7.68892C7.49256 4.33331 7.33337 4.4925 7.33337 4.68887V7.75554C7.33337 7.9519 7.49256 8.11109 7.68892 8.11109H10.5334C10.7297 8.11109 10.8889 7.9519 10.8889 7.75554V7.13331C10.8889 6.93695 10.7297 6.77776 10.5334 6.77776H8.6667Z" fill=""/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
8
core/core-frontend/src/assets/svg/threshold_full.svg
Normal file
8
core/core-frontend/src/assets/svg/threshold_full.svg
Normal file
@ -0,0 +1,8 @@
|
||||
<svg width="14" height="16" viewBox="0 0 14 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.3336 8.50507C12.3336 5.64881 9.8718 3.33335 6.99992 3.33335C4.12804 3.33335 1.67227 5.64881 1.67227 8.50507L1.67223 14H0.667415C0.420612 14 0.333251 14.0903 0.333251 14.3358V15.0017C0.333251 15.2472 0.420612 15.3334 0.667415 15.3334H13.3346C13.5814 15.3334 13.6666 15.2472 13.6666 15.0017V14.3358C13.6666 14.0903 13.5814 14 13.3346 14H12.3333L12.3336 8.50507ZM4.66659 8.00002H5.33325C5.51735 8.00002 5.66659 8.14926 5.66659 8.33335V9.66669C5.66659 9.85078 5.51735 10 5.33325 10H4.66659C4.48249 10 4.33325 9.85078 4.33325 9.66669V8.33335C4.33325 8.14926 4.48249 8.00002 4.66659 8.00002Z" fill="#F54A45"/>
|
||||
<path d="M1.19005 4.38966L1.14367 4.36634C0.939405 4.27805 0.696891 4.35495 0.582928 4.55234L0.380908 4.90225L0.357581 4.94863C0.269295 5.1529 0.346195 5.39541 0.543586 5.50937L1.17342 5.87301L1.2198 5.89634C1.42407 5.98462 1.66658 5.90772 1.78054 5.71033L1.98256 5.36042L2.00589 5.31404C2.09418 5.10978 2.01728 4.86726 1.81989 4.7533L1.19005 4.38966Z" fill="#F54A45"/>
|
||||
<path d="M13.6189 4.90225L13.4169 4.55234C13.2942 4.33977 13.0224 4.26693 12.8098 4.38966L12.18 4.7533C11.9674 4.87603 11.8945 5.14785 12.0173 5.36042L12.2193 5.71033C12.342 5.92291 12.6138 5.99574 12.8264 5.87301L13.4563 5.50937C13.6688 5.38664 13.7417 5.11483 13.6189 4.90225Z" fill="#F54A45"/>
|
||||
<path d="M3.74159 1.92897L3.71309 1.88558C3.58033 1.70699 3.33186 1.65233 3.13447 1.76629L2.78456 1.96831L2.74117 1.99682C2.56258 2.12957 2.50792 2.37805 2.62188 2.57544L3.14714 3.4852L3.17564 3.52859C3.30839 3.70718 3.55687 3.76184 3.75426 3.64788L4.10417 3.44586L4.14756 3.41735C4.32615 3.2846 4.38081 3.03613 4.26685 2.83874L3.74159 1.92897Z" fill="#F54A45"/>
|
||||
<path d="M11.2153 1.96831L10.8654 1.76629C10.6528 1.64356 10.381 1.7164 10.2582 1.92897L9.73299 2.83874C9.61026 3.05131 9.68309 3.32313 9.89567 3.44586L10.2456 3.64788C10.4582 3.77061 10.73 3.69778 10.8527 3.4852L11.378 2.57544C11.5007 2.36286 11.4278 2.09104 11.2153 1.96831Z" fill="#F54A45"/>
|
||||
<path d="M7.33325 0.666687H6.66658C6.48249 0.666687 6.33325 0.815925 6.33325 1.00002V2.33335C6.33325 2.51745 6.48249 2.66669 6.66658 2.66669H7.33325C7.51735 2.66669 7.66658 2.51745 7.66658 2.33335V1.00002C7.66658 0.815925 7.51735 0.666687 7.33325 0.666687Z" fill="#F54A45"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
@ -221,6 +221,8 @@ import emailTask from '@/assets/svg/email-task.svg'
|
||||
import embedded from '@/assets/svg/embedded.svg'
|
||||
import association from '@/assets/svg/association.svg'
|
||||
import threshold from '@/assets/svg/threshold.svg'
|
||||
import threshold_full from '@/assets/svg/threshold_full.svg'
|
||||
import clock from '@/assets/svg/clock.svg'
|
||||
import example from '@/assets/svg/example.svg'
|
||||
import exclamationmark from '@/assets/svg/exclamationmark.svg'
|
||||
import exclamationmark2 from '@/assets/svg/exclamationmark2.svg'
|
||||
@ -889,6 +891,8 @@ const iconMap = {
|
||||
embedded: embedded,
|
||||
association: association,
|
||||
threshold: threshold,
|
||||
threshold_full: threshold_full,
|
||||
clock,
|
||||
example: example,
|
||||
exclamationmark: exclamationmark,
|
||||
exclamationmark2: exclamationmark2,
|
||||
|
@ -2780,6 +2780,9 @@ export default {
|
||||
status: '数据状态',
|
||||
base_setting: '基本设置',
|
||||
threshold_setting: '告警设置',
|
||||
name: '告警名称'
|
||||
name: '告警名称',
|
||||
grid_title: '告警管理',
|
||||
grid: '告警列表',
|
||||
record: '告警记录'
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,65 @@
|
||||
package io.dataease.api.threshold;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import io.dataease.api.threshold.dto.ThresholdBatchReciRequest;
|
||||
import io.dataease.api.threshold.dto.ThresholdCreator;
|
||||
import io.dataease.api.threshold.dto.ThresholdGridRequest;
|
||||
import io.dataease.api.threshold.dto.ThresholdSwitchRequest;
|
||||
import io.dataease.api.threshold.vo.ThresholdGridVO;
|
||||
import io.dataease.api.threshold.vo.ThresholdInstanceVO;
|
||||
import io.dataease.model.KeywordRequest;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "阈值告警")
|
||||
@ApiSupport(order = 888, author = "fit2cloud-someone")
|
||||
public interface ThresholdApi {
|
||||
|
||||
@Operation(summary = "保存")
|
||||
@PostMapping("/save")
|
||||
void save(@RequestBody ThresholdCreator creator);
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/edit")
|
||||
void edit(@RequestBody ThresholdCreator creator);
|
||||
|
||||
@Operation(summary = "查询列表")
|
||||
@Parameters({
|
||||
@Parameter(name = "goPage", description = "目标页码", required = true, in = ParameterIn.PATH),
|
||||
@Parameter(name = "pageSize", description = "每页容量", required = true, in = ParameterIn.PATH),
|
||||
@Parameter(name = "request", description = "过滤条件", required = true)
|
||||
})
|
||||
@PostMapping("/pager/{goPage}/{pageSize}")
|
||||
IPage<ThresholdGridVO> pager(@PathVariable("goPage") int goPage, @PathVariable("pageSize") int pageSize, @RequestBody ThresholdGridRequest request);
|
||||
|
||||
@Operation(summary = "切换可用")
|
||||
@PostMapping("/switch")
|
||||
void switchEnable(@RequestBody ThresholdSwitchRequest request);
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@PostMapping("/delete")
|
||||
void delete(@RequestBody List<Long> idList);
|
||||
|
||||
@Operation(summary = "批量设置接收人")
|
||||
@PostMapping("/batchReci")
|
||||
void batchReci(@RequestBody ThresholdBatchReciRequest request);
|
||||
|
||||
@Operation(summary = "查询实例列表")
|
||||
@Parameters({
|
||||
@Parameter(name = "goPage", description = "目标页码", required = true, in = ParameterIn.PATH),
|
||||
@Parameter(name = "pageSize", description = "每页容量", required = true, in = ParameterIn.PATH),
|
||||
@Parameter(name = "request", description = "过滤条件", required = true)
|
||||
})
|
||||
@PostMapping("/instancePager/{goPage}/{pageSize}")
|
||||
IPage<ThresholdInstanceVO> instancePager(@PathVariable("goPage") int goPage, @PathVariable("pageSize") int pageSize, @RequestBody KeywordRequest request);
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package io.dataease.api.threshold.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BaseReciDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -1996467050556455121L;
|
||||
|
||||
private List<Integer> reciFlagList;
|
||||
|
||||
private List<Long> uidList;
|
||||
|
||||
private List<Long> ridList;
|
||||
|
||||
private List<String> emailList;
|
||||
|
||||
private List<String> larkGroupList;
|
||||
|
||||
private List<String> webhookList;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package io.dataease.api.threshold.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ThresholdBatchReciRequest extends BaseReciDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -2831988863396898760L;
|
||||
|
||||
private List<Long> idList;
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package io.dataease.api.threshold.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ThresholdCreator extends BaseReciDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -4085895087749460947L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Boolean enable = true;
|
||||
|
||||
private Integer rateType = 1;
|
||||
|
||||
private Integer rateValue = 1;
|
||||
|
||||
private Long rateTime;
|
||||
|
||||
private Long resourceId;
|
||||
|
||||
private String resourceType;
|
||||
|
||||
private Long chartId;
|
||||
|
||||
private String chartType;
|
||||
|
||||
private String thresholdRules;
|
||||
|
||||
private Integer msgType = 0;
|
||||
|
||||
private String msgTitle;
|
||||
|
||||
private String msgContent;
|
||||
|
||||
private Boolean repeat = true;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package io.dataease.api.threshold.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ThresholdGridRequest implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -2729126999572515149L;
|
||||
|
||||
private String keyword;
|
||||
|
||||
private List<String> resourceTypeList;
|
||||
|
||||
private List<Integer> statusList;
|
||||
|
||||
private List<Integer> enableList;
|
||||
|
||||
private List<Long> timeList;
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package io.dataease.api.threshold.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ThresholdSwitchRequest implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -805688257417787452L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private Boolean enable;
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package io.dataease.api.threshold.vo;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ThresholdGridVO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 3729780170978191092L;
|
||||
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long resourceId;
|
||||
|
||||
private String resourceType;
|
||||
|
||||
private String resourceName;
|
||||
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long chartId;
|
||||
|
||||
private String chartType;
|
||||
|
||||
private String chartName;
|
||||
|
||||
private Boolean status;
|
||||
|
||||
private Boolean enable;
|
||||
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long creator;
|
||||
|
||||
private String createName;
|
||||
|
||||
private Long createTime;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package io.dataease.api.threshold.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ThresholdInstanceVO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 4896658954041017L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long taskId;
|
||||
|
||||
private String name;
|
||||
|
||||
private Long execTime;
|
||||
|
||||
private Boolean status;
|
||||
|
||||
private String content;
|
||||
|
||||
private String msg;
|
||||
}
|
Loading…
Reference in New Issue
Block a user