chore(vue): use g for consistency with Flask

This commit is contained in:
Eneko Illarramendi
2020-04-03 22:38:50 +02:00
parent d0b44eada9
commit a81de95f73
5 changed files with 18 additions and 18 deletions
+5 -5
View File
@@ -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 () {
+4 -4
View File
@@ -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>