Upload files to IndexedDB
This commit is contained in:
parent
5bd5ef1f02
commit
8b421ea59e
15 changed files with 539 additions and 99 deletions
28
static/js/page_storage.mjs
Normal file
28
static/js/page_storage.mjs
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue