mirror of
https://github.com/dromara/hertzbeat.git
synced 2026-09-17 09:40:58 +00:00
[web-app] feature: case insensitive search (#2007)
Co-authored-by: tomsun28 <tomsun28@outlook.com>
This commit is contained in:
@@ -194,7 +194,7 @@
|
||||
required
|
||||
name="target"
|
||||
id="target"
|
||||
[nzShowSearch]="true"
|
||||
[nzShowSearch]="{ filter: caseInsensitiveFilter }"
|
||||
[nzPlaceHolder]="'alert.setting.target.place-holder' | i18n"
|
||||
[nzOptions]="appHierarchies"
|
||||
[(ngModel)]="cascadeValues"
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { I18NService } from '@core';
|
||||
import { ALAIN_I18N_TOKEN } from '@delon/theme';
|
||||
import { NzCascaderFilter } from 'ng-zorro-antd/cascader';
|
||||
import { ModalButtonOptions, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzNotificationService } from 'ng-zorro-antd/notification';
|
||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||
@@ -396,6 +397,12 @@ export class AlertSettingComponent implements OnInit {
|
||||
currentMetrics: any[] = [];
|
||||
alertRules: any[] = [{}];
|
||||
isExpr = false;
|
||||
caseInsensitiveFilter: NzCascaderFilter = (i, p) => {
|
||||
return p.some(o => {
|
||||
const label = o.label;
|
||||
return !!label && label.toLowerCase().indexOf(i.toLowerCase()) !== -1;
|
||||
});
|
||||
};
|
||||
cascadeOnChange(values: string[]): void {
|
||||
if (values == null || values.length != 3) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user