From bc090190fca9a170566e1d605bdbdbd3536c70f5 Mon Sep 17 00:00:00 2001 From: Tiago vasconcelos Date: Tue, 22 Mar 2022 10:29:18 +0000 Subject: [PATCH] update settings and topup logic --- .../admin/templates/admin/index.html | 91 ++++++++++++------- 1 file changed, 57 insertions(+), 34 deletions(-) diff --git a/lnbits/extensions/admin/templates/admin/index.html b/lnbits/extensions/admin/templates/admin/index.html index 65ac9f336..e9ddc7c47 100644 --- a/lnbits/extensions/admin/templates/admin/index.html +++ b/lnbits/extensions/admin/templates/admin/index.html @@ -30,7 +30,7 @@ - + @@ -61,7 +61,7 @@
- +

TopUp a wallet

@@ -87,13 +87,13 @@
- +
@@ -577,7 +577,6 @@

Site Description

s !== ad) }, - topupWallet: function () { - var self = this + topupWallet() { LNbits.api .request( 'GET', '/admin/api/v1/admin/' + - self.wallet.id + + this.wallet.data.id + '/' + - self.wallet.data.amount, - self.g.user.wallets[0].adminkey + this.wallet.data.amount, + this.g.user.wallets[0].adminkey ) - .then(function (response) { - self.$q.notify({ + .then((response) => { + this.$q.notify({ type: 'positive', message: - 'Success! Added ' + - self.wallet.amount + - ' to ' + - self.wallet.id, + 'Success! Added ' + + this.wallet.data.amount + + ' to ' + + this.wallet.data.id, icon: null }) + this.wallet.data = {} }) .catch(function (error) { LNbits.utils.notifyApiError(error) @@ -1224,36 +1224,59 @@ self.data.admin.edited.push(source) console.log(self.data.admin.edited) }, - UpdateLNbits: function () { - var self = this - let {site_title, admin_users, default_wallet_name, data_folder, disabled_ext, service_fee, funding_source_primary} = this.data.admin + UpdateLNbits() { + let { + admin_users, + allowed_users, + admin_ext, + disabled_ext, + funding_source, + force_https, + service_fee, + hide_api, + site_title, + site_tagline, + site_description, + default_wallet_name, + denomination, + theme, + ad_space + } = this.data.admin + //console.log("this", this.data.admin) let data = { - site_title, - site_tagline: this.data.admin.tagline, - site_description: this.data.admin.description, - admin_users: admin_users.toString(), - default_wallet_name, - data_folder, + admin_users: admin_users.toString(), + allowed_users: allowed_users.toString(), + admin_ext: admin_ext.toString(), disabled_ext: disabled_ext.toString(), - service_fee, - funding_source: funding_source_primary} + funding_source, + force_https, + service_fee, + hide_api, + site_title, + site_tagline, + site_description, + default_wallet_name, + denomination, + theme: theme.toString(), + ad_space: ad_space.toString() + } console.log(data) LNbits.api .request( 'POST', '/admin/api/v1/admin/', - self.g.user.wallets[0].adminkey, + this.g.user.wallets[0].adminkey, data ) - .then(function (response) { + .then(response => { console.log(response.data) - self.$q.notify({ + this.$q.notify({ type: 'positive', message: 'Success! Added ' + - self.wallet.amount + + this.wallet.amount + ' to ' + - self.wallet.id, + this.wallet.id, icon: null }) })