feat(backend): configure UI animations defaults in config

This commit is contained in:
Łukasz Mierzwa
2020-10-11 17:09:37 +01:00
committed by Łukasz Mierzwa
parent 2028671a04
commit e7b5bf8fd9
6 changed files with 9 additions and 1 deletions
@@ -60,6 +60,7 @@ env UI_REFRESH=10s
env UI_HIDEFILTERSWHENIDLE=false
env UI_COLORTITLEBAR=true
env UI_THEME=dark
env UI_ANIMATIONS=false
env UI_MINIMALGROUPWIDTH=300
env UI_ALERTSPERGROUP=2
env UI_COLLAPSEGROUPS=expanded
@@ -189,6 +190,7 @@ level=info msg=" refresh: 10s"
level=info msg=" hideFiltersWhenIdle: false"
level=info msg=" colorTitlebar: true"
level=info msg=" theme: dark"
level=info msg=" animations: false"
level=info msg=" minimalGroupWidth: 300"
level=info msg=" alertsPerGroup: 2"
level=info msg=" collapseGroups: expanded"
@@ -149,6 +149,7 @@ ui:
hideFiltersWhenIdle: true
colorTitlebar: false
theme: auto
animations: false
minimalGroupWidth: 420
alertsPerGroup: 5
collapseGroups: collapsedOnMobile
@@ -436,6 +437,7 @@ level=info msg=" refresh: 10s"
level=info msg=" hideFiltersWhenIdle: true"
level=info msg=" colorTitlebar: false"
level=info msg=" theme: auto"
level=info msg=" animations: false"
level=info msg=" minimalGroupWidth: 420"
level=info msg=" alertsPerGroup: 5"
level=info msg=" collapseGroups: collapsedOnMobile"
@@ -1,7 +1,7 @@
# Print out and compare logged config set via config file that includes invalid values
karma.bin-should-fail-no-timestamp --config.file=karma.yaml --check-config
! stdout .
stderr 'Failed to unmarshal configuration: 12 error\(s\) decoding:'
stderr 'Failed to unmarshal configuration: 13 error\(s\) decoding:'
-- karma.yaml --
alertmanager:
@@ -54,6 +54,7 @@ ui:
hideFiltersWhenIdle: z
colorTitlebar: yum
theme: x
animations: 1a
minimalGroupWidth: abc4
alertsPerGroup: 5a
collapseGroups: collapsedOanMobile
+1
View File
@@ -119,6 +119,7 @@ func SetupFlags(f *pflag.FlagSet) {
f.Bool("ui.hideFiltersWhenIdle", true, "Hide the filters bar when idle")
f.Bool("ui.colorTitlebar", false, "Color alert group titlebar based on alert state")
f.String("ui.theme", "auto", "Default theme, 'light', 'dark' or 'auto' (follow browser preference)")
f.Bool("ui.animations", true, "Enable UI animations")
f.Int("ui.minimalGroupWidth", 420, "Minimal width for each alert group on the grid")
f.Int("ui.alertsPerGroup", 5, "Default number of alerts to show for each alert group")
f.String("ui.collapseGroups", "collapsedOnMobile", "Default state for alert groups")
+1
View File
@@ -122,6 +122,7 @@ ui:
hideFiltersWhenIdle: true
colorTitlebar: false
theme: auto
animations: true
minimalGroupWidth: 420
alertsPerGroup: 5
collapseGroups: collapsedOnMobile
+1
View File
@@ -162,6 +162,7 @@ type configSchema struct {
HideFiltersWhenIdle bool `yaml:"hideFiltersWhenIdle" koanf:"hideFiltersWhenIdle"`
ColorTitlebar bool `yaml:"colorTitlebar" koanf:"colorTitlebar"`
Theme string `yaml:"theme" koanf:"theme"`
Animations bool `yaml:"animations" koanf:"animations"`
MinimalGroupWidth int `yaml:"minimalGroupWidth" koanf:"minimalGroupWidth"`
AlertsPerGroup int `yaml:"alertsPerGroup" koanf:"alertsPerGroup"`
CollapseGroups string `yaml:"collapseGroups" koanf:"collapseGroups"`