From 5e6ef5508bbd847e9100d1ce75ac248f0895c120 Mon Sep 17 00:00:00 2001 From: frack113 <62423083+frack113@users.noreply.github.com> Date: Thu, 10 Sep 2026 07:28:02 +0200 Subject: [PATCH 1/4] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20shared=20r?= =?UTF-8?q?epo=20section=20template,=20DOMPurify=20chat=20sanitization,=20?= =?UTF-8?q?and=20CSS=20modularization?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/routes/page_admin.py | 4 +- src/api/routes/page_logs.py | 5 +- src/presentation/static/css/base/local.css | 103 +++++++ src/presentation/static/css/base/theme.css | 161 ++++------ .../static/css/base/utilities.css | 41 +++ .../static/css/components/forms.css | 51 ++++ src/presentation/static/css/config.css | 79 ----- .../static/css/layout/header-nav.css | 74 +---- .../static/css/layout/sidebar.css | 29 ++ src/presentation/static/css/pages/chat.css | 9 + .../static/js/external/dompurify.min.js | 3 + src/presentation/static/js/internal/chat.js | 73 +++-- src/presentation/static/js/internal/local.js | 185 ++++++++++++ .../static/js/internal/notifications.js | 8 + .../static/js/internal/repo-browser.js | 54 +++- src/presentation/templates/chat/index.html.j2 | 5 +- .../templates/config/config.html.j2 | 24 +- .../templates/dashboard/base.html.j2 | 2 +- src/presentation/templates/data/base.html.j2 | 2 +- .../templates/data/github.html.j2 | 56 +--- src/presentation/templates/data/local.html.j2 | 283 +----------------- .../templates/data/prompts.html.j2 | 18 +- .../templates/data/sigma_spec.html.j2 | 57 +--- .../templates/data/vectordb.html.j2 | 2 +- src/presentation/templates/logs/base.html.j2 | 2 +- .../templates/shared/_header.html.j2 | 36 ++- .../templates/shared/_repo_section.html.j2 | 47 +++ .../templates/shared/layout.html.j2 | 7 +- 28 files changed, 713 insertions(+), 707 deletions(-) create mode 100644 src/presentation/static/css/base/local.css create mode 100644 src/presentation/static/css/base/utilities.css create mode 100644 src/presentation/static/js/external/dompurify.min.js create mode 100644 src/presentation/static/js/internal/local.js create mode 100644 src/presentation/templates/shared/_repo_section.html.j2 diff --git a/src/api/routes/page_admin.py b/src/api/routes/page_admin.py index 2b2a658..a64985f 100644 --- a/src/api/routes/page_admin.py +++ b/src/api/routes/page_admin.py @@ -21,10 +21,12 @@ async def config_page(request: Request): """Serve the unified config dashboard page.""" cfg = get_config().to_dict() + # Escape "" so embedded JSON cannot break out of the + diff --git a/src/presentation/templates/config/config.html.j2 b/src/presentation/templates/config/config.html.j2 index f84595b..ab6961c 100644 --- a/src/presentation/templates/config/config.html.j2 +++ b/src/presentation/templates/config/config.html.j2 @@ -1,7 +1,7 @@ {# Config Dashboard — sections with side-by-side cards #} {% extends "config/layout.html.j2" %} -{% block title %}Config - SigmaHQ RAG{% endblock %} +{% block title %}Config — SigmaHQ RAG{% endblock %} {% block styles %} @@ -102,9 +102,9 @@
or click to browse (supported: .md, .txt, .yml, .yaml, .json, etc.)
@@ -159,181 +62,5 @@ {% endblock %} {% block scripts %} - -{% endblock %} + +{% endblock %} \ No newline at end of file diff --git a/src/presentation/templates/data/prompts.html.j2 b/src/presentation/templates/data/prompts.html.j2 index 21a52c6..256e206 100644 --- a/src/presentation/templates/data/prompts.html.j2 +++ b/src/presentation/templates/data/prompts.html.j2 @@ -1,6 +1,6 @@ {% extends "data/base.html.j2" %} -{% block title %}Prompts | Data Sources | SigmaHQ RAG{% endblock %} +{% block title %}Prompts — SigmaHQ RAG{% endblock %} {% block content %}