Merge branch 'master' into StreamerCopilot

This commit is contained in:
Ben Arc
2021-04-13 19:20:45 +01:00
24 changed files with 391 additions and 431 deletions
@@ -4,6 +4,11 @@
label="API info"
:content-inset-level="0.5"
>
<q-card-section>
<strong>Wallet ID: </strong><em>{{ wallet.id }}</em><br />
<strong>Admin key: </strong><em>{{ wallet.adminkey }}</em><br />
<strong>Invoice/read key: </strong><em>{{ wallet.inkey }}</em>
</q-card-section>
<q-expansion-item
group="api"
dense
+75 -15
View File
@@ -88,21 +88,81 @@
<div class="col-12 col-md-3 col-lg-3">
<div class="row q-col-gutter-lg justify-center">
<div class="col-6 col-sm-4 col-md-8 q-gutter-y-sm">
<q-btn
flat
color="purple"
label="Supporters"
type="a"
href="mailto:lnbits@pm.me"
class="full-width"
></q-btn>
<a href="https://github.com/rootzoll/raspiblitz">
<q-img
contain
:src="($q.dark.isActive) ? '/static/images/raspiblitz-negative.svg' : '/static/images/raspiblitz.svg'"
style="height: 90px"
></q-img>
</a>
<q-btn flat color="purple" label="Runs on" class="full-width"></q-btn>
<div class="row">
<div class="col">
<a href="https://github.com/ElementsProject/lightning">
<q-img
contain
:src="($q.dark.isActive) ? '/static/images/cln.png' : '/static/images/lnd.png'"
></q-img>
</a>
</div>
<div class="col q-pl-md">
<a href="https://github.com/lightningnetwork/lnd">
<q-img
contain
:src="($q.dark.isActive) ? '/static/images/lnd.png' : '/static/images/lnd.png'"
></q-img>
</a>
</div>
</div>
<div class="row">
<div class="col">
<a href="https://opennode.com">
<q-img
contain
:src="($q.dark.isActive) ? '/static/images/opennode.png' : '/static/images/opennode.png'"
></q-img>
</a>
</div>
<div class="col q-pl-md">
<a href="https://lnpay.co/">
<q-img
contain
:src="($q.dark.isActive) ? '/static/images/lnpay.png' : '/static/images/lnpay.png'"
></q-img>
</a>
</div>
</div>
<div class="row">
<div class="col">
<a href="https://github.com/shesek/spark-wallet">
<q-img
contain
:src="($q.dark.isActive) ? '/static/images/spark.png' : '/static/images/spark.png'"
></q-img>
</a>
</div>
<div class="col q-pl-md">
<a href="https://t.me/lntxbot">
<q-img
contain
:src="($q.dark.isActive) ? '/static/images/lntxbot.png' : '/static/images/lntxbot.png'"
></q-img>
</a>
</div>
</div>
<div class="row">
<div class="col">
<a href="https://github.com/rootzoll/raspiblitz">
<q-img
contain
:src="($q.dark.isActive) ? '/static/images/blitz.png' : '/static/images/blitz.png'"
></q-img>
</a>
</div>
<div class="col q-pl-md">
<a href="https://getumbrel.com/">
<q-img
contain
:src="($q.dark.isActive) ? '/static/images/umbrel.png' : '/static/images/umbrel.png'"
></q-img>
</a>
</div>
</div>
</div>
</div>
</div>
+9 -6
View File
@@ -4,6 +4,7 @@
<!---->
{% block scripts %} {{ window_vars(user, wallet) }}
<script src="/core/static/js/wallet.js"></script>
<link rel="manifest" href="/manifest/{{ user.id }}.webmanifest">
{% endblock %}
<!---->
{% block title %} {{ wallet.name }} - {{ SITE_TITLE }} {% endblock %}
@@ -220,14 +221,13 @@
<div class="col-12 col-md-5 q-gutter-y-md">
<q-card>
<q-card-section>
<h6 class="text-subtitle1 q-mt-none q-mb-sm">LNbits wallet</h6>
<strong>Wallet name: </strong><em>{{ wallet.name }}</em><br />
<strong>Wallet ID: </strong><em>{{ wallet.id }}</em><br />
<strong>Admin key: </strong><em>{{ wallet.adminkey }}</em><br />
<strong>Invoice/read key: </strong><em>{{ wallet.inkey }}</em>
<h6 class="text-subtitle1 q-mt-none q-mb-sm">
LNbits wallet: <strong><em>{{ wallet.name }}</em></strong>
</h6>
</q-card-section>
<q-card-section class="q-pa-none">
<q-separator></q-separator>
<q-list>
{% include "core/_api_docs.html" %}
<q-separator></q-separator>
@@ -238,7 +238,10 @@
>
<q-card>
<q-card-section>
<p>This QR code contains your wallet URL with full access. You can scan it from your phone to open your wallet from there.</p>
<p>
This QR code contains your wallet URL with full access. You
can scan it from your phone to open your wallet from there.
</p>
<qrcode
:value="'{{request.url_root}}'+'wallet?usr={{user.id}}&wal={{wallet.id}}'"
:options="{width:240}"
+38 -1
View File
@@ -5,8 +5,9 @@ from http import HTTPStatus
from quart import (
g,
abort,
redirect,
jsonify,
request,
redirect,
render_template,
send_from_directory,
url_for,
@@ -165,3 +166,39 @@ async def lnurlwallet():
await trio.sleep(3)
return redirect(url_for("core.wallet", usr=user.id, wal=wallet.id))
@core_app.route("/manifest/<usr>.webmanifest")
async def manifest(usr: str):
user = await get_user(usr)
if not user:
return "", HTTPStatus.NOT_FOUND
return jsonify(
{
"short_name": "LNbits",
"name": "LNbits Wallet",
"icons": [
{
"src": "https://cdn.jsdelivr.net/gh/lnbits/lnbits@0.3.0/docs/logos/lnbits.png",
"type": "image/png",
"sizes": "900x900",
}
],
"start_url": "/wallet?usr=" + usr,
"background_color": "#3367D6",
"description": "Weather forecast information",
"display": "standalone",
"scope": "/",
"theme_color": "#3367D6",
"shortcuts": [
{
"name": wallet.name,
"short_name": wallet.name,
"description": wallet.name,
"url": "/wallet?usr=" + usr + "&wal=" + wallet.id,
}
for wallet in user.wallets
],
}
)
@@ -41,10 +41,14 @@
<q-card v-show="ticketLink.show" class="q-pa-lg">
<div class="text-center q-mb-lg">
<a :href="ticketLink.data.link" target="_blank">
<q-btn unelevated size="xl" color="deep-purple"
>Link to your ticket!</q-btn
></a
<q-btn
unelevated
size="xl"
:href="ticketLink.data.link"
target="_blank"
color="deep-purple"
type="a"
>Link to your ticket!</q-btn
>
<br /><br />
<p>You'll be redirected in a few moments...</p>
@@ -176,22 +176,29 @@
<q-dialog v-model="formDialog.show" position="top">
<q-card class="q-pa-lg q-pt-xl lnbits__dialog-card">
<q-form @submit="sendEventData" class="q-gutter-md">
<q-select
filled
dense
emit-value
v-model="formDialog.data.wallet"
:options="g.user.walletOptions"
label="Wallet *"
>
</q-select>
<q-input
filled
dense
v-model.trim="formDialog.data.name"
type="name"
label="Name of event "
></q-input>
<div class="row">
<div class="col">
<q-input
filled
dense
v-model.trim="formDialog.data.name"
type="name"
label="Title of event "
></q-input>
</div>
<div class="col q-pl-sm">
<q-select
filled
dense
emit-value
v-model="formDialog.data.wallet"
:options="g.user.walletOptions"
label="Wallet *"
>
</q-select>
</div>
</div>
<q-input
filled
dense
@@ -199,41 +206,63 @@
type="textarea"
label="Info about the event "
></q-input>
<q-input
filled
dense
v-model.trim="formDialog.data.closing_date"
type="date"
label="Closing for tickets "
></q-input>
<q-input
filled
dense
v-model.trim="formDialog.data.event_start_date"
type="date"
label="Event begins "
></q-input>
<q-input
filled
dense
v-model.trim="formDialog.data.event_end_date"
type="date"
label="Event ends "
></q-input>
<q-input
filled
dense
v-model.number="formDialog.data.amount_tickets"
type="number"
label="Amount of tickets "
></q-input>
<q-input
filled
dense
v-model.number="formDialog.data.price_per_ticket"
type="number"
label="Price per ticket "
></q-input>
<div class="row">
<div class="col-4">Ticket closing date</div>
<div class="col-8">
<q-input
filled
dense
v-model.trim="formDialog.data.closing_date"
type="date"
></q-input>
</div>
</div>
<div class="row">
<div class="col-4">Event begins</div>
<div class="col-8">
<q-input
filled
dense
v-model.trim="formDialog.data.event_start_date"
type="date"
></q-input>
</div>
</div>
<div class="row">
<div class="col-4">Event ends</div>
<div class="col-8">
<q-input
filled
dense
v-model.trim="formDialog.data.event_end_date"
type="date"
></q-input>
</div>
</div>
<div class="row">
<div class="col">
<q-input
filled
dense
v-model.number="formDialog.data.amount_tickets"
type="number"
label="Amount of tickets "
></q-input>
</div>
<div class="col q-pl-sm">
<q-input
filled
dense
v-model.number="formDialog.data.price_per_ticket"
type="number"
label="Price per ticket "
></q-input>
</div>
</div>
<div class="row q-mt-lg">
<q-btn
v-if="formDialog.data.id"
@@ -10,7 +10,7 @@
class="col"
color="white"
style="background-color: grey; height: 30px; padding: 5px"
v-if="charge_time_elapsed == 'True'"
v-if="timetoComplete < 1"
>
<center>Time elapsed</center>
</div>
@@ -106,7 +106,7 @@
<q-card class="q-pa-lg" v-if="lnbtc">
<q-card-section class="q-pa-none">
<div class="text-center q-pt-md">
<div v-if="charge_time_elapsed == 'True' && charge_paid == 'False'">
<div v-if="timetoComplete < 1 && charge_paid == 'False'">
<q-icon
name="block"
style="color: #ccc; font-size: 21.4em"
@@ -156,7 +156,7 @@
<q-card class="q-pa-lg" v-if="onbtc">
<q-card-section class="q-pa-none">
<div class="text-center q-pt-md">
<div v-if="charge_time_elapsed == 'True' && charge_paid == 'False'">
<div v-if="timetoComplete < 1 && charge_paid == 'False'">
<q-icon
name="block"
style="color: #ccc; font-size: 21.4em"
@@ -229,6 +229,7 @@
newProgress: 0.4,
counter: 1,
newTimeLeft: '',
timetoComplete: 100,
lnbtc: true,
onbtc: false,
charge_time_elapsed: '{{charge.time_elapsed}}',
@@ -247,7 +248,6 @@
'filla'
)
.then(function (response) {
console.log(response.data)
self.charge_time_elapsed = response.data.time_elapsed
self.charge_amount = response.data.amount
self.charge_balance = response.data.balance
@@ -271,6 +271,7 @@
var timeToComplete =
parseInt('{{ charge.time }}') * 60 -
(Date.now() / 1000 - parseInt('{{ charge.timestamp }}'))
this.timetoComplete = timeToComplete
var timeLeft = Quasar.utils.date.formatDate(
new Date((timeToComplete - 3600) * 1000),
'HH:mm:ss'
@@ -288,8 +289,7 @@
timerCount: function () {
self = this
var refreshIntervalId = setInterval(function () {
if (self.charge_paid == 'True') {
console.log('did this work?')
if (self.charge_paid == 'True' || self.timetoComplete < 1) {
clearInterval(refreshIntervalId)
}
self.getTheTime()
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="0 0 457 80.82"><defs><style>.cls-1{fill:#fff}</style></defs><path d="M379.92 105.59c5.53.9 7.24 5.74 6.33 11.17l-2.11 11.57c-1.51 8.86-8.25 13.89-19.92 13.89H346l12.37-70.43h18.43c9.66 0 16.09 5 14.49 13.88l-1.51 8.85c-1.01 6.04-4.13 10.37-9.86 11.07zm-9.76 5.14h-7l-3.72 21.42h6.94c3.32 0 5.74-1.7 6.34-5.43l1.91-10.56c.66-3.73-1.15-5.43-4.47-5.43zm-5.24-9.87h6.54c3.33 0 5.74-1.71 6.44-5.43l1.41-8.15c.71-3.72-1.1-5.43-4.42-5.43h-6.54zM420.09 142.22H390.4l12.38-70.43h11.67l-10.56 60h18zM426.75 142.22l12.37-70.43h11.67l-12.37 70.43zM490.65 82.05h-11.78l-10.56 60.17h-11.67l10.56-60.17h-11.77l1.81-10.26h35.22zM516.83 142.22h-33.71l1.41-8.05 29.88-52.73h-19.32l1.62-9.65h31.79l-1.41 8-29.78 52.72h21.23z" class="cls-1" transform="translate(-71.5 -66.59)"/><path fill="#ffe000" d="M333.53 119l-17-24.25 4.94-28.13L280.86 95l17 24.25-5 28.13zm-41.61-22l18.42-12.91-2.19 12.49L322.47 117 304 129.92l2.23-12.49z" transform="translate(-71.5 -66.59)"/><path d="M117.18 86.68L115 99.26c-1.2 6.94-4.52 11.16-9.86 13.28l4.73 29.68H98.26l-3.92-28.08H88.1l-4.93 28.08H71.5l12.37-70.43h18.21c9.66 0 17.01 4.21 15.1 14.89zm-17.31-4.63h-6.13l-3.83 22h6.14c3.82 0 6.64-1.41 7.55-6.43l1.6-9.16c.91-5-1.5-6.41-5.33-6.41zM142.15 142.22l.31-15.7h-13l-5.23 15.7h-11.56l25.46-70.43h14.69l.9 70.43zm.41-25.36l.6-31.29-10.46 31.29zM188.36 96.94l1.81-9.86c.71-4.43-1.51-6-4.93-6s-6.24 1.61-6.94 6l-.91 4.83c-.6 3.62.1 5.63 3.12 7.55l7.45 4.62c6.24 3.93 9.66 7 8.35 14.09l-1.81 10.16c-1.92 10.86-8.25 14.69-19.92 14.69h-.21c-9.65 0-16.8-3.72-14.89-14.69l2.22-12.27h11.47l-1.91 10.66c-.71 4.33 1.4 6.24 4.92 6.24s6.44-1.91 7.15-6.24l1-5.53c.7-3.82-.21-5.84-3.32-7.75l-7.35-4.63c-5.43-3.42-9.36-7.85-8.25-14.09l1.59-9.25C168.94 75 176.28 71 187 71h.2c8.65 0 16.6 4 14.69 14.49l-2 11.47zM246.24 86.68l-2.32 13.38C242 110.73 235.27 115 223.6 115h-6.54l-4.83 27.27h-11.67l12.37-70.43h18.21c9.66-.05 17.01 4.16 15.1 14.84zm-12 1.81c.91-5-1.51-6.44-5.33-6.44h-6.14l-3.92 22.64H225c3.82 0 6.64-1.41 7.54-6.44zM244.35 142.22l12.38-70.43h11.67L256 142.22z" class="cls-1" transform="translate(-71.5 -66.59)"/></svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="0 0 457 80.82"><defs><style>.cls-1{fill:#1a1a1a}</style></defs><path d="M379.92 105.59c5.53.9 7.24 5.74 6.33 11.17l-2.11 11.57c-1.51 8.86-8.25 13.89-19.92 13.89H346l12.37-70.43h18.43c9.66 0 16.09 5 14.49 13.88l-1.51 8.85c-1.01 6.04-4.13 10.37-9.86 11.07zm-9.76 5.14h-7l-3.72 21.42h6.94c3.32 0 5.74-1.7 6.34-5.43l1.91-10.56c.66-3.73-1.15-5.43-4.47-5.43zm-5.24-9.87h6.54c3.33 0 5.74-1.71 6.44-5.43l1.41-8.15c.71-3.72-1.1-5.43-4.42-5.43h-6.54zM420.09 142.22H390.4l12.38-70.43h11.67l-10.56 60h18zM426.75 142.22l12.37-70.43h11.67l-12.37 70.43zM490.65 82.05h-11.78l-10.56 60.17h-11.67l10.56-60.17h-11.77l1.81-10.26h35.22zM516.83 142.22h-33.71l1.41-8.05 29.88-52.73h-19.32l1.62-9.65h31.79l-1.41 8-29.78 52.72h21.23zM333.53 119l-17-24.25 4.94-28.13L280.86 95l17 24.25-5 28.13z" class="cls-1" transform="translate(-71.5 -66.59)"/><path fill="#ffe000" d="M234.77 50.84L220.42 30.4l18.42-12.91-2.19 12.49 14.32 20.47-18.43 12.88 2.23-12.49z"/><path d="M117.18 86.68L115 99.26c-1.2 6.94-4.52 11.16-9.86 13.28l4.73 29.68H98.26l-3.92-28.08H88.1l-4.93 28.08H71.5l12.37-70.43h18.21c9.66 0 17.01 4.21 15.1 14.89zm-17.31-4.63h-6.13l-3.83 22h6.14c3.82 0 6.64-1.41 7.55-6.43l1.6-9.16c.91-5-1.5-6.41-5.33-6.41zM142.15 142.22l.31-15.7h-13l-5.23 15.7h-11.56l25.46-70.43h14.69l.9 70.43zm.41-25.36l.6-31.29-10.46 31.29zM188.36 96.94l1.81-9.86c.71-4.43-1.51-6-4.93-6s-6.24 1.61-6.94 6l-.91 4.83c-.6 3.62.1 5.63 3.12 7.55l7.45 4.62c6.24 3.93 9.66 7 8.35 14.09l-1.81 10.16c-1.92 10.86-8.25 14.69-19.92 14.69h-.21c-9.65 0-16.8-3.72-14.89-14.69l2.22-12.27h11.47l-1.91 10.66c-.71 4.33 1.4 6.24 4.92 6.24s6.44-1.91 7.15-6.24l1-5.53c.7-3.82-.21-5.84-3.32-7.75l-7.35-4.63c-5.43-3.42-9.36-7.85-8.25-14.09l1.59-9.25C168.94 75 176.28 71 187 71h.2c8.65 0 16.6 4 14.69 14.49l-2 11.47zM246.24 86.68l-2.32 13.38C242 110.73 235.27 115 223.6 115h-6.54l-4.83 27.27h-11.67l12.37-70.43h18.21c9.66-.05 17.01 4.16 15.1 14.84zm-12 1.81c.91-5-1.51-6.44-5.33-6.44h-6.14l-3.92 22.64H225c3.82 0 6.64-1.41 7.54-6.44zM244.35 142.22l12.38-70.43h11.67L256 142.22z" class="cls-1" transform="translate(-71.5 -66.59)"/></svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB