Files
nostash/Shared (Extension)/Resources/event_log.js
2023-02-12 15:09:35 -05:00

21 lines
391 B
JavaScript

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();