From 94b34163004c60ef73b10c31971dbc1a70918401 Mon Sep 17 00:00:00 2001 From: Kristjan Date: Sat, 2 Jan 2021 16:58:03 +0100 Subject: [PATCH] prettier formatting --- lnbits/extensions/subdomains/README.md | 27 +- lnbits/extensions/subdomains/config.json | 8 +- .../templates/subdomains/_api_docs.html | 15 +- .../templates/subdomains/display.html | 83 ++++-- .../templates/subdomains/index.html | 279 ++++++++++++++---- 5 files changed, 311 insertions(+), 101 deletions(-) diff --git a/lnbits/extensions/subdomains/README.md b/lnbits/extensions/subdomains/README.md index 48c2c12ca..49dfc223d 100644 --- a/lnbits/extensions/subdomains/README.md +++ b/lnbits/extensions/subdomains/README.md @@ -1,26 +1,30 @@

Subdomains Extension

-So the goal of the extension is to allow the owner of a domain to sell their subdomain to the anyone who is willing to pay some money for it. +So the goal of the extension is to allow the owner of a domain to sell their subdomain to the anyone who is willing to pay some money for it. ## Requirements + - Free cloudflare account - Cloudflare as a dns server provider - Cloudflare TOKEN and Cloudflare zone-id where the domain is parked - ## Usage + 1. Register at cloudflare and setup your domain with them. (Just follow instructions they provide...) 2. Change DNS server at your domain registrar to point to cloudflare's -3. Get Cloudflare zoneID for your domain - +3. Get Cloudflare zoneID for your domain + 4. get Cloudflare API TOKEN - - + + 5. Open the lnbits subdomains extension and register your domain with lnbits 6. Click on the button in the table to open the public form that was generated for your domain - - Extension also supports webhooks so you can get notified when someone buys a new domain + +- Extension also supports webhooks so you can get notified when someone buys a new domain + ## API Endpoints + - **Domains** - GET /api/v1/domains - POST /api/v1/domains @@ -32,12 +36,13 @@ So the goal of the extension is to allow the owner of a domain to sell their sub - GET /api/v1/subdomains/ - DELETE /api/v1/subdomains/ -## Useful +## Useful ### Cloudflare + - Cloudflare offers programmatic subdomain registration... (create new A record) - you can keep your existing domain's registrar, you just have to transfer dns records to the cloudflare (free service) -- more information: +- more information: - https://api.cloudflare.com/#getting-started-requests - API endpoints needed for our project: - https://api.cloudflare.com/#dns-records-for-a-zone-list-dns-records @@ -45,5 +50,5 @@ So the goal of the extension is to allow the owner of a domain to sell their sub - https://api.cloudflare.com/#dns-records-for-a-zone-delete-dns-record - https://api.cloudflare.com/#dns-records-for-a-zone-update-dns-record - api can be used by providing authorization token OR authorization key - - check API Tokens and API Keys : https://api.cloudflare.com/#getting-started-requests -- Cloudflare API postman collection: https://support.cloudflare.com/hc/en-us/articles/115002323852-Using-Cloudflare-API-with-Postman-Collections \ No newline at end of file + - check API Tokens and API Keys : https://api.cloudflare.com/#getting-started-requests +- Cloudflare API postman collection: https://support.cloudflare.com/hc/en-us/articles/115002323852-Using-Cloudflare-API-with-Postman-Collections diff --git a/lnbits/extensions/subdomains/config.json b/lnbits/extensions/subdomains/config.json index 4a34be565..6bf9480cd 100644 --- a/lnbits/extensions/subdomains/config.json +++ b/lnbits/extensions/subdomains/config.json @@ -1,6 +1,6 @@ { - "name": "Subdomains", - "short_description": "Sell subdomains of your domain", - "icon": "domain", - "contributors": ["grmkris"] + "name": "Subdomains", + "short_description": "Sell subdomains of your domain", + "icon": "domain", + "contributors": ["grmkris"] } diff --git a/lnbits/extensions/subdomains/templates/subdomains/_api_docs.html b/lnbits/extensions/subdomains/templates/subdomains/_api_docs.html index 61b79947d..cc1518e90 100644 --- a/lnbits/extensions/subdomains/templates/subdomains/_api_docs.html +++ b/lnbits/extensions/subdomains/templates/subdomains/_api_docs.html @@ -1,4 +1,9 @@ - +
@@ -6,11 +11,13 @@

Charge people for using your subdomain name...
- Are you the owner of cool-domain.com and want to sell cool-subdomain.cool-domain.com + Are you the owner of cool-domain.com and want to sell + cool-subdomain.cool-domain.com
- Created by, Kris + Created by, Kris

-
\ No newline at end of file +
diff --git a/lnbits/extensions/subdomains/templates/subdomains/display.html b/lnbits/extensions/subdomains/templates/subdomains/display.html index 3e3d6f654..e46228cdc 100644 --- a/lnbits/extensions/subdomains/templates/subdomains/display.html +++ b/lnbits/extensions/subdomains/templates/subdomains/display.html @@ -8,26 +8,59 @@
{{ domain_desc }}

- - - + + + - + - +

Cost per day: {{ domain_cost }} sats
- {% raw %} - Total cost: {{amountSats}} sats - {% endraw %}

+ {% raw %} Total cost: {{amountSats}} sats {% endraw %} +

- Submit - Cancel + type="submit" + >Submit + Cancel
@@ -35,18 +68,27 @@ - +
- Copy invoice + Copy invoice Close
@@ -105,7 +147,7 @@ dismissMsg() clearInterval(paymentChecker) - setTimeout(function () { }, 10000) + setTimeout(function () {}, 10000) }, Invoice: function () { var self = this @@ -157,10 +199,9 @@ self.$q.notify({ type: 'positive', message: 'Sent, thank you!', - icon: 'thumb_up', + icon: 'thumb_up' }) - console.log("END") - + console.log('END') } }) .catch(function (error) { @@ -177,4 +218,4 @@ } }) -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/lnbits/extensions/subdomains/templates/subdomains/index.html b/lnbits/extensions/subdomains/templates/subdomains/index.html index 8294f65f8..05168a798 100644 --- a/lnbits/extensions/subdomains/templates/subdomains/index.html +++ b/lnbits/extensions/subdomains/templates/subdomains/index.html @@ -5,7 +5,9 @@
- New Domain + New Domain @@ -16,11 +18,19 @@
Domains
- Export to CSV + Export to CSV
- + {% raw %}