Browse Source

Reverted tasteful button, and started admin table

adminvar
benarc 4 years ago
parent
commit
e559649633
  1. 23
      lnbits/core/migrations.py
  2. 28
      lnbits/core/static/js/wallet.js
  3. 38
      lnbits/core/templates/core/wallet.html

23
lnbits/core/migrations.py

@ -16,6 +16,29 @@ def m001_initial(db):
"""
Initial LNbits tables.
"""
db.execute(
"""
CREATE TABLE IF NOT EXISTS admin (
user TEXT NOT NULL,
site_title TEXT NOT NULL,
primary_color TEXT NOT NULL,
secondary_color TEXT NOT NULL,
allowed_users TEXT NOT NULL,
admin_user TEXT NOT NULL,
default_wallet_name TEXT NOT NULL,
data_folder TEXT NOT NULL,
disabled_ext TEXT NOT NULL,
force_https TEXT NOT NULL,
service_fee TEXT NOT NULL,
backend_wallet TEXT NOT NULL,
read_key TEXT NOT NULL,
invoice_key TEXT NOT NULL,
admin_key TEXT NOT NULL,
cert TEXT NOT NULL
);
"""
)
db.execute(
"""
CREATE TABLE IF NOT EXISTS accounts (

28
lnbits/core/static/js/wallet.js

@ -127,12 +127,6 @@ new Vue({
memo: ''
}
},
update: {
show: false,
data: {
amount: null
}
},
send: {
show: false,
invoice: null,
@ -247,14 +241,6 @@ new Vue({
paymentChecker: null
}
},
showUpdateDialog: function () {
this.update = {
show: true,
data: {
amount: null
}
}
},
closeReceiveDialog: function () {
var checker = this.receive.paymentChecker
setTimeout(function () {
@ -298,20 +284,6 @@ new Vue({
self.receive.status = 'pending'
})
},
updateBalance: function () {
var self = this
self.receive.status = 'loading'
LNbits.api
.updateBalance(self.g.wallet, self.update.data.amount)
.then(function (response) {
self.fetchPayments()
self.update.show = false
})
.catch(function (error) {
LNbits.utils.notifyApiError(error)
self.receive.status = 'pending'
})
},
decodeQR: function (res) {
this.send.data.bolt11 = res
this.decodeInvoice()

38
lnbits/core/templates/core/wallet.html

@ -23,19 +23,7 @@
<div class="row q-pb-md q-px-md q-col-gutter-md">
<div class="col">
<h3 class="q-my-none">
<strong>{% raw %}{{ fbalance }}{% endraw %}</strong> sat {% if
admin %}
<q-btn
unelevated
round
size="10px"
color="purple"
icon="add"
@click="showUpdateDialog"
>
<q-tooltip> Admin top up </q-tooltip>
</q-btn>
{% endif %}
<strong>{% raw %}{{ fbalance }}{% endraw %}</strong> sat
</h3>
</div>
</div>
@ -258,30 +246,6 @@
</div>
</div>
<q-dialog v-model="update.show" position="top">
<q-card class="q-pa-lg q-pt-xl lnbits__dialog-card">
<q-form @submit="updateBalance" class="q-gutter-md">
<q-input
filled
dense
v-model.number="update.data.amount"
type="number"
label="Amount (sat) *"
></q-input>
<div class="row q-mt-lg">
<q-btn
unelevated
color="deep-purple"
:disable="update.data.amount == null || update.data.amount <= 0"
type="submit"
>Top up</q-btn
>
<q-btn v-close-popup flat color="grey" class="q-ml-auto">Cancel</q-btn>
</div>
</q-form>
</q-card>
</q-dialog>
<q-dialog v-model="receive.show" position="top" @hide="closeReceiveDialog">
<q-card
v-if="!receive.paymentReq"

Loading…
Cancel
Save