From 634c03e1c668d83693ff5105f88ad1a57903564a Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Sat, 23 Aug 2025 13:37:12 +0300 Subject: [PATCH] appview/pages: better error page styles Signed-off-by: Anirudh Oppiliappan --- appview/middleware/middleware.go | 2 +- appview/pages/templates/errors/404.html | 28 ++++++++++++--- appview/pages/templates/errors/500.html | 39 +++++++++++++++++++-- appview/pages/templates/errors/503.html | 33 ++++++++++++++--- appview/pages/templates/errors/knot404.html | 29 ++++++++++++--- 5 files changed, 113 insertions(+), 18 deletions(-) diff --git a/appview/middleware/middleware.go b/appview/middleware/middleware.go index 7a32032c..093329d0 100644 --- a/appview/middleware/middleware.go +++ b/appview/middleware/middleware.go @@ -217,7 +217,7 @@ func (mw Middleware) ResolveRepo() middlewareFunc { if err != nil { // invalid did or handle log.Println("failed to resolve repo") - mw.pages.Error404(w) + mw.pages.ErrorKnot404(w) return } diff --git a/appview/pages/templates/errors/404.html b/appview/pages/templates/errors/404.html index 1f8b2681..36bdece0 100644 --- a/appview/pages/templates/errors/404.html +++ b/appview/pages/templates/errors/404.html @@ -1,8 +1,28 @@ {{ define "title" }}404 · tangled{{ end }} {{ define "content" }} -

404 — nothing like that here!

-

- It seems we couldn't find what you were looking for. Sorry about that! -

+
+
+
+
+ {{ i "search-x" "w-8 h-8 text-gray-400 dark:text-gray-500" }} +
+
+ +
+

+ 404 — page not found +

+

+ The page you're looking for doesn't exist. It may have been moved, deleted, or you have the wrong URL. +

+ +
+
+
{{ end }} diff --git a/appview/pages/templates/errors/500.html b/appview/pages/templates/errors/500.html index 14709f29..feb3e170 100644 --- a/appview/pages/templates/errors/500.html +++ b/appview/pages/templates/errors/500.html @@ -1,6 +1,39 @@ {{ define "title" }}500 · tangled{{ end }} {{ define "content" }} -

500 — something broke!

-

We're working on getting service back up. Hang tight!

-{{ end }} +
+
+
+
+ {{ i "alert-triangle" "w-8 h-8 text-red-500 dark:text-red-400" }} +
+
+ +
+

+ 500 — internal server error +

+

+ Something went wrong on our end. We've been notified and are working to fix the issue. +

+
+
+ {{ i "info" "w-4 h-4" }} + we're on it! +
+

Our team has been automatically notified about this error.

+
+
+ + + {{ i "home" "w-4 h-4" }} + back to home + +
+
+
+
+{{ end }} \ No newline at end of file diff --git a/appview/pages/templates/errors/503.html b/appview/pages/templates/errors/503.html index 17254799..5f9a9211 100644 --- a/appview/pages/templates/errors/503.html +++ b/appview/pages/templates/errors/503.html @@ -1,9 +1,32 @@ {{ define "title" }}503 · tangled{{ end }} {{ define "content" }} -

503 — unable to reach knot

-

- We were unable to reach the knot hosting this repository. Try again - later. -

+
+
+
+
+ {{ i "server-off" "w-8 h-8 text-blue-500 dark:text-blue-400" }} +
+
+ +
+

+ 503 — service unavailable +

+

+ We were unable to reach the knot hosting this repository. The service may be temporarily unavailable. +

+
+ + + {{ i "arrow-left" "w-4 h-4" }} + back to timeline + +
+
+
+
{{ end }} diff --git a/appview/pages/templates/errors/knot404.html b/appview/pages/templates/errors/knot404.html index dcda54b6..00246b24 100644 --- a/appview/pages/templates/errors/knot404.html +++ b/appview/pages/templates/errors/knot404.html @@ -1,9 +1,28 @@ {{ define "title" }}404 · tangled{{ end }} {{ define "content" }} -

404 — repository not found!

-

- The repository you were looking for could not be found. - The knot serving the repository may be unavailable. -

+
+
+
+
+ {{ i "book-x" "w-8 h-8 text-orange-500 dark:text-orange-400" }} +
+
+ +
+

+ 404 — repository not found +

+

+ The repository you were looking for could not be found. The knot serving the repository may be unavailable. +

+ +
+
+
{{ end }} -- 2.51.2