diff --git a/internal/config/config.go b/internal/config/config.go index 3bd5daf8..5fd61ad8 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -66,6 +66,7 @@ type Config struct { Actions []Action `mapstructure:"actions"` Entities []Entity `mapstructure:"entities"` CheckForUpdates bool + PageTitle string ShowFooter bool ShowNavigation bool ShowNewVersions bool @@ -79,6 +80,7 @@ type Config struct { func DefaultConfig() *Config { config := Config{} config.UseSingleHTTPFrontend = true + config.PageTitle = "OliveTin" config.ShowFooter = true config.ShowNavigation = true config.ShowNewVersions = true diff --git a/internal/httpservers/webuiServer.go b/internal/httpservers/webuiServer.go index 25cafc76..14d96dc8 100644 --- a/internal/httpservers/webuiServer.go +++ b/internal/httpservers/webuiServer.go @@ -19,6 +19,8 @@ type webUISettings struct { ShowNewVersions bool AvailableVersion string CurrentVersion string + PageTitle string + } func findWebuiDir() string { @@ -52,6 +54,7 @@ func generateWebUISettings(w http.ResponseWriter, r *http.Request) { ShowNewVersions: cfg.ShowNewVersions, AvailableVersion: updatecheck.AvailableVersion, CurrentVersion: updatecheck.CurrentVersion, + PageTitle: cfg.PageTitle, }) _, err := w.Write([]byte(jsonRet)) diff --git a/webui/index.html b/webui/index.html index a9ff8362..9e2fdf2f 100644 --- a/webui/index.html +++ b/webui/index.html @@ -16,6 +16,23 @@
+ + + +
+ + +
diff --git a/webui/main.js b/webui/main.js index b8c95313..7853e763 100644 --- a/webui/main.js +++ b/webui/main.js @@ -64,6 +64,12 @@ function processWebuiSettingsJson (settings) { document.querySelector('#section-switcher').hidden = !settings.ShowNavigation document.querySelector('footer[title="footer"]').hidden = !settings.ShowFooter + + if (settings.PageTitle) { + document.title = settings.PageTitle + const titleElem = document.querySelector('#page-title') + if (titleElem) titleElem.innerText = settings.PageTitle + } } function main () { diff --git a/webui/style.css b/webui/style.css index 7c77002e..615a60c2 100644 --- a/webui/style.css +++ b/webui/style.css @@ -20,11 +20,79 @@ fieldset#root-group { border: 0; } +#sidebar-toggle-wrapper { + display: inline; +} + +h1 { + display: inline; + padding-left: 1em; + font-size: small; +} + +label#sidebar-toggler-button { + top: 1em; + left: 0.5em; + height: 2em; + width: 2em; + border-radius: 50%; + background-color: white; + text-align: center; + display: inline-grid; + place-items: center; + padding: 0; + box-shadow: 0 0 5px 0 #444; + color: #666; +} + +label#sidebar-toggler-button:hover, +label#sidebar-toggler-button:focus { + color: black; + cursor: pointer; +} + +aside { + position: absolute; + width: 180px; + height: 100%; + left: 0; + top: 0; + padding-top: 4em; + transition: 0.5s ease; + background-color: white; + border: 0 0 10px 0; + box-shadow: 0 0 10px 0 #444; +} + +input:checked ~ aside { + left: -250px; +} + +aside ul { + padding: 0; + margin: 0; +} + +aside ul li { + list-style: none; + text-align: left; + padding-left: 1em; + padding-top: 0.5em; + padding-bottom: 0.5em; + border-bottom: 1px inset black; +} + +aside ul li:hover { + color: black; + background-color: #efefef; + cursor: pointer; +} + table { background-color: white; border-collapse: collapse; width: 100%; - box-shadow: 0 0 10px 0 #444; + box-shadow: 0 0 5px 0 #444; } th, @@ -257,6 +325,15 @@ label { padding-right: 1em; } +#perma-widget { + position: absolute; + z-index: 2; +} + +#perma-widget label { + display: inline; +} + input { padding: 0.6em; }