Licensing service (#19903)
* Licensing: supplies a service to handle licensing information * Licensing: uses the license service further Uses the license service instead of settings.isEnterprise: - external team members - saml - usage stats * Licensing: fixes broken tests due to new Licensing service dependency * Licensing: fixes linting errors * Licensing: exposes license expiry information to the frontend
This commit is contained in:
+5
-8
@@ -83,7 +83,7 @@ func (hs *HTTPServer) setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, er
|
||||
NewGrafanaVersion: plugins.GrafanaLatestVersion,
|
||||
NewGrafanaVersionExists: plugins.GrafanaHasUpdate,
|
||||
AppName: setting.ApplicationName,
|
||||
AppNameBodyClass: getAppNameBodyClass(setting.ApplicationName),
|
||||
AppNameBodyClass: getAppNameBodyClass(hs.License.HasValidLicense()),
|
||||
}
|
||||
|
||||
if setting.DisableGravatar {
|
||||
@@ -372,13 +372,10 @@ func (hs *HTTPServer) NotFoundHandler(c *m.ReqContext) {
|
||||
c.HTML(404, "index", data)
|
||||
}
|
||||
|
||||
func getAppNameBodyClass(name string) string {
|
||||
switch name {
|
||||
case setting.APP_NAME:
|
||||
return "app-grafana"
|
||||
case setting.APP_NAME_ENTERPRISE:
|
||||
func getAppNameBodyClass(validLicense bool) string {
|
||||
if validLicense {
|
||||
return "app-enterprise"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
|
||||
return "app-grafana"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user