Add filters in statistics view

This commit is contained in:
Ettore
2026-05-10 00:48:21 +02:00
parent ff097b31d1
commit 0264425383
4 changed files with 146 additions and 14 deletions

View File

@@ -206,6 +206,40 @@
<h3>Gate Access Log</h3>
<button id="btn-refresh-stats" class="btn btn-ghost" style="font-size:.85rem;padding:.5rem 1rem">↻ Refresh</button>
</div>
<!-- Filter bar -->
<div style="display:flex;flex-wrap:wrap;gap:.75rem;margin-bottom:1rem;align-items:flex-end">
<div style="display:flex;flex-direction:column;gap:.3rem">
<label style="font-size:.8rem;font-weight:600;color:var(--text-muted)">Keypass code</label>
<input id="filter-keypass" type="text" placeholder="Any"
style="width:140px;font-family:monospace;text-transform:uppercase" autocomplete="off" />
</div>
<div style="display:flex;flex-direction:column;gap:.3rem">
<label style="font-size:.8rem;font-weight:600;color:var(--text-muted)">Gate</label>
<select id="filter-gate" style="width:160px">
<option value="">Any</option>
</select>
</div>
<div style="display:flex;flex-direction:column;gap:.3rem">
<label style="font-size:.8rem;font-weight:600;color:var(--text-muted)">Result</label>
<select id="filter-success" style="width:110px">
<option value="">Any</option>
<option value="true">Success</option>
<option value="false">Failed</option>
</select>
</div>
<div style="display:flex;flex-direction:column;gap:.3rem">
<label style="font-size:.8rem;font-weight:600;color:var(--text-muted)">From</label>
<input id="filter-from" type="datetime-local" style="width:180px" />
</div>
<div style="display:flex;flex-direction:column;gap:.3rem">
<label style="font-size:.8rem;font-weight:600;color:var(--text-muted)">To</label>
<input id="filter-to" type="datetime-local" style="width:180px" />
</div>
<button id="btn-stats-filter" class="btn btn-primary" style="font-size:.85rem;padding:.5rem 1rem">Filter</button>
<button id="btn-stats-reset" class="btn btn-ghost" style="font-size:.85rem;padding:.5rem 1rem">Reset</button>
</div>
<div class="table-wrap card" style="padding:0">
<table id="stats-table">
<thead>
@@ -221,6 +255,16 @@
<tbody id="stats-body"></tbody>
</table>
</div>
<!-- Pagination -->
<div style="display:flex;align-items:center;justify-content:space-between;margin-top:1rem;font-size:.9rem;flex-wrap:wrap;gap:.5rem">
<span id="stats-total-label" style="color:var(--text-muted)"></span>
<div style="display:flex;gap:.5rem;align-items:center">
<button id="btn-stats-prev" class="btn btn-ghost" style="font-size:.85rem;padding:.4rem .9rem">← Prev</button>
<span id="stats-page-label" style="color:var(--text-muted);min-width:90px;text-align:center"></span>
<button id="btn-stats-next" class="btn btn-ghost" style="font-size:.85rem;padding:.4rem .9rem">Next →</button>
</div>
</div>
</div>
<!-- ── Admins pane ──────────────────────────────────────────────────── -->