Timeline stuff

This commit is contained in:
Ruben van de Ven 2019-04-27 16:39:20 +02:00
parent 0ddef76357
commit bb5f518041
3 changed files with 8 additions and 3 deletions

View file

@ -74,6 +74,7 @@ copy autossh-hugvey.service to `/etc/systemd/system/`:
```bash ```bash
cp autossh-hugvey.service /etc/systemd/system/autossh-hugvey.service cp autossh-hugvey.service /etc/systemd/system/autossh-hugvey.service
sudo systemctl enable autossh-hugvey.service
``` ```
### clients ### clients

View file

@ -263,7 +263,7 @@ class Panopticon(object):
assert isinstance(record, logging.LogRecord) assert isinstance(record, logging.LogRecord)
hugvey_id = record.name.split('.')[1] hugvey_id = record.name.split('.')[1]
items = record.msg.split(':', 2) items = record.msg.split(':', 2)
msg = {'action': 'log', 'id':hugvey_id, 'type': items[0]} msg = {'action': 'log', 'id':hugvey_id, 'type': items[0], 'lvl':record.levelno, 'lvlname':record.levelname}
if len(items) > 1: if len(items) > 1:
msg['info'] = items[1] msg['info'] = items[1]
if len(items) > 2: if len(items) > 2:

View file

@ -129,7 +129,9 @@ class Timeline{
break; break;
case 'story': case 'story':
// 'info': 'start'/'finished' // 'info': 'start'/'finished'
this.eventDataSet.add({content: msg['type'] +': ' + msg['info'] + ': ' + msg['args'], start: new Date(), type: 'point', group: hv_id, 'className': 'story'}); this.eventDataSet.add({
content: msg['type'] +': ' + msg['info'] + (msg.hasOwnProperty('args')? ': '+msg['args'] : ""),
start: new Date(), type: 'point', group: hv_id, 'className': 'story'});
break; break;
case 'condition': case 'condition':
@ -137,7 +139,9 @@ class Timeline{
// don't draw these :-0 // don't draw these :-0
break; break;
default: default:
this.eventDataSet.add({content: msg['type'] +': ' + msg['info'] + ': ' + msg['args'], start: new Date(), type: 'point', group: hv_id}); this.eventDataSet.add({
content: msg['type'] +': ' + msg['info'] + (msg.hasOwnProperty('args')? ': '+msg['args'] : ""),
start: new Date(), type: 'point', group: hv_id, 'className': msg['lvlname']});
break; break;
} }
} }