From d61f1db70e016066698ad981f5fb478505fcffc7 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Fri, 17 May 2019 19:06:00 +0200 Subject: [PATCH 1/2] Convenience changes to panopticon and timeline --- hugvey/central_command.py | 1 + www/css/styles.css | 4 ++-- www/js/hugvey_timeline.js | 6 +++--- www/scss/styles.scss | 4 ++-- www/timeline.html | 1 + 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hugvey/central_command.py b/hugvey/central_command.py index bda39a5..2491257 100644 --- a/hugvey/central_command.py +++ b/hugvey/central_command.py @@ -150,6 +150,7 @@ class CentralCommand(object): for hv_id in self.hugvey_ids: status['hugveys'].append(self.getHugveyStatus(hv_id, hv_id in selected_ids)) + status['hugveys'].sort(key=lambda hv: hv['light_id'] if 'light_id' in hv else hv['id']) # if selected_id and selected_id in self.hugveys: # if self.hugveys[selected_id].recorder: # status['logbook'] = self.hugveys[selected_id].recorder.currentLog diff --git a/www/css/styles.css b/www/css/styles.css index 090f746..a8fc216 100644 --- a/www/css/styles.css +++ b/www/css/styles.css @@ -61,7 +61,7 @@ img.icon { height: 100%; overflow-y: scroll; } .panopticon #status { - width: 90%; } + width: 80%; } #status > div { width: 33.3333333%; height: 200px; @@ -344,7 +344,7 @@ body.showTimeline #toggleTimeline { border-radius: 15px; } #logbook { - width: 50%; + width: 20%; padding: 10px; color: #999; height: 100%; diff --git a/www/js/hugvey_timeline.js b/www/js/hugvey_timeline.js index 0840120..bc00d36 100644 --- a/www/js/hugvey_timeline.js +++ b/www/js/hugvey_timeline.js @@ -124,7 +124,7 @@ checkbox.addEventListener('change', (event) => { this.eventDataSet.update(d); console.log('update', d); } else { - this.eventDataSet.add({id: mId, content: msgContent, title: `${msgContent} (${msgId})`, start: new Date(), group: hv_id, 'className': 'message'}); + this.eventDataSet.add({id: mId, content: msgContent, title: `${msgContent} (${msgId})`, start: new Date(), end: new Date(Date.now()+5000), group: hv_id, 'className': 'message'}); } break; case 'speaking': @@ -136,7 +136,7 @@ checkbox.addEventListener('change', (event) => { let scId = 'sc-'+id+'-'+hv_id; if(info.startsWith('start')){ - this.eventDataSet.add({content: info, start: new Date(), type: 'point', group: hv_id, 'className': 'speech'}); + this.eventDataSet.add({content: info, start: new Date(), end: new Date(Date.now() + 1000), type: 'point', group: hv_id, 'className': 'speech'}); } if(info.startsWith('content')){ d = this.eventDataSet.get(scId); @@ -148,7 +148,7 @@ checkbox.addEventListener('change', (event) => { this.eventDataSet.update(d); } else { console.log('add'); - this.eventDataSet.add({id: scId, content: content, title: content, start: new Date(), group: hv_id, 'className': 'speech'}); + this.eventDataSet.add({id: scId, content: content, title: content, start: new Date(), end: new Date(Date.now() + 1000), group: hv_id, 'className': 'speech'}); } } if(info.startsWith('end')){ diff --git a/www/scss/styles.scss b/www/scss/styles.scss index c0af4c8..10845e0 100644 --- a/www/scss/styles.scss +++ b/www/scss/styles.scss @@ -85,7 +85,7 @@ img.icon{ overflow-y: scroll; .panopticon &{ - width: 90% + width: 80% } & > div{ @@ -553,7 +553,7 @@ img.icon{ } #logbook{ - width: 50%; + width: 20%; padding: 10px; color: #999; height: 100%; diff --git a/www/timeline.html b/www/timeline.html index f615f13..94af64a 100644 --- a/www/timeline.html +++ b/www/timeline.html @@ -4,6 +4,7 @@ +