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-tooltip>Delete Wallet</q-tooltip>
|
||||||
</q-btn>
|
</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
|
<q-btn
|
||||||
round
|
round
|
||||||
v-if="props.row.deleted"
|
v-if="props.row.deleted"
|
||||||
|
|
@ -140,6 +127,42 @@
|
||||||
>
|
>
|
||||||
<q-tooltip>Undelete Wallet</q-tooltip>
|
<q-tooltip>Undelete Wallet</q-tooltip>
|
||||||
</q-btn>
|
</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>
|
||||||
<q-td auto-width>
|
<q-td auto-width>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
|
||||||
|
|
@ -333,7 +333,6 @@ window.UsersPageLogic = {
|
||||||
const url = `${window.location.origin}/wallet?usr=${this.activeWallet.userId}&wal=${walletId}`
|
const url = `${window.location.origin}/wallet?usr=${this.activeWallet.userId}&wal=${walletId}`
|
||||||
this.copyText(url)
|
this.copyText(url)
|
||||||
},
|
},
|
||||||
|
|
||||||
fetchUsers(props) {
|
fetchUsers(props) {
|
||||||
this.relaxFilterForFields(['username', 'email'])
|
this.relaxFilterForFields(['username', 'email'])
|
||||||
const params = LNbits.utils.prepareFilterQuery(this.usersTable, props)
|
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) {
|
toggleAdmin(userId) {
|
||||||
LNbits.api
|
LNbits.api
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue