mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-19 12:01:12 +02:00
fix purge
check for missing protocol fix request url default more debub fix lnbits root url add documentation reference
This commit is contained in:
@@ -176,7 +176,7 @@ async def purge_addresses(domain_id: str):
|
|||||||
now = datetime.now().timestamp()
|
now = datetime.now().timestamp()
|
||||||
|
|
||||||
for row in rows:
|
for row in rows:
|
||||||
r = Addresses(**row)._asdict()
|
r = Addresses(**row).dict()
|
||||||
|
|
||||||
start = datetime.fromtimestamp(r["time"])
|
start = datetime.fromtimestamp(r["time"])
|
||||||
paid = r["paid"]
|
paid = r["paid"]
|
||||||
|
@@ -370,9 +370,8 @@
|
|||||||
if (data.wallet_endpoint == '') {
|
if (data.wallet_endpoint == '') {
|
||||||
data.wallet_endpoint = null
|
data.wallet_endpoint = null
|
||||||
}
|
}
|
||||||
data.wallet_endpoint = data.wallet_endpoint ?? '{{ request.url_root }}'
|
data.wallet_endpoint = data.wallet_endpoint ?? '{{ root_url }}'
|
||||||
data.duration = parseInt(data.duration)
|
data.duration = parseInt(data.duration)
|
||||||
console.log('data', data)
|
|
||||||
|
|
||||||
axios
|
axios
|
||||||
.post('/lnaddress/api/v1/address/{{ domain_id }}', data)
|
.post('/lnaddress/api/v1/address/{{ domain_id }}', data)
|
||||||
|
@@ -186,10 +186,14 @@
|
|||||||
<q-input
|
<q-input
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
|
bottom-slots
|
||||||
v-model.trim="domainDialog.data.cf_token"
|
v-model.trim="domainDialog.data.cf_token"
|
||||||
type="text"
|
type="text"
|
||||||
label="Cloudflare API token"
|
label="Cloudflare API token"
|
||||||
>
|
>
|
||||||
|
<template v-slot:hint>
|
||||||
|
Check extension <a href="https://github.com/lnbits/lnbits-legend/tree/master/lnbits/extensions/lnaddress">documentation!</a>
|
||||||
|
</template>
|
||||||
<q-tooltip class="bg-grey-8" anchor="bottom left" self="top left"
|
<q-tooltip class="bg-grey-8" anchor="bottom left" self="top left"
|
||||||
>Your API key in cloudflare</q-tooltip
|
>Your API key in cloudflare</q-tooltip
|
||||||
>
|
>
|
||||||
@@ -489,18 +493,6 @@
|
|||||||
this.getDomains()
|
this.getDomains()
|
||||||
this.getAddresses()
|
this.getAddresses()
|
||||||
}
|
}
|
||||||
// var self = this
|
|
||||||
//
|
|
||||||
// // axios is available for making requests
|
|
||||||
// axios({
|
|
||||||
// method: 'GET',
|
|
||||||
// url: '/example/api/v1/tools',
|
|
||||||
// headers: {
|
|
||||||
// 'X-example-header': 'not-used'
|
|
||||||
// }
|
|
||||||
// }).then(function (response) {
|
|
||||||
// self.tools = response.data
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
from fastapi import Request
|
from fastapi import Request
|
||||||
from fastapi.params import Depends
|
from fastapi.params import Depends
|
||||||
@@ -34,6 +35,7 @@ async def display(domain_id, request: Request):
|
|||||||
await purge_addresses(domain_id)
|
await purge_addresses(domain_id)
|
||||||
|
|
||||||
wallet = await get_wallet(domain.wallet)
|
wallet = await get_wallet(domain.wallet)
|
||||||
|
url = urlparse(str(request.url))
|
||||||
|
|
||||||
return lnaddress_renderer().TemplateResponse(
|
return lnaddress_renderer().TemplateResponse(
|
||||||
"lnaddress/display.html",
|
"lnaddress/display.html",
|
||||||
@@ -43,5 +45,6 @@ async def display(domain_id, request: Request):
|
|||||||
"domain_domain": domain.domain,
|
"domain_domain": domain.domain,
|
||||||
"domain_cost": domain.cost,
|
"domain_cost": domain.cost,
|
||||||
"domain_wallet_inkey": wallet.inkey,
|
"domain_wallet_inkey": wallet.inkey,
|
||||||
|
"root_url": f"{url.scheme}://{url.netloc}"
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user