Merge branch 'hide-navigation-buttons'

This commit is contained in:
jamesread 2021-10-18 13:03:52 +01:00
commit 2d27128477
3 changed files with 6 additions and 0 deletions

View File

@ -42,6 +42,7 @@ type UserGroup struct {
type Config struct {
UseSingleHTTPFrontend bool
ThemeName string
HideNavigation bool
ListenAddressSingleHTTPFrontend string
ListenAddressWebUI string
ListenAddressRestActions string
@ -59,6 +60,7 @@ type Config struct {
func DefaultConfig() *Config {
config := Config{}
config.UseSingleHTTPFrontend = true
config.HideNavigation = false
config.ListenAddressSingleHTTPFrontend = "0.0.0.0:1337"
config.ListenAddressRestActions = "localhost:1338"
config.ListenAddressGrpcActions = "localhost:1339"

View File

@ -13,6 +13,7 @@ import (
type webUISettings struct {
Rest string
ThemeName string
HideNavigation bool
}
func findWebuiDir() string {
@ -44,6 +45,7 @@ func generateWebUISettings(w http.ResponseWriter, r *http.Request) {
jsonRet, _ := json.Marshal(webUISettings{
Rest: restAddress + "/api/",
ThemeName: cfg.ThemeName,
HideNavigation: cfg.HideNavigation,
})
w.Write([]byte(jsonRet))

View File

@ -66,6 +66,8 @@ function processWebuiSettingsJson (settings) {
document.head.appendChild(themeCss)
}
document.querySelector('#switcher').hidden = settings.HideNavigation
}
setupSections()