[alerter,webapp]feature 告警配置支持多指标集合 !10

* [alerter,webapp]feature 告警配置支持多指标集合
This commit is contained in:
tomsun28
2022-03-08 02:57:49 +00:00
parent 9a62ed5769
commit 7c12eda30e
4 changed files with 53 additions and 24 deletions

View File

@@ -136,6 +136,7 @@ export class AlertSettingComponent implements OnInit {
if (message.code === 0) {
this.define = message.data;
this.cascadeValues = [this.define.app, this.define.metric, this.define.field];
this.cascadeOnChange(this.cascadeValues);
} else {
this.notifySvc.error('查询此监控定义详情失败!', message.msg);
}
@@ -234,6 +235,26 @@ export class AlertSettingComponent implements OnInit {
isManageModalAdd = true;
define!: AlertDefine;
cascadeValues: string[] = [];
otherMetrics: string[] = [];
cascadeOnChange(values: string[]): void {
if (values == null || values.length != 3) {
return;
}
this.appHierarchies.forEach(hierarchy => {
if (hierarchy.value == values[0]) {
hierarchy.children.forEach((metrics: { value: string; children: any[]}) => {
if (metrics.value == values[1]) {
this.otherMetrics = [];
metrics.children.forEach(item => {
if (item.value != values[2]) {
this.otherMetrics.push(item.value);
}
});
}
});
}
});
}
onManageModalCancel() {
this.isManageModalVisible = false;
}