diff --git a/public/app/components/require.config.js b/public/app/components/require.config.js index cfb90b00696..141b7ccaf85 100644 --- a/public/app/components/require.config.js +++ b/public/app/components/require.config.js @@ -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', diff --git a/public/app/components/settings.js b/public/app/components/settings.js deleted file mode 100644 index a9e1d382dd5..00000000000 --- a/public/app/components/settings.js +++ /dev/null @@ -1,57 +0,0 @@ -define([ - 'lodash', -], -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 - ', - panels : { - 'graph': { path: 'app/panels/graph', name: 'Graph' }, - 'singlestat': { path: 'app/panels/singlestat', name: 'Single stat' }, - 'text': { path: 'app/panels/text', name: 'Text' }, - 'dashlist': { path: 'app/panels/dashlist', name: 'Dashboard list' }, - }, - 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; - }; -}); diff --git a/public/app/core/config.js b/public/app/core/config.js index e26a55e097b..f8e7bb228a2 100644 --- a/public/app/core/config.js +++ b/public/app/core/config.js @@ -1,5 +1,5 @@ define([ - 'settings', + 'app/core/settings', ], function (Settings) { "use strict"; diff --git a/public/app/core/settings.js b/public/app/core/settings.js new file mode 100644 index 00000000000..b7fb6e53c14 --- /dev/null +++ b/public/app/core/settings.js @@ -0,0 +1,27 @@ +define([ + 'lodash', +], +function (_) { + "use strict"; + + return function Settings (options) { + var defaults = { + datasources : {}, + window_title_prefix : 'Grafana - ', + panels : { + 'graph': { path: 'app/panels/graph', name: 'Graph' }, + 'singlestat': { path: 'app/panels/singlestat', name: 'Single stat' }, + 'text': { path: 'app/panels/text', name: 'Text' }, + 'dashlist': { path: 'app/panels/dashlist', name: 'Dashboard list' }, + }, + new_panel_title: 'no title (click here)', + plugins: {}, + playlist_timespan: "1m", + unsaved_changes_warning: true, + appSubUrl: "" + }; + + var settings = _.extend({}, defaults, options); + return settings; + }; +});