mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Feature Management: UI improvements (#76866)
* Feature Management: UI improvements * update UI logic --------- Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
This commit is contained in:
@@ -16,6 +16,7 @@ var (
|
||||
type FeatureManager struct {
|
||||
isDevMod bool
|
||||
restartRequired bool
|
||||
allowEditing bool
|
||||
licensing licensing.Licensing
|
||||
flags map[string]*FeatureFlag
|
||||
enabled map[string]bool // only the "on" values
|
||||
@@ -150,7 +151,7 @@ func (fm *FeatureManager) GetFlags() []FeatureFlag {
|
||||
}
|
||||
|
||||
func (fm *FeatureManager) GetState() *FeatureManagerState {
|
||||
return &FeatureManagerState{RestartRequired: fm.restartRequired}
|
||||
return &FeatureManagerState{RestartRequired: fm.restartRequired, AllowEditing: fm.allowEditing}
|
||||
}
|
||||
|
||||
func (fm *FeatureManager) SetRestartRequired() {
|
||||
|
||||
@@ -132,4 +132,5 @@ type FeatureToggleDTO struct {
|
||||
|
||||
type FeatureManagerState struct {
|
||||
RestartRequired bool `json:"restartRequired"`
|
||||
AllowEditing bool `json:"allowEditing"`
|
||||
}
|
||||
|
||||
@@ -24,11 +24,12 @@ var (
|
||||
|
||||
func ProvideManagerService(cfg *setting.Cfg, licensing licensing.Licensing) (*FeatureManager, error) {
|
||||
mgmt := &FeatureManager{
|
||||
isDevMod: setting.Env != setting.Prod,
|
||||
licensing: licensing,
|
||||
flags: make(map[string]*FeatureFlag, 30),
|
||||
enabled: make(map[string]bool),
|
||||
log: log.New("featuremgmt"),
|
||||
isDevMod: setting.Env != setting.Prod,
|
||||
licensing: licensing,
|
||||
flags: make(map[string]*FeatureFlag, 30),
|
||||
enabled: make(map[string]bool),
|
||||
allowEditing: cfg.FeatureManagement.AllowEditing && cfg.FeatureManagement.UpdateWebhook != "",
|
||||
log: log.New("featuremgmt"),
|
||||
}
|
||||
|
||||
// Register the standard flags
|
||||
|
||||
Reference in New Issue
Block a user