Added tag
This commit is contained in:
parent
52d490d687
commit
5539a82b4a
2 changed files with 51 additions and 34 deletions
|
|
@ -63,6 +63,12 @@ new Vue({
|
||||||
if (isPercent) {
|
if (isPercent) {
|
||||||
if (this.targets[index].percent > 100) this.targets[index].percent = 100
|
if (this.targets[index].percent > 100) this.targets[index].percent = 100
|
||||||
if (this.targets[index].percent < 0) this.targets[index].percent = 0
|
if (this.targets[index].percent < 0) this.targets[index].percent = 0
|
||||||
|
this.targets[index].tag = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
// not percentage
|
||||||
|
if (!isPercent) {
|
||||||
|
this.targets[index].percent = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove empty lines (except last)
|
// remove empty lines (except last)
|
||||||
|
|
@ -72,6 +78,7 @@ new Vue({
|
||||||
if (
|
if (
|
||||||
(!target.wallet || target.wallet.trim() === '') &&
|
(!target.wallet || target.wallet.trim() === '') &&
|
||||||
(!target.alias || target.alias.trim() === '') &&
|
(!target.alias || target.alias.trim() === '') &&
|
||||||
|
(!target.tag || target.tag.trim() === '') &&
|
||||||
!target.percent
|
!target.percent
|
||||||
) {
|
) {
|
||||||
this.targets.splice(i, 1)
|
this.targets.splice(i, 1)
|
||||||
|
|
@ -81,7 +88,7 @@ new Vue({
|
||||||
|
|
||||||
// add a line at the end if the last one is filled
|
// add a line at the end if the last one is filled
|
||||||
let last = this.targets[this.targets.length - 1]
|
let last = this.targets[this.targets.length - 1]
|
||||||
if (last.wallet && last.wallet.trim() !== '' && last.percent > 0) {
|
if (last.wallet && last.wallet.trim() !== '') {
|
||||||
this.targets.push({})
|
this.targets.push({})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -113,6 +120,7 @@ new Vue({
|
||||||
|
|
||||||
// overwrite so changes appear
|
// overwrite so changes appear
|
||||||
this.targets = this.targets
|
this.targets = this.targets
|
||||||
|
console.log(this.targets)
|
||||||
},
|
},
|
||||||
saveTargets() {
|
saveTargets() {
|
||||||
LNbits.api
|
LNbits.api
|
||||||
|
|
|
||||||
|
|
@ -31,28 +31,6 @@
|
||||||
style="flex-wrap: nowrap"
|
style="flex-wrap: nowrap"
|
||||||
v-for="(target, t) in targets"
|
v-for="(target, t) in targets"
|
||||||
>
|
>
|
||||||
<q-toggle
|
|
||||||
:false-value="'split'"
|
|
||||||
:true-value="'tag'"
|
|
||||||
color="primary"
|
|
||||||
label=""
|
|
||||||
v-model="target.method"
|
|
||||||
:label="'Split funds by %, or send funds by tag' || `${target.method}`"
|
|
||||||
></q-toggle>
|
|
||||||
<q-select
|
|
||||||
dense
|
|
||||||
:options="g.user.wallets.filter(w => w.id !== selectedWallet.id).map(o => ({name: o.name, value: o.id}))"
|
|
||||||
v-model="target.wallet"
|
|
||||||
label="Wallet"
|
|
||||||
:hint="t === targets.length - 1 ? 'A wallet ID or invoice key.' : undefined"
|
|
||||||
@input="targetChanged(false)"
|
|
||||||
option-label="name"
|
|
||||||
style="width: 1000px"
|
|
||||||
new-value-mode="add-unique"
|
|
||||||
use-input
|
|
||||||
input-debounce="0"
|
|
||||||
emit-value
|
|
||||||
></q-select>
|
|
||||||
<q-input
|
<q-input
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -60,25 +38,56 @@
|
||||||
label="Alias"
|
label="Alias"
|
||||||
:hint="t === targets.length - 1 ? 'A name to identify this target wallet locally.' : undefined"
|
:hint="t === targets.length - 1 ? 'A name to identify this target wallet locally.' : undefined"
|
||||||
@input="targetChanged(false)"
|
@input="targetChanged(false)"
|
||||||
|
style="width: 150px"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
v-if="target.method == 'split'"
|
|
||||||
dense
|
dense
|
||||||
outlined
|
v-model="target.wallet"
|
||||||
v-model.number="target.percent"
|
label="Wallet"
|
||||||
label="Split Share"
|
:hint="t === targets.length - 1 ? 'A wallet ID or invoice key.' : undefined"
|
||||||
suffix="%"
|
@input="targetChanged(false)"
|
||||||
@input="percentageChanged(true, t)"
|
option-label="name"
|
||||||
|
style="width: 300px"
|
||||||
|
new-value-mode="add-unique"
|
||||||
|
use-input
|
||||||
|
input-debounce="0"
|
||||||
|
emit-value
|
||||||
></q-input>
|
></q-input>
|
||||||
|
|
||||||
|
|
||||||
|
<q-toggle
|
||||||
|
:false-value="'split'"
|
||||||
|
:true-value="'tag'"
|
||||||
|
color="primary"
|
||||||
|
label=""
|
||||||
|
style="width: 180px"
|
||||||
|
v-model="target.method"
|
||||||
|
:label="`${target.method}` === 'tag' ? 'Send funds by tag' : `${target.method}` === 'split' ? 'Split funds by %' : 'Split/tag?'"
|
||||||
|
></q-toggle>
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
v-else
|
v-if="target.method == 'tag' || target.tag != null"
|
||||||
|
style="width: 150px"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model.number="target.tag"
|
v-model.number="target.tag"
|
||||||
label="Forward by tag"
|
label="Tag name"
|
||||||
suffix="#"
|
suffix="#"
|
||||||
|
@input="percentageChanged(false, t)"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
|
||||||
|
<q-input
|
||||||
|
v-else-if="target.method == 'split' || target.percent >= 0"
|
||||||
|
style="width: 150px"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
v-model.number="target.percent"
|
||||||
|
label="split"
|
||||||
|
suffix="%"
|
||||||
|
@input="percentageChanged(true, t)"
|
||||||
|
></q-input>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row justify-evenly q-pa-lg">
|
<div class="row justify-evenly q-pa-lg">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue