Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
30cda20e
Commit
30cda20e
authored
Nov 14, 2013
by
Boaz Leskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve the bool filter construction in filterSrv
parent
2e7a2d74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
src/app/services/filterSrv.js
+14
-7
No files found.
src/app/services/filterSrv.js
View file @
30cda20e
...
@@ -129,25 +129,32 @@ define([
...
@@ -129,25 +129,32 @@ define([
};
};
this
.
getBoolFilter
=
function
(
ids
)
{
this
.
getBoolFilter
=
function
(
ids
)
{
// A default match all filter, just in case there are no other filters
var
bool
=
ejs
.
BoolFilter
();
var
bool
=
ejs
.
BoolFilter
().
must
(
ejs
.
MatchAllFilter
());
// there is no way to introspect the BoolFilter and find out if it has a filter. We must keep note.
var
either_bool
=
ejs
.
BoolFilter
().
must
(
ejs
.
MatchAllFilter
());
var
added_a_filter
=
false
;
_
.
each
(
ids
,
function
(
id
)
{
_
.
each
(
ids
,
function
(
id
)
{
if
(
self
.
list
[
id
].
active
)
{
if
(
self
.
list
[
id
].
active
)
{
added_a_filter
=
true
;
switch
(
self
.
list
[
id
].
mandate
)
switch
(
self
.
list
[
id
].
mandate
)
{
{
case
'mustNot'
:
case
'mustNot'
:
bool
=
bool
.
mustNot
(
self
.
getEjsObj
(
id
));
bool
.
mustNot
(
self
.
getEjsObj
(
id
));
break
;
break
;
case
'either'
:
case
'either'
:
either_bool
=
either_
bool
.
should
(
self
.
getEjsObj
(
id
));
bool
.
should
(
self
.
getEjsObj
(
id
));
break
;
break
;
default
:
default
:
bool
=
bool
.
must
(
self
.
getEjsObj
(
id
));
bool
.
must
(
self
.
getEjsObj
(
id
));
}
}
}
}
});
});
return
bool
.
must
(
either_bool
);
// add a match filter so we'd get some data
if
(
!
added_a_filter
)
{
bool
.
must
(
ejs
.
MatchAllFilter
());
}
return
bool
;
};
};
this
.
getEjsObj
=
function
(
id
)
{
this
.
getEjsObj
=
function
(
id
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment