started working into html
This commit is contained in:
parent
c87ccf7107
commit
246bdb765c
3 changed files with 54 additions and 1847 deletions
|
|
@ -25,7 +25,7 @@ temp_static_files = [
|
|||
def temp_renderer():
|
||||
return temp_renderer(["temp/temps"])
|
||||
|
||||
|
||||
from .lnurl import *
|
||||
from .tasks import wait_for_paid_invoices
|
||||
from .views import *
|
||||
from .views_api import *
|
||||
|
|
|
|||
|
|
@ -35,250 +35,6 @@
|
|||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
${ col.label }
|
||||
</q-th>
|
||||
<q-th auto-width>Tip Wallet</q-th>
|
||||
<q-th auto-width>Tip Options %</q-th>
|
||||
<q-th auto-width>Withdraw PIN</q-th>
|
||||
<q-th auto-width>Withdraw Limit</q-th>
|
||||
<q-th auto-width>Withdraw Premium</q-th>
|
||||
<q-th auto-width></q-th>
|
||||
<q-th auto-width></q-th>
|
||||
</q-tr>
|
||||
</temp>
|
||||
|
||||
<temp v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
size="sm"
|
||||
color="accent"
|
||||
round
|
||||
dense
|
||||
@click="props.expand = !props.expand"
|
||||
:icon="props.expand ? 'expand_less' : 'expand_more'"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
unelevated
|
||||
dense
|
||||
size="sm"
|
||||
icon="qr_code"
|
||||
:color="($q.dark.isActive) ? 'grey-7' : 'grey-5'"
|
||||
class="q-mr-sm"
|
||||
@click="openUrlDialog(props.row.id)"
|
||||
><q-tooltip>PoS QR</q-tooltip></q-btn
|
||||
>
|
||||
<q-btn
|
||||
unelevated
|
||||
dense
|
||||
size="sm"
|
||||
icon="launch"
|
||||
:color="($q.dark.isActive) ? 'grey-7' : 'grey-5'"
|
||||
type="a"
|
||||
:href="props.row.temp"
|
||||
target="_blank"
|
||||
><q-tooltip>Open PoS</q-tooltip></q-btn
|
||||
>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
unelevated
|
||||
dense
|
||||
size="md"
|
||||
copy="copy"
|
||||
@click="copyText(props.row.id)"
|
||||
><q-tooltip>Click to copy</q-tooltip
|
||||
>${props.row.id.substring(0,6)}...</q-btn
|
||||
>
|
||||
</q-td>
|
||||
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
v-if="col.name != 'id'"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
>
|
||||
${ (col.name == 'tip_options' && col.value ?
|
||||
JSON.parse(col.value).join(", ") : col.value) }
|
||||
</q-td>
|
||||
<q-td v-if="props.row.tip_wallet != ''" auto-width>
|
||||
<q-btn
|
||||
unelevated
|
||||
dense
|
||||
size="md"
|
||||
copy="copy"
|
||||
@click="copyText(props.row.tip_wallet)"
|
||||
><q-tooltip>Click to copy</q-tooltip
|
||||
>${props.row.tip_wallet.substring(0,6)}...</q-btn
|
||||
>
|
||||
</q-td>
|
||||
<q-td v-else auto-width> N/A </q-td>
|
||||
<q-td v-if="props.row.tip_wallet != ''" auto-width>
|
||||
${props.row.tip_options}
|
||||
</q-td>
|
||||
<q-td v-else auto-width>N/A </q-td>
|
||||
<q-td v-if="props.row.withdrawlimit >= 1" auto-width>
|
||||
${props.row.withdrawpin}
|
||||
</q-td>
|
||||
<q-td v-else auto-width> N/A </q-td>
|
||||
<q-td v-if="props.row.withdrawlimit >= 1" auto-width>
|
||||
${props.row.withdrawlimit}
|
||||
</q-td>
|
||||
<q-td v-else auto-width> N/A </q-td>
|
||||
<q-td v-if="props.row.withdrawpremium > 0" auto-width>
|
||||
${props.row.withdrawpremium}%
|
||||
</q-td>
|
||||
<q-td v-else auto-width> 0 </q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
size="xs"
|
||||
@click="updateTPosForm(props.row.id)"
|
||||
icon="edit"
|
||||
color="blue"
|
||||
></q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
size="xs"
|
||||
@click="deleteTemp(props.row.id)"
|
||||
icon="cancel"
|
||||
color="pink"
|
||||
></q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
<q-tr v-show="props.expand" :props="props">
|
||||
<q-td colspan="100%">
|
||||
<div class="row items-center q-mb-lg">
|
||||
<div class="col-12">
|
||||
<q-tabs
|
||||
v-model="tab"
|
||||
no-caps
|
||||
class="bg-dark text-white shadow-2"
|
||||
>
|
||||
<q-tab name="items" label="Items"></q-tab>
|
||||
</q-tabs>
|
||||
<q-tab-panels v-model="tab">
|
||||
<q-tab-panel name="items">
|
||||
<div>
|
||||
<div class="row items-center no-wrap q-mb-md">
|
||||
<div class="col-12 q-pr-lg">
|
||||
<q-btn
|
||||
color="primary"
|
||||
unelevated
|
||||
@click="openItemDialog(props.row.id)"
|
||||
class="float-left q-my-sm"
|
||||
>Add Item</q-btn
|
||||
>
|
||||
<q-btn
|
||||
color="grey"
|
||||
outline
|
||||
unelevated
|
||||
@click="deleteAllItems(props.row.id)"
|
||||
class="float-left q-my-sm q-ml-sm"
|
||||
>Delete All</q-btn
|
||||
>
|
||||
<q-btn-dropdown
|
||||
class="float-right q-my-sm"
|
||||
outline
|
||||
color="primary"
|
||||
label="Import/Export"
|
||||
>
|
||||
<q-list>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="importJSON(props.row.id)"
|
||||
>
|
||||
<input
|
||||
id="import"
|
||||
type="file"
|
||||
accept=".json"
|
||||
style="display: none"
|
||||
/>
|
||||
<q-item-section>
|
||||
<q-item-label>Import</q-item-label>
|
||||
<q-item-label caption
|
||||
>Import a JSON file</q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="exportJSON(props.row.id)"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-item-label>Export</q-item-label>
|
||||
<q-item-label caption
|
||||
>Export a JSON file</q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-btn-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row items-center no-wrap q-mb-md">
|
||||
<div class="col-12">
|
||||
<q-table
|
||||
flat
|
||||
dense
|
||||
:data="itemsArray(props.row.id)"
|
||||
row-key="id"
|
||||
:columns="itemsTable.columns"
|
||||
:pagination.sync="itemsTable.pagination"
|
||||
>
|
||||
<temp v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
size="sm"
|
||||
color="pink"
|
||||
dense
|
||||
@click="deleteItem(props.row.id)"
|
||||
icon="delete"
|
||||
></q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
size="sm"
|
||||
color="accent"
|
||||
dense
|
||||
@click="openItemDialog(props.row.id)"
|
||||
icon="edit"
|
||||
></q-btn>
|
||||
</q-td>
|
||||
|
||||
<q-td key="id" :props="props">
|
||||
${props.row.id.split(':')[1]}
|
||||
</q-td>
|
||||
<q-td key="title" :props="props">
|
||||
${props.row.title}
|
||||
</q-td>
|
||||
<q-td key="price" :props="props">
|
||||
${itemFormatPrice(props.row.price,
|
||||
props.row.id)}
|
||||
</q-td>
|
||||
<q-td key="disabled" :props="props">
|
||||
${props.row.disabled}
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</temp>
|
||||
</q-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</div>
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</temp>
|
||||
</q-table>
|
||||
|
|
@ -310,7 +66,7 @@
|
|||
dense
|
||||
v-model.trim="formDialog.data.name"
|
||||
label="Name"
|
||||
placeholder="Tiago's PoS"
|
||||
placeholder="Name for your record"
|
||||
></q-input>
|
||||
<q-select
|
||||
filled
|
||||
|
|
@ -320,92 +76,18 @@
|
|||
: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>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<q-checkbox
|
||||
v-model="formDialog.advanced.tips"
|
||||
label="Enable tips"
|
||||
></q-checkbox>
|
||||
</div>
|
||||
<div class="col">
|
||||
<q-checkbox
|
||||
v-model="formDialog.advanced.otc"
|
||||
label="Enable selling Bitcoin (ATM)"
|
||||
></q-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<temp v-if="formDialog.advanced.tips">
|
||||
<q-select
|
||||
filled
|
||||
dense
|
||||
emit-value
|
||||
v-model="formDialog.data.tip_wallet"
|
||||
:options="g.user.walletOptions"
|
||||
label="Tip Wallet"
|
||||
></q-select>
|
||||
<q-select
|
||||
filled
|
||||
multiple
|
||||
dense
|
||||
emit-value
|
||||
v-model="formDialog.data.tip_options"
|
||||
v-if="formDialog.data.tip_wallet"
|
||||
use-input
|
||||
use-chips
|
||||
multiple
|
||||
hide-dropdown-icon
|
||||
input-debounce="0"
|
||||
new-value-mode="add-unique"
|
||||
label="Tip % Options (hit enter to add values)"
|
||||
><q-tooltip>Hit enter to add values</q-tooltip>
|
||||
<temp v-slot:hint>
|
||||
You can leave this blank. A default rounding option is available
|
||||
(round amount to a value)
|
||||
</temp>
|
||||
</q-select>
|
||||
</temp>
|
||||
<temp v-if="formDialog.advanced.otc">
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
v-model.number="formDialog.data.withdrawlimit"
|
||||
type="number"
|
||||
label="Max amount to be sold daily (sats)"
|
||||
v-model.trim="itemDialog.data.description"
|
||||
label="Description"
|
||||
></q-input>
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
v-model.number="formDialog.data.withdrawpin"
|
||||
type="number"
|
||||
label="Withdraw PIN"
|
||||
v-model.trim="itemDialog.data.description"
|
||||
label="Description"
|
||||
></q-input>
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
v-model.number="formDialog.data.withdrawbtwn"
|
||||
type="number"
|
||||
min="0"
|
||||
label="Time between withdraws (minutes)"
|
||||
></q-input>
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
v-model.number="formDialog.data.withdrawpremium"
|
||||
type="number"
|
||||
label="Withdraw premium"
|
||||
step="0.01"
|
||||
min="0.01"
|
||||
></q-input>
|
||||
</temp>
|
||||
|
||||
<div class="row q-mt-lg">
|
||||
<q-btn
|
||||
v-if="formDialog.data.id"
|
||||
|
|
@ -429,63 +111,7 @@
|
|||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
<q-dialog v-model="itemDialog.show" position="top" @hide="closeItemDialog">
|
||||
<q-card class="q-pa-lg q-pt-xl" style="width: 500px">
|
||||
<q-form @submit="addItems" class="q-gutter-md">
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
v-model.trim="itemDialog.data.title"
|
||||
label="Title *"
|
||||
></q-input>
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
v-model.trim="itemDialog.data.description"
|
||||
label="Description"
|
||||
></q-input>
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
v-model.trim="itemDialog.data.image"
|
||||
label="Image URL"
|
||||
></q-input>
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
v-model.number="itemDialog.data.price"
|
||||
:label="`Price (${itemDialog.data.currency})*`"
|
||||
></q-input>
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
v-model.number="itemDialog.data.tax"
|
||||
label="Tax %"
|
||||
></q-input>
|
||||
<q-checkbox
|
||||
v-model="itemDialog.data.disabled"
|
||||
label="Disable"
|
||||
></q-checkbox>
|
||||
<div class="row q-mt-lg">
|
||||
<q-btn
|
||||
unelevated
|
||||
color="primary"
|
||||
:disable="!Boolean(itemDialog.data.title) || !Boolean(itemDialog.data.price)"
|
||||
type="submit"
|
||||
>${itemDialog.data.id ? 'Update Item' : 'Create Item'}</q-btn
|
||||
>
|
||||
<q-btn
|
||||
v-close-popup
|
||||
@hide="closeItemDialog"
|
||||
flat
|
||||
color="grey"
|
||||
class="q-ml-auto"
|
||||
>Cancel</q-btn
|
||||
>
|
||||
</div>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<q-dialog v-model="urlDialog.show" position="top">
|
||||
<q-card class="q-pa-lg q-pt-xl lnbits__dialog-card">
|
||||
<q-responsive :ratio="1" class="q-mx-xl q-mb-md">
|
||||
|
|
@ -508,41 +134,6 @@
|
|||
</div>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
<q-dialog v-model="fileDataDialog.show" position="top">
|
||||
<q-card class="q-pa-lg q-pt-xl lnbits__dialog-card">
|
||||
<q-card-section>
|
||||
<h6 class="text-subtitle1 q-my-none">
|
||||
Importing ${fileDataDialog?.count} items
|
||||
</h6>
|
||||
</q-card-section>
|
||||
<q-list bordered padding separator>
|
||||
<q-item v-for="item in fileDataDialog.data" :key="item.name">
|
||||
<q-item-section v-if="item.image" top avatar>
|
||||
<q-avatar>
|
||||
<img :src="item.image" style="object-fit: scale-down" />
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>
|
||||
<q-item-label>${item.title}</q-item-label>
|
||||
<q-item-label v-if="item.description" caption
|
||||
>${item.description}</q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section side top>
|
||||
<q-badge :label="item.formattedPrice" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<div class="row q-mt-lg">
|
||||
<q-btn outline color="primary" @click="fileDataDialog.import"
|
||||
>Import</q-btn
|
||||
>
|
||||
<q-btn v-close-popup flat color="grey" class="q-ml-auto">Close</q-btn>
|
||||
</div>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</div>
|
||||
{% endblock %} {% block scripts %} {{ window_vars(user) }}
|
||||
<script>
|
||||
|
|
@ -573,181 +164,7 @@
|
|||
delimiters: ['${', '}'],
|
||||
data: function () {
|
||||
return {
|
||||
temps: [],
|
||||
currencyOptions: [
|
||||
'USD',
|
||||
'EUR',
|
||||
'GBP',
|
||||
'AED',
|
||||
'AFN',
|
||||
'ALL',
|
||||
'AMD',
|
||||
'ANG',
|
||||
'AOA',
|
||||
'ARS',
|
||||
'AUD',
|
||||
'AWG',
|
||||
'AZN',
|
||||
'BAM',
|
||||
'BBD',
|
||||
'BDT',
|
||||
'BGN',
|
||||
'BHD',
|
||||
'BIF',
|
||||
'BMD',
|
||||
'BND',
|
||||
'BOB',
|
||||
'BRL',
|
||||
'BSD',
|
||||
'BTN',
|
||||
'BWP',
|
||||
'BYN',
|
||||
'BZD',
|
||||
'CAD',
|
||||
'CDF',
|
||||
'CHF',
|
||||
'CLF',
|
||||
'CLP',
|
||||
'CNH',
|
||||
'CNY',
|
||||
'COP',
|
||||
'CRC',
|
||||
'CUC',
|
||||
'CUP',
|
||||
'CVE',
|
||||
'CZK',
|
||||
'DJF',
|
||||
'DKK',
|
||||
'DOP',
|
||||
'DZD',
|
||||
'EGP',
|
||||
'ERN',
|
||||
'ETB',
|
||||
'EUR',
|
||||
'FJD',
|
||||
'FKP',
|
||||
'GBP',
|
||||
'GEL',
|
||||
'GGP',
|
||||
'GHS',
|
||||
'GIP',
|
||||
'GMD',
|
||||
'GNF',
|
||||
'GTQ',
|
||||
'GYD',
|
||||
'HKD',
|
||||
'HNL',
|
||||
'HRK',
|
||||
'HTG',
|
||||
'HUF',
|
||||
'IDR',
|
||||
'ILS',
|
||||
'IMP',
|
||||
'INR',
|
||||
'IQD',
|
||||
'IRR',
|
||||
'IRT',
|
||||
'ISK',
|
||||
'JEP',
|
||||
'JMD',
|
||||
'JOD',
|
||||
'JPY',
|
||||
'KES',
|
||||
'KGS',
|
||||
'KHR',
|
||||
'KMF',
|
||||
'KPW',
|
||||
'KRW',
|
||||
'KWD',
|
||||
'KYD',
|
||||
'KZT',
|
||||
'LAK',
|
||||
'LBP',
|
||||
'LKR',
|
||||
'LRD',
|
||||
'LSL',
|
||||
'LYD',
|
||||
'MAD',
|
||||
'MDL',
|
||||
'MGA',
|
||||
'MKD',
|
||||
'MMK',
|
||||
'MNT',
|
||||
'MOP',
|
||||
'MRO',
|
||||
'MUR',
|
||||
'MVR',
|
||||
'MWK',
|
||||
'MXN',
|
||||
'MYR',
|
||||
'MZN',
|
||||
'NAD',
|
||||
'NGN',
|
||||
'NIO',
|
||||
'NOK',
|
||||
'NPR',
|
||||
'NZD',
|
||||
'OMR',
|
||||
'PAB',
|
||||
'PEN',
|
||||
'PGK',
|
||||
'PHP',
|
||||
'PKR',
|
||||
'PLN',
|
||||
'PYG',
|
||||
'QAR',
|
||||
'RON',
|
||||
'RSD',
|
||||
'RUB',
|
||||
'RWF',
|
||||
'SAR',
|
||||
'SBD',
|
||||
'SCR',
|
||||
'SDG',
|
||||
'SEK',
|
||||
'SGD',
|
||||
'SHP',
|
||||
'SLL',
|
||||
'SOS',
|
||||
'SRD',
|
||||
'SSP',
|
||||
'STD',
|
||||
'SVC',
|
||||
'SYP',
|
||||
'SZL',
|
||||
'THB',
|
||||
'TJS',
|
||||
'TMT',
|
||||
'TND',
|
||||
'TOP',
|
||||
'TRY',
|
||||
'TTD',
|
||||
'TWD',
|
||||
'TZS',
|
||||
'UAH',
|
||||
'UGX',
|
||||
'USD',
|
||||
'UYU',
|
||||
'UZS',
|
||||
'VEF',
|
||||
'VES',
|
||||
'VND',
|
||||
'VUV',
|
||||
'WST',
|
||||
'XAF',
|
||||
'XAG',
|
||||
'XAU',
|
||||
'XCD',
|
||||
'XDR',
|
||||
'XOF',
|
||||
'XPD',
|
||||
'XPF',
|
||||
'XPT',
|
||||
'YER',
|
||||
'ZAR',
|
||||
'ZMW',
|
||||
'ZWL'
|
||||
],
|
||||
|
||||
tempsTable: {
|
||||
columns: [
|
||||
{name: 'id', align: 'left', label: 'ID', field: 'id'},
|
||||
|
|
@ -775,65 +192,6 @@
|
|||
otc: false
|
||||
}
|
||||
},
|
||||
itemDialog: {
|
||||
show: false,
|
||||
data: {
|
||||
title: '',
|
||||
image: '',
|
||||
price: '',
|
||||
disabled: false
|
||||
}
|
||||
},
|
||||
tab: 'items',
|
||||
itemsTable: {
|
||||
columns: [
|
||||
{
|
||||
name: 'delete',
|
||||
align: 'left',
|
||||
label: '',
|
||||
field: ''
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
align: 'left',
|
||||
label: '',
|
||||
field: ''
|
||||
},
|
||||
|
||||
{
|
||||
name: 'id',
|
||||
align: 'left',
|
||||
label: 'ID',
|
||||
field: 'id'
|
||||
},
|
||||
{
|
||||
name: 'title',
|
||||
align: 'left',
|
||||
label: 'Title',
|
||||
field: 'title'
|
||||
},
|
||||
{
|
||||
name: 'price',
|
||||
align: 'left',
|
||||
label: 'Price',
|
||||
field: 'price'
|
||||
},
|
||||
{
|
||||
name: 'disabled',
|
||||
align: 'left',
|
||||
label: 'Disabled',
|
||||
field: 'disabled'
|
||||
}
|
||||
],
|
||||
pagination: {
|
||||
rowsPerPage: 10
|
||||
}
|
||||
},
|
||||
fileDataDialog: {
|
||||
show: false,
|
||||
data: {},
|
||||
import: () => {}
|
||||
},
|
||||
urlDialog: {
|
||||
show: false,
|
||||
data: {}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue