mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-01-19 05:33:47 +01:00
chore(vue): use g
for consistency with Flask
This commit is contained in:
parent
d0b44eada9
commit
a81de95f73
@ -145,7 +145,7 @@ new Vue({
|
||||
if (this.payments.length) {
|
||||
return _.pluck(this.payments, 'amount').reduce(function (a, b) { return a + b; }, 0) / 1000;
|
||||
}
|
||||
return this.w.wallet.sat;
|
||||
return this.g.wallet.sat;
|
||||
},
|
||||
fbalance: function () {
|
||||
return LNbits.utils.formatSat(this.balance)
|
||||
@ -211,7 +211,7 @@ new Vue({
|
||||
createInvoice: function () {
|
||||
var self = this;
|
||||
this.receive.status = 'loading';
|
||||
LNbits.api.createInvoice(this.w.wallet, this.receive.data.amount, this.receive.data.memo)
|
||||
LNbits.api.createInvoice(this.g.wallet, this.receive.data.amount, this.receive.data.memo)
|
||||
.then(function (response) {
|
||||
self.receive.status = 'success';
|
||||
self.receive.paymentReq = response.data.payment_request;
|
||||
@ -279,7 +279,7 @@ new Vue({
|
||||
icon: null
|
||||
});
|
||||
|
||||
LNbits.api.payInvoice(this.w.wallet, this.send.data.bolt11).then(function (response) {
|
||||
LNbits.api.payInvoice(this.g.wallet, this.send.data.bolt11).then(function (response) {
|
||||
self.send.paymentChecker = setInterval(function () {
|
||||
LNbits.api.getPayment(self.w.wallet, response.data.checking_id).then(function (res) {
|
||||
if (res.data.paid) {
|
||||
@ -301,7 +301,7 @@ new Vue({
|
||||
fetchPayments: function (checkPending) {
|
||||
var self = this;
|
||||
|
||||
return LNbits.api.getPayments(this.w.wallet, checkPending).then(function (response) {
|
||||
return LNbits.api.getPayments(this.g.wallet, checkPending).then(function (response) {
|
||||
self.payments = response.data.map(function (obj) {
|
||||
return LNbits.map.payment(obj);
|
||||
}).sort(function (a, b) {
|
||||
@ -326,7 +326,7 @@ new Vue({
|
||||
},
|
||||
watch: {
|
||||
'payments': function () {
|
||||
EventHub.$emit('update-wallet-balance', [this.w.wallet.id, this.balance]);
|
||||
EventHub.$emit('update-wallet-balance', [this.g.wallet.id, this.balance]);
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
{% block page %}
|
||||
<div class="row q-col-gutter-md">
|
||||
<div class="col-6 col-md-4 col-lg-3" v-for="extension in w.extensions" :key="extension.code">
|
||||
<div class="col-6 col-md-4 col-lg-3" v-for="extension in g.extensions" :key="extension.code">
|
||||
<q-card>
|
||||
<q-card-section>
|
||||
<q-icon :name="extension.icon" color="grey-5" style="font-size: 4rem;"></q-icon>
|
||||
@ -26,14 +26,14 @@
|
||||
<q-card-actions>
|
||||
<div v-if="extension.isEnabled">
|
||||
<q-btn flat color="deep-purple"
|
||||
type="a" :href="[extension.url, '?usr=', w.user.id].join('')">Open</q-btn>
|
||||
type="a" :href="[extension.url, '?usr=', g.user.id].join('')">Open</q-btn>
|
||||
<q-btn flat color="grey-5"
|
||||
type="a"
|
||||
:href="['{{ url_for('core.extensions') }}', '?usr=', w.user.id, '&disable=', extension.code].join('')"> Disable</q-btn>
|
||||
:href="['{{ url_for('core.extensions') }}', '?usr=', g.user.id, '&disable=', extension.code].join('')"> Disable</q-btn>
|
||||
</div>
|
||||
<q-btn v-else flat color="deep-purple"
|
||||
type="a"
|
||||
:href="['{{ url_for('core.extensions') }}', '?usr=', w.user.id, '&enable=', extension.code].join('')">
|
||||
:href="['{{ url_for('core.extensions') }}', '?usr=', g.user.id, '&enable=', extension.code].join('')">
|
||||
Enable</q-btn>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
|
@ -18,8 +18,8 @@
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-separator class="q-my-lg"></q-separator>
|
||||
<p>A magical "w" is always available, with info about the user, wallets and extensions:</p>
|
||||
<code class="text-caption">{% raw %}{{ w }}{% endraw %}</code>
|
||||
<p>A magical "g" is always available, with info about the user, wallets and extensions:</p>
|
||||
<code class="text-caption">{% raw %}{{ g }}{% endraw %}</code>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
{% endblock %}
|
||||
|
@ -141,7 +141,7 @@ var LNbits = {
|
||||
var windowMixin = {
|
||||
data: function () {
|
||||
return {
|
||||
w: {
|
||||
g: {
|
||||
visibleDrawer: false,
|
||||
extensions: [],
|
||||
user: null,
|
||||
@ -165,14 +165,14 @@ var windowMixin = {
|
||||
created: function () {
|
||||
this.$q.dark.set(this.$q.localStorage.getItem('lnbits.darkMode'));
|
||||
if (window.user) {
|
||||
this.w.user = Object.freeze(LNbits.map.user(window.user));
|
||||
this.g.user = Object.freeze(LNbits.map.user(window.user));
|
||||
}
|
||||
if (window.wallet) {
|
||||
this.w.wallet = Object.freeze(LNbits.map.wallet(window.wallet));
|
||||
this.g.wallet = Object.freeze(LNbits.map.wallet(window.wallet));
|
||||
}
|
||||
if (window.extensions) {
|
||||
var user = this.w.user;
|
||||
this.w.extensions = Object.freeze(window.extensions.map(function (data) {
|
||||
var user = this.g.user;
|
||||
this.g.extensions = Object.freeze(window.extensions.map(function (data) {
|
||||
return LNbits.map.extension(data);
|
||||
}).map(function (obj) {
|
||||
if (user) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
<q-header bordered class="bg-lnbits-dark">
|
||||
<q-toolbar>
|
||||
<q-btn dense flat round icon="menu" @click="w.visibleDrawer = !w.visibleDrawer"></q-btn>
|
||||
<q-btn dense flat round icon="menu" @click="g.visibleDrawer = !g.visibleDrawer"></q-btn>
|
||||
<q-toolbar-title><strong>LN</strong>bits</q-toolbar-title>
|
||||
<q-badge color="yellow" text-color="black">
|
||||
<span><span v-show="$q.screen.gt.sm">USE WITH CAUTION - LNbits wallet is still in </span>BETA</span>
|
||||
@ -30,7 +30,7 @@
|
||||
</q-toolbar>
|
||||
</q-header>
|
||||
|
||||
<q-drawer v-model="w.visibleDrawer" side="left" :width="($q.screen.lt.md) ? 260 : 230" show-if-above :elevated="$q.screen.lt.md">
|
||||
<q-drawer v-model="g.visibleDrawer" side="left" :width="($q.screen.lt.md) ? 260 : 230" show-if-above :elevated="$q.screen.lt.md">
|
||||
{% block drawer %}
|
||||
<lnbits-wallet-list></lnbits-wallet-list>
|
||||
<lnbits-extension-list class="q-pb-xl"></lnbits-extension-list>
|
||||
|
Loading…
Reference in New Issue
Block a user