From b413c66ca4182843d9d13ea76489ca1b579d4a99 Mon Sep 17 00:00:00 2001 From: zwitschi Date: Mon, 1 Jun 2026 12:44:36 +0200 Subject: [PATCH] feat: Refactor dashboard template to extend base layout and improve structure --- web/templates/base.html | 154 ++++++++++-- web/templates/dashboard.html | 460 ++++++++++++----------------------- 2 files changed, 287 insertions(+), 327 deletions(-) diff --git a/web/templates/base.html b/web/templates/base.html index 2a7f813..4155859 100644 --- a/web/templates/base.html +++ b/web/templates/base.html @@ -3,44 +3,146 @@ - {{ title or "Arbitrade" }} + {% block title %}{{ title or "Arbitrade" }}{% endblock %} + {% block head_scripts %}{% endblock %} + {% block extra_style %}{% endblock %} -
{% block content %}{% endblock %}
+
+ {% block content %}{% endblock %} +
+ {% block scripts %}{% endblock %} diff --git a/web/templates/dashboard.html b/web/templates/dashboard.html index d35a9ea..e7c2ca1 100644 --- a/web/templates/dashboard.html +++ b/web/templates/dashboard.html @@ -1,311 +1,169 @@ - - - - - - {{ title }} - - - - - - -
-
-
-

Arbitrade Dashboard

-

Live execution, P&L, and system state.

-
- -
+{% extends "base.html" %} {% block title %}{{ title }}{% endblock %} {% block +head_scripts %} + + +{% endblock %} {% block main_class %}shell{% endblock %} {% block content %} +
+
+

Arbitrade Dashboard

+

Live execution, P&L, and system state.

+
+ +
-
- {% include "partials/metrics.html" %} -
+
+ {% include "partials/metrics.html" %} +
-
- {% include "partials/overview.html" %} -
+
+ {% include "partials/overview.html" %} +
-
- {% include "partials/controls.html" %} -
+
+ {% include "partials/controls.html" %} +
-
- {% include "partials/charts.html" %} -
+
+ {% include "partials/charts.html" %} +
+{% endblock %} {% block scripts %} + -
- - + const stream = new EventSource("{{ stream_endpoint }}"); + stream.addEventListener("metrics", (event) => { + const panel = document.getElementById("metrics-panel"); + if (panel) { + panel.outerHTML = JSON.parse(event.data); + } + }); + const overviewStream = new EventSource("{{ overview_stream_endpoint }}"); + overviewStream.addEventListener("overview", (event) => { + const panel = document.getElementById("overview-panel"); + if (panel) { + panel.outerHTML = JSON.parse(event.data); + } + }); + +{% endblock %}