Filters for created_at and kind.

This commit is contained in:
Ryan Breen
2023-02-12 22:46:34 -05:00
parent 0847a55afa
commit e0349bdf00
3 changed files with 85 additions and 15 deletions

View File

@@ -17,19 +17,53 @@
<h1 class="section-header">Event Log</h1>
<div>
<select id="view" class="input" x-model="view" @change="reload">
<option value="created_at">created_at</option>
<option value="kind">kind</option>
<option value="host">host</option>
<option value="pubkey">pubkey</option>
</select>
<div class="section">
<div class="section-header">Filters</div>
<div class="grid grid-cols-2 lg:grid-cols-4 gap-4">
<div>
<label for="view">View</label>
<select id="view" class="input" x-model="view" @change="reload">
<option value="created_at">created_at</option>
<option value="kind">kind</option>
<option value="host">host</option>
<option value="pubkey">pubkey</option>
</select>
</div>
<div>
<label for="sort">Order</label>
<select id="sort" x-model="sort" class="input" @change="reload">
<option value="asc">Ascending</option>
<option value="desc">Descending</option>
</select>
</div>
<div></div>
<div></div>
<div x-show="view === 'created_at'">
<label for="fromCreatedAt">From</label>
<input type="date" id="fromCreatedAt" x-model="fromCreatedAt" class="input" @change="reload">
</div>
<div x-show="view === 'created_at'">
<label for="toCreatedAt">To</label>
<input type="date" id="toCreatedAt" x-model="toCreatedAt" class="input" @change="reload">
</div>
<div x-show="view === 'kind'">
<label for="fromKind">From</label>
<input type="number" id="fromKind" x-model.number="fromKind" class="input" @change="reload">
</div>
<div x-show="view === 'kind'">
<label for="toKind">To</label>
<input type="number" id="toKind" x-model.number="toKind" class="input" @change="reload">
</div>
</div>
</div>
<div>
<input type="checkbox" id="asc" class="checkbox" x-model="ascending" @change="reload">
<label for="asc">Ascending order</label>
</div>
<template x-for="event in events">
<div class="mt-3" x-text="JSON.stringify(event, 2)">