Commit 1665cb42 by Torkel Ödegaard

refactoring: moving components -> core

parent 1113081a
...@@ -3,7 +3,6 @@ require.config({ ...@@ -3,7 +3,6 @@ require.config({
baseUrl: 'public', baseUrl: 'public',
paths: { paths: {
settings: 'app/components/settings',
kbn: 'app/components/kbn', kbn: 'app/components/kbn',
'extend-jquery': 'app/components/extend-jquery', 'extend-jquery': 'app/components/extend-jquery',
lodash: 'app/components/lodash.extended', lodash: 'app/components/lodash.extended',
......
define([ define([
'settings', 'app/core/settings',
], ],
function (Settings) { function (Settings) {
"use strict"; "use strict";
......
...@@ -5,12 +5,6 @@ function (_) { ...@@ -5,12 +5,6 @@ function (_) {
"use strict"; "use strict";
return function Settings (options) { 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 = { var defaults = {
datasources : {}, datasources : {},
window_title_prefix : 'Grafana - ', window_title_prefix : 'Grafana - ',
...@@ -22,36 +16,12 @@ function (_) { ...@@ -22,36 +16,12 @@ function (_) {
}, },
new_panel_title: 'no title (click here)', new_panel_title: 'no title (click here)',
plugins: {}, plugins: {},
default_route: '/dashboard/file/default.json',
playlist_timespan: "1m", playlist_timespan: "1m",
unsaved_changes_warning: true, unsaved_changes_warning: true,
search: { max_results: 100 },
appSubUrl: "" appSubUrl: ""
}; };
var settings = _.extend({}, defaults, options); 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; 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