Merge branch 'main' into rej_shownavigation

This commit is contained in:
James Read 2022-03-23 15:43:43 +00:00 committed by GitHub
commit 24b8857165
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 5 deletions

View File

@ -60,7 +60,6 @@ type UserGroup struct {
type Config struct { type Config struct {
UseSingleHTTPFrontend bool UseSingleHTTPFrontend bool
ThemeName string ThemeName string
ShowNavigation bool
ListenAddressSingleHTTPFrontend string ListenAddressSingleHTTPFrontend string
ListenAddressWebUI string ListenAddressWebUI string
ListenAddressRestActions string ListenAddressRestActions string
@ -70,6 +69,8 @@ type Config struct {
Actions []Action `mapstructure:"actions"` Actions []Action `mapstructure:"actions"`
Entities []Entity `mapstructure:"entities"` Entities []Entity `mapstructure:"entities"`
CheckForUpdates bool CheckForUpdates bool
ShowFooter bool
ShowNavigation bool
ShowNewVersions bool ShowNewVersions bool
Usergroups []UserGroup Usergroups []UserGroup
DefaultPermissions DefaultPermissions DefaultPermissions DefaultPermissions
@ -79,14 +80,15 @@ type Config struct {
func DefaultConfig() *Config { func DefaultConfig() *Config {
config := Config{} config := Config{}
config.UseSingleHTTPFrontend = true config.UseSingleHTTPFrontend = true
config.ShowFooter = true
config.ShowNavigation = true config.ShowNavigation = true
config.ShowNewVersions = 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"
config.ListenAddressWebUI = "localhost:1340" config.ListenAddressWebUI = "localhost:1340"
config.LogLevel = "INFO" config.LogLevel = "INFO"
config.CheckForUpdates = true config.CheckForUpdates = true
config.ShowNewVersions = true
config.DefaultPermissions.Exec = true config.DefaultPermissions.Exec = true
config.DefaultPermissions.View = true config.DefaultPermissions.View = true

View File

@ -14,10 +14,11 @@ import (
type webUISettings struct { type webUISettings struct {
Rest string Rest string
ThemeName string ThemeName string
ShowFooter bool
ShowNavigation bool ShowNavigation bool
ShowNewVersions bool
AvailableVersion string AvailableVersion string
CurrentVersion string CurrentVersion string
ShowNewVersions bool
} }
func findWebuiDir() string { func findWebuiDir() string {
@ -52,10 +53,12 @@ func generateWebUISettings(w http.ResponseWriter, r *http.Request) {
jsonRet, _ := json.Marshal(webUISettings{ jsonRet, _ := json.Marshal(webUISettings{
Rest: restAddress + "/api/", Rest: restAddress + "/api/",
ThemeName: cfg.ThemeName, ThemeName: cfg.ThemeName,
ShowFooter: cfg.ShowFooter,
ShowNavigation: cfg.ShowNavigation, ShowNavigation: cfg.ShowNavigation,
ShowNewVersions: cfg.ShowNewVersions,
AvailableVersion: updatecheck.AvailableVersion, AvailableVersion: updatecheck.AvailableVersion,
CurrentVersion: updatecheck.CurrentVersion, CurrentVersion: updatecheck.CurrentVersion,
ShowNewVersions: cfg.ShowNewVersions,
}) })
_, err := w.Write([]byte(jsonRet)) _, err := w.Write([]byte(jsonRet))

View File

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