From 9cf4401f13be88b6a4d13aa034ca17aa3ffc5ce3 Mon Sep 17 00:00:00 2001 From: oberon Date: Sat, 14 Feb 2026 11:53:58 +0100 Subject: [PATCH] change highlight.js to language-bash --- static/js/highlight.log.js | 12 ++++++++++++ templates/admin_logs.html | 27 ++++++++++++++++++++++++++- templates/base.html | 1 + 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 static/js/highlight.log.js diff --git a/static/js/highlight.log.js b/static/js/highlight.log.js new file mode 100644 index 0000000..66809d6 --- /dev/null +++ b/static/js/highlight.log.js @@ -0,0 +1,12 @@ +// static/js/highlight.log.js +hljs.registerLanguage('log', function(hljs) { + return { + contains: [ + { className: 'timestamp', begin: /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/, relevance: 10 }, + { className: 'level', begin: /\| (INFO|WARNING|ERROR|DEBUG|CRITICAL) +\|/, relevance: 10 }, + { className: 'traceback', begin: /Traceback/, end: /$/, contains: [hljs.BACKSLASH_ESCAPE] }, + hljs.QUOTE_STRING_MODE, + hljs.NUMBER_MODE + ] + }; +}); \ No newline at end of file diff --git a/templates/admin_logs.html b/templates/admin_logs.html index ae92e4a..2ebf8e0 100644 --- a/templates/admin_logs.html +++ b/templates/admin_logs.html @@ -15,12 +15,37 @@ {% endfor %} - + + +
+  
+{{ logs | safe }}
+  
+
+ + Zurück zum Admin diff --git a/templates/base.html b/templates/base.html index 9b04dd8..b7d47cd 100644 --- a/templates/base.html +++ b/templates/base.html @@ -14,6 +14,7 @@ +