Added max filter.

This commit is contained in:
Ryan Breen
2023-02-15 21:34:31 -05:00
parent 3553871953
commit 79c379f2c2
2 changed files with 6 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ export async function sortByIndex(index, query, asc, max) {
.openCursor(query, asc ? 'next' : 'prev'); .openCursor(query, asc ? 'next' : 'prev');
while (cursor) { while (cursor) {
events.push(cursor.value); events.push(cursor.value);
if (cursor.length >= max) { if (events.length >= max) {
break; break;
} }
cursor = await cursor.continue(); cursor = await cursor.continue();

View File

@@ -45,7 +45,11 @@
</select> </select>
</div> </div>
<div></div> <div>
<label for="max">Max</label>
<input type="number" x-model.number="max" @input.debounce.750ms="reload" class="input" min="10">
</div>
<div></div> <div></div>
<div x-show="view === 'created_at'"> <div x-show="view === 'created_at'">