minor improvement: filtering service logs

This commit is contained in:
Martino Ferrari
2026-05-20 17:39:53 +02:00
parent 74816028a8
commit 58abf98eea
3 changed files with 241 additions and 245 deletions
Binary file not shown.
+2
View File
@@ -1189,6 +1189,7 @@ function flushLogs() {
function renderLogs() {
logDirty = false;
const body = document.getElementById('log-body');
const showService = document.getElementById('lf-service').checked;
const showDebug = document.getElementById('lf-debug').checked;
const showInfo = document.getElementById('lf-info').checked;
const showWarn = document.getElementById('lf-warn').checked;
@@ -1197,6 +1198,7 @@ function renderLogs() {
const visible = logs.filter(l => {
const lv = l.level;
if ((lv==='CMD' || lv==='RESP') && !showService) return false;
if (lv==='DEBUG' && !showDebug) return false;
if ((lv==='INFO'||lv==='Information') && !showInfo) return false;
if ((lv==='WARNING'||lv==='Warning') && !showWarn) return false;
+28 -34
View File
@@ -167,14 +167,13 @@ select{background:#313244;border:1px solid #45475a;color:#cdd6f4;padding:2px 4px
</head>
<body>
<div id="app">
<!-- ═══ TOOLBAR ═══ -->
<div id="toolbar">
<!-- Connection menu -->
<div class="menu-wrap tb-group">
<button id="conn-menu-btn" onclick="toggleMenu('conn-dropdown')">
<span id="conn-status"></span> Connection ▾
<span id="conn-status"></span>
Connection ▾
</button>
<div class="dropdown" id="conn-dropdown">
<div class="menu-row">
@@ -202,7 +201,6 @@ select{background:#313244;border:1px solid #45475a;color:#cdd6f4;padding:2px 4px
</div>
</div>
</div>
<div class="tb-group">
<button id="btn-pause" onclick="togglePause()">⏸ Pause</button>
<button onclick="openStepDialog()">⚙ Step</button>
@@ -219,10 +217,10 @@ select{background:#313244;border:1px solid #45475a;color:#cdd6f4;padding:2px 4px
<span id="udp-stats" style="color:#585b70;font-size:11px">0 pkts</span>
</div>
</div>
<!-- ═══ STEP STATUS BAR ═══ -->
<div id="step-bar">
<span>⏹ PAUSED at <b id="paused-gam"></b></span>
<span>⏹ PAUSED at
<b id="paused-gam"></b></span>
<span id="step-remaining"></span>
<select id="step-thread" style="width:120px"></select>
<button onclick="step(1)">Step 1</button>
@@ -230,10 +228,8 @@ select{background:#313244;border:1px solid #45475a;color:#cdd6f4;padding:2px 4px
<button onclick="step(20)">Step 20</button>
<button class="ok" onclick="togglePause()">▶ Resume</button>
</div>
<!-- ═══ MAIN ═══ -->
<div id="main">
<!-- LEFT: object tree -->
<div id="left-panel">
<div class="panel-header">
@@ -245,18 +241,14 @@ select{background:#313244;border:1px solid #45475a;color:#cdd6f4;padding:2px 4px
<div class="empty-hint">Connect to MARTe2 then click Tree</div>
</div>
</div>
<!-- Left resize/collapse strip -->
<div id="left-strip" class="panel-strip" title="Drag to resize · Click to collapse"></div>
<!-- CENTER: plots -->
<div id="center-panel">
<div class="empty-hint" id="no-plots-hint">Add a plot panel to begin — drag signals from the tree or traced list</div>
</div>
<!-- Right resize/collapse strip -->
<div id="right-strip" class="panel-strip" title="Drag to resize · Click to collapse"></div>
<!-- RIGHT: tabs -->
<div id="right-panel">
<div class="tabs">
@@ -278,29 +270,31 @@ select{background:#313244;border:1px solid #45475a;color:#cdd6f4;padding:2px 4px
<div class="empty-hint" id="no-msgs-hint">No messages sent</div>
</div>
</div>
</div>
<!-- ═══ LOGS ═══ -->
<div id="log-panel">
<div id="log-toolbar">
<button class="panel-toggle" title="Collapse logs" onclick="togglePanel('log-panel','▼','▲',this)" id="log-toggle-btn"></button>
<span style="font-weight:600;color:#89b4fa">Logs</span>
<label><input type="checkbox" id="lf-debug" checked onchange="renderLogs()"> Debug</label>
<label><input type="checkbox" id="lf-info" checked onchange="renderLogs()"> Info</label>
<label><input type="checkbox" id="lf-warn" checked onchange="renderLogs()"> Warn</label>
<label><input type="checkbox" id="lf-error" checked onchange="renderLogs()"> Error</label>
<label><input type="checkbox" id="lf-service" checked onchange="renderLogs()">
Service</label>
<label><input type="checkbox" id="lf-debug" checked onchange="renderLogs()">
Debug</label>
<label><input type="checkbox" id="lf-info" checked onchange="renderLogs()">
Info</label>
<label><input type="checkbox" id="lf-warn" checked onchange="renderLogs()">
Warn</label>
<label><input type="checkbox" id="lf-error" checked onchange="renderLogs()">
Error</label>
<input type="text" id="log-filter" placeholder="Filter…" oninput="renderLogs()" style="width:150px">
<button onclick="logs=[];renderLogs()" style="margin-left:auto">Clear</button>
<label><input type="checkbox" id="log-autoscroll" checked> Auto-scroll</label>
<label><input type="checkbox" id="log-autoscroll" checked>
Auto-scroll</label>
</div>
<div id="log-body"></div>
</div>
</div><!-- #app -->
<!-- ═══ DIALOGS ═══ -->
<!-- Force dialog -->
<div class="dialog-overlay" id="dlg-force" style="display:none" onclick="if(event.target===this)closeDlg('dlg-force')">
<div class="dialog">
@@ -314,8 +308,8 @@ select{background:#313244;border:1px solid #45475a;color:#cdd6f4;padding:2px 4px
<button onclick="closeDlg('dlg-force')">Cancel</button>
<button class="active" onclick="doForce()">Force</button>
</div>
</div></div>
</div>
</div>
<!-- Unforce confirm -->
<div class="dialog-overlay" id="dlg-unforce" style="display:none" onclick="if(event.target===this)closeDlg('dlg-unforce')">
<div class="dialog">
@@ -325,8 +319,8 @@ select{background:#313244;border:1px solid #45475a;color:#cdd6f4;padding:2px 4px
<button onclick="closeDlg('dlg-unforce')">Cancel</button>
<button class="danger" onclick="doUnforce()">Unforce</button>
</div>
</div></div>
</div>
</div>
<!-- Break dialog -->
<div class="dialog-overlay" id="dlg-break" style="display:none" onclick="if(event.target===this)closeDlg('dlg-break')">
<div class="dialog">
@@ -352,8 +346,8 @@ select{background:#313244;border:1px solid #45475a;color:#cdd6f4;padding:2px 4px
<button onclick="closeDlg('dlg-break')">Cancel</button>
<button class="active" onclick="doBreak()">Set Break</button>
</div>
</div></div>
</div>
</div>
<!-- Message dialog -->
<div class="dialog-overlay" id="dlg-msg" style="display:none" onclick="if(event.target===this)closeDlg('dlg-msg')">
<div class="dialog">
@@ -373,8 +367,8 @@ select{background:#313244;border:1px solid #45475a;color:#cdd6f4;padding:2px 4px
<button onclick="closeDlg('dlg-msg')">Cancel</button>
<button class="active" onclick="doSendMsg()">Send</button>
</div>
</div></div>
</div>
</div>
<!-- Info dialog -->
<div class="dialog-overlay" id="dlg-info" style="display:none" onclick="if(event.target===this)closeDlg('dlg-info')">
<div class="dialog" style="max-width:600px;width:90vw">
@@ -383,8 +377,8 @@ select{background:#313244;border:1px solid #45475a;color:#cdd6f4;padding:2px 4px
<div class="btns" style="margin-top:12px">
<button onclick="closeDlg('dlg-info')">Close</button>
</div>
</div></div>
</div>
</div>
<!-- Step dialog -->
<div class="dialog-overlay" id="dlg-step" style="display:none" onclick="if(event.target===this)closeDlg('dlg-step')">
<div class="dialog">
@@ -404,8 +398,8 @@ select{background:#313244;border:1px solid #45475a;color:#cdd6f4;padding:2px 4px
<button onclick="closeDlg('dlg-step')">Cancel</button>
<button class="active" onclick="doStep()">Step</button>
</div>
</div></div>
</div>
</div>
<script src="uplot.min.js"></script>
<script src="app.js"></script>
</body>