Transformers: configure result transformations after query(alpha) (#18740)
This commit is contained in:
committed by
Dominik Prokop
parent
205c0a58ac
commit
7d32caeac2
@@ -195,6 +195,7 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interf
|
||||
"env": setting.Env,
|
||||
"isEnterprise": setting.IsEnterprise,
|
||||
},
|
||||
"featureToggles": hs.Cfg.FeatureToggles,
|
||||
}
|
||||
|
||||
return jsonObj, nil
|
||||
|
||||
@@ -266,6 +266,8 @@ type Cfg struct {
|
||||
EditorsCanAdmin bool
|
||||
|
||||
ApiKeyMaxSecondsToLive int64
|
||||
|
||||
FeatureToggles map[string]bool
|
||||
}
|
||||
|
||||
type CommandLineArgs struct {
|
||||
@@ -941,6 +943,17 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
|
||||
cfg.PluginsEnableAlpha = pluginsSection.Key("enable_alpha").MustBool(false)
|
||||
cfg.PluginsAppsSkipVerifyTLS = pluginsSection.Key("app_tls_skip_verify_insecure").MustBool(false)
|
||||
|
||||
// Read and populate feature toggles list
|
||||
featureTogglesSection := iniFile.Section("feature_toggles")
|
||||
cfg.FeatureToggles = make(map[string]bool)
|
||||
featuresTogglesStr, err := valueAsString(featureTogglesSection, "enable", "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, feature := range util.SplitString(featuresTogglesStr) {
|
||||
cfg.FeatureToggles[feature] = true
|
||||
}
|
||||
|
||||
// check old location for this option
|
||||
if panelsSection.Key("enable_alpha").MustBool(false) {
|
||||
cfg.PluginsEnableAlpha = true
|
||||
|
||||
Reference in New Issue
Block a user