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
4e47447d
Commit
4e47447d
authored
Jul 29, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
began work on ES annotation datasource, #201
parent
a1772d26
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
19 deletions
+50
-19
src/app/controllers/dashLoader.js
+2
-4
src/app/dashboards/empty.json
+1
-4
src/app/directives/grafanaGraph.js
+0
-1
src/app/panels/annotations/editor.js
+1
-6
src/app/partials/elasticsearch/annotation_editor.html
+1
-0
src/app/services/datasourceSrv.js
+13
-4
src/app/services/elasticsearch/es-datasource.js
+32
-0
No files found.
src/app/controllers/dashLoader.js
View file @
4e47447d
...
...
@@ -12,8 +12,6 @@ function (angular, _, moment) {
module
.
controller
(
'dashLoader'
,
function
(
$scope
,
$rootScope
,
$http
,
alertSrv
,
$location
,
playlistSrv
,
elastic
)
{
$scope
.
init
=
function
()
{
$scope
.
elasticsearch
=
$scope
.
elasticsearch
||
{};
$scope
.
onAppEvent
(
'save-dashboard'
,
function
()
{
$scope
.
saveDashboard
();
});
...
...
@@ -35,10 +33,10 @@ function (angular, _, moment) {
var
_l
=
$scope
.
dashboard
.
loader
;
if
(
type
===
'load'
)
{
return
(
_l
.
load_elasticsearch
||
_l
.
load_gist
);
return
(
_l
.
load_elasticsearch
);
}
if
(
type
===
'save'
)
{
return
(
_l
.
save_elasticsearch
||
_l
.
save_gist
);
return
(
_l
.
save_elasticsearch
);
}
return
false
;
};
...
...
src/app/dashboards/empty.json
View file @
4e47447d
...
...
@@ -66,16 +66,14 @@
}
],
"loader"
:
{
"save_gist"
:
false
,
"save_elasticsearch"
:
true
,
"save_default"
:
true
,
"save_temp"
:
true
,
"save_temp_ttl_enable"
:
true
,
"save_temp_ttl"
:
"30d"
,
"load_gist"
:
false
,
"load_elasticsearch"
:
true
,
"load_elasticsearch_size"
:
20
,
"hide"
:
false
},
"refresh"
:
false
}
\ No newline at end of file
}
src/app/directives/grafanaGraph.js
View file @
4e47447d
...
...
@@ -167,7 +167,6 @@ function (angular, $, kbn, moment, _) {
// if legend is to the right delay plot draw a few milliseconds
// so the legend width calculation can be done
if
(
shouldDelayDraw
(
panel
))
{
console
.
log
(
'delay'
);
legendSideLastValue
=
panel
.
legend
.
rightSide
;
setTimeout
(
function
()
{
plot
=
$
.
plot
(
elem
,
data
,
options
);
...
...
src/app/panels/annotations/editor.js
View file @
4e47447d
...
...
@@ -56,12 +56,7 @@ function (angular, app, _) {
$scope
.
add
=
function
()
{
$scope
.
currentAnnotation
.
datasource
=
$scope
.
currentDatasource
.
name
;
$scope
.
panel
.
annotations
.
push
(
$scope
.
currentAnnotation
);
$scope
.
currentAnnnotation
=
angular
.
copy
(
annotationDefaults
);
};
$scope
.
hide
=
function
(
annotation
)
{
annotation
.
enable
=
!
annotation
.
enable
;
$rootScope
.
$broadcast
(
'refresh'
);
$scope
.
currentAnnotation
=
angular
.
copy
(
annotationDefaults
);
};
});
...
...
src/app/partials/elasticsearch/annotation_editor.html
0 → 100644
View file @
4e47447d
<h2>
Elasticsearch
</h2>
src/app/services/datasourceSrv.js
View file @
4e47447d
...
...
@@ -5,13 +5,14 @@ define([
'./graphite/graphiteDatasource'
,
'./influxdb/influxdbDatasource'
,
'./opentsdb/opentsdbDatasource'
,
'./elasticsearch/es-datasource'
,
],
function
(
angular
,
_
,
config
)
{
'use strict'
;
var
module
=
angular
.
module
(
'grafana.services'
);
module
.
service
(
'datasourceSrv'
,
function
(
$q
,
filterSrv
,
$http
,
GraphiteDatasource
,
InfluxDatasource
,
OpenTSDBDatasource
)
{
module
.
service
(
'datasourceSrv'
,
function
(
$q
,
filterSrv
,
$http
,
$injector
)
{
var
datasources
=
{};
this
.
init
=
function
()
{
...
...
@@ -29,14 +30,22 @@ function (angular, _, config) {
};
this
.
datasourceFactory
=
function
(
ds
)
{
var
Datasource
=
null
;
switch
(
ds
.
type
)
{
case
'graphite'
:
return
new
GraphiteDatasource
(
ds
);
Datasource
=
$injector
.
get
(
'GraphiteDatasource'
);
break
;
case
'influxdb'
:
return
new
InfluxDatasource
(
ds
);
Datasource
=
$injector
.
get
(
'InfluxDatasource'
);
break
;
case
'opentsdb'
:
return
new
OpenTSDBDatasource
(
ds
);
Datasource
=
$injector
.
get
(
'OpenTSDBDatasource'
);
break
;
case
'elasticsearch'
:
Datasource
=
$injector
.
get
(
'ElasticDatasource'
);
break
;
}
return
new
Datasource
(
ds
);
};
this
.
get
=
function
(
name
)
{
...
...
src/app/services/elasticsearch/es-datasource.js
0 → 100644
View file @
4e47447d
define
([
'angular'
,
'underscore'
,
'jquery'
,
'config'
,
'kbn'
,
'moment'
],
function
(
angular
,
_
,
$
,
config
,
kbn
,
moment
)
{
'use strict'
;
var
module
=
angular
.
module
(
'grafana.services'
);
module
.
factory
(
'ElasticDatasource'
,
function
(
$q
,
$http
)
{
function
ElasticDatasource
(
datasource
)
{
this
.
type
=
'elastic'
;
this
.
basicAuth
=
datasource
.
basicAuth
;
this
.
url
=
datasource
.
url
;
this
.
name
=
datasource
.
name
;
this
.
supportAnnotations
=
true
;
this
.
annotationEditorSrc
=
'app/partials/elasticsearch/annotation_editor.html'
;
}
ElasticDatasource
.
prototype
.
annotationQuery
=
function
(
annotation
,
filterSrv
,
rangeUnparsed
)
{
};
return
ElasticDatasource
;
});
});
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