@ -8,7 +8,7 @@
< div class = "col-12 col-md-8 col-lg-7 q-gutter-y-md" >
< div class = "col-12 col-md-8 col-lg-7 q-gutter-y-md" >
< q-card >
< q-card >
< q-card-section >
< 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-section >
< / q-card >
< / q-card >
@ -31,7 +31,6 @@
< template v-slot:header = "props" >
< template v-slot:header = "props" >
< q-tr :props = "props" >
< q-tr :props = "props" >
< q-th auto-width > < / q-th >
< q-th auto-width > < / q-th >
< q-th
< q-th
v-for="col in props.cols"
v-for="col in props.cols"
:key="col.name"
:key="col.name"
@ -39,16 +38,14 @@
>
>
{{ col.label }}
{{ col.label }}
< / q-th >
< / q-th >
< q-th auto-width > < / q-th >
< q-th auto-width > < / q-th >
< / q-tr >
< / q-tr >
< / template >
< / template >
< template v-slot:body = "props" >
< template v-slot:body = "props" >
< q-tr :props = "props" >
< q-tr :props = "props" >
< q-td auto-width >
< 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-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 >
< q-td
< q-td
v-for="col in props.cols"
v-for="col in props.cols"
@ -78,45 +75,41 @@
< q-list >
< q-list >
< q-expansion-item
< q-expansion-item
group="extras"
group="extras"
icon="swap_vertical_circle"
icon="info"
label="Info"
label="Info">
:content-inset-level="0.5"
>
< q-card >
< q-card >
< q-card-section >
< q-card-section >
< h5 class = "text-subtitle1 q-my-none " > Tiago's Point of Sale< / h5 >
< 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. < 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 / >
< 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 >
< small > Created by, < a href = "https://github.com/talvasconcelos" > Tiago Vasconcelos< / a > < / small > < / 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 >
< / q-card >
< small > Created by < a href = "https://github.com/talvasconcelos" target = "_blank" > Tiago Vasconcelos< / a > .< / small >
< / q-card-section >
< / q-card-section >
< / q-card >
< / q-expansion-item >
< / q-expansion-item >
< / q-list >
< / q-list >
< / q-card-section >
< / q-card-section >
< / q-card >
< / q-card >
< / div >
< / 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-card class = "q-pa-lg q-pt-xl" style = "width: 500px" >
< q-form class = "q-gutter-md" >
< q-form class = "q-gutter-md" >
< q-input filled dense
< q-input filled dense
v-model.trim="tpos Dialog.data.name"
v-model.trim="form Dialog.data.name"
label="Name"
label="Name"
placeholder="Tiago's PoS">< / q-input >
placeholder="Tiago's PoS">< / q-input >
< q-select filled dense
< q-select filled dense emit-value v-model = "tposDialog.data.wallet" :options = "g.user.walletOptions" label = "Wallet *" >
emit-value v-model="formDialog.data.wallet"
< / q-select >
: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 filled dense
< / q-select >
emit-value v-model="formDialog.data.currency"
:options="currencyOptions"
label="Currency *">< / q-select >
< q-btn unelevated
< q-btn unelevated
color="deep-purple"
color="deep-purple"
:disable="tposDialog.data.currency == null || tpos Dialog.data.name == null"
:disable="formDialog.data.currency == null || form Dialog.data.name == null"
@click="createTPoS">Create TPoS< / q-btn >
@click="createTPoS">Create TPoS< / q-btn >
< q-btn v-close-popup flat color = "grey" class = "q-ml-auto" > Cancel< / q-btn >
< q-btn v-close-popup flat color = "grey" class = "q-ml-auto" > Cancel< / q-btn >
< / q-form >
< / q-form >
< / q-card >
< / q-card >
@ -141,9 +134,13 @@
return {
return {
tposs: [],
tposs: [],
currencyOptions: [
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: {
tpossTable: {
columns: [
columns: [
{name: 'id', align: 'left', label: 'ID', field: 'id'},
{name: 'id', align: 'left', label: 'ID', field: 'id'},
@ -154,13 +151,16 @@
rowsPerPage: 10
rowsPerPage: 10
}
}
},
},
tpos Dialog: {
form Dialog: {
show: false,
show: false,
data: {}
data: {}
}
}
};
};
},
},
methods: {
methods: {
closeFormDialog: function () {
this.formDialog.data = {};
},
getTPoSs: function () {
getTPoSs: function () {
var self = this;
var self = this;
@ -170,29 +170,25 @@
this.g.user.wallets[0].inkey
this.g.user.wallets[0].inkey
).then(function (response) {
).then(function (response) {
self.tposs = response.data.map(function (obj) {
self.tposs = response.data.map(function (obj) {
console.log(obj)
return mapTPoS(obj);
return mapTPoS(obj);
});
});
});
});
},
},
createTPoS: function () {
createTPoS: function () {
var data = {
var data = {
name: this.tpos Dialog.data.name,
name: this.form Dialog.data.name,
currency: this.tpos Dialog.data.currency
currency: this.form Dialog.data.currency
};
};
var self = this;
var self = this;
console.log(this.tposDialog.data.wallet);
LNbits.api.request(
LNbits.api.request(
'POST',
'POST',
'/tpos/api/v1/tposs',
'/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
data
).then(function (response) {
).then(function (response) {
self.tposs.push(mapTPoS(response.data));
self.tposs.push(mapTPoS(response.data));
self.tposDialog.show = false;
self.formDialog.show = false;
self.tposDialog.data = {};
}).catch(function (error) {
}).catch(function (error) {
LNbits.utils.notifyApiError(error);
LNbits.utils.notifyApiError(error);
});
});
@ -202,7 +198,7 @@
var tpos = _.findWhere(this.tposs, {id: tposId});
var tpos = _.findWhere(this.tposs, {id: tposId});
this.$q.dialog({
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: {
ok: {
flat: true,
flat: true,
color: 'orange'
color: 'orange'
@ -235,5 +231,3 @@
});
});
< / script >
< / script >
{% endblock %}
{% endblock %}