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
78e8ab80
Commit
78e8ab80
authored
Dec 31, 2013
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
basic version of filters/template targets is working
parent
a4adec42
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
6 deletions
+30
-6
src/app/panels/filtering/module.html
+3
-3
src/app/partials/dashboard.html
+1
-0
src/app/services/filterSrv.js
+23
-0
src/app/services/graphite/graphiteSrv.js
+3
-2
src/css/bootstrap.dark.min.css
+0
-0
src/vendor/bootstrap/less/grafana.less
+0
-1
No files found.
src/app/panels/filtering/module.html
View file @
78e8ab80
...
...
@@ -6,7 +6,7 @@
.filter-panel-filter
{
display
:
inline-block
;
vertical-align
:
top
;
padding
:
5
px
10px
0px
10px
;
padding
:
3
px
10px
0px
10px
;
margin
:
0px
5px
;
border-left
:
1px
solid
#111
;
border-right
:
1px
solid
#111
;
...
...
@@ -22,7 +22,7 @@
float
:
right
;
margin-bottom
:
0px
!important
;
margin-left
:
3px
;
margin-top
:
3
px
;
margin-top
:
4
px
;
}
.add-filter-action
{
position
:
relative
;
...
...
@@ -56,7 +56,7 @@
</a>
<ul
class=
"dropdown-menu"
>
<li
ng-repeat=
"option in filter.options"
>
<a
ng-click=
"filter
.current = option
"
>
{{option.text}}
</a>
<a
ng-click=
"filter
Srv.filterOptionSelected(filter, option)
"
>
{{option.text}}
</a>
</li>
</ul>
</li>
...
...
src/app/partials/dashboard.html
View file @
78e8ab80
...
...
@@ -6,6 +6,7 @@
<div
class=
"top-row-open"
ng-hide=
"pulldown.collapse"
>
<kibana-simple-panel
type=
"pulldown.type"
ng-cloak
></kibana-simple-panel>
</div>
<div
class=
"clearfix"
></div>
</div>
<div
class=
"clearfix"
></div>
<div
class=
"container-fluid main"
ng-class=
"{'grafana-dashboard-hide-controls': dashboard.current.hideControls}"
>
...
...
src/app/services/filterSrv.js
View file @
78e8ab80
...
...
@@ -27,12 +27,35 @@ define([
self
.
list
=
dashboard
.
current
.
services
.
filter
.
list
;
self
.
time
=
dashboard
.
current
.
services
.
filter
.
time
;
self
.
templateSettings
=
{
interpolate
:
/
\[\[([\s\S]
+
?)\]\]
/g
,
};
};
this
.
filterOptionSelected
=
function
(
filter
,
option
)
{
filter
.
current
=
option
;
self
.
filterTemplateData
=
undefined
;
dashboard
.
refresh
();
};
this
.
add
=
function
(
filter
)
{
self
.
list
.
push
(
filter
);
};
this
.
applyFilterToTarget
=
function
(
target
)
{
if
(
target
.
indexOf
(
'[['
)
===
-
1
)
{
return
target
;
}
if
(
!
self
.
filterTemplateData
)
{
self
.
filterTemplateData
=
{};
_
.
each
(
self
.
list
,
function
(
filter
)
{
self
.
filterTemplateData
[
filter
.
name
]
=
filter
.
current
.
value
;
});
}
return
_
.
template
(
target
,
self
.
filterTemplateData
,
self
.
templateSettings
);
};
this
.
remove
=
function
(
filter
)
{
self
.
list
=
dashboard
.
current
.
services
.
filter
.
list
=
_
.
without
(
self
.
list
,
filter
);
...
...
src/app/services/graphite/graphiteSrv.js
View file @
78e8ab80
...
...
@@ -9,7 +9,7 @@ function (angular, _, $, config) {
var
module
=
angular
.
module
(
'kibana.services'
);
module
.
service
(
'graphiteSrv'
,
function
(
$http
)
{
module
.
service
(
'graphiteSrv'
,
function
(
$http
,
filterSrv
)
{
this
.
query
=
function
(
options
)
{
var
graphOptions
=
{
...
...
@@ -74,7 +74,8 @@ function (angular, _, $, config) {
if
(
key
===
"targets"
)
{
$
.
each
(
value
,
function
(
index
,
value
)
{
if
(
!
value
.
hide
)
{
clean_options
.
push
(
"target="
+
encodeURIComponent
(
value
.
target
));
var
targetValue
=
filterSrv
.
applyFilterToTarget
(
value
.
target
);
clean_options
.
push
(
"target="
+
encodeURIComponent
(
targetValue
));
}
});
}
...
...
src/css/bootstrap.dark.min.css
View file @
78e8ab80
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/vendor/bootstrap/less/grafana.less
View file @
78e8ab80
...
...
@@ -32,7 +32,6 @@
.filter-pulldown {
background: #444;
overflow: hidden;
border-top: 1px solid #111;
border-bottom: 1px solid #111;
}
...
...
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