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
75683c42
Commit
75683c42
authored
Feb 23, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Closes #123, you can now specify template (ie filter) values in url. ?fillterName=filterValue
parent
3f2c69ae
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
14 deletions
+26
-14
src/app/services/filterSrv.js
+25
-13
src/index.html
+1
-1
No files found.
src/app/services/filterSrv.js
View file @
75683c42
...
...
@@ -8,7 +8,7 @@ define([
var
module
=
angular
.
module
(
'kibana.services'
);
module
.
service
(
'filterSrv'
,
function
(
dashboard
,
$rootScope
,
$timeout
)
{
module
.
service
(
'filterSrv'
,
function
(
dashboard
,
$rootScope
,
$timeout
,
$routeParams
)
{
// defaults
var
_d
=
{
list
:
[],
...
...
@@ -26,16 +26,38 @@ define([
self
.
list
=
dashboard
.
current
.
services
.
filter
.
list
;
self
.
time
=
dashboard
.
current
.
services
.
filter
.
time
;
self
.
filterTemplateData
=
undefined
;
self
.
templateSettings
=
{
interpolate
:
/
\[\[([\s\S]
+
?)\]\]
/g
,
};
if
(
self
.
list
.
length
)
{
this
.
updateTemplateData
(
true
);
}
};
this
.
updateTemplateData
=
function
(
initial
)
{
self
.
filterTemplateData
=
{};
_
.
each
(
self
.
list
,
function
(
filter
)
{
if
(
initial
)
{
var
urlValue
=
$routeParams
[
filter
.
name
];
if
(
urlValue
)
{
filter
.
current
=
{
text
:
urlValue
,
value
:
urlValue
};
}
}
if
(
!
filter
.
current
||
!
filter
.
current
.
value
)
{
return
;
}
self
.
filterTemplateData
[
filter
.
name
]
=
filter
.
current
.
value
;
});
}
this
.
filterOptionSelected
=
function
(
filter
,
option
)
{
filter
.
current
=
option
;
self
.
filterTemplateData
=
undefined
;
this
.
updateTemplateData
()
;
dashboard
.
refresh
();
};
...
...
@@ -47,16 +69,6 @@ define([
if
(
target
.
indexOf
(
'[['
)
===
-
1
)
{
return
target
;
}
if
(
!
self
.
filterTemplateData
)
{
self
.
filterTemplateData
=
{};
_
.
each
(
self
.
list
,
function
(
filter
)
{
if
(
!
filter
.
current
||
!
filter
.
current
.
value
)
{
return
;
}
self
.
filterTemplateData
[
filter
.
name
]
=
filter
.
current
.
value
;
});
}
return
_
.
template
(
target
,
self
.
filterTemplateData
,
self
.
templateSettings
);
};
...
...
src/index.html
View file @
75683c42
...
...
@@ -21,7 +21,7 @@
</head>
<body
ng-cloak
body-class
>
<body
ng-cloak
body-class
>
<!--<link rel="stylesheet" ng-href="css/bootstrap.{{dashboard.current.style||'dark'}}.min.css">-->
<link
rel=
"stylesheet"
ng-href=
"css/bootstrap.{{dashboard.current.style||'dark'}}.min.css"
>
...
...
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