From c05ecb054dd5cb06245bc01e7c9923f023dfa38d Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Tue, 7 Feb 2023 14:44:11 +0200 Subject: [PATCH] feat: edit relay info --- .../relay-details/relay-details.html | 86 +++++++++++++++---- .../components/relay-details/relay-details.js | 17 +++- 2 files changed, 84 insertions(+), 19 deletions(-) diff --git a/static/components/relay-details/relay-details.html b/static/components/relay-details/relay-details.html index 827b545..af14561 100644 --- a/static/components/relay-details/relay-details.html +++ b/static/components/relay-details/relay-details.html @@ -7,25 +7,54 @@ -
-
- Update Relay +
+
+
Name:
+
+ +
+
-
- Delete Relay +
+
Description:
+
+ +
+
+
+
+
Relay Public Key:
+
+ +
+
+
+
+
Contact:
+
+ +
+
@@ -39,4 +68,25 @@ qqq +
+
+ Update Relay +
+
+ Delete Relay +
+
diff --git a/static/components/relay-details/relay-details.js b/static/components/relay-details/relay-details.js index 19df2b6..d3c2d72 100644 --- a/static/components/relay-details/relay-details.js +++ b/static/components/relay-details/relay-details.js @@ -8,6 +8,7 @@ async function relayDetails(path) { data: function () { return { tab: 'info', + relay: null, formDialogItem: { show: false, data: { @@ -40,9 +41,23 @@ async function relayDetails(path) { LNbits.utils.notifyApiError(error) } }) + }, + getRelay: async function () { + try { + const {data} = await LNbits.api.request( + 'GET', + '/nostrrelay/api/v1/relay/' + this.relayId, + this.inkey + ) + this.relay = data + } catch (error) { + LNbits.utils.notifyApiError(error) + } } }, - created: async function () {} + created: async function () { + await this.getRelay() + } }) }