[web-app] 告警阈值配置环境变量提示

This commit is contained in:
tomsun28
2021-12-18 22:10:13 +08:00
parent eda23b3751
commit 5f0acb794a
3 changed files with 36 additions and 12 deletions

View File

@@ -123,12 +123,31 @@
</nz-cascader> </nz-cascader>
</nz-form-control> </nz-form-control>
</nz-form-item > </nz-form-item >
<nz-form-item>
<nz-col [nzSpan]="8" nzOffset="7">
<nz-collapse>
<nz-collapse-panel
[nzActive] = "isManageModalAdd"
nzHeader="支持的阈值触发表达式环境变量"
>
<nz-list nzSize="small" nzSplit="false">
<nz-list-item *ngIf="cascadeValues.length == 3">
<code>{{cascadeValues[2]}} : 选中的指标对象</code>
</nz-list-item>
<nz-list-item>
<code>instance : 所属行实例值</code>
</nz-list-item>
</nz-list>
</nz-collapse-panel>
</nz-collapse>
</nz-col>
</nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="7" nzFor= 'expr' nzRequired="true">阈值触发表达式</nz-form-label> <nz-form-label [nzSpan]="7" nzFor= 'expr' nzRequired="true">阈值触发表达式</nz-form-label>
<nz-form-control [nzSpan]="8"> <nz-form-control [nzSpan]="8">
<nz-textarea-count [nzMaxCharacterCount]="100"> <nz-textarea-count [nzMaxCharacterCount]="100">
<textarea [(ngModel)]="define.expr" rows="3" nz-input <textarea [(ngModel)]="define.expr" rows="3" nz-input
name="expr" id="expr" placeholder="请输入阈值判断表达式"> name="expr" id="expr" placeholder="请输入阈值判断表达式,示例: instance.equals(cpu1)&&usage>40">
</textarea> </textarea>
</nz-textarea-count> </nz-textarea-count>
</nz-form-control> </nz-form-control>

View File

@@ -344,4 +344,5 @@ export class AlertSettingComponent implements OnInit {
}); });
} }
// end 告警定义与监控关联model // end 告警定义与监控关联model
} }

View File

@@ -11,6 +11,8 @@ import {NzRadioModule} from "ng-zorro-antd/radio";
import {NzSwitchModule} from "ng-zorro-antd/switch"; import {NzSwitchModule} from "ng-zorro-antd/switch";
import {NzCascaderModule} from "ng-zorro-antd/cascader"; import {NzCascaderModule} from "ng-zorro-antd/cascader";
import {NzTransferModule} from "ng-zorro-antd/transfer"; import {NzTransferModule} from "ng-zorro-antd/transfer";
import {NzCollapseModule} from "ng-zorro-antd/collapse";
import {NzListModule} from "ng-zorro-antd/list";
const COMPONENTS: Type<void>[] = [ const COMPONENTS: Type<void>[] = [
AlertCenterComponent, AlertCenterComponent,
@@ -19,17 +21,19 @@ const COMPONENTS: Type<void>[] = [
]; ];
@NgModule({ @NgModule({
imports: [ imports: [
SharedModule, SharedModule,
AlertRoutingModule, AlertRoutingModule,
NzDividerModule, NzDividerModule,
NzBreadCrumbModule, NzBreadCrumbModule,
NzTagModule, NzTagModule,
NzRadioModule, NzRadioModule,
NzSwitchModule, NzSwitchModule,
NzCascaderModule, NzCascaderModule,
NzTransferModule NzTransferModule,
], NzCollapseModule,
NzListModule
],
declarations: COMPONENTS, declarations: COMPONENTS,
}) })
export class AlertModule { } export class AlertModule { }