diff --git a/internal/config/config.go b/internal/config/config.go index e1b90e7..564a0c4 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -13,7 +13,7 @@ type Action struct { Arguments []ActionArgument } -// ActionArgument objects appear on Actions. +// ActionArgument objects appear on Actions. type ActionArgument struct { Name string Title string @@ -60,7 +60,6 @@ type UserGroup struct { type Config struct { UseSingleHTTPFrontend bool ThemeName string - ShowNavigation bool ListenAddressSingleHTTPFrontend string ListenAddressWebUI string ListenAddressRestActions string @@ -70,6 +69,8 @@ type Config struct { Actions []Action `mapstructure:"actions"` Entities []Entity `mapstructure:"entities"` CheckForUpdates bool + ShowFooter bool + ShowNavigation bool ShowNewVersions bool Usergroups []UserGroup DefaultPermissions DefaultPermissions @@ -79,14 +80,15 @@ type Config struct { func DefaultConfig() *Config { config := Config{} config.UseSingleHTTPFrontend = true + config.ShowFooter = true config.ShowNavigation = true + config.ShowNewVersions = true config.ListenAddressSingleHTTPFrontend = "0.0.0.0:1337" config.ListenAddressRestActions = "localhost:1338" config.ListenAddressGrpcActions = "localhost:1339" config.ListenAddressWebUI = "localhost:1340" config.LogLevel = "INFO" config.CheckForUpdates = true - config.ShowNewVersions = true config.DefaultPermissions.Exec = true config.DefaultPermissions.View = true diff --git a/internal/httpservers/webuiServer.go b/internal/httpservers/webuiServer.go index dceecc7..12f616f 100644 --- a/internal/httpservers/webuiServer.go +++ b/internal/httpservers/webuiServer.go @@ -14,10 +14,11 @@ import ( type webUISettings struct { Rest string ThemeName string + ShowFooter bool ShowNavigation bool + ShowNewVersions bool AvailableVersion string CurrentVersion string - ShowNewVersions bool } func findWebuiDir() string { @@ -52,10 +53,12 @@ func generateWebUISettings(w http.ResponseWriter, r *http.Request) { jsonRet, _ := json.Marshal(webUISettings{ Rest: restAddress + "/api/", ThemeName: cfg.ThemeName, + ShowFooter: cfg.ShowFooter, ShowNavigation: cfg.ShowNavigation, + ShowNewVersions: cfg.ShowNewVersions, AvailableVersion: updatecheck.AvailableVersion, CurrentVersion: updatecheck.CurrentVersion, - ShowNewVersions: cfg.ShowNewVersions, + }) _, err := w.Write([]byte(jsonRet)) diff --git a/webui/main.js b/webui/main.js index bfb8c89..b8c9531 100644 --- a/webui/main.js +++ b/webui/main.js @@ -63,6 +63,7 @@ function processWebuiSettingsJson (settings) { } document.querySelector('#section-switcher').hidden = !settings.ShowNavigation + document.querySelector('footer[title="footer"]').hidden = !settings.ShowFooter } function main () {