From 208d7d7a57b283999c9711ff6bab696d1dab40d4 Mon Sep 17 00:00:00 2001 From: Drath Date: Mon, 29 Dec 2025 16:10:32 +0100 Subject: [PATCH] add errir cides --- README.md | 2 -- app/main.py | 4 ++++ app/templates/error.html.j2 | 17 ++++++++++++++++ app/templates/index.css | 40 ++++++++++++++++++++++++++++++++----- 4 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 app/templates/error.html.j2 diff --git a/README.md b/README.md index c4fecca..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,2 +0,0 @@ -# todo -waitress \ No newline at end of file diff --git a/app/main.py b/app/main.py index 287509f..94cb98a 100644 --- a/app/main.py +++ b/app/main.py @@ -39,6 +39,10 @@ def opnsense(): def server(): return str(isUp("10.0.1.200")) +@app.route('/http/') +def httpcodes(status): + return render_template('error.html.j2', status=status, host="10.0.0.102") + if __name__ == '__main__': if isProdution: print("Starting waitress server") diff --git a/app/templates/error.html.j2 b/app/templates/error.html.j2 new file mode 100644 index 0000000..3e20317 --- /dev/null +++ b/app/templates/error.html.j2 @@ -0,0 +1,17 @@ + + + {{ url }} + + + + + +

oops.

+
+ We got HTTP status {{ status }} +
+ + + diff --git a/app/templates/index.css b/app/templates/index.css index fcad717..8f74aac 100644 --- a/app/templates/index.css +++ b/app/templates/index.css @@ -1,11 +1,18 @@ body { font-family: Arial, Helvetica, sans-serif; font-weight: 700; + font-size: min(10vw, 4em); background-color: #e5e5e5; color: #0a0a0a; } -h1, a { +.accent, +a:hover { + color: #bf1f22; +} + +h1, +a { letter-spacing: -0.08em; } @@ -19,18 +26,24 @@ h1 { a { text-decoration: none; - font-size: min(10vw,4em); - color: #0a0a0a; + color: inherit; position: relative; padding-right: 1rem; &:hover { - color: #bf1f22; text-decoration: underline; } } -#links { +footer { + font-size: 18px; + opacity: 20%; + position: absolute; + bottom: 0px; +} + +#links, +#content { display: flex; flex-direction: row; gap: 1rem; @@ -62,4 +75,21 @@ a { #links a::after { display: none; } +} + +@media (prefers-color-scheme: dark) { + + .accent, + a:hover { + color: #a4133c; + } + + body { + color: #c1c1c1; + background-color: #1a1a1a; + } + + #links a:not(:last-child)::after { + background-color: rgb(240, 240, 240); + } } \ No newline at end of file