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() { function renderLogs() {
logDirty = false; logDirty = false;
const body = document.getElementById('log-body'); const body = document.getElementById('log-body');
const showService = document.getElementById('lf-service').checked;
const showDebug = document.getElementById('lf-debug').checked; const showDebug = document.getElementById('lf-debug').checked;
const showInfo = document.getElementById('lf-info').checked; const showInfo = document.getElementById('lf-info').checked;
const showWarn = document.getElementById('lf-warn').checked; const showWarn = document.getElementById('lf-warn').checked;
@@ -1197,6 +1198,7 @@ function renderLogs() {
const visible = logs.filter(l => { const visible = logs.filter(l => {
const lv = l.level; const lv = l.level;
if ((lv==='CMD' || lv==='RESP') && !showService) return false;
if (lv==='DEBUG' && !showDebug) return false; if (lv==='DEBUG' && !showDebug) return false;
if ((lv==='INFO'||lv==='Information') && !showInfo) return false; if ((lv==='INFO'||lv==='Information') && !showInfo) return false;
if ((lv==='WARNING'||lv==='Warning') && !showWarn) 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> </head>
<body> <body>
<div id="app"> <div id="app">
<!-- ═══ TOOLBAR ═══ --> <!-- ═══ TOOLBAR ═══ -->
<div id="toolbar"> <div id="toolbar">
<!-- Connection menu --> <!-- Connection menu -->
<div class="menu-wrap tb-group"> <div class="menu-wrap tb-group">
<button id="conn-menu-btn" onclick="toggleMenu('conn-dropdown')"> <button id="conn-menu-btn" onclick="toggleMenu('conn-dropdown')">
<span id="conn-status"></span> Connection ▾ <span id="conn-status"></span>
Connection ▾
</button> </button>
<div class="dropdown" id="conn-dropdown"> <div class="dropdown" id="conn-dropdown">
<div class="menu-row"> <div class="menu-row">
@@ -202,7 +201,6 @@ select{background:#313244;border:1px solid #45475a;color:#cdd6f4;padding:2px 4px
</div> </div>
</div> </div>
</div> </div>
<div class="tb-group"> <div class="tb-group">
<button id="btn-pause" onclick="togglePause()">⏸ Pause</button> <button id="btn-pause" onclick="togglePause()">⏸ Pause</button>
<button onclick="openStepDialog()">⚙ Step</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> <span id="udp-stats" style="color:#585b70;font-size:11px">0 pkts</span>
</div> </div>
</div> </div>
<!-- ═══ STEP STATUS BAR ═══ --> <!-- ═══ STEP STATUS BAR ═══ -->
<div id="step-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> <span id="step-remaining"></span>
<select id="step-thread" style="width:120px"></select> <select id="step-thread" style="width:120px"></select>
<button onclick="step(1)">Step 1</button> <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 onclick="step(20)">Step 20</button>
<button class="ok" onclick="togglePause()">▶ Resume</button> <button class="ok" onclick="togglePause()">▶ Resume</button>
</div> </div>
<!-- ═══ MAIN ═══ --> <!-- ═══ MAIN ═══ -->
<div id="main"> <div id="main">
<!-- LEFT: object tree --> <!-- LEFT: object tree -->
<div id="left-panel"> <div id="left-panel">
<div class="panel-header"> <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 class="empty-hint">Connect to MARTe2 then click Tree</div>
</div> </div>
</div> </div>
<!-- Left resize/collapse strip --> <!-- Left resize/collapse strip -->
<div id="left-strip" class="panel-strip" title="Drag to resize · Click to collapse"></div> <div id="left-strip" class="panel-strip" title="Drag to resize · Click to collapse"></div>
<!-- CENTER: plots --> <!-- CENTER: plots -->
<div id="center-panel"> <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 class="empty-hint" id="no-plots-hint">Add a plot panel to begin — drag signals from the tree or traced list</div>
</div> </div>
<!-- Right resize/collapse strip --> <!-- Right resize/collapse strip -->
<div id="right-strip" class="panel-strip" title="Drag to resize · Click to collapse"></div> <div id="right-strip" class="panel-strip" title="Drag to resize · Click to collapse"></div>
<!-- RIGHT: tabs --> <!-- RIGHT: tabs -->
<div id="right-panel"> <div id="right-panel">
<div class="tabs"> <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 class="empty-hint" id="no-msgs-hint">No messages sent</div>
</div> </div>
</div> </div>
</div> </div>
<!-- ═══ LOGS ═══ --> <!-- ═══ LOGS ═══ -->
<div id="log-panel"> <div id="log-panel">
<div id="log-toolbar"> <div id="log-toolbar">
<button class="panel-toggle" title="Collapse logs" onclick="togglePanel('log-panel','▼','▲',this)" id="log-toggle-btn"></button> <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> <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-service" checked onchange="renderLogs()">
<label><input type="checkbox" id="lf-info" checked onchange="renderLogs()"> Info</label> Service</label>
<label><input type="checkbox" id="lf-warn" checked onchange="renderLogs()"> Warn</label> <label><input type="checkbox" id="lf-debug" checked onchange="renderLogs()">
<label><input type="checkbox" id="lf-error" checked onchange="renderLogs()"> Error</label> 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"> <input type="text" id="log-filter" placeholder="Filter…" oninput="renderLogs()" style="width:150px">
<button onclick="logs=[];renderLogs()" style="margin-left:auto">Clear</button> <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>
<div id="log-body"></div> <div id="log-body"></div>
</div> </div>
</div><!-- #app --> </div><!-- #app -->
<!-- ═══ DIALOGS ═══ --> <!-- ═══ DIALOGS ═══ -->
<!-- Force dialog --> <!-- Force dialog -->
<div class="dialog-overlay" id="dlg-force" style="display:none" onclick="if(event.target===this)closeDlg('dlg-force')"> <div class="dialog-overlay" id="dlg-force" style="display:none" onclick="if(event.target===this)closeDlg('dlg-force')">
<div class="dialog"> <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 onclick="closeDlg('dlg-force')">Cancel</button>
<button class="active" onclick="doForce()">Force</button> <button class="active" onclick="doForce()">Force</button>
</div> </div>
</div></div> </div>
</div>
<!-- Unforce confirm --> <!-- Unforce confirm -->
<div class="dialog-overlay" id="dlg-unforce" style="display:none" onclick="if(event.target===this)closeDlg('dlg-unforce')"> <div class="dialog-overlay" id="dlg-unforce" style="display:none" onclick="if(event.target===this)closeDlg('dlg-unforce')">
<div class="dialog"> <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 onclick="closeDlg('dlg-unforce')">Cancel</button>
<button class="danger" onclick="doUnforce()">Unforce</button> <button class="danger" onclick="doUnforce()">Unforce</button>
</div> </div>
</div></div> </div>
</div>
<!-- Break dialog --> <!-- Break dialog -->
<div class="dialog-overlay" id="dlg-break" style="display:none" onclick="if(event.target===this)closeDlg('dlg-break')"> <div class="dialog-overlay" id="dlg-break" style="display:none" onclick="if(event.target===this)closeDlg('dlg-break')">
<div class="dialog"> <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 onclick="closeDlg('dlg-break')">Cancel</button>
<button class="active" onclick="doBreak()">Set Break</button> <button class="active" onclick="doBreak()">Set Break</button>
</div> </div>
</div></div> </div>
</div>
<!-- Message dialog --> <!-- Message dialog -->
<div class="dialog-overlay" id="dlg-msg" style="display:none" onclick="if(event.target===this)closeDlg('dlg-msg')"> <div class="dialog-overlay" id="dlg-msg" style="display:none" onclick="if(event.target===this)closeDlg('dlg-msg')">
<div class="dialog"> <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 onclick="closeDlg('dlg-msg')">Cancel</button>
<button class="active" onclick="doSendMsg()">Send</button> <button class="active" onclick="doSendMsg()">Send</button>
</div> </div>
</div></div> </div>
</div>
<!-- Info dialog --> <!-- Info dialog -->
<div class="dialog-overlay" id="dlg-info" style="display:none" onclick="if(event.target===this)closeDlg('dlg-info')"> <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"> <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"> <div class="btns" style="margin-top:12px">
<button onclick="closeDlg('dlg-info')">Close</button> <button onclick="closeDlg('dlg-info')">Close</button>
</div> </div>
</div></div> </div>
</div>
<!-- Step dialog --> <!-- Step dialog -->
<div class="dialog-overlay" id="dlg-step" style="display:none" onclick="if(event.target===this)closeDlg('dlg-step')"> <div class="dialog-overlay" id="dlg-step" style="display:none" onclick="if(event.target===this)closeDlg('dlg-step')">
<div class="dialog"> <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 onclick="closeDlg('dlg-step')">Cancel</button>
<button class="active" onclick="doStep()">Step</button> <button class="active" onclick="doStep()">Step</button>
</div> </div>
</div></div> </div>
</div>
<script src="uplot.min.js"></script> <script src="uplot.min.js"></script>
<script src="app.js"></script> <script src="app.js"></script>
</body> </body>