From 0f28b1981fc386f6171ae14939a1b7aca86640ba Mon Sep 17 00:00:00 2001 From: JP Appel Date: Sat, 5 Oct 2024 13:40:12 -0400 Subject: Add server controls to dashboard, update styling --- dashboard/dashboard.go | 6 ++++++ static/styles.css | 12 +++++++++++- templates/dashboard/dashboard.html | 2 ++ templates/dashboard/server_controls.html | 7 +++++++ templates/dashboard/server_logs.html | 10 ++++++++++ templates/dashboard/server_status.html | 2 +- 6 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 templates/dashboard/server_controls.html diff --git a/dashboard/dashboard.go b/dashboard/dashboard.go index c3839f2..8daf375 100644 --- a/dashboard/dashboard.go +++ b/dashboard/dashboard.go @@ -11,6 +11,10 @@ import ( var Logger *slog.Logger var templates map[string]*template.Template +func getStatuses() { + +} + func Index(w http.ResponseWriter, req *http.Request) { t, ok := templates["dashboard"] @@ -44,5 +48,7 @@ func init() { filepath.Join("templates", "base.html"), filepath.Join("templates", "dashboard", "dashboard.html"), filepath.Join("templates", "dashboard", "server_status.html"), + filepath.Join("templates", "dashboard", "server_controls.html"), + filepath.Join("templates", "dashboard", "server_logs.html"), )) } diff --git a/static/styles.css b/static/styles.css index 497cf2c..51dd3fe 100644 --- a/static/styles.css +++ b/static/styles.css @@ -4,7 +4,17 @@ main { flex-direction: column; } -section.server-status { +section.dashboard-item { padding: 0 1em 0.75em; border: 0.25em solid black; } + +section.server-logs div.logs-viewer { + width: 100%; + display: flex; + flex-direction: column; +} + +#logs-viewer-area { + resize: none; +} diff --git a/templates/dashboard/dashboard.html b/templates/dashboard/dashboard.html index 29a852e..b0f7eb3 100644 --- a/templates/dashboard/dashboard.html +++ b/templates/dashboard/dashboard.html @@ -3,5 +3,7 @@

Welcome to the Dashboard! It is still under construction so please be patient :)

{{template "server_status" . }} + {{template "server_controls" . }} + {{template "server_logs" . }}
{{ end }} diff --git a/templates/dashboard/server_controls.html b/templates/dashboard/server_controls.html new file mode 100644 index 0000000..eba93e8 --- /dev/null +++ b/templates/dashboard/server_controls.html @@ -0,0 +1,7 @@ +{{ define "server_controls" }} +
+

Server Controls

+ + +
+{{ end }} diff --git a/templates/dashboard/server_logs.html b/templates/dashboard/server_logs.html index e69de29..f1977ac 100644 --- a/templates/dashboard/server_logs.html +++ b/templates/dashboard/server_logs.html @@ -0,0 +1,10 @@ +{{ define "server_logs" }} +
+

Server Logs

+
+ + + +
+
+{{ end }} diff --git a/templates/dashboard/server_status.html b/templates/dashboard/server_status.html index 8019659..d118714 100644 --- a/templates/dashboard/server_status.html +++ b/templates/dashboard/server_status.html @@ -1,5 +1,5 @@ {{define "server_status"}} -
+

Server Status

-- cgit v1.2.3