Upload files to IndexedDB

This commit is contained in:
Magnus Åhall 2026-06-01 14:27:41 +02:00
parent 5bd5ef1f02
commit 8b421ea59e
15 changed files with 539 additions and 99 deletions

View file

@ -0,0 +1,28 @@
import { CustomHTMLElement } from "./lib/custom_html_element.mjs"
export class N2PageStorage extends CustomHTMLElement {
static {
this.tmpl = document.createElement('template')
this.tmpl.innerHTML = `
<h1>Local storage</h1>
<div data-el="count-nodes"></div>
<div data-el="count-queued-nodes"></div>
<div data-el="count-history-nodes"></div>
`
}
constructor() {
super()
window._mbus.subscribe('SHOW_PAGE', () => this.render())
}
async render() {
const countNodes = await globalThis.nodeStore.nodeCount()
const countQueuedNodes = await globalThis.nodeStore.sendQueue.count()
const countHistoryNodes = await globalThis.nodeStore.nodesHistory.count()
this.elCountNodes.innerText = countNodes
this.elCountQueuedNodes.innerText = countQueuedNodes
this.elCountHistoryNodes.innerText = countHistoryNodes
}
}
customElements.define('n2-pagestorage', N2PageStorage)