mirror of https://github.com/MISP/misp-dashboard
Merge branch 'master' of https://github.com/MISP/misp-dashboard
commit
9f1ffe97ca
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
# By default Redis does not run as a daemon. Use 'yes' if you need it.
|
# By default Redis does not run as a daemon. Use 'yes' if you need it.
|
||||||
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
|
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
|
||||||
daemonize no
|
daemonize yes
|
||||||
|
|
||||||
# When running daemonized, Redis writes a pid file in /var/run/redis.pid by
|
# When running daemonized, Redis writes a pid file in /var/run/redis.pid by
|
||||||
# default. You can specify a custom pid file location here.
|
# default. You can specify a custom pid file location here.
|
||||||
|
@ -141,7 +141,7 @@ databases 16
|
||||||
|
|
||||||
#save 900 1
|
#save 900 1
|
||||||
#save 300 10
|
#save 300 10
|
||||||
save 60 10000
|
save 9000 1
|
||||||
|
|
||||||
# By default Redis will stop accepting writes if RDB snapshots are enabled
|
# By default Redis will stop accepting writes if RDB snapshots are enabled
|
||||||
# (at least one save point) and the latest background save failed.
|
# (at least one save point) and the latest background save failed.
|
||||||
|
|
|
@ -187,7 +187,24 @@ function queryAndAddMarkers() {
|
||||||
var coord = circleRadius._latlng;
|
var coord = circleRadius._latlng;
|
||||||
var dateStart = datePickersRadiusWidgetFrom.datepicker("getDate").getTime() / 1000;
|
var dateStart = datePickersRadiusWidgetFrom.datepicker("getDate").getTime() / 1000;
|
||||||
var dateEnd = datePickersRadiusWidgetTo.datepicker("getDate").getTime() / 1000;
|
var dateEnd = datePickersRadiusWidgetTo.datepicker("getDate").getTime() / 1000;
|
||||||
$.getJSON(urlCoordsByRadius+"?dateStart="+dateStart+"&dateEnd="+dateEnd+"¢erLat="+coord.lat+"¢erLon="+coord.lng+"&radius="+radius_km, function(allList){
|
var geo_param = {
|
||||||
|
dateStart: dateStart,
|
||||||
|
dateEnd: dateEnd,
|
||||||
|
centerLat: coord.lat,
|
||||||
|
centerLon: coord.lng,
|
||||||
|
radius: radius_km
|
||||||
|
};
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
data: geo_param,
|
||||||
|
cache: false,
|
||||||
|
beforeSend: function(XMLHttpRequest) {
|
||||||
|
//$('.loading').show();
|
||||||
|
set_loading_status($('#geo_info_qry_btn'), true, 'Querying and fetching', 1);
|
||||||
|
},
|
||||||
|
success: function(data, textStatus) {
|
||||||
|
var allList = data;
|
||||||
|
set_loading_status($('#geo_info_qry_btn'), true, 'Drawing '+allList.length + ' results', 2);
|
||||||
// remove old markers
|
// remove old markers
|
||||||
for (var i in savedMarkerRadius) {
|
for (var i in savedMarkerRadius) {
|
||||||
savedMarkerRadius[i].remove(); // remove marker
|
savedMarkerRadius[i].remove(); // remove marker
|
||||||
|
@ -205,12 +222,56 @@ function queryAndAddMarkers() {
|
||||||
savedMarkerRadius.push(marker);
|
savedMarkerRadius.push(marker);
|
||||||
marker.bindPopup(dataText, {autoClose:false}).openPopup();
|
marker.bindPopup(dataText, {autoClose:false}).openPopup();
|
||||||
}
|
}
|
||||||
|
set_loading_status($('#geo_info_qry_btn'), false, allList.length + ' results');
|
||||||
|
},
|
||||||
|
error: function( jqXhr, textStatus, errorThrown ){
|
||||||
|
set_loading_status($('#geo_info_qry_btn'), false, 'Error: '+ errorThrown);
|
||||||
|
},
|
||||||
|
type: 'get',
|
||||||
|
url: urlCoordsByRadius
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* UTIL */
|
/* UTIL */
|
||||||
|
|
||||||
|
function set_loading_status(jhtml, is_loading, text, loading_state) {
|
||||||
|
text = text === undefined || text === null ? '' : text;
|
||||||
|
if (is_loading) {
|
||||||
|
if (jhtml.data('default-text') === undefined) {
|
||||||
|
jhtml.data('default-text', jhtml.text());
|
||||||
|
}
|
||||||
|
var loading_icon = ''
|
||||||
|
switch(loading_state) {
|
||||||
|
case 1:
|
||||||
|
loading_icon = 'fa-spinner';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
loading_icon = 'fa-circle-o-notch';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
loading_icon = 'fa-refresh';
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
loading_icon = 'fa-circle-o-notch';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
var loadingIcon = $('<i class="fa fa-spin '+loading_icon+'"></i>');
|
||||||
|
jhtml.text(' '+text);
|
||||||
|
jhtml.prepend(loadingIcon);
|
||||||
|
} else {
|
||||||
|
jhtml.empty();
|
||||||
|
jhtml.text(text);
|
||||||
|
setTimeout(function() {
|
||||||
|
let old_text = jhtml.data('default-text');
|
||||||
|
jhtml.text(old_text);
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function days_between(date1, date2) {
|
function days_between(date1, date2) {
|
||||||
var ONEDAY = 60*60*24*1000;
|
var ONEDAY = 60*60*24*1000;
|
||||||
var diff_ms = Math.abs(date1.getTime() - date2.getTime());
|
var diff_ms = Math.abs(date1.getTime() - date2.getTime());
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
<script src="{{ url_for('static', filename='js/jquery.flot.resize.js') }}"></script>
|
<script src="{{ url_for('static', filename='js/jquery.flot.resize.js') }}"></script>
|
||||||
<!-- Bootstrap Core JavaScript -->
|
<!-- Bootstrap Core JavaScript -->
|
||||||
<script src="{{ url_for('static', filename='js/bootstrap.js') }}"></script>
|
<script src="{{ url_for('static', filename='js/bootstrap.js') }}"></script>
|
||||||
<link href="{{ url_for('static', filename='css/font-awesome.min.css') }}" rel="text/css">
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/font-awesome.min.css') }}" rel="text/css">
|
||||||
|
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/jquery-jvectormap-2.0.3.css') }}" type="text/css" media="screen"/>
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/jquery-jvectormap-2.0.3.css') }}" type="text/css" media="screen"/>
|
||||||
<script src="{{ url_for('static', filename='js/jquery-jvectormap-2.0.3.min.js') }}"></script>
|
<script src="{{ url_for('static', filename='js/jquery-jvectormap-2.0.3.min.js') }}"></script>
|
||||||
|
@ -211,7 +211,7 @@ small {
|
||||||
<input type="text" id="datepickerRadiusFrom" size="20" style="">
|
<input type="text" id="datepickerRadiusFrom" size="20" style="">
|
||||||
<input type="text" id="datepickerRadiusTo" size="20" style="">
|
<input type="text" id="datepickerRadiusTo" size="20" style="">
|
||||||
</strong>
|
</strong>
|
||||||
<button type="button" class="btn btn-default leftSepa" onclick="queryAndAddMarkers()">Query</button>
|
<button id="geo_info_qry_btn" type="button" class="btn btn-default leftSepa" style="padding-left: 12px;" onclick="queryAndAddMarkers()">Query</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="panelbody" class="panel-body" style="height: 100%;">
|
<div id="panelbody" class="panel-body" style="height: 100%;">
|
||||||
<div id="radiusMap" style="width:100%; height: 51vh; position: relative; z-index: 1;"></div>
|
<div id="radiusMap" style="width:100%; height: 51vh; position: relative; z-index: 1;"></div>
|
||||||
|
|
Loading…
Reference in New Issue