hide caching settings when its disabled (#34756) (#34769)

(cherry picked from commit 3aba08f708)

Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2021-05-26 15:06:29 -05:00
committed by GitHub
co-authored by Kevin Minehart
parent 52e2a2403f
commit fca62d20d6
3 changed files with 7 additions and 1 deletions
+3
View File
@@ -83,6 +83,9 @@ export class GrafanaBootConfig implements GrafanaConfig {
azure: AzureSettings = {
managedIdentityEnabled: false,
};
caching = {
enabled: false,
};
constructor(options: GrafanaBootConfig) {
const mode = options.bootData.user.lightTheme ? 'light' : 'dark';
+3
View File
@@ -255,6 +255,9 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *models.ReqContext) (map[string]i
"cloud": hs.Cfg.Azure.Cloud,
"managedIdentityEnabled": hs.Cfg.Azure.ManagedIdentityEnabled,
},
"caching": map[string]bool{
"enabled": hs.Cfg.SectionWithEnvOverrides("caching").Key("enabled").MustBool(true),
},
}
return jsonObj, nil
@@ -68,7 +68,7 @@ export function buildNavModel(dataSource: DataSourceSettings, plugin: GenericDat
id: `datasource-cache-${dataSource.id}`,
text: 'Cache',
url: `datasources/edit/${dataSource.id}/cache`,
hideFromTabs: !pluginMeta.isBackend,
hideFromTabs: !pluginMeta.isBackend || !config.caching.enabled,
});
}