Basic event log view functions.

This commit is contained in:
Ryan Breen
2023-02-12 15:09:35 -05:00
parent dfec82deb2
commit 0847a55afa
6 changed files with 98 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
import Alpine from 'alpinejs';
import { sortByIndex } from './db';
Alpine.data('eventLog', () => ({
events: [],
view: 'created_at',
max: 100,
ascending: false,
async init() {
await this.reload();
},
async reload() {
let events = await sortByIndex(this.view, this.ascending, this.max);
this.events = events;
},
}));
Alpine.start();