Basic event log view functions.
This commit is contained in:
20
Shared (Extension)/Resources/event_log.js
Normal file
20
Shared (Extension)/Resources/event_log.js
Normal 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();
|
||||
Reference in New Issue
Block a user