Commit 1665cb42 by Torkel Ödegaard

refactoring: moving components -> core

parent 1113081a
......@@ -3,7 +3,6 @@ require.config({
baseUrl: 'public',
paths: {
settings: 'app/components/settings',
kbn: 'app/components/kbn',
'extend-jquery': 'app/components/extend-jquery',
lodash: 'app/components/lodash.extended',
......
define([
'settings',
'app/core/settings',
],
function (Settings) {
"use strict";
......
......@@ -5,12 +5,6 @@ function (_) {
"use strict";
return function Settings (options) {
/**
* To add a setting, you MUST define a default. Also,
* THESE ARE ONLY DEFAULTS.
* They are overridden by config.js in the root directory
* @type {Object}
*/
var defaults = {
datasources : {},
window_title_prefix : 'Grafana - ',
......@@ -22,36 +16,12 @@ function (_) {
},
new_panel_title: 'no title (click here)',
plugins: {},
default_route: '/dashboard/file/default.json',
playlist_timespan: "1m",
unsaved_changes_warning: true,
search: { max_results: 100 },
appSubUrl: ""
};
var settings = _.extend({}, defaults, options);
// var parseBasicAuth = function(datasource) {
// var passwordEnd = datasource.url.indexOf('@');
// if (passwordEnd > 0) {
// var userStart = datasource.url.indexOf('//') + 2;
// var userAndPassword = datasource.url.substring(userStart, passwordEnd);
// var bytes = crypto.charenc.Binary.stringToBytes(userAndPassword);
// datasource.basicAuth = crypto.util.bytesToBase64(bytes);
//
// var urlHead = datasource.url.substring(0, userStart);
// datasource.url = urlHead + datasource.url.substring(passwordEnd + 1);
// }
//
// return datasource;
// };
//
// _.each(settings.datasources, function(datasource, key) {
// datasource.name = key;
// if (datasource.url) { parseBasicAuth(datasource); }
// if (datasource.type === 'influxdb') { parseMultipleHosts(datasource); }
// });
return settings;
};
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment