mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
feat(ui): allow setting default value for UI darkTheme option
This commit is contained in:
@@ -770,6 +770,7 @@ ui:
|
||||
refresh: duration
|
||||
hideFiltersWhenIdle: bool
|
||||
colorTitlebar: bool
|
||||
darkTheme: bool
|
||||
minimalGroupWidth: integer
|
||||
alertsPerGroup: integer
|
||||
collapseGroups: string
|
||||
@@ -781,6 +782,8 @@ ui:
|
||||
user inactivity
|
||||
- `colorTitlebar` - if enabled alert group title bar color will be set to follow
|
||||
alerts in that group
|
||||
- `darkTheme` - if enabled dark mode will be enabled.
|
||||
Note: dark mode is *experimental* and might be buggy.
|
||||
- `minimalGroupWidth` - minimal width (in pixels) for each alert group rendered
|
||||
on the grid. This value is used to calculate the number of columns rendered on
|
||||
the grid.
|
||||
@@ -799,6 +802,7 @@ ui:
|
||||
refresh: 30s
|
||||
hideFiltersWhenIdle: true
|
||||
colorTitlebar: false
|
||||
darkTheme: false
|
||||
minimalGroupWidth: 420
|
||||
alertsPerGroup: 5
|
||||
collapseGroups: collapsedOnMobile
|
||||
|
||||
@@ -96,6 +96,7 @@ func init() {
|
||||
pflag.Duration("ui.refresh", time.Second*30, "UI refresh interval")
|
||||
pflag.Bool("ui.hideFiltersWhenIdle", true, "Hide the filters bar when idle")
|
||||
pflag.Bool("ui.colorTitlebar", false, "Color alert group titlebar based on alert state")
|
||||
pflag.Bool("ui.darkTheme", false, "Enable dark theme")
|
||||
pflag.Int("ui.minimalGroupWidth", 420, "Minimal width for each alert group on the grid")
|
||||
pflag.Int("ui.alertsPerGroup", 5, "Default number of alerts to show for each alert group")
|
||||
pflag.String("ui.collapseGroups", "collapsedOnMobile", "Default state for alert groups")
|
||||
@@ -186,6 +187,7 @@ func (config *configSchema) Read() {
|
||||
config.UI.Refresh = v.GetDuration("ui.refresh")
|
||||
config.UI.HideFiltersWhenIdle = v.GetBool("ui.hideFiltersWhenIdle")
|
||||
config.UI.ColorTitlebar = v.GetBool("ui.colorTitlebar")
|
||||
config.UI.DarkTheme = v.GetBool("ui.darkTheme")
|
||||
config.UI.MinimalGroupWidth = v.GetInt("ui.minimalGroupWidth")
|
||||
config.UI.AlertsPerGroup = v.GetInt("ui.alertsPerGroup")
|
||||
config.UI.CollapseGroups = v.GetString("ui.collapseGroups")
|
||||
|
||||
@@ -136,6 +136,7 @@ ui:
|
||||
refresh: 30s
|
||||
hideFiltersWhenIdle: true
|
||||
colorTitlebar: false
|
||||
darkTheme: false
|
||||
minimalGroupWidth: 420
|
||||
alertsPerGroup: 5
|
||||
collapseGroups: collapsedOnMobile
|
||||
|
||||
@@ -112,6 +112,7 @@ type configSchema struct {
|
||||
Refresh time.Duration
|
||||
HideFiltersWhenIdle bool `yaml:"hideFiltersWhenIdle" mapstructure:"hideFiltersWhenIdle"`
|
||||
ColorTitlebar bool `yaml:"colorTitlebar" mapstructure:"colorTitlebar"`
|
||||
DarkTheme bool `yaml:"darkTheme" mapstructure:"darkTheme"`
|
||||
MinimalGroupWidth int `yaml:"minimalGroupWidth" mapstructure:"minimalGroupWidth"`
|
||||
AlertsPerGroup int `yaml:"alertsPerGroup" mapstructure:"alertsPerGroup"`
|
||||
CollapseGroups string `yaml:"collapseGroups" mapstructure:"collapseGroups"`
|
||||
|
||||
Reference in New Issue
Block a user