feat: alerts view + created-at timestamps on decisions
All checks were successful
Deploy / deploy (push) Successful in 22s
All checks were successful
Deploy / deploy (push) Successful in 22s
Mirror cscli alerts list: new /alerts endpoint hits LAPI machine auth with since/ip/scenario/origin filters, renders ID, scope:value, reason, country, AS, events, decisions, created_at. Decisions table gains a Created column derived from until - duration (LAPI does not expose created_at on /v1/decisions). Both views format timestamps locally and append a relative "x ago" via Intl.RelativeTimeFormat, refreshed every 30s on the decisions view.
This commit is contained in:
@@ -39,6 +39,37 @@
|
||||
</div>
|
||||
<div id="unban-me-result"></div>
|
||||
|
||||
<section>
|
||||
<h2>Recent alerts</h2>
|
||||
<form hx-get="/alerts" hx-target="#alerts" hx-trigger="submit, load delay:200ms" hx-swap="innerHTML" hx-indicator="#alerts" class="row">
|
||||
<select name="since">
|
||||
<option value="15m">15m</option>
|
||||
<option value="1h" selected>1h</option>
|
||||
<option value="6h">6h</option>
|
||||
<option value="24h">24h</option>
|
||||
<option value="168h">7d</option>
|
||||
<option value="720h">30d</option>
|
||||
</select>
|
||||
<input type="text" name="ip" placeholder="IP (optional)">
|
||||
<input type="text" name="scenario" placeholder="Scenario (optional)">
|
||||
<select name="origin">
|
||||
<option value="">any origin</option>
|
||||
<option value="crowdsec">crowdsec</option>
|
||||
<option value="cscli">cscli</option>
|
||||
<option value="CAPI">CAPI</option>
|
||||
<option value="lists">lists</option>
|
||||
</select>
|
||||
<select name="limit">
|
||||
<option value="100">100</option>
|
||||
<option value="200" selected>200</option>
|
||||
<option value="500">500</option>
|
||||
<option value="1000">1000</option>
|
||||
</select>
|
||||
<button type="submit">Search</button>
|
||||
</form>
|
||||
<div id="alerts">Loading…</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Active decisions</h2>
|
||||
<form hx-get="/decisions" hx-target="#decisions" hx-trigger="submit, load delay:200ms" hx-swap="innerHTML" hx-indicator="#decisions" class="row">
|
||||
|
||||
Reference in New Issue
Block a user