Config: Use license info instead of build info for feature toggling (#21558)
This commit is contained in:
@@ -5,7 +5,7 @@ import { GrafanaTheme, GrafanaThemeType, PanelPluginMeta, DataSourceInstanceSett
|
||||
export interface BuildInfo {
|
||||
version: string;
|
||||
commit: string;
|
||||
isEnterprise: boolean;
|
||||
isEnterprise: boolean; // deprecated: use licenseInfo.hasLicense instead
|
||||
env: string;
|
||||
latestVersion: string;
|
||||
hasUpdate: boolean;
|
||||
@@ -17,6 +17,12 @@ interface FeatureToggles {
|
||||
expressions: boolean;
|
||||
newEdit: boolean;
|
||||
}
|
||||
|
||||
interface LicenseInfo {
|
||||
hasLicense: boolean;
|
||||
expiry: number;
|
||||
}
|
||||
|
||||
export class GrafanaBootConfig {
|
||||
datasources: { [str: string]: DataSourceInstanceSettings } = {};
|
||||
panels: { [key: string]: PanelPluginMeta } = {};
|
||||
@@ -55,6 +61,7 @@ export class GrafanaBootConfig {
|
||||
expressions: false,
|
||||
newEdit: false,
|
||||
};
|
||||
licenseInfo: LicenseInfo = {} as LicenseInfo;
|
||||
|
||||
constructor(options: GrafanaBootConfig) {
|
||||
this.theme = options.bootData.user.lightTheme ? getTheme(GrafanaThemeType.Light) : getTheme(GrafanaThemeType.Dark);
|
||||
|
||||
Reference in New Issue
Block a user