From ca0ba37be597fc1d42c365d66f16e35a433beca8 Mon Sep 17 00:00:00 2001 From: MarekWo Date: Fri, 20 Mar 2026 20:41:20 +0100 Subject: [PATCH] fix(logs): open System Log as fullscreen modal like Console Changed from target="_blank" link to fullscreen modal with iframe, matching the pattern used by Console, DM, and Contacts modals. Iframe loads on open and clears on close to manage WebSocket lifecycle. Co-Authored-By: Claude Opus 4.6 --- app/templates/base.html | 4 ++-- app/templates/index.html | 37 +++++++++++++++++++++++++++++++++++++ app/templates/logs.html | 8 ++------ 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/app/templates/base.html b/app/templates/base.html index f3c9d03..aa412bd 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -133,13 +133,13 @@ Direct meshcli commands - + + + + + + {% endblock %} {% block extra_scripts %} @@ -302,6 +322,23 @@ } }); } + + // System Log modal - load iframe on open, clear on close + const logsModal = document.getElementById('logsModal'); + if (logsModal) { + logsModal.addEventListener('show.bs.modal', function () { + const logsFrame = document.getElementById('logsFrame'); + if (logsFrame) { + logsFrame.src = '/logs'; + } + }); + logsModal.addEventListener('hidden.bs.modal', function () { + const logsFrame = document.getElementById('logsFrame'); + if (logsFrame) { + logsFrame.src = ''; // disconnect WebSocket when closed + } + }); + } }); {% endblock %} diff --git a/app/templates/logs.html b/app/templates/logs.html index a6e331f..48235b4 100644 --- a/app/templates/logs.html +++ b/app/templates/logs.html @@ -151,15 +151,11 @@
-
- - - -
System Log
-
0 entries +
+