Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion pi/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,12 @@ def do_DELETE(self):
if path == "/api/udplog":
_udp_log.clear()
self._send_json({"ok": True})
elif path == "/api/log":
# The dashboard "Clear" button only emptied the browser DOM; the next
# poll re-fetched the retained entries so the activity log reappeared.
# Clear the server-side log so the Clear actually sticks.
activity_log.clear()
self._send_json({"ok": True})
Comment on lines +1736 to +1741
elif path == "/api/firmware/delete":
self._handle_firmware_delete()
else:
Expand Down Expand Up @@ -3616,7 +3622,10 @@ def _serve_ui(self):
setTimeout(() => { btn.disabled = false; btn.textContent = 'Enter Captive Portal'; }, 30000);
}

function clearLog() {
async function clearLog() {
// Clear the server-side log first, else the next poll re-fetches the retained
// entries (resetting lastLogTs alone pulls the whole log back).
try { await fetch('/api/log', { method: 'DELETE' }); } catch (e) { /* ignore */ }
document.getElementById('log-entries').innerHTML = '';
lastLogTs = '';
}
Comment on lines +3625 to 3631
Expand Down