diff options
| author | JP Appel <jeanpierre.appel01@gmail.com> | 2024-10-05 13:40:12 -0400 |
|---|---|---|
| committer | JP Appel <jeanpierre.appel01@gmail.com> | 2024-10-05 13:40:12 -0400 |
| commit | 0f28b1981fc386f6171ae14939a1b7aca86640ba (patch) | |
| tree | 1c3109c972b904ff71565ffa953a62746cf503a3 | |
| parent | 50df0f7b61462a6bfad9e74f7c7917c6b19d4b92 (diff) | |
Add server controls to dashboard, update styling
| -rw-r--r-- | dashboard/dashboard.go | 6 | ||||
| -rw-r--r-- | static/styles.css | 12 | ||||
| -rw-r--r-- | templates/dashboard/dashboard.html | 2 | ||||
| -rw-r--r-- | templates/dashboard/server_controls.html | 7 | ||||
| -rw-r--r-- | templates/dashboard/server_logs.html | 10 | ||||
| -rw-r--r-- | templates/dashboard/server_status.html | 2 |
6 files changed, 37 insertions, 2 deletions
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 @@ <p>Welcome to the Dashboard! It is still under construction so please be patient :) </p> <main> {{template "server_status" . }} + {{template "server_controls" . }} + {{template "server_logs" . }} </main> {{ 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" }} +<section class="dashboard-item server-controls"> + <h2>Server Controls</h2> + <button>Start</button> + <button>Stop</button> +</section> +{{ 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" }} +<section class="dashboard-item server-logs"> + <h2>Server Logs</h2> + <div class="logs-viewer"> + <label for="logs-viewer-area">Foundry Logs</label> + <textarea id="logs-viewer-area" name="logs-viewer-area" readonly="true" placeholder="Loading..."></textarea> + <button>Download</button> + </div> +</section> +{{ 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"}} -<section class="server-status"> +<section class="dashboard-item server-status"> <h2>Server Status</h2> <div id=uptime> <dl> |
