Fixed marker bug + fixed bug multiple attributes from event

pull/18/head
Sami Mokaddem 2017-10-24 12:17:10 +02:00
parent e27b0967b6
commit 6abc6fe9e4
3 changed files with 10 additions and 6 deletions

View File

@ -43,7 +43,7 @@ class MapEventManager {
addMapEvent(mapevent) {
if(this._mapEventArray.length >= MAXIMGROTATION) {
var toDel = this._mapEventArray[0];
toDel._marker.remove(); // remove marker
toDel.marker.remove(); // remove marker
this._coordSet.delete(toDel.text);
this._mapEventArray.slice(1);
}

View File

@ -181,7 +181,7 @@ small {
<input id="checkbox_log_critical" type="checkbox" value="critical" checked="true"> CRITICAL
</div>
</div>
<div id="divLogTable" class="panel-body" style="height: 98%;">
<div id="divLogTable" class="panel-body" style="height: 98%; padding: 3px;">
<div class="row" style="height: 100%;">
<div class="col-lg-12" style="height: 100%;">
<table class="table table-bordered table-hover table-striped" id="table_log">

View File

@ -56,7 +56,6 @@ def getCoordAndPublish(supposed_ip, categ):
coord = rep['coord']
coord_dic = {'lat': coord['lat'], 'lon': coord['lon']}
coord_list = [coord['lat'], coord['lon']]
print(coord_list)
now = datetime.datetime.now()
today_str = str(now.year)+str(now.month)+str(now.day)
keyname = 'GEO_' + today_str
@ -87,16 +86,21 @@ def handler_keepalive(jsonevent):
publish_log('Keepalive', to_push)
def handler_event(jsonevent):
print('sending', 'event')
print(jsonevent)
#fields: threat_level_id, id, info
jsonevent = jsonevent['Event']
#redirect to handler_attribute
if 'Attribute' in jsonevent:
handler_attribute(jsonevent['Attribute'])
attributes = jsonevent['Attribute']
if attributes is list:
for attr in attributes:
handler_attribute(attr)
else:
handler_attribute(attr)
def handler_attribute(jsonattr):
print('sending', 'attribute')
print(jsonattr)
jsonattr = jsonattr['Attribute']
to_push = []
for field in json.loads(cfg.get('Log', 'fieldname_order')):