feat: edit wallet name by admin (#3417)
This commit is contained in:
parent
de6827af58
commit
7116353431
2 changed files with 53 additions and 14 deletions
|
|
@ -116,19 +116,6 @@
|
|||
>
|
||||
<q-tooltip>Delete Wallet</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
icon="link"
|
||||
size="sm"
|
||||
flat
|
||||
class="cursor-pointer q-mr-xs"
|
||||
@click="copyWalletLink(props.row.id)"
|
||||
>
|
||||
<q-tooltip>Copy Wallet Link</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<span v-text="props.row.name"></span>
|
||||
<q-btn
|
||||
round
|
||||
v-if="props.row.deleted"
|
||||
|
|
@ -140,6 +127,42 @@
|
|||
>
|
||||
<q-tooltip>Undelete Wallet</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
icon="link"
|
||||
size="sm"
|
||||
flat
|
||||
class="cursor-pointer q-mr-xs"
|
||||
@click="copyWalletLink(props.row.id)"
|
||||
>
|
||||
<q-tooltip>Copy Wallet Link</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<span
|
||||
v-text="props.row.name"
|
||||
v-if="!props.row.editable"
|
||||
:class="props.row.deleted ? 'text-strike' : 'cursor-pointer'"
|
||||
@click="props.row.editable = true && !props.row.deleted"
|
||||
></span>
|
||||
<q-input
|
||||
v-else
|
||||
@keydown.enter="updateWallet(props.row)"
|
||||
v-model="props.row.name"
|
||||
size="xs"
|
||||
flat
|
||||
dense
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-btn
|
||||
@click="updateWallet(props.row)"
|
||||
round
|
||||
dense
|
||||
size="xs"
|
||||
flat
|
||||
icon="send"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
|
|
|
|||
|
|
@ -333,7 +333,6 @@ window.UsersPageLogic = {
|
|||
const url = `${window.location.origin}/wallet?usr=${this.activeWallet.userId}&wal=${walletId}`
|
||||
this.copyText(url)
|
||||
},
|
||||
|
||||
fetchUsers(props) {
|
||||
this.relaxFilterForFields(['username', 'email'])
|
||||
const params = LNbits.utils.prepareFilterQuery(this.usersTable, props)
|
||||
|
|
@ -367,6 +366,23 @@ window.UsersPageLogic = {
|
|||
}
|
||||
})
|
||||
},
|
||||
updateWallet(userWallet) {
|
||||
LNbits.api
|
||||
.request('PATCH', '/api/v1/wallet', userWallet.adminkey, {
|
||||
name: userWallet.name
|
||||
})
|
||||
.then(() => {
|
||||
userWallet.editable = false
|
||||
Quasar.Notify.create({
|
||||
message: 'Wallet name updated.',
|
||||
type: 'positive',
|
||||
timeout: 3500
|
||||
})
|
||||
})
|
||||
.catch(err => {
|
||||
LNbits.utils.notifyApiError(err)
|
||||
})
|
||||
},
|
||||
|
||||
toggleAdmin(userId) {
|
||||
LNbits.api
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue