|
@@ -13,18 +13,10 @@ function (_, crypto) {
|
|
|
* @type {Object}
|
|
* @type {Object}
|
|
|
*/
|
|
*/
|
|
|
var defaults = {
|
|
var defaults = {
|
|
|
- elasticsearch : "http://"+window.location.hostname+":9200",
|
|
|
|
|
- datasources : {
|
|
|
|
|
- default: {
|
|
|
|
|
- url: "http://"+window.location.hostname+":8080",
|
|
|
|
|
- default: true
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ datasources : {},
|
|
|
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) {
|
|
|
return datasource;
|
|
return datasource;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ // backward compatible with old config
|
|
|
if (options.graphiteUrl) {
|
|
if (options.graphiteUrl) {
|
|
|
- settings.datasources = {
|
|
|
|
|
- graphite: {
|
|
|
|
|
- type: 'graphite',
|
|
|
|
|
- url: options.graphiteUrl,
|
|
|
|
|
- default: true
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ settings.datasources.graphite = {
|
|
|
|
|
+ type: 'graphite',
|
|
|
|
|
+ url: options.graphiteUrl,
|
|
|
|
|
+ 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) {
|
|
|
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);
|
|
|
}
|
|
}
|