mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-27 12:26:19 +02:00
added prop to panel
This commit is contained in:
@@ -101,7 +101,8 @@
|
|||||||
return {
|
return {
|
||||||
fullscreen_cam: true,
|
fullscreen_cam: true,
|
||||||
textareaModel: '',
|
textareaModel: '',
|
||||||
iframe: ''
|
iframe: '',
|
||||||
|
copilot: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -130,36 +131,37 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
var copilot = JSON.parse(localStorage.getItem('copilot'))
|
self = this
|
||||||
console.log(copilot.id)
|
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)
|
||||||
this.connection = new WebSocket(
|
self.connection = new WebSocket(
|
||||||
'wss://' +
|
'wss://' +
|
||||||
document.domain +
|
document.domain +
|
||||||
':' +
|
':' +
|
||||||
location.port +
|
location.port +
|
||||||
'/copilot/ws/panel/' +
|
'/copilot/ws/panel/' +
|
||||||
copilot.id
|
self.copilot.id
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
this.connection = new WebSocket(
|
self.connection = new WebSocket(
|
||||||
'ws://' +
|
'ws://' +
|
||||||
document.domain +
|
document.domain +
|
||||||
':' +
|
':' +
|
||||||
location.port +
|
location.port +
|
||||||
'/copilot/ws/panel/' +
|
'/copilot/ws/panel/' +
|
||||||
copilot.id
|
self.copilot.id
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
this.connection.addEventListener('open', function (event) {})
|
self.connection.addEventListener('open', function (event) {})
|
||||||
|
|
||||||
this.connection.addEventListener('message', function (event) {
|
self.connection.addEventListener('message', function (event) {
|
||||||
console.log('Message from server ', event.data)
|
console.log('Message from server ', event.data)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.connection.addEventListener('close', function (event) {
|
self.connection.addEventListener('close', function (event) {
|
||||||
console.log('The connection has been closed')
|
console.log('The connection has been closed')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user