feat(backend): add multi-grid UI options to configuration file

This commit is contained in:
Łukasz Mierzwa
2020-03-30 18:32:08 +01:00
parent 2cd96abef7
commit 53289a1a06
4 changed files with 19 additions and 7 deletions

View File

@@ -61,6 +61,8 @@ env UI_THEME=dark
env UI_MINIMALGROUPWIDTH=300
env UI_ALERTSPERGROUP=2
env UI_COLLAPSEGROUPS=expanded
env UI_MULTIGRIDLABEL=cluster
env UI_MULTIGRIDSORTREVERSE=true
karma.bin-should-work --check-config
! stdout .
@@ -184,5 +186,7 @@ level=info msg=" theme: dark"
level=info msg=" minimalGroupWidth: 300"
level=info msg=" alertsPerGroup: 2"
level=info msg=" collapseGroups: expanded"
level=info msg=" multiGridLabel: cluster"
level=info msg=" multiGridSortReverse: true"
level=info msg="[ro] Configured Alertmanager source at http://localhost:9093 (proxied: false, readonly: true)"
level=info msg="Configuration is valid"

View File

@@ -147,6 +147,8 @@ ui:
minimalGroupWidth: 420
alertsPerGroup: 5
collapseGroups: collapsedOnMobile
multiGridLabel: severity
multiGridSortReverse: true
-- ca.pem --
-----BEGIN CERTIFICATE-----
@@ -425,6 +427,8 @@ level=info msg=" theme: auto"
level=info msg=" minimalGroupWidth: 420"
level=info msg=" alertsPerGroup: 5"
level=info msg=" collapseGroups: collapsedOnMobile"
level=info msg=" multiGridLabel: severity"
level=info msg=" multiGridSortReverse: true"
level=info msg="[ha1] Configured Alertmanager source at http://localhost:9093 (proxied: true, readonly: false)"
level=info msg="[ha2] Configured Alertmanager source at http://localhost:9094 (proxied: false, readonly: true)"
level=info msg="[local] Configured Alertmanager source at http://localhost:9095 (proxied: true, readonly: false)"

View File

@@ -123,6 +123,8 @@ ui:
minimalGroupWidth: 420
alertsPerGroup: 5
collapseGroups: collapsedOnMobile
multiGridLabel: ""
multiGridSortReverse: false
`
configDump, err := yaml.Marshal(Config)

View File

@@ -155,12 +155,14 @@ type configSchema struct {
}
} `yaml:"silenceForm" koanf:"silenceForm"`
UI struct {
Refresh time.Duration
HideFiltersWhenIdle bool `yaml:"hideFiltersWhenIdle" koanf:"hideFiltersWhenIdle"`
ColorTitlebar bool `yaml:"colorTitlebar" koanf:"colorTitlebar"`
Theme string `yaml:"theme" koanf:"theme"`
MinimalGroupWidth int `yaml:"minimalGroupWidth" koanf:"minimalGroupWidth"`
AlertsPerGroup int `yaml:"alertsPerGroup" koanf:"alertsPerGroup"`
CollapseGroups string `yaml:"collapseGroups" koanf:"collapseGroups"`
Refresh time.Duration
HideFiltersWhenIdle bool `yaml:"hideFiltersWhenIdle" koanf:"hideFiltersWhenIdle"`
ColorTitlebar bool `yaml:"colorTitlebar" koanf:"colorTitlebar"`
Theme string `yaml:"theme" koanf:"theme"`
MinimalGroupWidth int `yaml:"minimalGroupWidth" koanf:"minimalGroupWidth"`
AlertsPerGroup int `yaml:"alertsPerGroup" koanf:"alertsPerGroup"`
CollapseGroups string `yaml:"collapseGroups" koanf:"collapseGroups"`
MultiGridLabel string `yaml:"multiGridLabel" koanf:"multiGridLabel"`
MultiGridSortReverse bool `yaml:"multiGridSortReverse" koanf:"multiGridSortReverse"`
}
}