Remove all inline event handlers; replace with data-action delegation
Lint / Python (flake8) (push) Skipped
Lint / JS (eslint) (push) Skipped

- inspector.html: onclick on port blocks, close button, run-diagnostic button,
  and diag-toggle sections all converted to data-action attributes; single
  delegated click listener handles all cases + Escape key closes panel
- links.html: onclick on panel title headers, Collapse All, Expand All
  converted to data-action with delegated listener
- suppressions.html: onsubmit/onchange wired via addEventListener at init
- index.html: onsubmit/onchange on suppress modal form wired at init

No behavioural changes — pure event-handling refactor for TDS compliance.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-29 17:53:48 -04:00
co-authored by Claude Sonnet 4.6
parent 3a9cc472e1
commit d05deb6ccd
4 changed files with 42 additions and 15 deletions
+4 -2
View File
@@ -399,11 +399,11 @@
<h3 class="lt-modal-title" id="suppress-modal-title">Suppress Alert</h3>
<button type="button" class="lt-modal-close" data-modal-close aria-label="Close"></button>
</div>
<form id="suppress-form" onsubmit="submitSuppress(event)">
<form id="suppress-form">
<div class="lt-modal-body">
<div class="lt-form-group" style="margin-bottom:12px">
<label class="lt-label" for="sup-type">Target Type</label>
<select class="lt-select" id="sup-type" name="target_type" onchange="updateSuppressForm()">
<select class="lt-select" id="sup-type" name="target_type">
<option value="host">Host (all interfaces)</option>
<option value="interface">Specific Interface</option>
<option value="unifi_device">UniFi Device</option>
@@ -449,6 +449,8 @@
{% block scripts %}
<script>
lt.autoRefresh.start(refreshAll, 30000);
document.getElementById('suppress-form')?.addEventListener('submit', submitSuppress);
document.getElementById('sup-type')?.addEventListener('change', updateSuppressForm);
function updateEventAges() {
document.querySelectorAll('.event-age[data-ts]').forEach(el => {