feat(core): add search to payments table

This commit is contained in:
Eneko Illarramendi
2020-04-17 21:13:32 +02:00
parent de75057a15
commit d03e472cc2
4 changed files with 18 additions and 9 deletions
+8 -1
View File
@@ -133,7 +133,8 @@ new Vue({
],
pagination: {
rowsPerPage: 10
}
},
filter: null
},
paymentsChart: {
show: false
@@ -141,6 +142,12 @@ new Vue({
};
},
computed: {
filteredPayments: function () {
var q = this.paymentsTable.filter;
if (!q || q == '') return this.payments;
return LNbits.utils.search(this.payments, q);
},
balance: function () {
if (this.payments.length) {
return _.pluck(this.payments, 'amount').reduce(function (a, b) { return a + b; }, 0) / 1000;