[feat] ui support for high number of wallets and payments (#3174)

This commit is contained in:
Vlad Stan
2025-05-27 11:41:25 +03:00
committed by GitHub
parent 375b95c004
commit beee24bd92
22 changed files with 545 additions and 74 deletions
+36 -8
View File
@@ -179,12 +179,12 @@
>
<q-scroll-area style="height: 100%">
<q-item>
<q-item-section>
<q-item-section class="cursor-pointer" @click="goToWallets()">
<q-item-label
:style="$q.dark.isActive ? 'color:rgba(255, 255, 255, 0.64)' : ''"
class="q-item__label q-item__label--header q-pa-none"
header
v-text="$t('wallets')"
v-text="$t('wallets') + ' (' + g.user.wallets.length + ')'"
></q-item-label>
</q-item-section>
<q-item-section side>
@@ -211,7 +211,6 @@
:show-admin="'{{LNBITS_ADMIN_UI}}' == 'True'"
:show-users="'{{LNBITS_ADMIN_UI}}' == 'True'"
:show-audit="'{{LNBITS_AUDIT_ENABLED}}' == 'True'"
:show-payments="'{{LNBITS_ADMIN_UI}}' == 'True'"
:show-node="'{{LNBITS_NODE_UI}}' == 'True'"
:show-extensions="'{{LNBITS_EXTENSIONS_DEACTIVATE_ALL}}' == 'False'"
></lnbits-manage>
@@ -248,7 +247,7 @@
@click="showAddWalletDialog.show = true"
>
<q-tooltip
><span v-text="$t('add_wallet')"></span
><span v-text="$t('add_new_wallet')"></span
></q-tooltip>
</q-btn>
<q-dialog
@@ -258,7 +257,9 @@
>
<q-card style="min-width: 350px">
<q-card-section>
<div class="text-h6">Wallet name</div>
<div class="text-h6">
<span v-text="$t('wallet_name')"></span>
</div>
</q-card-section>
<q-card-section class="q-pt-none">
@@ -271,10 +272,14 @@
</q-card-section>
<q-card-actions align="right" class="text-primary">
<q-btn flat label="Cancel" v-close-popup></q-btn>
<q-btn
flat
label="Add wallet"
:label="$t('cancel')"
v-close-popup
></q-btn>
<q-btn
flat
:label="$t('add_wallet')"
v-close-popup
@click="submitAddWallet()"
></q-btn>
@@ -285,7 +290,7 @@
</q-card-section>
</q-card>
<q-card
v-for="wallet in g.user.wallets"
v-for="wallet in g.user.wallets.slice(0, g.user.extra.visible_wallet_count || 10)"
:key="wallet.id"
clickable
@click="selectWallet(wallet)"
@@ -331,6 +336,29 @@
</div>
</q-card-section>
</q-card>
<q-card
v-if="g.user.hiddenWalletsCount"
class="wallet-list-card"
>
<q-card-section
class="flex flex-center column full-height text-center"
>
<div>
<q-btn
round
color="primary"
icon="more_horiz"
@click="goToWallets()"
>
<q-tooltip
><span
v-text="$t('more_count', {count: g.user.hiddenWalletsCount})"
></span
></q-tooltip>
</q-btn>
</div>
</q-card-section>
</q-card>
</div>
</q-scroll-area>
+34 -15
View File
@@ -5,7 +5,10 @@
class="lnbits-drawer__q-list"
>
<q-item
v-for="walletRec in g.user.wallets"
v-for="walletRec in g.user.wallets.slice(
0,
g.user.extra.visible_wallet_count || 10
)"
:key="walletRec.id"
clickable
:active="g.wallet && g.wallet.id === walletRec.id"
@@ -43,6 +46,22 @@
<q-item-section side v-show="g.wallet && g.wallet.id === walletRec.id">
</q-item-section>
</q-item>
<q-item
v-if="g.user.hiddenWalletsCount > 0"
clickable
@click="goToWallets()"
>
<q-item-section side>
<q-icon name="more_horiz" color="grey-5" size="md"></q-icon>
</q-item-section>
<q-item-section>
<q-item-label
lines="1"
class="text-caption"
v-text="$t('more_count', {count: g.user.hiddenWalletsCount})"
></q-item-label>
</q-item-section>
</q-item>
<q-item clickable @click="showForm = !showForm">
<q-item-section side>
<q-icon
@@ -55,7 +74,7 @@
<q-item-label
lines="1"
class="text-caption"
v-text="$t('add_wallet')"
v-text="$t('add_new_wallet')"
></q-item-label>
</q-item-section>
</q-item>
@@ -178,19 +197,19 @@
<q-item-label lines="1" v-text="$t('api_watch')"></q-item-label>
</q-item-section>
</q-item>
<q-item v-if="showPayments" to="/payments">
<q-item-section side>
<q-icon
name="query_stats"
:color="isActive('/payments') ? 'primary' : 'grey-5'"
size="md"
></q-icon>
</q-item-section>
<q-item-section>
<q-item-label lines="1" v-text="$t('payments')"></q-item-label>
</q-item-section>
</q-item>
</div>
<q-item to="/payments">
<q-item-section side>
<q-icon
name="query_stats"
:color="isActive('/payments') ? 'primary' : 'grey-5'"
size="md"
></q-icon>
</q-item-section>
<q-item-section>
<q-item-label lines="1" v-text="$t('payments')"></q-item-label>
</q-item-section>
</q-item>
<q-item v-if="showExtensions" to="/extensions">
<q-item-section side>
<q-icon
@@ -1185,7 +1204,7 @@
color="primary"
:disable="walletName == ''"
type="submit"
:label="$t('add_wallet')"
:label="$t('add_new_wallet')"
class="full-width q-mb-sm"
></q-btn>
<q-btn