mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 19:00:54 -06:00
fixed regex issue
This commit is contained in:
parent
3797054eb4
commit
fc6d14127d
@ -52,7 +52,7 @@ export class AlertRuleList extends React.Component<IContainerProps, any> {
|
||||
render() {
|
||||
const { nav, alertList } = this.props;
|
||||
|
||||
let regex = new RegExp(this.state.search, 'ig');
|
||||
let regex = new RegExp(this.state.search, 'i');
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
@ -10,6 +10,13 @@ export const AlertListStore = types
|
||||
rules: types.array(AlertRule),
|
||||
stateFilter: types.optional(types.string, 'all'),
|
||||
})
|
||||
.views(self => ({
|
||||
searchFilter(regex) {
|
||||
return self.rules.filter(alert => {
|
||||
return regex.test(alert.name) || regex.test(alert.stateText);
|
||||
});
|
||||
},
|
||||
}))
|
||||
.actions(self => ({
|
||||
loadRules: flow(function* load(filters) {
|
||||
const backendSrv = getEnv(self).backendSrv;
|
||||
@ -31,11 +38,4 @@ export const AlertListStore = types
|
||||
self.rules.push(AlertRule.create(rule));
|
||||
}
|
||||
}),
|
||||
}))
|
||||
.views(self => ({
|
||||
searchFilter(regex) {
|
||||
return self.rules.filter(alert => {
|
||||
return regex.test(alert.name) || regex.test(alert.stateText);
|
||||
});
|
||||
},
|
||||
}));
|
||||
|
Loading…
Reference in New Issue
Block a user