refactor to use local
This commit is contained in:
parent
7d85310f30
commit
98ceb551c7
3 changed files with 18 additions and 14 deletions
|
|
@ -14,13 +14,13 @@
|
||||||
<img src="" style="width: 100%" id="animations" class="fixed-bottom-left" />
|
<img src="" style="width: 100%" id="animations" class="fixed-bottom-left" />
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="'{{ lnurl_toggle }}' == 1"
|
v-if="copilot.lnurl_toggle == 1"
|
||||||
class="rounded-borders fixed-top-right column"
|
class="rounded-borders fixed-top-right column"
|
||||||
style="width: 350px; z-index: 9999; background-color: white"
|
style="width: 350px; z-index: 9999; background-color: white"
|
||||||
>
|
>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<qrcode
|
<qrcode
|
||||||
:value="'{{ lnurl }}'"
|
:value="copilot.lnurl"
|
||||||
:options="{width:350}"
|
:options="{width:350}"
|
||||||
class="rounded-borders"
|
class="rounded-borders"
|
||||||
></qrcode>
|
></qrcode>
|
||||||
|
|
@ -34,12 +34,12 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<center>{{ copilot.lnurl_title }}</center>
|
<center>{% raw %}{{ copilot.lnurl_title }}{% endraw %}</center>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2
|
<h2
|
||||||
v-if="'{{ copilot.show_price }}' != 'None'"
|
v-if="copilot.show_price != 'None'"
|
||||||
class="text-bold fixed-bottom-left"
|
class="text-bold fixed-bottom-left"
|
||||||
style="
|
style="
|
||||||
margin: 60px 60px;
|
margin: 60px 60px;
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
{% raw %}{{ price }}{% endraw %}
|
{% raw %}{{ price }}{% endraw %}
|
||||||
</h2>
|
</h2>
|
||||||
<p
|
<p
|
||||||
v-if="'{{ copilot.show_ack }}' != 'None'"
|
v-if="copilot.show_ack != 'None'"
|
||||||
class="fixed-top"
|
class="fixed-top"
|
||||||
style="
|
style="
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
|
|
@ -88,7 +88,9 @@
|
||||||
return {
|
return {
|
||||||
price: '',
|
price: '',
|
||||||
counter: 1,
|
counter: 1,
|
||||||
colours: ['teal', 'purple', 'indigo', 'pink', 'green']
|
colours: ['teal', 'purple', 'indigo', 'pink', 'green'],
|
||||||
|
copilot: {},
|
||||||
|
lnurl: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -136,7 +138,7 @@
|
||||||
},
|
},
|
||||||
getPrice: function () {
|
getPrice: function () {
|
||||||
self = this
|
self = this
|
||||||
if ('{{ copilot.show_price }}' != 'None') {
|
if (self.copilot.show_price != 'None') {
|
||||||
LNbits.api
|
LNbits.api
|
||||||
.request('GET', 'https://api.opennode.com/v1/rates', 'filla')
|
.request('GET', 'https://api.opennode.com/v1/rates', 'filla')
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
|
|
@ -146,7 +148,6 @@
|
||||||
currency: 'USD'
|
currency: 'USD'
|
||||||
}).format(response.data.data.BTCUSD.USD)
|
}).format(response.data.data.BTCUSD.USD)
|
||||||
)
|
)
|
||||||
console.log(self.price)
|
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
LNbits.utils.notifyApiError(error)
|
LNbits.utils.notifyApiError(error)
|
||||||
|
|
@ -161,7 +162,6 @@
|
||||||
self.counter++
|
self.counter++
|
||||||
if (self.counter % 20 === 0) {
|
if (self.counter % 20 === 0) {
|
||||||
self.getPrice()
|
self.getPrice()
|
||||||
console.log('test')
|
|
||||||
}
|
}
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}, 2000)
|
}, 2000)
|
||||||
|
|
@ -171,10 +171,13 @@
|
||||||
this.initCamera()
|
this.initCamera()
|
||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
|
self = this
|
||||||
|
self.copilot = JSON.parse(localStorage.getItem('copilot'))
|
||||||
|
|
||||||
LNbits.api
|
LNbits.api
|
||||||
.request(
|
.request(
|
||||||
'GET',
|
'GET',
|
||||||
'/copilot/api/v1/copilot/ws/{{ copilot.id }}/launching/rocket',
|
'/copilot/api/v1/copilot/ws/' + self.copilot.id + '/launching/rocket',
|
||||||
'filla'
|
'filla'
|
||||||
)
|
)
|
||||||
.then(function (response) {})
|
.then(function (response) {})
|
||||||
|
|
@ -187,7 +190,8 @@
|
||||||
document.domain +
|
document.domain +
|
||||||
':' +
|
':' +
|
||||||
location.port +
|
location.port +
|
||||||
'/copilot/ws/compose/{{ copilot.id }}'
|
'/copilot/ws/compose/' +
|
||||||
|
self.copilot.id
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
this.connection = new WebSocket(
|
this.connection = new WebSocket(
|
||||||
|
|
@ -195,7 +199,8 @@
|
||||||
document.domain +
|
document.domain +
|
||||||
':' +
|
':' +
|
||||||
location.port +
|
location.port +
|
||||||
'/copilot/ws/compose/{{ copilot.id }}'
|
'/copilot/ws/compose/' +
|
||||||
|
self.copilot.id
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,6 @@
|
||||||
created: function () {
|
created: function () {
|
||||||
self = this
|
self = this
|
||||||
self.copilot = JSON.parse(localStorage.getItem('copilot'))
|
self.copilot = JSON.parse(localStorage.getItem('copilot'))
|
||||||
console.log(this.copilot.id)
|
|
||||||
|
|
||||||
if (location.protocol == 'https:') {
|
if (location.protocol == 'https:') {
|
||||||
console.log(location.protocol)
|
console.log(location.protocol)
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ async def api_copilot_retrieve(copilot_id):
|
||||||
return jsonify({"message": "copilot does not exist"}), HTTPStatus.NOT_FOUND
|
return jsonify({"message": "copilot does not exist"}), HTTPStatus.NOT_FOUND
|
||||||
|
|
||||||
return (
|
return (
|
||||||
jsonify(copilot._asdict()),
|
jsonify(copilot._asdict(), lnurl=copilot.lnurl),
|
||||||
HTTPStatus.OK,
|
HTTPStatus.OK,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue