From e4304ec3f7d4011dfcc91c8977ec9fbf9034a616 Mon Sep 17 00:00:00 2001 From: Ross Trottier Date: Tue, 25 Jun 2024 15:28:39 -0600 Subject: [PATCH] styling --- cmd/web/app-links.go | 32 ++++++++------ cmd/web/handlers.go | 8 ++++ cmd/web/main.go | 5 +++ cmd/web/routes.go | 4 +- ui/html/base.tmpl.html | 11 +++-- ui/html/pages/404.tmpl.html | 5 +++ ui/html/pages/home.tmpl.html | 19 +++++---- ui/html/pages/vpn.tmpl.html | 5 +++ ui/html/partials/nav.tmpl.html | 7 +-- ui/static/css/styles.css | 75 +++++++++++++++++++++++++++++++++ ui/static/img/baserow.png | Bin 0 -> 9233 bytes ui/static/img/bookstack.png | Bin 0 -> 41751 bytes ui/static/img/castopod.png | Bin 0 -> 10430 bytes ui/static/img/element.png | Bin 0 -> 17551 bytes ui/static/img/espo.png | Bin 0 -> 12752 bytes ui/static/img/freescout.png | Bin 0 -> 22407 bytes ui/static/img/gitea.png | Bin 0 -> 18714 bytes ui/static/img/jitsi.png | Bin 0 -> 37773 bytes ui/static/img/listmonk.png | Bin 0 -> 26191 bytes ui/static/img/nextcloud.png | Bin 0 -> 23124 bytes ui/static/img/powerdns.png | Bin 0 -> 10326 bytes ui/static/img/users.png | Bin 0 -> 16473 bytes ui/static/img/vaultwarden.png | Bin 0 -> 8897 bytes ui/static/img/wireguard.png | Bin 0 -> 23933 bytes ui/static/img/wordpress.png | Bin 0 -> 34705 bytes 25 files changed, 141 insertions(+), 30 deletions(-) create mode 100644 ui/html/pages/404.tmpl.html create mode 100644 ui/html/pages/vpn.tmpl.html create mode 100644 ui/static/img/baserow.png create mode 100644 ui/static/img/bookstack.png create mode 100644 ui/static/img/castopod.png create mode 100644 ui/static/img/element.png create mode 100644 ui/static/img/espo.png create mode 100644 ui/static/img/freescout.png create mode 100644 ui/static/img/gitea.png create mode 100644 ui/static/img/jitsi.png create mode 100644 ui/static/img/listmonk.png create mode 100644 ui/static/img/nextcloud.png create mode 100644 ui/static/img/powerdns.png create mode 100644 ui/static/img/users.png create mode 100644 ui/static/img/vaultwarden.png create mode 100644 ui/static/img/wireguard.png create mode 100644 ui/static/img/wordpress.png diff --git a/cmd/web/app-links.go b/cmd/web/app-links.go index d1e8b3c..67e789e 100644 --- a/cmd/web/app-links.go +++ b/cmd/web/app-links.go @@ -24,21 +24,27 @@ func getStarterLinks(baseUri string) []AppLink { { Title: "User Management", Description: "Create users and manage their access", - Image: "/img/panel.jpg", + Image: "/static/img/users.png", Url: "https://panel." + baseUri, }, { Title: "Nextcloud", Description: "Email, Files, Documents", - Image: "/img/nextcloud.jpg", + Image: "/static/img/nextcloud.png", Url: "https://nextcloud." + baseUri, }, { Title: "Vaultwarden", Description: "Password Management", - Image: "/img/vaultwarden.jpg", + Image: "/static/img/vaultwarden.png", Url: "https://vaultwarden." + baseUri, }, + { + Title: "Power DNS", + Description: "DNS Management", + Image: "/static/img/powerdns.png", + Url: "https://powerdns." + baseUri, + }, } } @@ -47,13 +53,13 @@ func getCreatorLinks(baseUri string) []AppLink { { Title: "Element and Matrix", Description: "Team Chat", - Image: "/img/element.jpg", + Image: "/static/img/element.png", Url: "https://element." + baseUri, }, { Title: "Wordpress", Description: "Your website", - Image: "/img/wordpress.jpg", + Image: "/static/img/wordpress.png", Url: "https://" + baseUri, }, } @@ -66,13 +72,13 @@ func getTeamsLinks(baseUri string) []AppLink { { Title: "Espo CRM", Description: "Customer relationship manager", - Image: "/img/espo.jpg", + Image: "/static/img/espo.png", Url: "https://espocrm." + baseUri, }, { Title: "FreeScout", Description: "Customer Help Desk", - Image: "/img/freescout.jpg", + Image: "/static/img/freescout.png", Url: "https://freescout." + baseUri, }, } @@ -85,37 +91,37 @@ func getEnterpriseLinks(baseUri string) []AppLink { { Title: "Jitsi", Description: "Video Chat", - Image: "/img/jitsi.jpg", + Image: "/static/img/jitsi.png", Url: "https://jitsi." + baseUri, }, { Title: "Listmonk", Description: "Email Marketing", - Image: "/img/listmonk.jpg", + Image: "/static/img/listmonk.png", Url: "https://listmonk." + baseUri, }, { Title: "Baserow", Description: "Visual Databases", - Image: "/img/baserow.jpg", + Image: "/static/img/baserow.png", Url: "https://baserow." + baseUri, }, { Title: "Bookstack", Description: "Wiki Knowledgebase", - Image: "/img/bookstack.jpg", + Image: "/static/img/bookstack.png", Url: "https://bookstack." + baseUri, }, { Title: "Gitea", Description: "GIT Source Control", - Image: "/img/gitea.jpg", + Image: "/static/img/gitea.png", Url: "https://gitea." + baseUri, }, { Title: "Castopod", Description: "Podcast Distribution", - Image: "/img/castopod.jpg", + Image: "/static/img/castopod.png", Url: "https://castopod." + baseUri, }, } diff --git a/cmd/web/handlers.go b/cmd/web/handlers.go index 7056a72..660bf74 100644 --- a/cmd/web/handlers.go +++ b/cmd/web/handlers.go @@ -22,4 +22,12 @@ func (app *application) home(writer http.ResponseWriter, request *http.Request) } app.render(writer, request, http.StatusOK, "home.tmpl.html", data) +} + +func (app *application) notFound(writer http.ResponseWriter, request *http.Request) { + app.render(writer, request, http.StatusNotFound, "404.tmpl.html", templateData{}) +} + +func (app *application) vpn(writer http.ResponseWriter, request *http.Request) { + app.render(writer, request, http.StatusOK, "vpn.tmpl.html", templateData{}) } \ No newline at end of file diff --git a/cmd/web/main.go b/cmd/web/main.go index 0956d40..e12135c 100644 --- a/cmd/web/main.go +++ b/cmd/web/main.go @@ -8,6 +8,11 @@ import ( "flag" ) +//TODO Get images for each app +//TODO Stylesheet +//TODO VPN Page +//TODO Auth through LDAP for VPN page + type application struct { logger *slog.Logger templateCache map[string]*template.Template diff --git a/cmd/web/routes.go b/cmd/web/routes.go index 318b241..61624cc 100644 --- a/cmd/web/routes.go +++ b/cmd/web/routes.go @@ -9,6 +9,8 @@ func (app *application) routes() *http.ServeMux { mux.Handle("GET /static/", http.StripPrefix("/static", fileServer)) //Set up routes mux.HandleFunc("GET /{$}", app.home) - + mux.HandleFunc("GET /", app.notFound) + mux.HandleFunc("GET /vpn/{$}", app.vpn) + return mux } \ No newline at end of file diff --git a/ui/html/base.tmpl.html b/ui/html/base.tmpl.html index 4242fb9..6d8271c 100644 --- a/ui/html/base.tmpl.html +++ b/ui/html/base.tmpl.html @@ -5,17 +5,20 @@ Federated Core Dashboard + + + -
-

Federated Computer

+
+

Federated Core

{{template "nav" .}} -
+
{{template "main" .}}
-