@ -8,7 +8,7 @@
< div class = "col-12 col-md-8 col-lg-7 q-gutter-y-md" >
< q-card >
< q-card-section >
< q-btn unelevated color = "deep-purple" @ click = "tpos Dialog.show = true" > New TPoS< / q-btn >
< q-btn unelevated color = "deep-purple" @ click = "form Dialog.show = true" > New TPoS< / q-btn >
< / q-card-section >
< / q-card >
@ -31,7 +31,6 @@
< template v-slot:header = "props" >
< q-tr :props = "props" >
< q-th auto-width > < / q-th >
< q-th
v-for="col in props.cols"
:key="col.name"
@ -39,17 +38,15 @@
>
{{ col.label }}
< / q-th >
< q-th auto-width > < / q-th >
< / q-tr >
< / template >
< template v-slot:body = "props" >
< q-tr :props = "props" >
< q-td auto-width >
< q-btn unelevated dense size = "xs" icon = "vpn_lock " :color = "($q.dark.isActive) ? 'grey-7' : 'grey-5'" type = "a" :href = "props.row.tpos" target = "_blank" > < / q-btn >
< / q-td >
< q-btn unelevated dense size = "xs" icon = "launch " :color = "($q.dark.isActive) ? 'grey-7' : 'grey-5'" type = "a" :href = "props.row.tpos" target = "_blank" > < / q-btn >
< / q-td >
< q-td
v-for="col in props.cols"
:key="col.name"
@ -77,47 +74,43 @@
< q-separator > < / q-separator >
< q-list >
< q-expansion-item
group="extras"
icon="swap_vertical_circle "
label="Info"
:content-inset-level="0.5"
>
< q-card >
< q-card-section >
< h5 class = "text-subtitle1 q-my-none" > Tiago's Point of Sale< / h5 >
< p > Is an instant and secure point of sale terminal. A merchant can use the PoS to accept payments to their LNbits wallet, without having to expose the wallet itself, which means it can even be shared with others. < br / > For example, a merchant could setup multiple TPoSs for each one of their colleagues, and use TPoS to track which colleague has taken sales. The terminal is optimized for mobile use, and is easily shared as a QR code, via the # share function on the TPoS. < br / >
< small > Created by, < a href = "https://github.com/talvasconcelos" > Tiago Vasconcelos< / a > < / small > < / p >
group="extras"
icon="info "
label="Info">
< q-card >
< q-card-section >
< h5 class = "text-subtitle1 q-mt-none q-mb-sm" > Tiago's Point of Sale< / h5 >
< p > Is an instant and secure point of sale terminal. A merchant can use the PoS to accept payments to their LNbits wallet, without having to expose the wallet itself, which means it can even be shared with others.< / p >
< p > For example, a merchant could setup multiple TPoSs for each one of their colleagues, and use TPoS to track which colleague has taken sales. The terminal is optimized for mobile use, and is easily shared as a QR code, via the "#" share function on the TPoS.< / p >
< small > Created by < a href = "https://github.com/talvasconcelos" target = "_blank" > Tiago Vasconcelos< / a > .< / small >
< / q-card-section >
< / q-card >
< / q-card-section >
< / q-expansion-item >
< / q-expansion-item >
< / q-list >
< / q-card-section >
< / q-card >
< / div >
< q-dialog v-model = "tpos Dialog.show" position = "top" >
< q-dialog v-model = "form Dialog.show" position = "top" @ hide = "closeFormDialog " >
< q-card class = "q-pa-lg q-pt-xl" style = "width: 500px" >
< q-form class = "q-gutter-md" >
< q-input filled dense
v-model.trim="tposDialog.data.name"
label="Name"
placeholder="Tiago's PoS">< / q-input >
< q-select filled dense emit-value v-model = "tposDialog.data.wallet" :options = "g.user.walletOptions" label = "Wallet *" >
< / q-select >
< q-select filled dense emit-value v-model = "tposDialog.data.currency" :options = "currencyOptions" label = "Currency *" >
< / q-select >
< q-btn unelevated
color="deep-purple"
:disable="tposDialog.data.currency == null || tposDialog.data.name == null"
@click="createTPoS">Create TPoS< / q-btn >
< q-btn v-close-popup flat color = "grey" class = "q-ml-auto" > Cancel< / q-btn >
v-model.trim="formDialog.data.name"
label="Name"
placeholder="Tiago's PoS">< / q-input >
< q-select filled dense
emit-value v-model="formDialog.data.wallet"
:options="g.user.walletOptions"
label="Wallet *">< / q-select >
< q-select filled dense
emit-value v-model="formDialog.data.currency"
:options="currencyOptions"
label="Currency *">< / q-select >
< q-btn unelevated
color="deep-purple"
:disable="formDialog.data.currency == null || formDialog.data.name == null"
@click="createTPoS">Create TPoS< / q-btn >
< q-btn v-close-popup flat color = "grey" class = "q-ml-auto" > Cancel< / q-btn >
< / q-form >
< / q-card >
< / q-dialog >
@ -141,9 +134,13 @@
return {
tposs: [],
currencyOptions: [
'USD', 'EUR', 'GBP', 'DZD', 'ARP', 'AUD', 'ATS', 'BSD', 'BBD', 'BEF', 'BMD', 'BRL', 'BGL', 'CAD', 'CLP', 'CNY', 'CYP', 'CSK', 'DKK', 'NLG', 'XCD', 'EGP', 'FJD', 'FIM', 'FRF', 'DEM', 'XAU', 'GRD', 'HKD', 'HUF', 'ISK', 'INR', 'IDR', 'IEP', 'ILS', 'ITL', 'JMD', 'JPY', 'JOD', 'KRW', 'LBP', 'LUF', 'MYR', 'MXP', 'NLG', 'NZD', 'NOK', 'PKR', 'XPD', 'PHP', 'XPT', 'PLZ', 'PTE', 'ROL', 'RUR', 'SAR', 'XAG', 'SGD', 'SKK', 'ZAR', 'KRW', 'ESP', 'XDR', 'SDD', 'SEK', 'CHF', 'TWD', 'THB', 'TTD', 'TRL', 'VEB', 'ZMK', 'EUR', 'XCD', 'XDR', 'XAG', 'XAU', 'XPD', 'XPT',
],
'USD', 'EUR', 'GBP', 'DZD', 'ARP', 'AUD', 'ATS', 'BSD', 'BBD', 'BEF', 'BMD', 'BRL', 'BGL', 'CAD', 'CLP',
'CNY', 'CYP', 'CSK', 'DKK', 'NLG', 'XCD', 'EGP', 'FJD', 'FIM', 'FRF', 'DEM', 'XAU', 'GRD', 'HKD', 'HUF',
'ISK', 'INR', 'IDR', 'IEP', 'ILS', 'ITL', 'JMD', 'JPY', 'JOD', 'KRW', 'LBP', 'LUF', 'MYR', 'MXP', 'NLG',
'NZD', 'NOK', 'PKR', 'XPD', 'PHP', 'XPT', 'PLZ', 'PTE', 'ROL', 'RUR', 'SAR', 'XAG', 'SGD', 'SKK', 'ZAR',
'KRW', 'ESP', 'XDR', 'SDD', 'SEK', 'CHF', 'TWD', 'THB', 'TTD', 'TRL', 'VEB', 'ZMK', 'EUR', 'XCD', 'XDR',
'XAG', 'XAU', 'XPD', 'XPT'
],
tpossTable: {
columns: [
{name: 'id', align: 'left', label: 'ID', field: 'id'},
@ -154,13 +151,16 @@
rowsPerPage: 10
}
},
tpos Dialog: {
form Dialog: {
show: false,
data: {}
}
};
},
methods: {
closeFormDialog: function () {
this.formDialog.data = {};
},
getTPoSs: function () {
var self = this;
@ -170,29 +170,25 @@
this.g.user.wallets[0].inkey
).then(function (response) {
self.tposs = response.data.map(function (obj) {
console.log(obj)
return mapTPoS(obj);
});
});
},
createTPoS: function () {
var data = {
name: this.tpos Dialog.data.name,
currency: this.tpos Dialog.data.currency
name: this.form Dialog.data.name,
currency: this.form Dialog.data.currency
};
var self = this;
console.log(this.tposDialog.data.wallet);
LNbits.api.request(
'POST',
'/tpos/api/v1/tposs',
_.findWhere(this.g.user.wallets, {id: this.tpos Dialog.data.wallet}).inkey,
_.findWhere(this.g.user.wallets, {id: this.form Dialog.data.wallet}).inkey,
data
).then(function (response) {
self.tposs.push(mapTPoS(response.data));
self.tposDialog.show = false;
self.tposDialog.data = {};
self.formDialog.show = false;
}).catch(function (error) {
LNbits.utils.notifyApiError(error);
});
@ -202,7 +198,7 @@
var tpos = _.findWhere(this.tposs, {id: tposId});
this.$q.dialog({
message: 'Are you sure you want to delete this TPoS link ?',
message: 'Are you sure you want to delete this TPoS?',
ok: {
flat: true,
color: 'orange'
@ -235,5 +231,3 @@
});
< / script >
{% endblock %}