diff --git a/static/components/key-pair/key-pair.html b/static/components/key-pair/key-pair.html new file mode 100644 index 0000000..a0657fa --- /dev/null +++ b/static/components/key-pair/key-pair.html @@ -0,0 +1,44 @@ +
+ +
+
Public Key
+
+ + Show Private Key + +
+
+ +
+
+
+ + + +
Click to copy
+
+
+
+
+
+ + + +
Click to copy
+
+
+
+
+
diff --git a/static/components/key-pair/key-pair.js b/static/components/key-pair/key-pair.js new file mode 100644 index 0000000..bee16b4 --- /dev/null +++ b/static/components/key-pair/key-pair.js @@ -0,0 +1,25 @@ +async function keyPair(path) { + const template = await loadTemplateAsync(path) + Vue.component('key-pair', { + name: 'key-pair', + template, + + props: ['public-key', 'private-key'], + data: function () { + return { + showPrivateKey: false + } + }, + methods: { + copyText: function (text, message, position) { + var notify = this.$q.notify + Quasar.utils.copyToClipboard(text).then(function () { + notify({ + message: message || 'Copied to clipboard!', + position: position || 'bottom' + }) + }) + } + } + }) +} diff --git a/static/js/index.js b/static/js/index.js index a5adbd6..5bc293f 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -2,6 +2,7 @@ const merchant = async () => { Vue.component(VueQrcode.name, VueQrcode) await stallDetails('static/components/stall-details/stall-details.html') + await keyPair('static/components/key-pair/key-pair.html') const nostr = window.NostrTools @@ -10,7 +11,8 @@ const merchant = async () => { mixins: [windowMixin], data: function () { return { - merchant: null + merchant: {}, + showKeys: false } }, methods: { @@ -20,7 +22,7 @@ const merchant = async () => { const data = {private_key: privkey, public_key: pubkey, config: {}} try { - const resp = await LNbits.api.request( + await LNbits.api.request( 'POST', '/nostrmarket/api/v1/merchant', this.g.user.wallets[0].adminkey, diff --git a/templates/nostrmarket/index.html b/templates/nostrmarket/index.html index 37710a5..fc154b4 100644 --- a/templates/nostrmarket/index.html +++ b/templates/nostrmarket/index.html @@ -59,7 +59,26 @@
- Merchant Exists + +
+
+ + Show Public or Private keys + +
+
+
+ + +
@@ -83,6 +102,7 @@ + {% endblock %}