mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-24 14:51:05 +01:00
adding camera
This commit is contained in:
parent
80969fbd9b
commit
6a05fd7106
4 changed files with 46 additions and 13 deletions
|
@ -24,6 +24,7 @@ async def m001_initial(db):
|
|||
amount_made INTEGER,
|
||||
fullscreen_cam INTEGER,
|
||||
iframe_url TEXT,
|
||||
notes TEXT,
|
||||
timestamp TIMESTAMP NOT NULL DEFAULT (strftime('%s', 'now'))
|
||||
);
|
||||
"""
|
||||
|
|
|
@ -23,6 +23,7 @@ class Copilots(NamedTuple):
|
|||
timestamp: int
|
||||
fullscreen_cam: int
|
||||
iframe_url: str
|
||||
notes: str
|
||||
|
||||
@classmethod
|
||||
def from_row(cls, row: Row) -> "Copilots":
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
{% extends "public.html" %} {% block page %} {% endblock %} {% block scripts %}
|
||||
{% extends "public.html" %} {% block page %}<q-page
|
||||
>fdgasdf
|
||||
|
||||
<video
|
||||
autoplay="true"
|
||||
id="videoElement"
|
||||
style="width: 100%"
|
||||
class="fixed-top-left"
|
||||
></video>
|
||||
</q-page>
|
||||
{% endblock %} {% block scripts %}
|
||||
<script src="{{ url_for('static', filename='vendor/vue-qrcode@1.0.2/vue-qrcode.min.js') }}"></script>
|
||||
<style>
|
||||
body.body--dark .q-drawer,
|
||||
body.body--dark .q-footer,
|
||||
body.body--dark .q-header,
|
||||
.q-drawer,
|
||||
.q-footer,
|
||||
.q-header {
|
||||
display: none;
|
||||
}
|
||||
.q-page {
|
||||
padding: 0px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
Vue.component(VueQrcode.name, VueQrcode)
|
||||
|
||||
|
@ -7,19 +30,27 @@
|
|||
el: '#vue',
|
||||
mixins: [windowMixin],
|
||||
data() {
|
||||
return {
|
||||
newProgress: 0.4,
|
||||
counter: 1,
|
||||
newTimeLeft: '',
|
||||
lnbtc: true,
|
||||
onbtc: false,
|
||||
charge_time_elapsed: '{{charge.time_elapsed}}',
|
||||
charge_amount: '{{charge.amount}}',
|
||||
charge_balance: '{{charge.balance}}',
|
||||
charge_paid: '{{charge.paid}}'
|
||||
return {}
|
||||
},
|
||||
methods: {
|
||||
initCamera() {
|
||||
var video = document.querySelector('#videoElement')
|
||||
|
||||
if (navigator.mediaDevices.getUserMedia) {
|
||||
navigator.mediaDevices
|
||||
.getUserMedia({video: true})
|
||||
.then(function (stream) {
|
||||
video.srcObject = stream
|
||||
})
|
||||
.catch(function (err0r) {
|
||||
console.log('Something went wrong!')
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {},
|
||||
mounted() {
|
||||
this.initCamera()
|
||||
},
|
||||
created: function () {}
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -477,7 +477,7 @@
|
|||
},
|
||||
opencopilotCompose: function (copilot_id) {
|
||||
let params =
|
||||
'scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=900,height=500,left=200,top=200'
|
||||
'scrollbars=no, resizable=no,status=no,location=no,toolbar=no,menubar=no,width=900,height=500,left=200,top=200'
|
||||
open('../copilot/cp/' + copilot_id, 'test', params)
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue