Skip to content

Commit 049ce19

Browse files
committed
format
1 parent 913f8d9 commit 049ce19

3 files changed

Lines changed: 88 additions & 30 deletions

File tree

static/js/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ window.app = Vue.createApp({
7676
data: null
7777
},
7878
options: ['bitcoin', 'confetti', 'rocket', 'face', 'martijn', 'rick'],
79-
// currencyOptions: ['None', 'btcusd', 'btceur', 'btcgbp'],
8079
currencyOptions: ['sat', ...window.currencies]
8180
}
8281
},

templates/copilot/compose.html

Lines changed: 85 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,40 @@
11
{% extends "public.html" %} {% block page %}<q-page>
2-
<video autoplay="true" id="videoScreen" style="width: 100%" class="fixed-bottom-right"></video>
3-
<video autoplay="true" id="videoCamera" style="width: 100%" class="fixed-bottom-right"></video>
2+
<video
3+
autoplay="true"
4+
id="videoScreen"
5+
style="width: 100%"
6+
class="fixed-bottom-right"
7+
></video>
8+
<video
9+
autoplay="true"
10+
id="videoCamera"
11+
style="width: 100%"
12+
class="fixed-bottom-right"
13+
></video>
414
<img src="" style="width: 100%" id="animations" class="fixed-bottom-left" />
515

6-
<q-card id="draggabletroll" v-show="troll_box" class="rounded-borders bg-dark"
7-
style="width: 350px; height: 500px; margin-top: 10%; float: right">
16+
<q-card
17+
id="draggabletroll"
18+
v-show="troll_box"
19+
class="rounded-borders bg-dark"
20+
style="width: 350px; height: 500px; margin-top: 10%; float: right"
21+
>
822
<q-card-section>
923
<div class="row">
1024
<div class="col" style="max-width: 100px">
11-
<lnbits-qrcode :value="chatUrl" class="rounded-borders"></lnbits-qrcode>
25+
<lnbits-qrcode
26+
:value="chatUrl"
27+
class="rounded-borders"
28+
></lnbits-qrcode>
1229
</div>
1330
<div class="col">
1431
<div class="text-h6 q-ml-md">Trollbox</div>
15-
<a :href="chatLink" class="text-white" style="color: #43a047" target="_blank">
32+
<a
33+
:href="chatLink"
34+
class="text-white"
35+
style="color: #43a047"
36+
target="_blank"
37+
>
1638
<p class="q-ml-md" v-text="chatLink"></p>
1739
</a>
1840
</div>
@@ -22,44 +44,73 @@
2244
<q-separator dark inset></q-separator>
2345

2446
<q-card-actions>
25-
<div class="absolute-bottom q-ml-md q-mb-xs" style="
47+
<div
48+
class="absolute-bottom q-ml-md q-mb-xs"
49+
style="
2650
max-height: 360px;
2751
overflow: auto;
2852
display: flex;
2953
flex-direction: column-reverse;
30-
">
31-
<p v-for="troll in chatCompute" style="margin-bottom: 5px; word-wrap: break-word" v-text="troll"></p>
54+
"
55+
>
56+
<p
57+
v-for="troll in chatCompute"
58+
style="margin-bottom: 5px; word-wrap: break-word"
59+
v-text="troll"
60+
></p>
3261
</div>
3362
</q-card-actions>
3463
</q-card>
3564

36-
<div v-if="copilot.lnurl_toggle == 1" id="draggableqr" class="rounded-borders" style="
65+
<div
66+
v-if="copilot.lnurl_toggle == 1"
67+
id="draggableqr"
68+
class="rounded-borders"
69+
style="
3770
width: 250px;
3871
background-color: white;
3972
height: 300px;
4073
margin-top: 10%;
41-
">
74+
"
75+
>
4276
<div class="col">
4377
<a class="text-secondary" :href="'lightning:' + copilot.lnurl">
44-
<lnbits-qrcode :value="'lightning:' + copilot.lnurl" class="rounded-borders"></lnbits-qrcode>
45-
<center class="absolute-bottom" style="color: black; font-size: 20px" v-text="copilot.lnurl_title"></center>
78+
<lnbits-qrcode
79+
:value="'lightning:' + copilot.lnurl"
80+
class="rounded-borders"
81+
></lnbits-qrcode>
82+
<center
83+
class="absolute-bottom"
84+
style="color: black; font-size: 20px"
85+
v-text="copilot.lnurl_title"
86+
></center>
4687
</a>
4788
</div>
4889
</div>
4990

