Initial skeleton

This commit is contained in:
Tiago Vasconcelos 2023-02-27 18:13:26 +00:00
parent d76f40baaf
commit cc65c91726
7 changed files with 103 additions and 0 deletions

View file

@ -0,0 +1,15 @@
async function stallDetails(path) {
const template = await loadTemplateAsync(path)
Vue.component('stall-details', {
name: 'stall-details',
template,
//props: ['stall-id', 'adminkey', 'inkey', 'wallet-options'],
data: function () {
return {
tab: 'info',
relay: null
}
}
})
}

15
static/js/index.js Normal file
View file

@ -0,0 +1,15 @@
const stalls = async () => {
Vue.component(VueQrcode.name, VueQrcode)
await relayDetails('static/components/stall-details/stall-details.html')
new Vue({
el: '#vue',
mixins: [windowMixin],
data: function () {
return {}
}
})
}
stalls()

18
static/js/utils.js Normal file
View file

@ -0,0 +1,18 @@
function loadTemplateAsync(path) {
const result = new Promise(resolve => {
const xhttp = new XMLHttpRequest()
xhttp.onreadystatechange = function () {
if (this.readyState == 4) {
if (this.status == 200) resolve(this.responseText)
if (this.status == 404) resolve(`<div>Page not found: ${path}</div>`)
}
}
xhttp.open('GET', path, true)
xhttp.send()
})
return result
}