Merge pull request #48 from jonesrussell/rej_showfooter

feature: Show/Hide footer - thank you @jonesrussell !
This commit is contained in:
James Read 2022-03-22 22:08:56 +00:00 committed by GitHub
commit 51112aa2f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View File

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

View File

@ -15,6 +15,7 @@ type webUISettings struct {
Rest string Rest string
ThemeName string ThemeName string
HideNavigation bool HideNavigation bool
ShowFooter bool
AvailableVersion string AvailableVersion string
CurrentVersion string CurrentVersion string
ShowNewVersions bool ShowNewVersions bool
@ -53,6 +54,7 @@ func generateWebUISettings(w http.ResponseWriter, r *http.Request) {
Rest: restAddress + "/api/", Rest: restAddress + "/api/",
ThemeName: cfg.ThemeName, ThemeName: cfg.ThemeName,
HideNavigation: cfg.HideNavigation, HideNavigation: cfg.HideNavigation,
ShowFooter: cfg.ShowFooter,
AvailableVersion: updatecheck.AvailableVersion, AvailableVersion: updatecheck.AvailableVersion,
CurrentVersion: updatecheck.CurrentVersion, CurrentVersion: updatecheck.CurrentVersion,
ShowNewVersions: cfg.ShowNewVersions, ShowNewVersions: cfg.ShowNewVersions,

View File

@ -63,6 +63,7 @@ function processWebuiSettingsJson (settings) {
} }
document.querySelector('#section-switcher').hidden = settings.HideNavigation document.querySelector('#section-switcher').hidden = settings.HideNavigation
document.querySelector('footer[title="footer"]').hidden = !settings.ShowFooter
} }
function main () { function main () {