Feature Management: Update admin page UI after a successful update (#76380)
* Feature Management: Update admin page UI after a successful update * lint * lint * refactor
This commit is contained in:
@@ -14,13 +14,14 @@ var (
|
||||
)
|
||||
|
||||
type FeatureManager struct {
|
||||
isDevMod bool
|
||||
licensing licensing.Licensing
|
||||
flags map[string]*FeatureFlag
|
||||
enabled map[string]bool // only the "on" values
|
||||
config string // path to config file
|
||||
vars map[string]any
|
||||
log log.Logger
|
||||
isDevMod bool
|
||||
restartRequired bool
|
||||
licensing licensing.Licensing
|
||||
flags map[string]*FeatureFlag
|
||||
enabled map[string]bool // only the "on" values
|
||||
config string // path to config file
|
||||
vars map[string]any
|
||||
log log.Logger
|
||||
}
|
||||
|
||||
// This will merge the flags with the current configuration
|
||||
@@ -148,6 +149,14 @@ func (fm *FeatureManager) GetFlags() []FeatureFlag {
|
||||
return v
|
||||
}
|
||||
|
||||
func (fm *FeatureManager) GetState() *FeatureManagerState {
|
||||
return &FeatureManagerState{RestartRequired: fm.restartRequired}
|
||||
}
|
||||
|
||||
func (fm *FeatureManager) SetRestartRequired() {
|
||||
fm.restartRequired = true
|
||||
}
|
||||
|
||||
// Check to see if a feature toggle exists by name
|
||||
func (fm *FeatureManager) LookupFlag(name string) (FeatureFlag, bool) {
|
||||
f, ok := fm.flags[name]
|
||||
|
||||
@@ -127,3 +127,7 @@ type FeatureToggleDTO struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
ReadOnly bool `json:"readOnly,omitempty"`
|
||||
}
|
||||
|
||||
type FeatureManagerState struct {
|
||||
RestartRequired bool `json:"restartRequired"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user