Simplified mobile wallet (#2175)

---------

Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
This commit is contained in:
Arc 2023-12-22 16:32:01 +00:00 committed by GitHub
parent 815c3e61e4
commit e8c9304519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 87 additions and 18 deletions

View File

@ -15,13 +15,28 @@
{% elif HIDE_API %} {% elif HIDE_API %}
<div class="col-12 q-gutter-y-md"> <div class="col-12 q-gutter-y-md">
{% else %} {% else %}
<div class="col-12 col-md-7 q-gutter-y-md"> <div
class="col-12 col-md-7 q-gutter-y-md"
:style="$q.screen.lt.md ? {
position: mobileSimple ? 'fixed !important': ''
, top: mobileSimple ? '50% !important': ''
, left: mobileSimple ? '50% !important': ''
, transform: mobileSimple ? 'translate(-50%, -50%) !important': ''
} : ''"
>
{% endif %} {% endif %}
<q-card> <q-card
:style="$q.screen.lt.md ? {
background: $q.screen.lt.md ? 'none !important': ''
, boxShadow: $q.screen.lt.md ? 'none !important': ''
, margin: $q.screen.lt.md && mobileSimple ? 'auto !important': ''
, width: $q.screen.lt.md && mobileSimple ? '90% !important': ''
} : ''"
>
<q-card-section> <q-card-section>
<h3 class="q-my-none"> <h3 class="q-my-none text-no-wrap">
<strong>{% raw %}{{ formattedBalance }} {% endraw %}</strong> <strong>{% raw %}{{ formattedBalance }} {% endraw %}</strong>
{{LNBITS_DENOMINATION}} <small>{{LNBITS_DENOMINATION}}</small>
<q-btn <q-btn
v-if="'{{user.super_user}}' == 'True'" v-if="'{{user.super_user}}' == 'True'"
flat flat
@ -55,12 +70,27 @@
</q-popup-edit> </q-popup-edit>
</q-btn> </q-btn>
</h3> </h3>
<div v-if="g.wallet.currency"> <div class="row">
<span <div class="col">
class="text-h5 text-italic" <div v-if="g.wallet.currency">
v-text="formattedFiatBalance" <span
style="opacity: 0.75" class="text-h5 text-italic"
></span> v-text="formattedFiatBalance"
style="opacity: 0.75"
></span>
</div>
</div>
<div class="col">
<q-btn
@click="mobileSimple = !mobileSimple"
color="primary"
class="float-right lt-md"
size="sm"
flat
:icon="mobileSimple ? 'unfold_more' : 'unfold_less'"
:label="mobileSimple ? $t('more') : $t('less')"
></q-btn>
</div>
</div> </div>
</q-card-section> </q-card-section>
<div class="row q-pb-md q-px-md q-col-gutter-md gt-sm"> <div class="row q-pb-md q-px-md q-col-gutter-md gt-sm">
@ -98,7 +128,13 @@
</div> </div>
</q-card> </q-card>
<q-card> <q-card
:style="$q.screen.lt.md ? {
background: $q.screen.lt.md ? 'none !important': ''
, boxShadow: $q.screen.lt.md ? 'none !important': ''
, marginTop: $q.screen.lt.md ? '0px !important': ''
} : ''"
>
<q-card-section> <q-card-section>
<div class="row items-center no-wrap q-mb-sm"> <div class="row items-center no-wrap q-mb-sm">
<div class="col"> <div class="col">
@ -107,7 +143,7 @@
:v-text="$t('transactions')" :v-text="$t('transactions')"
></h5> ></h5>
</div> </div>
<div class="col-auto"> <div class="gt-sm col-auto">
<q-btn <q-btn
flat flat
color="grey" color="grey"
@ -132,6 +168,9 @@
</div> </div>
</div> </div>
<q-input <q-input
:style="$q.screen.lt.md ? {
display: mobileSimple ? 'none !important': ''
} : ''"
filled filled
dense dense
clearable clearable
@ -144,13 +183,15 @@
<q-table <q-table
dense dense
flat flat
:data="payments" :data="paymentsOmitter"
:row-key="paymentTableRowKey" :row-key="paymentTableRowKey"
:columns="paymentsTable.columns" :columns="paymentsTable.columns"
:pagination.sync="paymentsTable.pagination" :pagination.sync="paymentsTable.pagination"
:no-data-label="$t('no_transactions')" :no-data-label="$t('no_transactions')"
:filter="paymentsTable.filter" :filter="paymentsTable.filter"
:loading="paymentsTable.loading" :loading="paymentsTable.loading"
:hide-header="mobileSimple"
:hide-bottom="mobileSimple"
@request="fetchPayments" @request="fetchPayments"
> >
{% raw %} {% raw %}
@ -304,11 +345,13 @@
</q-card-section> </q-card-section>
</q-card> </q-card>
</div> </div>
{% if HIDE_API %} {% if HIDE_API %}
<div class="col-12 col-md-4 q-gutter-y-md"> <div class="col-12 col-md-4 q-gutter-y-md">
{% else %} {% else %}
<div class="col-12 col-md-5 q-gutter-y-md"> <div
v-if="!mobileSimple || $q.screen.gt.sm"
class="col-12 col-md-5 q-gutter-y-md"
>
<q-card> <q-card>
<q-card-section> <q-card-section>
<h6 class="text-subtitle1 q-mt-none q-mb-sm"> <h6 class="text-subtitle1 q-mt-none q-mb-sm">

