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
dcfad7d6
Commit
dcfad7d6
authored
Feb 28, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed playlist functionallity, broken after recent changes
parent
9e892bdd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
19 deletions
+14
-19
src/app/controllers/search.js
+1
-1
src/app/features/dashboard/playlistCtrl.js
+2
-3
src/app/features/dashboard/playlistSrv.js
+6
-4
src/app/partials/search.html
+1
-1
src/app/plugins/datasource/elasticsearch/datasource.js
+0
-5
src/app/plugins/datasource/grafana/datasource.js
+0
-5
src/app/services/backendSrv.js
+4
-0
No files found.
src/app/controllers/search.js
View file @
dcfad7d6
...
...
@@ -60,7 +60,7 @@ function (angular, _, config) {
$scope
.
currentSearchId
=
$scope
.
currentSearchId
+
1
;
var
localSearchId
=
$scope
.
currentSearchId
;
return
backendSrv
.
get
(
'/api/search'
,
$scope
.
query
).
then
(
function
(
results
)
{
return
backendSrv
.
search
(
$scope
.
query
).
then
(
function
(
results
)
{
if
(
localSearchId
<
$scope
.
currentSearchId
)
{
return
;
}
$scope
.
resultCount
=
results
.
tagsOnly
?
results
.
tags
.
length
:
results
.
dashboards
.
length
;
...
...
src/app/features/dashboard/playlistCtrl.js
View file @
dcfad7d6
...
...
@@ -8,12 +8,11 @@ function (angular, _, config) {
var
module
=
angular
.
module
(
'grafana.controllers'
);
module
.
controller
(
'PlaylistCtrl'
,
function
(
$scope
,
playlistSrv
,
datasource
Srv
)
{
module
.
controller
(
'PlaylistCtrl'
,
function
(
$scope
,
playlistSrv
,
backend
Srv
)
{
$scope
.
init
=
function
()
{
$scope
.
playlist
=
[];
$scope
.
timespan
=
config
.
playlist_timespan
;
$scope
.
db
=
datasourceSrv
.
getGrafanaDB
();
$scope
.
search
();
};
...
...
@@ -25,7 +24,7 @@ function (angular, _, config) {
query
.
starred
=
false
;
}
$scope
.
db
.
searchDashboards
(
query
).
then
(
function
(
results
)
{
backendSrv
.
search
(
query
).
then
(
function
(
results
)
{
$scope
.
searchHits
=
results
.
dashboards
;
$scope
.
filterHits
();
});
...
...
src/app/features/dashboard/playlistSrv.js
View file @
dcfad7d6
...
...
@@ -17,11 +17,10 @@ function (angular, _, kbn) {
angular
.
element
(
window
).
unbind
(
'resize'
);
var
dash
=
self
.
dashboards
[
self
.
index
%
self
.
dashboards
.
length
];
var
relativeUrl
=
dash
.
url
.
substring
(
$location
.
absUrl
().
length
-
$location
.
url
().
length
);
$location
.
url
(
relativeUrl
);
self
.
index
++
;
$location
.
url
(
'dashboard/db/'
+
dash
.
slug
);
self
.
index
++
;
self
.
cancelPromise
=
$timeout
(
self
.
next
,
self
.
interval
);
};
...
...
@@ -31,13 +30,16 @@ function (angular, _, kbn) {
};
this
.
start
=
function
(
dashboards
,
timespan
)
{
this
.
stop
();
self
.
stop
();
self
.
index
=
0
;
self
.
interval
=
kbn
.
interval_to_ms
(
timespan
);
self
.
dashboards
=
dashboards
;
$rootScope
.
playlistSrv
=
this
;
self
.
cancelPromise
=
$timeout
(
self
.
next
,
self
.
interval
);
self
.
next
();
};
this
.
stop
=
function
()
{
...
...
src/app/partials/search.html
View file @
dcfad7d6
...
...
@@ -71,7 +71,7 @@
<i
class=
"fa fa-download"
></i>
Import
</a>
<button
class=
"btn btn-inverse pull-left"
dash-editor-link=
"app/partials/playlist.html"
editor-scope=
"isolated"
>
<button
class=
"btn btn-inverse pull-left"
dash-editor-link=
"app/partials/playlist.html"
editor-scope=
"isolated"
ng-click=
"dismiss();"
>
<i
class=
"fa fa-play"
></i>
Playlist
</button>
...
...
src/app/plugins/datasource/elasticsearch/datasource.js
View file @
dcfad7d6
...
...
@@ -18,15 +18,10 @@ function (angular, _, config, kbn, moment) {
this
.
url
=
datasource
.
url
;
this
.
name
=
datasource
.
name
;
this
.
index
=
datasource
.
index
;
this
.
grafanaDB
=
datasource
.
grafanaDB
;
this
.
searchMaxResults
=
config
.
search
.
max_results
||
20
;
this
.
saveTemp
=
_
.
isUndefined
(
datasource
.
save_temp
)
?
true
:
datasource
.
save_temp
;
this
.
saveTempTTL
=
_
.
isUndefined
(
datasource
.
save_temp_ttl
)
?
'30d'
:
datasource
.
save_temp_ttl
;
this
.
annotationEditorSrc
=
'app/features/elasticsearch/partials/annotations.editor.html'
;
this
.
supportAnnotations
=
true
;
this
.
supportMetrics
=
false
;
}
ElasticDatasource
.
prototype
.
_request
=
function
(
method
,
url
,
index
,
data
)
{
...
...
src/app/plugins/datasource/grafana/datasource.js
View file @
dcfad7d6
...
...
@@ -11,11 +11,6 @@ function (angular, _, kbn) {
module
.
factory
(
'GrafanaDatasource'
,
function
(
$q
,
backendSrv
)
{
function
GrafanaDatasource
()
{
this
.
type
=
'grafana'
;
this
.
grafanaDB
=
true
;
this
.
name
=
"grafana"
;
this
.
supportMetrics
=
true
;
this
.
editorSrc
=
'app/features/grafanaDatasource/partials/query.editor.html'
;
}
GrafanaDatasource
.
prototype
.
getDashboard
=
function
(
slug
,
isTemp
)
{
...
...
src/app/services/backendSrv.js
View file @
dcfad7d6
...
...
@@ -77,6 +77,10 @@ function (angular, _, config) {
});
};
this
.
search
=
function
(
query
)
{
return
this
.
get
(
'/api/search'
,
query
);
};
this
.
saveDashboard
=
function
(
dash
)
{
return
this
.
post
(
'/api/dashboards/db/'
,
{
dashboard
:
dash
});
};
...
...
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