This commit is contained in:
Ben Arc 2021-06-23 23:58:39 +01:00
parent 9267aba6d9
commit 2bc3fb1b91
3 changed files with 34 additions and 26 deletions

View File

@ -112,7 +112,9 @@
@click="openUpdateCopilotLink(props.row.id)"
icon="edit"
color="light-blue"
></q-btn>
>
<q-tooltip> Edit copilot </q-tooltip>
</q-btn>
</q-td>
<q-td
v-for="col in props.cols"
@ -408,22 +410,8 @@
data: function () {
return {
filter: '',
watchonlyactive: false,
balance: null,
checker: null,
walletLinks: [],
CopilotLinks: [],
CopilotLinksObj: [],
onchainwallet: '',
currentaddress: '',
Addresses: {
show: false,
data: null
},
mempool: {
endpoint: ''
},
CopilotsTable: {
columns: [
{
@ -466,7 +454,7 @@
lnurl_toggle: false,
show_message: false,
show_ack: false,
show_price: false,
show_price: 'None',
title: ''
}
},
@ -475,7 +463,7 @@
data: null
},
options: ['bitcoin', 'confetti', 'rocket', 'face', 'martijn', 'rick'],
currencyOptions: ['btcusd', 'btceur', 'btcgbp']
currencyOptions: ['None', 'btcusd', 'btceur', 'btcgbp']
}
},
methods: {
@ -556,7 +544,7 @@
openCopilotPanel: function (copilot_id) {
this.getCopilot(copilot_id)
let params =
'scrollbars=no, resizable=no,status=no,location=no,toolbar=no,menubar=no,width=400,height=450,left=10,top=400'
'scrollbars=no, resizable=no,status=no,location=no,toolbar=no,menubar=no,width=300,height=450,left=10,top=400'
open('../copilot/pn/', '_blank', params)
},
deleteCopilotLink: function (copilotId) {
@ -595,6 +583,16 @@
if (data[property]) {
updatedData[property] = data[property]
}
if (property == 'animation1threshold' && data[property]) {
console.log(data[property])
updatedData[property] = parseInt(data[property])
}
if (property == 'animation2threshold' && data[property]) {
updatedData[property] = parseInt(data[property])
}
if (property == 'animation3threshold' && data[property]) {
updatedData[property] = parseInt(data[property])
}
}
console.log(updatedData)
@ -606,6 +604,9 @@
updatedData
)
.then(function (response) {
self.CopilotLinks = _.reject(self.CopilotLinks, function (obj) {
return obj.id === updatedData.id
})
self.CopilotLinks.push(mapCopilot(response.data))
self.formDialogCopilot.show = false
})

View File

@ -1,5 +1,5 @@
{% extends "public.html" %} {% block page %}
<div class="q-pa-sm" style="width: 300px; margin: 10px auto">
<div class="q-pa-sm" style="width: 240px; margin: 10px auto">
<q-card class="my-card">
<div class="column">
<div class="col">
@ -10,12 +10,12 @@
dense
@click="openCompose"
icon="face"
style="font-size: 80px"
style="font-size: 60px"
></q-btn>
</center>
</div>
<center>
<div class="col" style="margin: 15px; font-size: 25px">
<div class="col" style="margin: 15px; font-size: 22px">
Title: {% raw %} {{ copilot.title }} {% endraw %}
</div>
</center>
@ -28,6 +28,7 @@
color="primary"
@click="fullscreenToggle"
label="Screen share"
size="sm"
>
</q-btn>
</div>
@ -39,6 +40,7 @@
color="primary"
@click="animationBTN('rocket')"
label="rocket"
size="sm"
/>
</div>
<div class="col">
@ -47,6 +49,7 @@
color="primary"
@click="animationBTN('confetti')"
label="confetti"
size="sm"
/>
</div>
<div class="col">
@ -55,6 +58,7 @@
color="primary"
@click="animationBTN('face')"
label="face"
size="sm"
/>
</div>
</div>
@ -65,6 +69,7 @@
color="primary"
@click="animationBTN('rick')"
label="rick"
size="sm"
/>
</div>
<div class="col">
@ -73,6 +78,7 @@
color="primary"
@click="animationBTN('martijn')"
label="martijn"
size="sm"
/>
</div>
<div class="col">
@ -81,6 +87,7 @@
color="primary"
@click="animationBTN('bitcoin')"
label="bitcoin"
size="sm"
/>
</div>
</div>

View File

@ -27,20 +27,20 @@ from .crud import (
@api_validate_post_request(
schema={
"title": {"type": "string", "empty": False, "required": True},
"lnurl_toggle": {"type": "integer", "empty": False, "required": True},
"lnurl_toggle": {"type": "integer", "empty": False},
"wallet": {"type": "string", "empty": False, "required": False},
"animation1": {"type": "string", "empty": True, "required": False},
"animation2": {"type": "string", "empty": True, "required": False},
"animation3": {"type": "string", "empty": True, "required": False},
"animation1threshold": {"type": "string", "empty": True, "required": False},
"animation2threshold": {"type": "string", "empty": True, "required": False},
"animation3threshold": {"type": "string", "empty": True, "required": False},
"animation1threshold": {"type": "integer", "empty": True, "required": False},
"animation2threshold": {"type": "integer", "empty": True, "required": False},
"animation3threshold": {"type": "integer", "empty": True, "required": False},
"animation1webhook": {"type": "string", "empty": True, "required": False},
"animation2webhook": {"type": "string", "empty": True, "required": False},
"animation3webhook": {"type": "string", "empty": True, "required": False},
"lnurl_title": {"type": "string", "empty": True, "required": False},
"show_message": {"type": "integer", "empty": True, "required": False},
"show_ack": {"type": "integer", "empty": True, "required": True},
"show_ack": {"type": "integer", "empty": True},
"show_price": {"type": "string", "empty": True},
}
)