Some changes in an attempt to fix the Panopticon crashes

This commit is contained in:
Ruben van de Ven 2019-04-16 14:45:32 +02:00
parent 7bb3410ec5
commit b2a378acfe
5 changed files with 20 additions and 3 deletions

View file

@ -159,7 +159,7 @@ class VoiceServer(object):
try:
if self.hugvey.cmd_server.muteMic:
logger.debug('block recording {}' .format(
logger.log(LOG_BS, 'block recording {}' .format(
self.hugvey.cmd_server.muteMic))
# multiply by 0 to disable audio recording while playback

View file

@ -115,6 +115,10 @@ def getWebSocketHandler(central_command):
@classmethod
def write_to_clients(wsHandlerClass, msg):
if msg is None:
logger.critical("Tried to send 'none' to Panopticon")
return
for client in wsHandlerClass.connections:
client.write_message(msg)

View file

@ -48,6 +48,7 @@ if __name__ == '__main__':
host = urlparse(hv.config['events']['cmd_address']).hostname
logger.info("Connect to logger on {}".format(host))
socket_handler = logging.handlers.SocketHandler(host, 19996) # default listening address
socket_handler.setLevel(logging.DEBUG) # don't send BS messages
logger.addHandler(socket_handler);
hv.start()

View file

@ -40,7 +40,7 @@
</h1>
<div class='status'>{{ hv.status }}</div>
<div v-if="hv.status != 'off' && hv.status != 'gone' && hv.status != 'loading'">
<select v-model="hv.language" @change="change_lang(hv, hv.language)">
<select v-model="hv.language" @change="change_lang(hv, hv.language)" v-on:click.stop>
<option v-for="lang in languages" :title="lang.file"
:value="lang.code">
<span :class="['flag-icon', lang.code]"></span>

View file

@ -45,6 +45,7 @@ class Panopticon {
return panopticon.change_language(hv.id, lang_code);
},
showHugvey: function(hv) {
document.body.classList.remove('showTimeline');
panopticon.hugveys.selectedId = hv.language ? hv.id : null;
panopticon.updateSelectedHugvey();
}
@ -127,7 +128,12 @@ class Panopticon {
}, 500);
console.log(startDate, endDate);
this.timelineInterval = setInterval(function(){panopticon.timeline.moveTo(new Date());}, 1000);
this.timelineInterval = setInterval(function(){
// skip movement if not visible
if(!document.body.classList.contains('showTimeline'))
return;
panopticon.timeline.moveTo(new Date());
}, 1000);
}
break;
@ -209,6 +215,12 @@ class Panopticon {
updateSelectedHugvey() {
let hv = null;
if(document.body.classList.contains('showTimeline')) {
// skip at all if no hugvey is visbile anyway due to the timeline
return;
}
if(this.hugveys.selectedId) {
hv = this.getHugvey(this.hugveys.selectedId);
if(hv.language && this.graph.language_code != hv.language) {