File diff suppressed because one or more lines are too long

View File

@ -177,6 +177,7 @@ window.localisation.br = {
notification_source_label: notification_source_label:
'URL de origem (use apenas a fonte de status oficial do LNbits e fontes de confiança)', 'URL de origem (use apenas a fonte de status oficial do LNbits e fontes de confiança)',
more: 'mais', more: 'mais',
less: 'menos',
releases: 'Lançamentos', releases: 'Lançamentos',
killswitch: 'Dispositivo de desativação', killswitch: 'Dispositivo de desativação',
watchdog: 'Cão de guarda', watchdog: 'Cão de guarda',

View File

@ -166,6 +166,7 @@ window.localisation.cn = {
notification_source: '通知来源', notification_source: '通知来源',
notification_source_label: '来源 URL仅使用官方LNbits状态源和您信任的源', notification_source_label: '来源 URL仅使用官方LNbits状态源和您信任的源',
more: '更多', more: '更多',
less: '少',
releases: '版本', releases: '版本',
killswitch: '杀手锏', killswitch: '杀手锏',
watchdog: '监控程序', watchdog: '监控程序',

View File

@ -174,6 +174,7 @@ window.localisation.cs = {
notification_source_label: notification_source_label:
'URL zdroje (používejte pouze oficiální zdroj stavu LNbits a zdroje, kterým můžete věřit)', 'URL zdroje (používejte pouze oficiální zdroj stavu LNbits a zdroje, kterým můžete věřit)',
more: 'více', more: 'více',
less: 'méně',
releases: 'Vydání', releases: 'Vydání',
killswitch: 'Killswitch', killswitch: 'Killswitch',
watchdog: 'Watchdog', watchdog: 'Watchdog',

View File

@ -179,6 +179,7 @@ window.localisation.de = {
notification_source_label: notification_source_label:
'Quell-URL (verwenden Sie nur die offizielle LNbits-Statusquelle und Quellen, denen Sie vertrauen können)', 'Quell-URL (verwenden Sie nur die offizielle LNbits-Statusquelle und Quellen, denen Sie vertrauen können)',
more: 'mehr', more: 'mehr',
less: 'weniger',
releases: 'Veröffentlichungen', releases: 'Veröffentlichungen',
killswitch: 'Killswitch', killswitch: 'Killswitch',
watchdog: 'Wachhund', watchdog: 'Wachhund',

View File

@ -171,6 +171,7 @@ window.localisation.en = {
notification_source_label: notification_source_label:
'Source URL (only use the official LNbits status source, and sources you can trust)', 'Source URL (only use the official LNbits status source, and sources you can trust)',
more: 'more', more: 'more',
less: 'less',
releases: 'Releases', releases: 'Releases',
killswitch: 'Killswitch', killswitch: 'Killswitch',
watchdog: 'Watchdog', watchdog: 'Watchdog',

View File

@ -177,6 +177,7 @@ window.localisation.es = {
notification_source_label: notification_source_label:
'URL de origen (solo use la fuente oficial de estado de LNbits y fuentes en las que confíe)', 'URL de origen (solo use la fuente oficial de estado de LNbits y fuentes en las que confíe)',
more: 'más', more: 'más',
less: 'menos',
releases: 'Lanzamientos', releases: 'Lanzamientos',
killswitch: 'Interruptor de apagado', killswitch: 'Interruptor de apagado',
watchdog: 'Perro guardián', watchdog: 'Perro guardián',

View File

@ -181,6 +181,7 @@ window.localisation.fr = {
notification_source_label: notification_source_label:
'URL source (utilisez uniquement la source officielle de statut LNbits et des sources de confiance)', 'URL source (utilisez uniquement la source officielle de statut LNbits et des sources de confiance)',
more: 'plus', more: 'plus',
less: 'moins',
releases: 'Versions', releases: 'Versions',
killswitch: "Interrupteur d'arrêt", killswitch: "Interrupteur d'arrêt",
watchdog: 'Chien de garde', watchdog: 'Chien de garde',

View File

@ -177,6 +177,7 @@ window.localisation.it = {
notification_source_label: notification_source_label:
'URL sorgente (utilizzare solo la fonte ufficiale di stato LNbits e fonti di cui ti puoi fidare)', 'URL sorgente (utilizzare solo la fonte ufficiale di stato LNbits e fonti di cui ti puoi fidare)',
more: 'più', more: 'più',
less: 'meno',
releases: 'Pubblicazioni', releases: 'Pubblicazioni',
killswitch: 'Interruttore di spegnimento', killswitch: 'Interruttore di spegnimento',
watchdog: 'Cane da guardia', watchdog: 'Cane da guardia',

View File

@ -174,6 +174,7 @@ window.localisation.jp = {
notification_source_label: notification_source_label:
'ソースURL公式のLNbitsステータスソースのみを使用し、信頼できるソースのみを利用してください', 'ソースURL公式のLNbitsステータスソースのみを使用し、信頼できるソースのみを利用してください',
more: 'より多くの', more: 'より多くの',
less: '少ない',
releases: 'リリース', releases: 'リリース',
killswitch: 'キルスイッチ', killswitch: 'キルスイッチ',
watchdog: 'ウォッチドッグ', watchdog: 'ウォッチドッグ',

View File

@ -174,6 +174,7 @@ window.localisation.kr = {
notification_source_label: notification_source_label:
'알림 메세지를 가져올 URL (공식 LNbits 상황판 출처나, 당신이 신뢰할 수 있는 출처만을 사용하세요)', '알림 메세지를 가져올 URL (공식 LNbits 상황판 출처나, 당신이 신뢰할 수 있는 출처만을 사용하세요)',
more: '더 알아보기', more: '더 알아보기',
less: '적게',
releases: '배포 버전들', releases: '배포 버전들',
killswitch: '비상 정지', killswitch: '비상 정지',
watchdog: '와치독', watchdog: '와치독',

View File

@ -177,6 +177,7 @@ window.localisation.nl = {
notification_source_label: notification_source_label:
'Bron-URL (gebruik alleen de officiële LNbits-statusbron en bronnen die u vertrouwt)', 'Bron-URL (gebruik alleen de officiële LNbits-statusbron en bronnen die u vertrouwt)',
more: 'meer', more: 'meer',
less: 'minder',
releases: 'Uitgaven', releases: 'Uitgaven',
killswitch: 'Killswitch', killswitch: 'Killswitch',
watchdog: 'Waakhond', watchdog: 'Waakhond',

View File

@ -176,6 +176,7 @@ window.localisation.pi = {
notification_source_label: notification_source_label:
"Source URL (only use th' official LNbits status source, and sources ye can trust)", "Source URL (only use th' official LNbits status source, and sources ye can trust)",
more: "Arr, 'tis more.", more: "Arr, 'tis more.",
less: "Arr, 'tis more fewer.",
releases: 'Releases', releases: 'Releases',
killswitch: 'Killswitch', killswitch: 'Killswitch',
watchdog: 'Seadog', watchdog: 'Seadog',

View File

@ -174,6 +174,7 @@ window.localisation.pl = {
notification_source_label: notification_source_label:
'Adres URL źródła (używaj tylko oficjalnego źródła statusu LNbits oraz źródeł, którym możesz zaufać)', 'Adres URL źródła (używaj tylko oficjalnego źródła statusu LNbits oraz źródeł, którym możesz zaufać)',
more: 'więcej', more: 'więcej',
less: 'mniej',
releases: 'Wydania', releases: 'Wydania',
killswitch: 'Killswitch', killswitch: 'Killswitch',
watchdog: 'Pies gończy', watchdog: 'Pies gończy',

View File

@ -176,6 +176,7 @@ window.localisation.pt = {
notification_source_label: notification_source_label:
'URL de Origem (use apenas a fonte oficial de status do LNbits e fontes em que confia)', 'URL de Origem (use apenas a fonte oficial de status do LNbits e fontes em que confia)',
more: 'mais', more: 'mais',
less: 'menos',
releases: 'Lançamentos', releases: 'Lançamentos',
killswitch: 'Interruptor de desativação', killswitch: 'Interruptor de desativação',
watchdog: 'Cão de guarda', watchdog: 'Cão de guarda',

View File

@ -174,6 +174,7 @@ window.localisation.sk = {
notification_source_label: notification_source_label:
'URL zdroja (používajte len oficiálny LNbits zdroj stavu a zdroje, ktorým môžete dôverovať)', 'URL zdroja (používajte len oficiálny LNbits zdroj stavu a zdroje, ktorým môžete dôverovať)',
more: 'viac', more: 'viac',
less: 'menej',
releases: 'Vydania', releases: 'Vydania',
killswitch: 'Killswitch', killswitch: 'Killswitch',
watchdog: 'Watchdog', watchdog: 'Watchdog',

View File

@ -174,6 +174,7 @@ window.localisation.we = {
notification_source_label: notification_source_label:
'URL Ffynhonnell (defnyddiwch yn unig ffynhonnell statws swyddogol LNbits, a ffynonellau y gallwch ymddiried ynddynt)', 'URL Ffynhonnell (defnyddiwch yn unig ffynhonnell statws swyddogol LNbits, a ffynonellau y gallwch ymddiried ynddynt)',
more: 'mwy', more: 'mwy',
less: 'llai',
releases: 'Rhyddhau', releases: 'Rhyddhau',
killswitch: 'Killswitch', killswitch: 'Killswitch',
watchdog: 'Gwyliwr', watchdog: 'Gwyliwr',

View File

@ -1,6 +1,6 @@
// update cache version every time there is a new deployment // update cache version every time there is a new deployment
// so the service worker reinitializes the cache // so the service worker reinitializes the cache
const CACHE_VERSION = 97 const CACHE_VERSION = 98
const CURRENT_CACHE = `lnbits-${CACHE_VERSION}-` const CURRENT_CACHE = `lnbits-${CACHE_VERSION}-`
const getApiKey = request => { const getApiKey = request => {

View File

@ -242,6 +242,7 @@ new Vue({
}, },
balance: 0, balance: 0,
fiatBalance: 0, fiatBalance: 0,
mobileSimple: false,
credit: 0, credit: 0,
update: { update: {
name: null, name: null,
@ -271,6 +272,12 @@ new Vue({
return LNbits.utils.search(this.payments, q) return LNbits.utils.search(this.payments, q)
}, },
paymentsOmitter() {
if (this.$q.screen.lt.md && this.mobileSimple) {
return this.payments.length > 0 ? [this.payments[0]] : []
}
return this.payments
},
canPay: function () { canPay: function () {
if (!this.parse.invoice) return false if (!this.parse.invoice) return false
return this.parse.invoice.sat <= this.balance return this.parse.invoice.sat <= this.balance
@ -861,6 +868,9 @@ new Vue({
this.decodeRequest() this.decodeRequest()
this.parse.show = true this.parse.show = true
} }
if (this.$q.screen.lt.md) {
this.mobileSimple = true
}
this.fetchBalance() this.fetchBalance()
this.fetchPayments() this.fetchPayments()

View File

@ -64,7 +64,7 @@
v-text="$t('voidwallet_active')" v-text="$t('voidwallet_active')"
color="red" color="red"
text-color="black" text-color="black"
class="q-mr-md" class="q-mr-md gt-md"
> >
</q-badge> </q-badge>
{%endif%} {%endif%}