Webapp: evidence pack date range, US month labels, hardware gap rows

Evidence pack takes ?from=&to= (inclusive, Eastern time) with From/To
pickers and quick ranges; ZIP is named ENT-056_<site>_<from>_to_<to>.
Month keys show as 'September 2026'. Hardware gap rows on the to-do
use the shared one-line grid with chips for the missing pack or BIOS.
This commit is contained in:
cproudlock
2026-10-14 15:08:36 -04:00
parent a54df7ebd9
commit 2dbaaded44
4 changed files with 116 additions and 15 deletions

View File

@@ -63,9 +63,19 @@
</details>
<details class="more">
<summary class="ui-btn">Evidence pack</summary>
<form class="menu" method="get" action="{{ url_for('blancco_evidence_pack') }}" style="width: min(320px, calc(100vw - 32px)); padding: 14px; gap: 10px">
<label for="evidenceMonth" class="sub">ENT-056/158 evidence pack for</label>
<input id="evidenceMonth" type="month" name="month" value="{{ last_month }}" class="field" required>
<form class="menu" method="get" action="{{ url_for('blancco_evidence_pack') }}" style="width: min(380px, calc(100vw - 32px)); padding: 14px; gap: 10px">
<div class="sub" style="white-space: normal">ENT-056/158 evidence pack: every report erased between these dates (Eastern time, both days included).</div>
<div style="display: flex; gap: 8px; flex-wrap: wrap">
<label class="sub" style="display: flex; flex-direction: column; gap: 4px">From
<input id="evidenceFrom" type="date" name="from" value="{{ pack_from }}" class="field" required></label>
<label class="sub" style="display: flex; flex-direction: column; gap: 4px">To
<input id="evidenceTo" type="date" name="to" value="{{ pack_to }}" class="field" required></label>
</div>
<div style="display: flex; gap: 6px; flex-wrap: wrap" aria-label="Quick ranges">
<button type="button" class="fbtn" data-range="last-month">Last month</button>
<button type="button" class="fbtn" data-range="this-month">This month</button>
<button type="button" class="fbtn" data-range="last-30">Last 30 days</button>
</div>
<button type="submit" class="ui-btn pri">Download</button>
<div class="sub" style="white-space: normal">Built automatically into <span class="mono">evidence\</span> on the reports share on the 1st.</div>
</form>
@@ -191,6 +201,19 @@
document.getElementById('deleteFilename').textContent = filename;
document.getElementById('deleteForm').action = "{{ url_for('blancco_delete_report', filename='__F__') }}".replace('__F__', encodeURIComponent(filename));
});
// Evidence pack quick ranges (dates in the browser's local day; the
// server reads them as Eastern-time days).
function iso(d) { return d.getFullYear() + '-' + ('0' + (d.getMonth() + 1)).slice(-2) + '-' + ('0' + d.getDate()).slice(-2); }
document.querySelectorAll('[data-range]').forEach(function (b) {
b.addEventListener('click', function () {
var now = new Date(), from, to;
if (b.dataset.range === 'last-month') { from = new Date(now.getFullYear(), now.getMonth() - 1, 1); to = new Date(now.getFullYear(), now.getMonth(), 0); }
else if (b.dataset.range === 'this-month') { from = new Date(now.getFullYear(), now.getMonth(), 1); to = now; }
else { to = now; from = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 29); }
document.getElementById('evidenceFrom').value = iso(from);
document.getElementById('evidenceTo').value = iso(to);
});
});
// Search and filters: rows hide; a month with no visible row hides; a
// search or filter opens the months so matches are seen.
var q = document.getElementById('rq'), f = '';