feat: basic account UI
This commit is contained in:
parent
2099a8b7bb
commit
d0f38346e3
7 changed files with 116 additions and 16 deletions
|
|
@ -3,7 +3,7 @@
|
|||
<q-tab name="info" label="Relay Info"></q-tab>
|
||||
<q-tab name="payment" label="Payment"></q-tab>
|
||||
<q-tab name="config" label="Config"></q-tab>
|
||||
<q-tab name="access" label="Access"></q-tab>
|
||||
<q-tab name="accounts" label="Accounts"></q-tab>
|
||||
</q-tabs>
|
||||
<q-tab-panels v-model="tab">
|
||||
<q-tab-panel name="info">
|
||||
|
|
@ -527,7 +527,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="access">
|
||||
<q-tab-panel name="accounts">
|
||||
<div v-if="relay">
|
||||
<div class="row items-center no-wrap q-mb-md">
|
||||
<div class="col-2 q-pr-lg">Public Key: </div>
|
||||
|
|
|
|||
|
|
@ -114,9 +114,29 @@ async function relayDetails(path) {
|
|||
this.relay.config.wallet =
|
||||
this.relay.config.wallet || this.walletOptions[0].value
|
||||
},
|
||||
allowPublicKey: function () {
|
||||
this.relay.config.allowedPublicKeys.push(this.allowedPubkey)
|
||||
this.allowedPubkey = ''
|
||||
allowPublicKey: async function () {
|
||||
try {
|
||||
const {data} = await LNbits.api.request(
|
||||
'PUT',
|
||||
'/nostrrelay/api/v1/account',
|
||||
this.adminkey,
|
||||
{
|
||||
pubkey: this.allowedPubkey,
|
||||
allowed: true
|
||||
}
|
||||
)
|
||||
this.relay = data
|
||||
this.$emit('relay-updated', this.relay)
|
||||
this.$q.notify({
|
||||
type: 'positive',
|
||||
message: 'Account Updated',
|
||||
timeout: 5000
|
||||
})
|
||||
this.allowedPubkey = ''
|
||||
} catch (error) {
|
||||
LNbits.utils.notifyApiError(error)
|
||||
}
|
||||
|
||||
},
|
||||
blockPublicKey: function () {
|
||||
this.relay.config.blockedPublicKeys.push(this.blockedPubkey)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue