mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-26 16:51:42 +02:00
Fixed models
This commit is contained in:
parent
1bfa28da19
commit
937654e4f7
@ -36,7 +36,7 @@ async def create_lnurldevice(
|
||||
pin3,
|
||||
profit4,
|
||||
amount4,
|
||||
pin4,
|
||||
pin4
|
||||
)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
""",
|
||||
|
@ -19,18 +19,18 @@ class createLnurldevice(BaseModel):
|
||||
profit: float
|
||||
amount: int
|
||||
pin: int
|
||||
profit1: float
|
||||
amount1: int
|
||||
pin1: int
|
||||
profit2: float
|
||||
amount2: int
|
||||
pin2: int
|
||||
profit3: float
|
||||
amount3: int
|
||||
pin3: int
|
||||
profit4: float
|
||||
amount4: int
|
||||
pin4: int
|
||||
profit1: float = 0
|
||||
amount1: int = 0
|
||||
pin1: int = 0
|
||||
profit2: float = 0
|
||||
amount2: int = 0
|
||||
pin2: int = 0
|
||||
profit3: float = 0
|
||||
amount3: int = 0
|
||||
pin3: int = 0
|
||||
profit4: float = 0
|
||||
amount4: int = 0
|
||||
pin4: int = 0
|
||||
|
||||
|
||||
class lnurldevices(BaseModel):
|
||||
|
@ -105,7 +105,7 @@
|
||||
@click="openQrCodeDialog(props.row.id)"
|
||||
><q-tooltip v-if="protocol == 'http:'">
|
||||
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
|
||||
@ -148,6 +148,42 @@
|
||||
style="width: 700px; max-width: 80vw"
|
||||
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>
|
||||
<center>
|
||||
<q-btn
|
||||
@ -230,18 +266,14 @@
|
||||
label="Profit margin (% added to invoices/deducted from faucets)"
|
||||
></q-input>
|
||||
<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>
|
||||
|
||||
<q-toggle v-model="switch5" color="primary" label="5"></q-toggle>
|
||||
|
||||
<div v-if="switch1">
|
||||
<div v-if="switches >= 0">
|
||||
<div class="row">
|
||||
<div class="col" >
|
||||
<q-input
|
||||
ref="setAmount"
|
||||
filled
|
||||
@ -255,6 +287,8 @@
|
||||
:step="'0.01'"
|
||||
value="0.00"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col q-ml-md">
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
@ -263,6 +297,8 @@
|
||||
value="1000"
|
||||
label="milesecs to turn Switch on for (1sec = 1000ms)"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col q-ml-md">
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
@ -271,7 +307,11 @@
|
||||
label="GPIO to turn on"
|
||||
></q-input>
|
||||
</div>
|
||||
<div v-if="switch2">
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="switches >= 1">
|
||||
<div class="row">
|
||||
<div class="col" >
|
||||
<q-input
|
||||
ref="setAmount"
|
||||
filled
|
||||
@ -285,6 +325,8 @@
|
||||
:step="'0.01'"
|
||||
value="0.00"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col q-ml-md">
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
@ -293,6 +335,8 @@
|
||||
value="1000"
|
||||
label="milesecs to turn Switch on for (1sec = 1000ms)"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col q-ml-md">
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
@ -301,7 +345,12 @@
|
||||
label="GPIO to turn on"
|
||||
></q-input>
|
||||
</div>
|
||||
<div v-if="switch3">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="switches >= 2">
|
||||
<div class="row">
|
||||
<div class="col" >
|
||||
<q-input
|
||||
ref="setAmount"
|
||||
filled
|
||||
@ -315,6 +364,8 @@
|
||||
:step="'0.01'"
|
||||
value="0.00"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col q-ml-md">
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
@ -323,6 +374,8 @@
|
||||
value="1000"
|
||||
label="milesecs to turn Switch on for (1sec = 1000ms)"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col q-ml-md">
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
@ -331,7 +384,12 @@
|
||||
label="GPIO to turn on"
|
||||
></q-input>
|
||||
</div>
|
||||
<div v-if="switch4">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="switches >= 3">
|
||||
<div class="row">
|
||||
<div class="col" >
|
||||
<q-input
|
||||
ref="setAmount"
|
||||
filled
|
||||
@ -345,6 +403,8 @@
|
||||
:step="'0.01'"
|
||||
value="0.00"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col q-ml-md">
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
@ -353,6 +413,8 @@
|
||||
value="1000"
|
||||
label="milesecs to turn Switch on for (1sec = 1000ms)"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col q-ml-md">
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
@ -361,7 +423,12 @@
|
||||
label="GPIO to turn on"
|
||||
></q-input>
|
||||
</div>
|
||||
<div v-if="switch4">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="switches >= 4">
|
||||
<div class="row">
|
||||
<div class="col" >
|
||||
<q-input
|
||||
ref="setAmount"
|
||||
filled
|
||||
@ -375,6 +442,8 @@
|
||||
:step="'0.01'"
|
||||
value="0.00"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col q-ml-md">
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
@ -383,6 +452,8 @@
|
||||
value="1000"
|
||||
label="milesecs to turn Switch on for (1sec = 1000ms)"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col q-ml-md">
|
||||
<q-input
|
||||
filled
|
||||
dense
|
||||
@ -392,7 +463,8 @@
|
||||
></q-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-mt-lg">
|
||||
<q-btn
|
||||
v-if="formDialoglnurldevice.data.id"
|
||||
@ -478,11 +550,7 @@
|
||||
wslocation: window.location.hostname,
|
||||
filter: '',
|
||||
currency: 'USD',
|
||||
switch1: false,
|
||||
switch2: false,
|
||||
switch3: false,
|
||||
switch4: false,
|
||||
switch5: false,
|
||||
switches: 0,
|
||||
lnurldeviceLinks: [],
|
||||
lnurldeviceLinksObj: [],
|
||||
devices: [
|
||||
@ -587,6 +655,14 @@
|
||||
window.location.protocol + '//' + window.location.host
|
||||
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) {
|
||||
var self = this
|
||||
self.formDialoglnurldevice.show = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user