feat(core): add search to payments table
This commit is contained in:
parent
de75057a15
commit
d03e472cc2
4 changed files with 18 additions and 9 deletions
|
|
@ -133,7 +133,8 @@ new Vue({
|
||||||
],
|
],
|
||||||
pagination: {
|
pagination: {
|
||||||
rowsPerPage: 10
|
rowsPerPage: 10
|
||||||
}
|
},
|
||||||
|
filter: null
|
||||||
},
|
},
|
||||||
paymentsChart: {
|
paymentsChart: {
|
||||||
show: false
|
show: false
|
||||||
|
|
@ -141,6 +142,12 @@ new Vue({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
filteredPayments: function () {
|
||||||
|
var q = this.paymentsTable.filter;
|
||||||
|
if (!q || q == '') return this.payments;
|
||||||
|
|
||||||
|
return LNbits.utils.search(this.payments, q);
|
||||||
|
},
|
||||||
balance: function () {
|
balance: function () {
|
||||||
if (this.payments.length) {
|
if (this.payments.length) {
|
||||||
return _.pluck(this.payments, 'amount').reduce(function (a, b) { return a + b; }, 0) / 1000;
|
return _.pluck(this.payments, 'amount').reduce(function (a, b) { return a + b; }, 0) / 1000;
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
|
|
||||||
<q-card>
|
<q-card>
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
<div class="row items-center no-wrap q-mb-md">
|
<div class="row items-center no-wrap q-mb-sm">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<h5 class="text-subtitle1 q-my-none">Transactions</h5>
|
<h5 class="text-subtitle1 q-my-none">Transactions</h5>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -63,8 +63,12 @@
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<q-input v-if="payments.length > 10" filled dense clearable
|
||||||
|
v-model="paymentsTable.filter"
|
||||||
|
debounce="300" placeholder="Search by memo, amount" class="q-mb-md">
|
||||||
|
</q-input>
|
||||||
<q-table dense flat
|
<q-table dense flat
|
||||||
:data="payments"
|
:data="filteredPayments"
|
||||||
row-key="payhash"
|
row-key="payhash"
|
||||||
:columns="paymentsTable.columns"
|
:columns="paymentsTable.columns"
|
||||||
:pagination.sync="paymentsTable.pagination">
|
:pagination.sync="paymentsTable.pagination">
|
||||||
|
|
@ -160,8 +164,8 @@
|
||||||
<q-spinner v-if="receive.status == 'loading'" color="deep-purple" size="2.55em"></q-spinner>
|
<q-spinner v-if="receive.status == 'loading'" color="deep-purple" size="2.55em"></q-spinner>
|
||||||
</q-form>
|
</q-form>
|
||||||
</q-card>
|
</q-card>
|
||||||
<q-card v-else class="q-pa-lg lnbits__dialog-card">
|
<q-card v-else class="q-pa-lg q-pt-xl lnbits__dialog-card">
|
||||||
<div class="text-center q-mb-md">
|
<div class="text-center q-mb-lg">
|
||||||
<a :href="'lightning:' + receive.paymentReq">
|
<a :href="'lightning:' + receive.paymentReq">
|
||||||
<q-responsive :ratio="1" class="q-mx-xl">
|
<q-responsive :ratio="1" class="q-mx-xl">
|
||||||
<qrcode :value="receive.paymentReq" :options="{width: 340}" class="rounded-borders"></qrcode>
|
<qrcode :value="receive.paymentReq" :options="{width: 340}" class="rounded-borders"></qrcode>
|
||||||
|
|
|
||||||
|
|
@ -42,5 +42,5 @@ class WithdrawLink(NamedTuple):
|
||||||
k1=self.k1,
|
k1=self.k1,
|
||||||
min_withdrawable=self.min_withdrawable * 1000,
|
min_withdrawable=self.min_withdrawable * 1000,
|
||||||
max_withdrawable=self.max_withdrawable * 1000,
|
max_withdrawable=self.max_withdrawable * 1000,
|
||||||
default_description="LNbits LNURL withdraw",
|
default_description="#withdraw LNbits LNURL",
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -161,9 +161,7 @@ new Vue({
|
||||||
if (this.g.user.wallets.length) {
|
if (this.g.user.wallets.length) {
|
||||||
var getWithdrawLinks = this.getWithdrawLinks;
|
var getWithdrawLinks = this.getWithdrawLinks;
|
||||||
getWithdrawLinks();
|
getWithdrawLinks();
|
||||||
/*setInterval(function(){
|
setInterval(function () { getWithdrawLinks(); }, 20000);
|
||||||
getWithdrawLinks();
|
|
||||||
}, 20000);*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue