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 %}