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
dd18b6c8
Commit
dd18b6c8
authored
Mar 18, 2014
by
Torkel Ödegaard
Committed by
Bruce Sherrod
Mar 26, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds support to have filters inside filters, (nested templated segments), Closes #128
parent
48d33171
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
8 deletions
+25
-8
src/app/panels/filtering/module.html
+4
-5
src/app/panels/filtering/module.js
+20
-2
src/app/services/all.js
+1
-1
No files found.
src/app/panels/filtering/module.html
View file @
dd18b6c8
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div
class=
'filtering-container'
>
<div
class=
'filtering-container'
>
<div
ng-repeat=
"filter in filter
Srv.l
ist"
class=
"small filter-panel-filter"
>
<div
ng-repeat=
"filter in filter
L
ist"
class=
"small filter-panel-filter"
>
<div>
<div>
<i
class=
"filter-action pointer icon-remove"
bs-tooltip=
"'Remove'"
ng-click=
"remove(filter)"
></i>
<i
class=
"filter-action pointer icon-remove"
bs-tooltip=
"'Remove'"
ng-click=
"remove(filter)"
></i>
<i
class=
"filter-action pointer icon-edit"
ng-hide=
"filter.editing"
bs-tooltip=
"'Edit'"
ng-click=
"filter.editing = true"
></i>
<i
class=
"filter-action pointer icon-edit"
ng-hide=
"filter.editing"
bs-tooltip=
"'Edit'"
ng-click=
"filter.editing = true"
></i>
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
</a>
</a>
<ul
class=
"dropdown-menu"
>
<ul
class=
"dropdown-menu"
>
<li
ng-repeat=
"option in filter.options"
>
<li
ng-repeat=
"option in filter.options"
>
<a
ng-click=
"filter
Srv.filter
OptionSelected(filter, option)"
>
{{option.text}}
</a>
<a
ng-click=
"filterOptionSelected(filter, option)"
>
{{option.text}}
</a>
</li>
</li>
</ul>
</ul>
</li>
</li>
...
@@ -40,9 +40,8 @@
...
@@ -40,9 +40,8 @@
</li>
</li>
</ul>
</ul>
<div>
<div>
<input
type=
"submit"
value=
"Apply"
ng-click=
"applyFilter(filter)"
class=
"filter-apply btn btn-success btn-mini"
bs-tooltip=
"'Save and refresh'"
/>
<input
type=
"submit"
value=
"Update"
ng-click=
"applyFilter(filter)"
class=
"filter-apply btn btn-success btn-mini"
bs-tooltip=
"'Update and refresh'"
/>
<button
ng-click=
"filter.editing=undefined"
class=
"filter-apply btn btn-mini"
bs-tooltip=
"'Save without refresh'"
>
Close
</button>
<button
ng-click=
"filter.editing=undefined"
class=
"filter-apply btn btn-mini"
bs-tooltip=
"'Save without refresh'"
>
Save
</button>
</div>
</div>
</form>
</form>
</div>
</div>
...
...
src/app/panels/filtering/module.js
View file @
dd18b6c8
...
@@ -27,15 +27,33 @@ function (angular, app, _) {
...
@@ -27,15 +27,33 @@ function (angular, app, _) {
_
.
defaults
(
$scope
.
panel
,
_d
);
_
.
defaults
(
$scope
.
panel
,
_d
);
$scope
.
init
=
function
()
{
$scope
.
init
=
function
()
{
$scope
.
filter
Srv
=
filterSrv
;
$scope
.
filter
List
=
filterSrv
.
list
;
};
};
$scope
.
remove
=
function
(
filter
)
{
$scope
.
remove
=
function
(
filter
)
{
filterSrv
.
remove
(
filter
);
filterSrv
.
remove
(
filter
);
};
};
$scope
.
filterOptionSelected
=
function
(
filter
,
option
)
{
filterSrv
.
filterOptionSelected
(
filter
,
option
);
$scope
.
applyFilterToOtherFilters
(
filter
);
};
$scope
.
applyFilterToOtherFilters
=
function
(
updatedFilter
)
{
_
.
each
(
$scope
.
filterList
,
function
(
filter
)
{
if
(
filter
===
updatedFilter
)
{
return
;
}
if
(
filter
.
query
.
indexOf
(
updatedFilter
.
name
)
!==
-
1
)
{
$scope
.
applyFilter
(
filter
);
}
});
};
$scope
.
applyFilter
=
function
(
filter
)
{
$scope
.
applyFilter
=
function
(
filter
)
{
datasourceSrv
.
default
.
metricFindQuery
(
filter
.
query
)
var
query
=
filterSrv
.
applyFilterToTarget
(
filter
.
query
);
datasourceSrv
.
default
.
metricFindQuery
(
query
)
.
then
(
function
(
results
)
{
.
then
(
function
(
results
)
{
filter
.
editing
=
undefined
;
filter
.
editing
=
undefined
;
filter
.
options
=
_
.
map
(
results
,
function
(
node
)
{
filter
.
options
=
_
.
map
(
results
,
function
(
node
)
{
...
...
src/app/services/all.js
View file @
dd18b6c8
define
([
define
([
'./alertSrv'
,
'./alertSrv'
,
'./dashboard'
,
'./dashboard'
,
'./datasourceSrv'
,
'./filterSrv'
,
'./filterSrv'
,
'./timer'
,
'./timer'
,
'./panelMove'
,
'./panelMove'
,
'./datasourceSrv'
,
'./keyboardManager'
,
'./keyboardManager'
,
'./annotationsSrv'
,
'./annotationsSrv'
,
'./playlistSrv'
,
'./playlistSrv'
,
...
...
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