2017-10-24 03:45:46 -05:00
|
|
|
import _ from 'lodash';
|
|
|
|
|
|
|
|
class Settings {
|
|
|
|
datasources: any;
|
|
|
|
panels: any;
|
|
|
|
appSubUrl: string;
|
|
|
|
window_title_prefix: string;
|
|
|
|
buildInfo: any;
|
|
|
|
new_panel_title: string;
|
|
|
|
bootData: any;
|
|
|
|
externalUserMngLinkUrl: string;
|
|
|
|
externalUserMngLinkName: string;
|
|
|
|
externalUserMngInfo: string;
|
|
|
|
allowOrgCreate: boolean;
|
|
|
|
disableLoginForm: boolean;
|
|
|
|
defaultDatasource: string;
|
|
|
|
alertingEnabled: boolean;
|
2017-11-23 10:04:50 -06:00
|
|
|
authProxyEnabled: boolean;
|
|
|
|
ldapEnabled: boolean;
|
2017-11-24 05:59:36 -06:00
|
|
|
oauth: any;
|
|
|
|
disableUserSignUp: boolean;
|
|
|
|
loginHint: any;
|
|
|
|
loginError: any;
|
2017-10-24 03:45:46 -05:00
|
|
|
|
|
|
|
constructor(options) {
|
|
|
|
var defaults = {
|
|
|
|
datasources: {},
|
|
|
|
window_title_prefix: 'Grafana - ',
|
|
|
|
panels: {},
|
|
|
|
new_panel_title: 'Panel Title',
|
|
|
|
playlist_timespan: "1m",
|
|
|
|
unsaved_changes_warning: true,
|
|
|
|
appSubUrl: ""
|
|
|
|
};
|
|
|
|
_.extend(this, defaults, options);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var bootData = (<any>window).grafanaBootData || { settings: {} };
|
|
|
|
var options = bootData.settings;
|
|
|
|
options.bootData = bootData;
|
|
|
|
|
|
|
|
const config = new Settings(options);
|
|
|
|
export default config;
|