mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
refactoring: enterprise build/hooks refactorings (#12478)
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
import _ from 'lodash';
|
||||
|
||||
class Settings {
|
||||
export interface BuildInfo {
|
||||
version: string;
|
||||
commit: string;
|
||||
isEnterprise: boolean;
|
||||
env: string;
|
||||
}
|
||||
|
||||
export class Settings {
|
||||
datasources: any;
|
||||
panels: any;
|
||||
appSubUrl: string;
|
||||
window_title_prefix: string;
|
||||
buildInfo: any;
|
||||
buildInfo: BuildInfo;
|
||||
new_panel_title: string;
|
||||
bootData: any;
|
||||
externalUserMngLinkUrl: string;
|
||||
@@ -22,7 +29,6 @@ class Settings {
|
||||
disableUserSignUp: boolean;
|
||||
loginHint: any;
|
||||
loginError: any;
|
||||
enterprise: boolean;
|
||||
|
||||
constructor(options) {
|
||||
var defaults = {
|
||||
@@ -33,7 +39,14 @@ class Settings {
|
||||
playlist_timespan: '1m',
|
||||
unsaved_changes_warning: true,
|
||||
appSubUrl: '',
|
||||
buildInfo: {
|
||||
version: 'v1.0',
|
||||
commit: '1',
|
||||
env: 'production',
|
||||
isEnterprise: false,
|
||||
},
|
||||
};
|
||||
|
||||
_.extend(this, defaults, options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,14 +34,10 @@ export class ContextSrv {
|
||||
constructor() {
|
||||
this.sidemenu = store.getBool('grafana.sidemenu', true);
|
||||
|
||||
if (!config.buildInfo) {
|
||||
config.buildInfo = {};
|
||||
}
|
||||
if (!config.bootData) {
|
||||
config.bootData = { user: {}, settings: {} };
|
||||
}
|
||||
|
||||
this.version = config.buildInfo.version;
|
||||
this.user = new User();
|
||||
this.isSignedIn = this.user.isSignedIn;
|
||||
this.isGrafanaAdmin = this.user.isGrafanaAdmin;
|
||||
|
||||
Reference in New Issue
Block a user