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
c61e4c02
Commit
c61e4c02
authored
Jul 30, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
further work on unifying datasources, #630
parent
b8ce61ae
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
20 deletions
+17
-20
src/app/components/settings.js
+11
-15
src/app/services/annotationsSrv.js
+1
-0
src/app/services/elasticsearch/es-datasource.js
+5
-5
No files found.
src/app/components/settings.js
View file @
c61e4c02
...
@@ -13,18 +13,10 @@ function (_, crypto) {
...
@@ -13,18 +13,10 @@ function (_, crypto) {
* @type {Object}
* @type {Object}
*/
*/
var
defaults
=
{
var
defaults
=
{
elasticsearch
:
"http://"
+
window
.
location
.
hostname
+
":9200"
,
datasources
:
{},
datasources
:
{
default
:
{
url
:
"http://"
+
window
.
location
.
hostname
+
":8080"
,
default
:
true
}
},
panels
:
[
'graph'
,
'text'
],
panels
:
[
'graph'
,
'text'
],
plugins
:
{},
plugins
:
{},
default_route
:
'/dashboard/file/default.json'
,
default_route
:
'/dashboard/file/default.json'
,
grafana_index
:
'grafana-dash'
,
elasticsearch_all_disabled
:
false
,
playlist_timespan
:
"1m"
,
playlist_timespan
:
"1m"
,
unsaved_changes_warning
:
true
,
unsaved_changes_warning
:
true
,
admin
:
{}
admin
:
{}
...
@@ -57,13 +49,21 @@ function (_, crypto) {
...
@@ -57,13 +49,21 @@ function (_, crypto) {
return
datasource
;
return
datasource
;
};
};
// backward compatible with old config
if
(
options
.
graphiteUrl
)
{
if
(
options
.
graphiteUrl
)
{
settings
.
datasources
=
{
settings
.
datasources
.
graphite
=
{
graphite
:
{
type
:
'graphite'
,
type
:
'graphite'
,
url
:
options
.
graphiteUrl
,
url
:
options
.
graphiteUrl
,
default
:
true
default
:
true
};
}
}
if
(
options
.
elasticsearch
)
{
settings
.
datasources
.
elasticsearch
=
{
type
:
'elasticsearch'
,
url
:
options
.
elasticsearch
,
index
:
options
.
grafana_index
,
grafanaDB
:
true
};
};
}
}
...
@@ -73,10 +73,6 @@ function (_, crypto) {
...
@@ -73,10 +73,6 @@ function (_, crypto) {
if
(
datasource
.
type
===
'influxdb'
)
{
parseMultipleHosts
(
datasource
);
}
if
(
datasource
.
type
===
'influxdb'
)
{
parseMultipleHosts
(
datasource
);
}
});
});
var
elasticParsed
=
parseBasicAuth
({
url
:
settings
.
elasticsearch
});
settings
.
elasticsearchBasicAuth
=
elasticParsed
.
basicAuth
;
settings
.
elasticsearch
=
elasticParsed
.
url
;
if
(
settings
.
plugins
.
panels
)
{
if
(
settings
.
plugins
.
panels
)
{
settings
.
panels
=
_
.
union
(
settings
.
panels
,
settings
.
plugins
.
panels
);
settings
.
panels
=
_
.
union
(
settings
.
panels
,
settings
.
plugins
.
panels
);
}
}
...
...
src/app/services/annotationsSrv.js
View file @
c61e4c02
...
@@ -37,6 +37,7 @@ define([
...
@@ -37,6 +37,7 @@ define([
var
promises
=
_
.
map
(
annotations
,
function
(
annotation
)
{
var
promises
=
_
.
map
(
annotations
,
function
(
annotation
)
{
var
datasource
=
datasourceSrv
.
get
(
annotation
.
datasource
);
var
datasource
=
datasourceSrv
.
get
(
annotation
.
datasource
);
return
datasource
.
annotationQuery
(
annotation
,
filterSrv
,
rangeUnparsed
)
return
datasource
.
annotationQuery
(
annotation
,
filterSrv
,
rangeUnparsed
)
.
then
(
this
.
receiveAnnotationResults
)
.
then
(
this
.
receiveAnnotationResults
)
.
then
(
null
,
errorHandler
);
.
then
(
null
,
errorHandler
);
...
...
src/app/services/elasticsearch/es-datasource.js
View file @
c61e4c02
...
@@ -31,10 +31,10 @@ function (angular, _, $, config, kbn, moment) {
...
@@ -31,10 +31,10 @@ function (angular, _, $, config, kbn, moment) {
method
:
method
,
method
:
method
,
data
:
data
data
:
data
};
};
// TODO: fix basic auth
if
(
config
.
elasticsearchB
asicAuth
)
{
if
(
this
.
b
asicAuth
)
{
options
.
headers
=
{
options
.
headers
=
{
"Authorization"
:
"Basic "
+
config
.
elasticsearchB
asicAuth
"Authorization"
:
"Basic "
+
this
.
b
asicAuth
};
};
}
}
...
@@ -117,8 +117,8 @@ function (angular, _, $, config, kbn, moment) {
...
@@ -117,8 +117,8 @@ function (angular, _, $, config, kbn, moment) {
}
else
{
}
else
{
return
false
;
return
false
;
}
}
},
function
(
data
,
status
)
{
},
function
(
data
)
{
if
(
status
===
0
)
{
if
(
data
.
status
===
0
)
{
throw
"Could not contact Elasticsearch. Please ensure that Elasticsearch is reachable from your browser."
;
throw
"Could not contact Elasticsearch. Please ensure that Elasticsearch is reachable from your browser."
;
}
else
{
}
else
{
throw
"Could not find dashboard "
+
id
;
throw
"Could not find dashboard "
+
id
;
...
...
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