diff --git a/templates/tpos/index.html b/templates/tpos/index.html
index 30b5733..e9dfbba 100644
--- a/templates/tpos/index.html
+++ b/templates/tpos/index.html
@@ -4,8 +4,12 @@
- New TPoS
+ New TPoS
@@ -19,8 +23,14 @@
TPoS
Export to CSV
-
+
@@ -41,27 +51,72 @@ TPoS
-
+
- PoS QR
- Open PoS
+ PoS QR
+ Open PoS
- Click to
- copy ${props.row.id.substring(0,6)}...
+ Click to copy ${props.row.id.substring(0,6)}...
-
+
${ (col.name == 'tip_options' && col.value ?
JSON.parse(col.value).join(", ") : col.value) }
-
- Click
- to copy ${props.row.tip_wallet.substring(0,6)}...
+
+ Click to copy ${props.row.tip_wallet.substring(0,6)}...
N/A
@@ -81,17 +136,35 @@ TPoS
0
-
+
-
+
-
+
@@ -99,24 +172,57 @@ TPoS
-
Add Item
-
Delete All
-
+ Add Item
+ Delete All
+
-
-
+
+
Import
- Import a JSON file
+ Import a JSON file
-
+
Export
- Export a JSON file
+ Export a JSON file
@@ -126,17 +232,33 @@ TPoS
-
+
-
+
-
+
@@ -189,26 +311,66 @@ {{SITE_TITLE}} TPoS extension
-
-
-
+
+
+
-
- Hit enter to add
- values
+
+ Hit enter to add values
You can leave this blank. A default rounding option is available
(round amount to a value)
@@ -216,44 +378,86 @@ {{SITE_TITLE}} TPoS extension
-
+
-
-
-
-
-
+
- Update TPoS
- Create
- TPoS
- Cancel
+ Update TPoS
+ Create TPoS
+ Cancel
@@ -261,21 +465,70 @@ {{SITE_TITLE}} TPoS extension
-
-
-
-
-
-
-
+
+
+
+
+
+
+
- ${itemDialog.data.id ? 'Update Item' : 'Create Item'}
- Cancel
+ type="submit"
+ >${itemDialog.data.id ? 'Update Item' : 'Create Item'}
+ Cancel
@@ -292,8 +545,12 @@ {{SITE_TITLE}} TPoS extension
- Copy
- URL
+ Copy URL
Close
@@ -315,7 +572,9 @@
${item.title}
- ${item.description}
+ ${item.description}
@@ -324,7 +583,9 @@
- Import
+ Import
Close
@@ -348,7 +609,7 @@
obj.itemsMap = new Map()
obj.items.forEach((item, idx) => {
let id = `${obj.id}:${idx + 1}`
- obj.itemsMap.set(id, { ...item, id })
+ obj.itemsMap.set(id, {...item, id})
})
return obj
}
@@ -537,16 +798,26 @@
],
tpossTable: {
columns: [
- { name: 'id', align: 'left', label: 'ID', field: 'id' },
- { name: 'name', align: 'left', label: 'Name', field: 'name' },
+ {name: 'id', align: 'left', label: 'ID', field: 'id'},
+ {name: 'name', align: 'left', label: 'Name', field: 'name'},
{
name: 'currency',
align: 'left',
label: 'Currency',
field: 'currency'
},
- { name: 'withdrawtimeopt', align: 'left', label: 'mins/sec', field: 'withdrawtimeopt' },
- { name: 'withdrawpindisabled', align: 'left', label: 'atm pin disabled', field: 'withdrawpindisabled' },
+ {
+ name: 'withdrawtimeopt',
+ align: 'left',
+ label: 'mins/sec',
+ field: 'withdrawtimeopt'
+ },
+ {
+ name: 'withdrawpindisabled',
+ align: 'left',
+ label: 'atm pin disabled',
+ field: 'withdrawpindisabled'
+ }
],
pagination: {
rowsPerPage: 10
@@ -634,7 +905,7 @@
fileDataDialog: {
show: false,
data: {},
- import: () => { }
+ import: () => {}
},
urlDialog: {
show: false,
@@ -687,8 +958,8 @@
tip_options:
this.formDialog.advanced.tips && this.formDialog.data.tip_options
? JSON.stringify(
- this.formDialog.data.tip_options.map(str => parseInt(str))
- )
+ this.formDialog.data.tip_options.map(str => parseInt(str))
+ )
: JSON.stringify([]),
tip_wallet:
(this.formDialog.advanced.tips &&
@@ -715,7 +986,7 @@
}
},
updateTPosForm(tposId) {
- const tpos = _.findWhere(this.tposs, { id: tposId })
+ const tpos = _.findWhere(this.tposs, {id: tposId})
this.formDialog.data = {
...tpos,
tip_options: JSON.parse(tpos.tip_options)
@@ -763,7 +1034,7 @@
},
deleteTPoS: function (tposId) {
var self = this
- var tpos = _.findWhere(this.tposs, { id: tposId })
+ var tpos = _.findWhere(this.tposs, {id: tposId})
LNbits.utils
.confirmDialog('Are you sure you want to delete this TPoS?')
@@ -772,7 +1043,7 @@
.request(
'DELETE',
'/tpos/api/v1/tposs/' + tposId,
- _.findWhere(self.g.user.wallets, { id: tpos.wallet }).adminkey
+ _.findWhere(self.g.user.wallets, {id: tpos.wallet}).adminkey
)
.then(function (response) {
self.tposs = _.reject(self.tposs, function (obj) {
@@ -788,17 +1059,17 @@
LNbits.utils.exportCSV(this.tpossTable.columns, this.tposs)
},
itemsArray(tposId) {
- const tpos = _.findWhere(this.tposs, { id: tposId })
+ const tpos = _.findWhere(this.tposs, {id: tposId})
return [...tpos.itemsMap.values()]
},
itemFormatPrice(price, id) {
const tpos = id.split(':')[0]
- const currency = _.findWhere(this.tposs, { id: tpos }).currency
+ const currency = _.findWhere(this.tposs, {id: tpos}).currency
return LNbits.utils.formatCurrency(Number(price).toFixed(2), currency)
},
openItemDialog(id) {
const [tposId, itemId] = id.split(':')
- const tpos = _.findWhere(this.tposs, { id: tposId })
+ const tpos = _.findWhere(this.tposs, {id: tposId})
if (itemId) {
const item = tpos.itemsMap.get(id)
this.itemDialog.data = {
@@ -823,7 +1094,7 @@
},
deleteItem(id) {
const [tposId, itemId] = id.split(':')
- const tpos = _.findWhere(this.tposs, { id: tposId })
+ const tpos = _.findWhere(this.tposs, {id: tposId})
const wallet = _.findWhere(this.g.user.wallets, {
id: tpos.wallet
})
@@ -838,7 +1109,7 @@
})
},
addItems() {
- const tpos = _.findWhere(this.tposs, { id: this.itemDialog.data.tpos })
+ const tpos = _.findWhere(this.tposs, {id: this.itemDialog.data.tpos})
const wallet = _.findWhere(this.g.user.wallets, {
id: tpos.wallet
})
@@ -853,7 +1124,7 @@
this.updateTposItems(tpos.id, wallet, data)
},
deleteAllItems(tposId) {
- const tpos = _.findWhere(this.tposs, { id: tposId })
+ const tpos = _.findWhere(this.tposs, {id: tposId})
const wallet = _.findWhere(this.g.user.wallets, {
id: tpos.wallet
})
@@ -887,7 +1158,7 @@
})
},
exportJSON(tposId) {
- const tpos = _.findWhere(this.tposs, { id: tposId })
+ const tpos = _.findWhere(this.tposs, {id: tposId})
const data = [...tpos.items]
const filename = `items_${tpos.id}.json`
const json = JSON.stringify(data, null, 2)
@@ -934,7 +1205,7 @@
}
},
openFileDataDialog(tposId, data) {
- const tpos = _.findWhere(this.tposs, { id: tposId })
+ const tpos = _.findWhere(this.tposs, {id: tposId})
const wallet = _.findWhere(this.g.user.wallets, {
id: tpos.wallet
})
@@ -954,7 +1225,7 @@
}
},
openUrlDialog(id) {
- this.urlDialog.data = _.findWhere(this.tposs, { id })
+ this.urlDialog.data = _.findWhere(this.tposs, {id})
this.urlDialog.show = true
},
formatAmount: function (amount, currency) {
@@ -975,4 +1246,4 @@
}
})
-{% endblock %}
\ No newline at end of file
+{% endblock %}