refactor: use utils.copytext (#3590)
This commit is contained in:
parent
e6ca8a33c6
commit
704e5a1b73
17 changed files with 50 additions and 40 deletions
2
lnbits/static/bundle-components.min.js
vendored
2
lnbits/static/bundle-components.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -700,7 +700,7 @@ window.app.component('lnbits-node-qrcode', {
|
||||||
dense
|
dense
|
||||||
unelevated
|
unelevated
|
||||||
size="md"
|
size="md"
|
||||||
@click="copyText(info.id)"
|
@click="utils.copyText(info.id)"
|
||||||
>Public Key<q-tooltip> Click to copy </q-tooltip>
|
>Public Key<q-tooltip> Click to copy </q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
|
|
@ -781,7 +781,7 @@ window.app.component('lnbits-node-info', {
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
icon='content_paste'
|
icon='content_paste'
|
||||||
@click='copyText(info.id)'
|
@click='utils.copyText(info.id)'
|
||||||
></q-btn>
|
></q-btn>
|
||||||
<q-btn
|
<q-btn
|
||||||
size='xs'
|
size='xs'
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ window.app.component('lnbits-qrcode', {
|
||||||
methods: {
|
methods: {
|
||||||
clickQrCode(event) {
|
clickQrCode(event) {
|
||||||
if (this.href === '') {
|
if (this.href === '') {
|
||||||
this.copyText(this.value)
|
this.utils.copyText(this.value)
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
|
|
@ -607,7 +607,7 @@ window.PageAccount = {
|
||||||
},
|
},
|
||||||
copyAssetLinkToClipboard(asset) {
|
copyAssetLinkToClipboard(asset) {
|
||||||
const assetUrl = `${window.location.origin}/api/v1/assets/${asset.id}/binary`
|
const assetUrl = `${window.location.origin}/api/v1/assets/${asset.id}/binary`
|
||||||
this.copyText(assetUrl)
|
this.utils.copyText(assetUrl)
|
||||||
},
|
},
|
||||||
addUserLabel() {
|
addUserLabel() {
|
||||||
if (!this.labelsDialog.data.name) {
|
if (!this.labelsDialog.data.name) {
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ window.PageUsers = {
|
||||||
)
|
)
|
||||||
.onOk(() => {
|
.onOk(() => {
|
||||||
const url = window.location.origin + '?reset_key=' + res.data
|
const url = window.location.origin + '?reset_key=' + res.data
|
||||||
this.copyText(url)
|
this.utils.copyText(url)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(LNbits.utils.notifyApiError)
|
.catch(LNbits.utils.notifyApiError)
|
||||||
|
|
@ -347,7 +347,7 @@ window.PageUsers = {
|
||||||
},
|
},
|
||||||
copyWalletLink(walletId) {
|
copyWalletLink(walletId) {
|
||||||
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.utils.copyText(url)
|
||||||
},
|
},
|
||||||
fetchUsers(props) {
|
fetchUsers(props) {
|
||||||
this.relaxFilterForFields(['username', 'email'])
|
this.relaxFilterForFields(['username', 'email'])
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ include('components/lnbits-wallet-extra.vue') %}
|
||||||
<q-item-label>
|
<q-item-label>
|
||||||
<q-icon
|
<q-icon
|
||||||
name="content_copy"
|
name="content_copy"
|
||||||
@click="copyText(payment.payment_hash)"
|
@click="utils.copyText(payment.payment_hash)"
|
||||||
size="1em"
|
size="1em"
|
||||||
color="grey"
|
color="grey"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
|
|
@ -188,7 +188,7 @@ include('components/lnbits-wallet-extra.vue') %}
|
||||||
<q-item-label>
|
<q-item-label>
|
||||||
<q-icon
|
<q-icon
|
||||||
name="content_copy"
|
name="content_copy"
|
||||||
@click="copyText(payment.bolt11)"
|
@click="utils.copyText(payment.bolt11)"
|
||||||
size="1em"
|
size="1em"
|
||||||
color="grey"
|
color="grey"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
|
|
@ -234,7 +234,7 @@ include('components/lnbits-wallet-extra.vue') %}
|
||||||
<q-item-label>
|
<q-item-label>
|
||||||
<q-icon
|
<q-icon
|
||||||
name="content_copy"
|
name="content_copy"
|
||||||
@click="copyText(payment.preimage)"
|
@click="utils.copyText(payment.preimage)"
|
||||||
size="1em"
|
size="1em"
|
||||||
color="grey"
|
color="grey"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
|
|
@ -553,7 +553,7 @@ include('components/lnbits-wallet-extra.vue') %}
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
class="text-grey"
|
class="text-grey"
|
||||||
@click="copyText(value)"
|
@click="utils.copyText(value)"
|
||||||
icon="content_copy"
|
icon="content_copy"
|
||||||
>
|
>
|
||||||
<q-tooltip>Copy</q-tooltip>
|
<q-tooltip>Copy</q-tooltip>
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
>
|
>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="prop.copy"
|
v-if="prop.copy"
|
||||||
@click="copyText(formData[key])"
|
@click="utils.copyText(formData[key])"
|
||||||
icon="content_copy"
|
icon="content_copy"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
color="grey"
|
color="grey"
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
<q-icon
|
<q-icon
|
||||||
name="content_copy"
|
name="content_copy"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
@click="copyText(g.wallet.id)"
|
@click="utils.copyText(g.wallet.id)"
|
||||||
></q-icon>
|
></q-icon>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
<q-icon
|
<q-icon
|
||||||
name="content_copy"
|
name="content_copy"
|
||||||
class="cursor-pointer q-ml-sm"
|
class="cursor-pointer q-ml-sm"
|
||||||
@click="copyText(g.wallet.adminkey)"
|
@click="utils.copyText(g.wallet.adminkey)"
|
||||||
></q-icon>
|
></q-icon>
|
||||||
<q-icon name="qr_code" class="cursor-pointer q-ml-sm">
|
<q-icon name="qr_code" class="cursor-pointer q-ml-sm">
|
||||||
<q-popup-proxy>
|
<q-popup-proxy>
|
||||||
|
|
@ -81,7 +81,7 @@
|
||||||
<q-icon
|
<q-icon
|
||||||
name="content_copy"
|
name="content_copy"
|
||||||
class="cursor-pointer q-ml-sm"
|
class="cursor-pointer q-ml-sm"
|
||||||
@click="copyText(g.wallet.inkey)"
|
@click="utils.copyText(g.wallet.inkey)"
|
||||||
></q-icon>
|
></q-icon>
|
||||||
<q-icon name="qr_code" class="cursor-pointer q-ml-sm">
|
<q-icon name="qr_code" class="cursor-pointer q-ml-sm">
|
||||||
<q-popup-proxy>
|
<q-popup-proxy>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
color="secondary"
|
color="secondary"
|
||||||
icon="content_copy"
|
icon="content_copy"
|
||||||
size="xs"
|
size="xs"
|
||||||
@click="copyText(paylink.lnurl)"
|
@click="utils.copyText(paylink.lnurl)"
|
||||||
>
|
>
|
||||||
<q-tooltip>
|
<q-tooltip>
|
||||||
<span v-text="`copy: ${paylink.lnurl}`"></span>
|
<span v-text="`copy: ${paylink.lnurl}`"></span>
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@
|
||||||
<q-icon
|
<q-icon
|
||||||
name="content_copy"
|
name="content_copy"
|
||||||
class="cursor-pointer q-ml-sm"
|
class="cursor-pointer q-ml-sm"
|
||||||
@click="copyText(g.wallet.sharedWalletId)"
|
@click="utils.copyText(g.wallet.sharedWalletId)"
|
||||||
></q-icon>
|
></q-icon>
|
||||||
<q-icon name="qr_code" class="cursor-pointer q-ml-sm">
|
<q-icon name="qr_code" class="cursor-pointer q-ml-sm">
|
||||||
<q-popup-proxy>
|
<q-popup-proxy>
|
||||||
|
|
|
||||||
|
|
@ -774,7 +774,9 @@
|
||||||
></q-btn>
|
></q-btn>
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
@click="copyText(apiAcl.apiToken)"
|
@click="
|
||||||
|
utils.copyText(apiAcl.apiToken)
|
||||||
|
"
|
||||||
icon="content_copy"
|
icon="content_copy"
|
||||||
color="black"
|
color="black"
|
||||||
flat
|
flat
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@
|
||||||
size="sm"
|
size="sm"
|
||||||
flat
|
flat
|
||||||
class="cursor-pointer q-mr-xs"
|
class="cursor-pointer q-mr-xs"
|
||||||
@click="copyText(props.row[col.name])"
|
@click="utils.copyText(props.row[col.name])"
|
||||||
>
|
>
|
||||||
<q-tooltip>Copy</q-tooltip>
|
<q-tooltip>Copy</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -183,7 +183,7 @@
|
||||||
|
|
||||||
<div class="row q-mt-lg">
|
<div class="row q-mt-lg">
|
||||||
<q-btn
|
<q-btn
|
||||||
@click="copyText(auditDetailsDialog.data)"
|
@click="utils.copyText(auditDetailsDialog.data)"
|
||||||
icon="content_copy"
|
icon="content_copy"
|
||||||
color="grey"
|
color="grey"
|
||||||
flat
|
flat
|
||||||
|
|
|
||||||
|
|
@ -415,7 +415,7 @@
|
||||||
v-if="selectedRelease.paymentRequest"
|
v-if="selectedRelease.paymentRequest"
|
||||||
outline
|
outline
|
||||||
color="grey"
|
color="grey"
|
||||||
@click="copyText(selectedRelease.paymentRequest)"
|
@click="utils.copyText(selectedRelease.paymentRequest)"
|
||||||
:label="$t('copy_invoice')"
|
:label="$t('copy_invoice')"
|
||||||
></q-btn>
|
></q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -816,7 +816,9 @@
|
||||||
v-if="selectedExtension.payToEnable.paymentRequest"
|
v-if="selectedExtension.payToEnable.paymentRequest"
|
||||||
outline
|
outline
|
||||||
color="grey"
|
color="grey"
|
||||||
@click="copyText(selectedExtension.payToEnable.paymentRequest)"
|
@click="
|
||||||
|
utils.copyText(selectedExtension.payToEnable.paymentRequest)
|
||||||
|
"
|
||||||
:label="$t('copy_invoice')"
|
:label="$t('copy_invoice')"
|
||||||
></q-btn>
|
></q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -337,7 +337,7 @@
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
icon="content_paste"
|
icon="content_paste"
|
||||||
@click="copyText(props.row.peer_id)"
|
@click="utils.copyText(props.row.peer_id)"
|
||||||
></q-btn>
|
></q-btn>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-caption col-grow">
|
<div class="text-caption col-grow">
|
||||||
|
|
@ -365,7 +365,7 @@
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
icon="content_paste"
|
icon="content_paste"
|
||||||
@click="copyText(props.row.id)"
|
@click="utils.copyText(props.row.id)"
|
||||||
></q-btn>
|
></q-btn>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|
@ -378,7 +378,9 @@
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
icon="content_paste"
|
icon="content_paste"
|
||||||
@click="copyText(props.row.short_id)"
|
@click="
|
||||||
|
utils.copyText(props.row.short_id)
|
||||||
|
"
|
||||||
></q-btn>
|
></q-btn>
|
||||||
</div>
|
</div>
|
||||||
<q-badge
|
<q-badge
|
||||||
|
|
@ -475,7 +477,7 @@
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
icon="content_paste"
|
icon="content_paste"
|
||||||
@click="copyText(props.row.id)"
|
@click="utils.copyText(props.row.id)"
|
||||||
></q-btn>
|
></q-btn>
|
||||||
<q-btn
|
<q-btn
|
||||||
size="xs"
|
size="xs"
|
||||||
|
|
@ -546,7 +548,7 @@
|
||||||
<q-icon
|
<q-icon
|
||||||
name="content_copy"
|
name="content_copy"
|
||||||
@click="
|
@click="
|
||||||
copyText(
|
utils.copyText(
|
||||||
transactionDetailsDialog.data.payment_hash
|
transactionDetailsDialog.data.payment_hash
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
|
|
@ -572,7 +574,7 @@
|
||||||
<q-icon
|
<q-icon
|
||||||
name="content_copy"
|
name="content_copy"
|
||||||
@click="
|
@click="
|
||||||
copyText(
|
utils.copyText(
|
||||||
transactionDetailsDialog.data.preimage
|
transactionDetailsDialog.data.preimage
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
|
|
@ -608,7 +610,9 @@
|
||||||
outline
|
outline
|
||||||
color="grey"
|
color="grey"
|
||||||
@click="
|
@click="
|
||||||
copyText(transactionDetailsDialog.data.bolt11)
|
utils.copyText(
|
||||||
|
transactionDetailsDialog.data.bolt11
|
||||||
|
)
|
||||||
"
|
"
|
||||||
:label="$t('copy_invoice')"
|
:label="$t('copy_invoice')"
|
||||||
class="q-mt-sm"
|
class="q-mt-sm"
|
||||||
|
|
@ -718,7 +722,9 @@
|
||||||
<q-btn
|
<q-btn
|
||||||
outline
|
outline
|
||||||
color="grey"
|
color="grey"
|
||||||
@click="copyText(props.row.bolt11)"
|
@click="
|
||||||
|
utils.copyText(props.row.bolt11)
|
||||||
|
"
|
||||||
:label="$t('copy_invoice')"
|
:label="$t('copy_invoice')"
|
||||||
></q-btn>
|
></q-btn>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
@ -813,7 +819,7 @@
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
icon="content_paste"
|
icon="content_paste"
|
||||||
@click="copyText(info.id)"
|
@click="utils.copyText(info.id)"
|
||||||
></q-btn>
|
></q-btn>
|
||||||
<q-btn
|
<q-btn
|
||||||
size="xs"
|
size="xs"
|
||||||
|
|
|
||||||
|
|
@ -354,7 +354,7 @@
|
||||||
size="sm"
|
size="sm"
|
||||||
flat
|
flat
|
||||||
class="cursor-pointer q-mr-xs"
|
class="cursor-pointer q-mr-xs"
|
||||||
@click="copyText(props.row[col.name])"
|
@click="utils.copyText(props.row[col.name])"
|
||||||
>
|
>
|
||||||
<q-tooltip anchor="top middle">Copy</q-tooltip>
|
<q-tooltip anchor="top middle">Copy</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -430,7 +430,7 @@
|
||||||
icon="content_copy"
|
icon="content_copy"
|
||||||
flat
|
flat
|
||||||
class="cursor-pointer q-ml-sm"
|
class="cursor-pointer q-ml-sm"
|
||||||
@click="copyText(value)"
|
@click="utils.copyText(value)"
|
||||||
>
|
>
|
||||||
<q-tooltip>Copy</q-tooltip>
|
<q-tooltip>Copy</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@
|
||||||
size="sm"
|
size="sm"
|
||||||
color="primary"
|
color="primary"
|
||||||
class="q-ml-xs"
|
class="q-ml-xs"
|
||||||
@click="copyText(props.row.adminkey)"
|
@click="utils.copyText(props.row.adminkey)"
|
||||||
>
|
>
|
||||||
<q-tooltip>Copy Admin Key</q-tooltip>
|
<q-tooltip>Copy Admin Key</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
size="sm"
|
size="sm"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
class="q-ml-xs"
|
class="q-ml-xs"
|
||||||
@click="copyText(props.row.inkey)"
|
@click="utils.copyText(props.row.inkey)"
|
||||||
>
|
>
|
||||||
<q-tooltip>Copy Invoice Key</q-tooltip>
|
<q-tooltip>Copy Invoice Key</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -181,7 +181,7 @@
|
||||||
size="sm"
|
size="sm"
|
||||||
flat
|
flat
|
||||||
class="cursor-pointer q-mr-xs"
|
class="cursor-pointer q-mr-xs"
|
||||||
@click="copyText(props.row.id)"
|
@click="utils.copyText(props.row.id)"
|
||||||
>
|
>
|
||||||
<q-tooltip>Copy Wallet ID</q-tooltip>
|
<q-tooltip>Copy Wallet ID</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -650,7 +650,7 @@
|
||||||
size="sm"
|
size="sm"
|
||||||
flat
|
flat
|
||||||
class="cursor-pointer q-mr-xs"
|
class="cursor-pointer q-mr-xs"
|
||||||
@click="copyText(props.row.id)"
|
@click="utils.copyText(props.row.id)"
|
||||||
>
|
>
|
||||||
<q-tooltip>Copy User ID</q-tooltip>
|
<q-tooltip>Copy User ID</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -667,7 +667,7 @@
|
||||||
size="sm"
|
size="sm"
|
||||||
flat
|
flat
|
||||||
class="cursor-pointer q-mr-xs"
|
class="cursor-pointer q-mr-xs"
|
||||||
@click="copyText(props.row.pubkey)"
|
@click="utils.copyText(props.row.pubkey)"
|
||||||
>
|
>
|
||||||
<q-tooltip>Copy Public Key</q-tooltip>
|
<q-tooltip>Copy Public Key</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
|
||||||
|
|
@ -549,7 +549,7 @@
|
||||||
<q-item-label>
|
<q-item-label>
|
||||||
<q-icon
|
<q-icon
|
||||||
name="content_copy"
|
name="content_copy"
|
||||||
@click="copyText(parse.invoice.hash)"
|
@click="utils.copyText(parse.invoice.hash)"
|
||||||
size="1em"
|
size="1em"
|
||||||
color="grey"
|
color="grey"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
|
|
@ -574,7 +574,7 @@
|
||||||
<q-item-label>
|
<q-item-label>
|
||||||
<q-icon
|
<q-icon
|
||||||
name="content_copy"
|
name="content_copy"
|
||||||
@click="copyText(parse.invoice.bolt11)"
|
@click="utils.copyText(parse.invoice.bolt11)"
|
||||||
size="1em"
|
size="1em"
|
||||||
color="grey"
|
color="grey"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue