mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-27 17:23:12 +02:00
Fixed models
This commit is contained in:
parent
1bfa28da19
commit
937654e4f7
@ -36,7 +36,7 @@ async def create_lnurldevice(
|
|||||||
pin3,
|
pin3,
|
||||||
profit4,
|
profit4,
|
||||||
amount4,
|
amount4,
|
||||||
pin4,
|
pin4
|
||||||
)
|
)
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||||
""",
|
""",
|
||||||
|
@ -19,18 +19,18 @@ class createLnurldevice(BaseModel):
|
|||||||
profit: float
|
profit: float
|
||||||
amount: int
|
amount: int
|
||||||
pin: int
|
pin: int
|
||||||
profit1: float
|
profit1: float = 0
|
||||||
amount1: int
|
amount1: int = 0
|
||||||
pin1: int
|
pin1: int = 0
|
||||||
profit2: float
|
profit2: float = 0
|
||||||
amount2: int
|
amount2: int = 0
|
||||||
pin2: int
|
pin2: int = 0
|
||||||
profit3: float
|
profit3: float = 0
|
||||||
amount3: int
|
amount3: int = 0
|
||||||
pin3: int
|
pin3: int = 0
|
||||||
profit4: float
|
profit4: float = 0
|
||||||
amount4: int
|
amount4: int = 0
|
||||||
pin4: int
|
pin4: int = 0
|
||||||
|
|
||||||
|
|
||||||
class lnurldevices(BaseModel):
|
class lnurldevices(BaseModel):
|
||||||
|
@ -105,7 +105,7 @@
|
|||||||
@click="openQrCodeDialog(props.row.id)"
|
@click="openQrCodeDialog(props.row.id)"
|
||||||
><q-tooltip v-if="protocol == 'http:'">
|
><q-tooltip v-if="protocol == 'http:'">
|
||||||
LNURLs only work over HTTPS </q-tooltip
|
LNURLs only work over HTTPS </q-tooltip
|
||||||
><q-tooltip v-else> view LNURL </q-tooltip></q-btn
|
><q-tooltip v-else> view LNURLS </q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td
|
<q-td
|
||||||
@ -148,6 +148,42 @@
|
|||||||
style="width: 700px; max-width: 80vw"
|
style="width: 700px; max-width: 80vw"
|
||||||
class="q-pa-lg q-pt-xl lnbits__dialog-card"
|
class="q-pa-lg q-pt-xl lnbits__dialog-card"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<q-tabs
|
||||||
|
v-model="tab"
|
||||||
|
dense
|
||||||
|
class="text-grey"
|
||||||
|
active-color="primary"
|
||||||
|
indicator-color="primary"
|
||||||
|
align="justify"
|
||||||
|
narrow-indicator
|
||||||
|
>
|
||||||
|
<q-tab name="mails" label="Mails" />
|
||||||
|
<q-tab name="alarms" label="Alarms" />
|
||||||
|
<q-tab name="movies" label="Movies" />
|
||||||
|
</q-tabs>
|
||||||
|
|
||||||
|
<q-separator />
|
||||||
|
|
||||||
|
<q-tab-panels v-model="tab" animated>
|
||||||
|
<q-tab-panel name="mails">
|
||||||
|
<div class="text-h6">Mails</div>
|
||||||
|
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
||||||
|
</q-tab-panel>
|
||||||
|
|
||||||
|
<q-tab-panel name="alarms">
|
||||||
|
<div class="text-h6">Alarms</div>
|
||||||
|
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
||||||
|
</q-tab-panel>
|
||||||
|
|
||||||
|
<q-tab-panel name="movies">
|
||||||
|
<div class="text-h6">Movies</div>
|
||||||
|
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
||||||
|
</q-tab-panel>
|
||||||
|
</q-tab-panels>
|
||||||
|
|
||||||
|
|
||||||
<div class="text-h6">LNURLDevice device string</div>
|
<div class="text-h6">LNURLDevice device string</div>
|
||||||
<center>
|
<center>
|
||||||
<q-btn
|
<q-btn
|
||||||
@ -230,18 +266,14 @@
|
|||||||
label="Profit margin (% added to invoices/deducted from faucets)"
|
label="Profit margin (% added to invoices/deducted from faucets)"
|
||||||
></q-input>
|
></q-input>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<p>Switches</p>
|
|
||||||
<q-toggle v-model="switch1" color="primary" label="1"></q-toggle>
|
|
||||||
|
|
||||||
<q-toggle v-model="switch2" color="primary" label="2"></q-toggle>
|
<q-btn unelevated class="q-mb-lg" round size="sm" icon="add" @click="addSwitch" v-model="switches" color="primary"></q-btn>
|
||||||
|
<q-btn unelevated class="q-mb-lg" round size="sm" icon="remove" @click="removeSwitch" v-model="switches" color="primary"></q-btn>
|
||||||
|
|
||||||
<q-toggle v-model="switch3" color="primary" label="3"></q-toggle>
|
|
||||||
|
|
||||||
<q-toggle v-model="switch4" color="primary" label="4"></q-toggle>
|
<div v-if="switches >= 0">
|
||||||
|
<div class="row">
|
||||||
<q-toggle v-model="switch5" color="primary" label="5"></q-toggle>
|
<div class="col" >
|
||||||
|
|
||||||
<div v-if="switch1">
|
|
||||||
<q-input
|
<q-input
|
||||||
ref="setAmount"
|
ref="setAmount"
|
||||||
filled
|
filled
|
||||||
@ -255,6 +287,8 @@
|
|||||||
:step="'0.01'"
|
:step="'0.01'"
|
||||||
value="0.00"
|
value="0.00"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
</div>
|
||||||
|
<div class="col q-ml-md">
|
||||||
<q-input
|
<q-input
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
@ -263,6 +297,8 @@
|
|||||||
value="1000"
|
value="1000"
|
||||||
label="milesecs to turn Switch on for (1sec = 1000ms)"
|
label="milesecs to turn Switch on for (1sec = 1000ms)"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
</div>
|
||||||
|
<div class="col q-ml-md">
|
||||||
<q-input
|
<q-input
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
@ -271,7 +307,11 @@
|
|||||||
label="GPIO to turn on"
|
label="GPIO to turn on"
|
||||||
></q-input>
|
></q-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="switch2">
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="switches >= 1">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col" >
|
||||||
<q-input
|
<q-input
|
||||||
ref="setAmount"
|
ref="setAmount"
|
||||||
filled
|
filled
|
||||||
@ -285,6 +325,8 @@
|
|||||||
:step="'0.01'"
|
:step="'0.01'"
|
||||||
value="0.00"
|
value="0.00"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
</div>
|
||||||
|
<div class="col q-ml-md">
|
||||||
<q-input
|
<q-input
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
@ -293,6 +335,8 @@
|
|||||||
value="1000"
|
value="1000"
|
||||||
label="milesecs to turn Switch on for (1sec = 1000ms)"
|
label="milesecs to turn Switch on for (1sec = 1000ms)"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
</div>
|
||||||
|
<div class="col q-ml-md">
|
||||||
<q-input
|
<q-input
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
@ -301,7 +345,12 @@
|
|||||||
label="GPIO to turn on"
|
label="GPIO to turn on"
|
||||||
></q-input>
|
></q-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="switch3">
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="switches >= 2">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col" >
|
||||||
<q-input
|
<q-input
|
||||||
ref="setAmount"
|
ref="setAmount"
|
||||||
filled
|
filled
|
||||||
@ -315,6 +364,8 @@
|
|||||||
:step="'0.01'"
|
:step="'0.01'"
|
||||||
value="0.00"
|
value="0.00"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
</div>
|
||||||
|
<div class="col q-ml-md">
|
||||||
<q-input
|
<q-input
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
@ -323,6 +374,8 @@
|
|||||||
value="1000"
|
value="1000"
|
||||||
label="milesecs to turn Switch on for (1sec = 1000ms)"
|
label="milesecs to turn Switch on for (1sec = 1000ms)"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
</div>
|
||||||
|
<div class="col q-ml-md">
|
||||||
<q-input
|
<q-input
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
@ -331,7 +384,12 @@
|
|||||||
label="GPIO to turn on"
|
label="GPIO to turn on"
|
||||||
></q-input>
|
></q-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="switch4">
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="switches >= 3">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col" >
|
||||||
<q-input
|
<q-input
|
||||||
ref="setAmount"
|
ref="setAmount"
|
||||||
filled
|
filled
|
||||||
@ -345,6 +403,8 @@
|
|||||||
:step="'0.01'"
|
:step="'0.01'"
|
||||||
value="0.00"
|
value="0.00"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
</div>
|
||||||
|
<div class="col q-ml-md">
|
||||||
<q-input
|
<q-input
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
@ -353,6 +413,8 @@
|
|||||||
value="1000"
|
value="1000"
|
||||||
label="milesecs to turn Switch on for (1sec = 1000ms)"
|
label="milesecs to turn Switch on for (1sec = 1000ms)"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
</div>
|
||||||
|
<div class="col q-ml-md">
|
||||||
<q-input
|
<q-input
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
@ -361,7 +423,12 @@
|
|||||||
label="GPIO to turn on"
|
label="GPIO to turn on"
|
||||||
></q-input>
|
></q-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="switch4">
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="switches >= 4">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col" >
|
||||||
<q-input
|
<q-input
|
||||||
ref="setAmount"
|
ref="setAmount"
|
||||||
filled
|
filled
|
||||||
@ -375,6 +442,8 @@
|
|||||||
:step="'0.01'"
|
:step="'0.01'"
|
||||||
value="0.00"
|
value="0.00"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
</div>
|
||||||
|
<div class="col q-ml-md">
|
||||||
<q-input
|
<q-input
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
@ -383,6 +452,8 @@
|
|||||||
value="1000"
|
value="1000"
|
||||||
label="milesecs to turn Switch on for (1sec = 1000ms)"
|
label="milesecs to turn Switch on for (1sec = 1000ms)"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
</div>
|
||||||
|
<div class="col q-ml-md">
|
||||||
<q-input
|
<q-input
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
@ -392,7 +463,8 @@
|
|||||||
></q-input>
|
></q-input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row q-mt-lg">
|
<div class="row q-mt-lg">
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="formDialoglnurldevice.data.id"
|
v-if="formDialoglnurldevice.data.id"
|
||||||
@ -478,11 +550,7 @@
|
|||||||
wslocation: window.location.hostname,
|
wslocation: window.location.hostname,
|
||||||
filter: '',
|
filter: '',
|
||||||
currency: 'USD',
|
currency: 'USD',
|
||||||
switch1: false,
|
switches: 0,
|
||||||
switch2: false,
|
|
||||||
switch3: false,
|
|
||||||
switch4: false,
|
|
||||||
switch5: false,
|
|
||||||
lnurldeviceLinks: [],
|
lnurldeviceLinks: [],
|
||||||
lnurldeviceLinksObj: [],
|
lnurldeviceLinksObj: [],
|
||||||
devices: [
|
devices: [
|
||||||
@ -587,6 +655,14 @@
|
|||||||
window.location.protocol + '//' + window.location.host
|
window.location.protocol + '//' + window.location.host
|
||||||
this.qrCodeDialog.show = true
|
this.qrCodeDialog.show = true
|
||||||
},
|
},
|
||||||
|
addSwitch: function () {
|
||||||
|
var self = this
|
||||||
|
self.switches = self.switches + 1
|
||||||
|
},
|
||||||
|
removeSwitch: function () {
|
||||||
|
var self = this
|
||||||
|
self.switches = self.switches - 1
|
||||||
|
},
|
||||||
cancellnurldevice: function (data) {
|
cancellnurldevice: function (data) {
|
||||||
var self = this
|
var self = this
|
||||||
self.formDialoglnurldevice.show = false
|
self.formDialoglnurldevice.show = false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user