Download events, Delete all events.
This commit is contained in:
@@ -110,6 +110,7 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<button class="button mt-3" @click="saveAll">Save all</button>
|
<button class="button mt-3" @click="saveAll">Save all</button>
|
||||||
|
<button class="button mt-3" @click="deleteAll">Delete all</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import Alpine from 'alpinejs';
|
import Alpine from 'alpinejs';
|
||||||
|
import { deleteDB } from 'idb';
|
||||||
import jsonFormatHighlight from 'json-format-highlight';
|
import jsonFormatHighlight from 'json-format-highlight';
|
||||||
import { getPublicKey } from 'nostr-tools';
|
import { getPublicKey } from 'nostr-tools';
|
||||||
import { downloadAllContents, getHosts, sortByIndex } from './db';
|
import { downloadAllContents, getHosts, sortByIndex } from './db';
|
||||||
@@ -58,6 +59,13 @@ Alpine.data('eventLog', () => ({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async deleteAll() {
|
||||||
|
if (confirm('Are you sure you want to delete ALL events?')) {
|
||||||
|
await deleteDB('events');
|
||||||
|
await this.reload();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
quickKindSelect() {
|
quickKindSelect() {
|
||||||
if (this.quickKind === '') return;
|
if (this.quickKind === '') return;
|
||||||
const i = parseInt(this.quickKind);
|
const i = parseInt(this.quickKind);
|
||||||
|
|||||||
Reference in New Issue
Block a user