50-
<h2 id="draggableprice" v-if="copilot.show_price != 0" class="text-bold" style="
91+
<h2
92+
id="draggableprice"
93+
v-if="copilot.show_price != 0"
94+
class="text-bold"
95+
style="
5196
margin: 60px 60px;
5297
font-size: 110px;
5398
text-shadow: 4px 8px 4px black;
5499
color: white;
55-
" v-text="price"></h2>
100+
"
101+
v-text="price"
102+
></h2>
56103

57-
<p v-if="copilot.show_ack != 0" class="fixed-top" style="
104+
<p
105+
v-if="copilot.show_ack != 0"
106+
class="fixed-top"
107+
style="
58108
font-size: 22px;
59109
text-shadow: 2px 4px 1px black;
60110
color: white;
61111
padding-left: 40%;
62-
">
112+
"
113+
>
63114
Powered by LNbits/StreamerCopilot
64115
</p>
65116
</q-page>
@@ -148,7 +199,7 @@
148199

149200
if (navigator.mediaDevices.getUserMedia) {
150201
navigator.mediaDevices
151-
.getUserMedia({ video: true })
202+
.getUserMedia({video: true})
152203
.then(stream => {
153204
video.srcObject = stream
154205
})
@@ -158,7 +209,7 @@
158209
initScreenShare() {
159210
const video = document.querySelector('#videoScreen')
160211
navigator.mediaDevices
161-
.getDisplayMedia({ video: true })
212+
.getDisplayMedia({video: true})
162213
.then(stream => {
163214
video.srcObject = stream
164215
})
@@ -210,16 +261,22 @@
210261
getFiat() {
211262
if (this.copilot.show_price) {
212263
LNbits.api
213-
.request('GET', `/api/v1/rate/` + this.copilot.show_price, null)
214-
.then(response => {
215-
this.price = LNbits.utils.formatCurrency(response.data.price.toFixed(2), this.copilot.show_price)
216-
})
217-
.catch(e => console.error(e))
264+
.request('GET', `/api/v1/rate/` + this.copilot.show_price, null)
265+
.then(response => {
266+
this.price = LNbits.utils.formatCurrency(
267+
response.data.price.toFixed(2),
268+
this.copilot.show_price
269+
)
270+
})
271+
.catch(e => console.error(e))
218272
this.fiatInterval = setInterval(() => {
219273
LNbits.api
220274
.request('GET', `/api/v1/rate/` + this.copilot.show_price, null)
221275
.then(response => {
222-
this.price = LNbits.utils.formatCurrency(response.data.price.toFixed(2), this.copilot.show_price)
276+
this.price = LNbits.utils.formatCurrency(
277+
response.data.price.toFixed(2),
278+
this.copilot.show_price
279+
)
223280
})
224281
.catch(e => console.error(e))
225282
}, 30000)
@@ -230,8 +287,8 @@
230287
.request(
231288
'GET',
232289
'/copilot/api/v1/copilot/ws/' +
233-
this.copilot.id +
234-
'/launching/rocket'
290+
this.copilot.id +
291+
'/launching/rocket'
235292
)
236293
.then(response1 => {
237294
Quasar.Notify.create({
@@ -341,4 +398,4 @@
341398
}
342399
})
343400
</script>
344-
{% endblock %}
401+
{% endblock %}

views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from lnbits.core.models import User
44
from lnbits.decorators import check_user_exists
55
from lnbits.helpers import template_renderer
6+
67
from ...utils.exchange_rates import allowed_currencies
78

89
copilot_generic_router: APIRouter = APIRouter()
@@ -15,7 +16,8 @@ def copilot_renderer():
1516
@copilot_generic_router.get("/", response_class=HTMLResponse)
1617
async def index(request: Request, user: User = Depends(check_user_exists)):
1718
return copilot_renderer().TemplateResponse(
18-
"copilot/index.html", {"request": request, "user": user.json(), "currencies": allowed_currencies()}
19+
"copilot/index.html",
20+
{"request": request, "user": user.json(), "currencies": allowed_currencies()},
1921
)
2022

2123

0 commit comments

Comments
 (0)