From 16d47d3dadc6a6f59b9193a45f4d64d9225dea65 Mon Sep 17 00:00:00 2001 From: Daniel Markstedt Date: Mon, 25 Sep 2023 21:16:29 -0700 Subject: [PATCH] Web UI: Create a system admin page and move options there --- .../static/themes/modern/icons/command.svg | 1 + python/web/src/static/themes/modern/style.css | 21 ++ python/web/src/templates/admin.html | 186 ++++++++++++++++++ python/web/src/templates/base.html | 47 ----- python/web/src/templates/index.html | 104 +--------- python/web/src/web.py | 29 ++- 6 files changed, 231 insertions(+), 157 deletions(-) create mode 100644 python/web/src/static/themes/modern/icons/command.svg create mode 100644 python/web/src/templates/admin.html diff --git a/python/web/src/static/themes/modern/icons/command.svg b/python/web/src/static/themes/modern/icons/command.svg new file mode 100644 index 0000000000..d2778fa6f2 --- /dev/null +++ b/python/web/src/static/themes/modern/icons/command.svg @@ -0,0 +1 @@ + diff --git a/python/web/src/static/themes/modern/style.css b/python/web/src/static/themes/modern/style.css index a21a91ed96..849b6f3b55 100644 --- a/python/web/src/static/themes/modern/style.css +++ b/python/web/src/static/themes/modern/style.css @@ -954,6 +954,27 @@ section#manual a p { margin: 0; } +/* + ------------------------------------------------------------------------------ + Index > Section: Admin + ------------------------------------------------------------------------------ + */ +section#admin { + margin: 2rem 0 1rem; +} + +section#admin a { + margin: auto; + display: block; + padding: 0.25rem 0 0.25rem 2rem; + background: url("icons/command.svg") no-repeat left center; + font-weight: bold; +} + +section#admin a p { + margin: 0; +} + /* ------------------------------------------------------------------------------ Drives page diff --git a/python/web/src/templates/admin.html b/python/web/src/templates/admin.html new file mode 100644 index 0000000000..87a633cc7d --- /dev/null +++ b/python/web/src/templates/admin.html @@ -0,0 +1,186 @@ +{% extends "base.html" %} +{% block content %} + +
+
+ + {{ _("Logging") }} + +
    +
  • {{ _("The current dropdown selection indicates the active log level.") }}
  • +
+
+ +
+
+ + + + + +
+
+ +
+
+ + + +
+
+
+ +
+ +
+
+ + {{ _("Appearance") }} + +
    +
  • {{ _("Theme and language are auto-detected for your user agent. Here you can change the default.") }}
  • +
  • {{ _("The System Name is the \"pretty\" hostname if set, with a fallback to the regular hostname.") }}
  • +
+
+ +
+
+ {{ _("The current theme is %(theme)s.", theme=current_theme) }} + {% if current_theme == "classic" %} + {{ _('Switch to the %(theme)s theme', theme="modern") }} + {% else %} + {{ _('Switch to the %(theme)s theme', theme="classic") }} + {% endif %} +
+ +
+ + + +
+
+ +
+
+ + + +
+
+ + +
+
+
+ +
+ +
+
+ + {{ _("Companion Services") }} + +
    +
  • {{ _("If you want to add a service, run the easyinstall.sh script and choose the one to install.") }}
  • +
  • {{ _("In order to manage the services in the Web UI, you may install Webmin as well.") }}
  • +
+
+
+ +
+ +
+
+ + {{ _("System Operations") }} + +
    +
  • {{ _("IMPORTANT: Always shut down the system before turning off the power. Failing to do so may lead to data loss.") }}
  • +
+
+ +
+
+ +
+
+ +
+
+
+ +

{{ _("Go to Home") }}

+ +{% endblock content %} diff --git a/python/web/src/templates/base.html b/python/web/src/templates/base.html index 38cbe09ba1..258bd4405b 100644 --- a/python/web/src/templates/base.html +++ b/python/web/src/templates/base.html @@ -104,53 +104,6 @@

{% block content %}{% endblock content %}