mirror of https://github.com/MISP/misp-dashboard
Added rotation speed selector
parent
220e0985d5
commit
2b6e696548
|
@ -124,6 +124,20 @@ $(document).ready(function () {
|
||||||
console.log("No event source_log");
|
console.log("No event source_log");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$( "#rotation_wait_time_selector" ).change(function() {
|
||||||
|
var sel = parseInt($( this ).val());
|
||||||
|
if(isNaN(sel)) {
|
||||||
|
rotation_wait_time = 0;
|
||||||
|
} else {
|
||||||
|
rotation_wait_time = sel;
|
||||||
|
}
|
||||||
|
var old = ROTATIONWAITTIME;
|
||||||
|
ROTATIONWAITTIME = 1000*rotation_wait_time; //seconds
|
||||||
|
if(old == 0) {
|
||||||
|
mapEventManager._timeoutRotate = setTimeout(function(){ mapEventManager.rotateMap(); }, ROTATIONWAITTIME);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
const MAXNUMCOORD = 100;
|
const MAXNUMCOORD = 100;
|
||||||
const PINGWAITTIME = 1000*1; //1s
|
const PINGWAITTIME = 1000*1; //1s
|
||||||
const MAXIMGROTATION = max_img_rotation;
|
const MAXIMGROTATION = max_img_rotation;
|
||||||
const ROTATIONWAITTIME = 1000*rotation_wait_time; //seconds
|
|
||||||
|
|
||||||
const OSMURL='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
const OSMURL='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
||||||
const OSMATTRIB='Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors';
|
const OSMATTRIB='Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors';
|
||||||
|
var ROTATIONWAITTIME = 1000*rotation_wait_time; //seconds
|
||||||
|
|
||||||
var myOpenStreetMap = L.map('feedDivMap1').setView([0, 0], 1);
|
var myOpenStreetMap = L.map('feedDivMap1').setView([0, 0], 1);
|
||||||
var osm = new L.TileLayer(OSMURL, {minZoom: 0, maxZoom: 17}).addTo(myOpenStreetMap);
|
var osm = new L.TileLayer(OSMURL, {minZoom: 0, maxZoom: 17}).addTo(myOpenStreetMap);
|
||||||
|
@ -87,7 +87,10 @@ class MapEventManager {
|
||||||
mapEvent.marker.bindPopup(mapEvent.textMarker).openPopup();
|
mapEvent.marker.bindPopup(mapEvent.textMarker).openPopup();
|
||||||
|
|
||||||
$("#textMap1").fadeOut(400, function(){ $(this).text(mapEvent.text); }).fadeIn(400);
|
$("#textMap1").fadeOut(400, function(){ $(this).text(mapEvent.text); }).fadeIn(400);
|
||||||
this._timeoutRotate = setTimeout(function(){ mapEventManager.rotateMap(); }, ROTATIONWAITTIME);
|
if(ROTATIONWAITTIME != 0) {
|
||||||
|
console.log(ROTATIONWAITTIME);
|
||||||
|
this._timeoutRotate = setTimeout(function(){ mapEventManager.rotateMap(); }, ROTATIONWAITTIME);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ping() {
|
ping() {
|
||||||
|
|
|
@ -78,14 +78,17 @@ small {
|
||||||
<div class="col-lg-5">
|
<div class="col-lg-5">
|
||||||
|
|
||||||
<div class="panel panel-default" style="margin-top: 15px; height: 68vh;">
|
<div class="panel panel-default" style="margin-top: 15px; height: 68vh;">
|
||||||
<!--<div class="panel-heading">
|
<div class="panel-heading bg-info" style="font-weight: bold;">
|
||||||
<i class="fa fa-bar-chart-o fa-fw"></i> Statistics
|
<b id="textMap1"> No map </b>
|
||||||
</div>-->
|
<div style="float: right;">
|
||||||
<!--<div id="panelbody" class="panel-body" style="height: 37vh; width:100%;">
|
<i id="txtMapNum">1</i><i>/{{ max_img_rotation }}</i>
|
||||||
<div id="feedDiv1A" style="width:50%; height: calc(100% - 30px); position: relative; float: left;"></div>
|
<select id="rotation_wait_time_selector" style="margin-top: -7px;">
|
||||||
<div id="feedDiv1B" style="width:50%; height: calc(100% - 30px); position: relative; float: left;"></div>-->
|
<option value="∞" selected>No rotation</option>
|
||||||
<div id="textMap1" class="panel-heading bg-info" style="font-weight: bold;"> No map
|
<option value="{{ rotation_wait_time }}" selected>{{ rotation_wait_time }}sec</option>
|
||||||
<i class="fa fa-bar-chart-o fa-fw"></i>
|
<option value="{{ rotation_wait_time * 2 }}">{{ rotation_wait_time * 2 }}sec</option>
|
||||||
|
<option value="{{ rotation_wait_time * 5}}">{{ rotation_wait_time * 5 }}sec</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="panelbody" class="panel-body" style="height: 93%; padding: 5px">
|
<div id="panelbody" class="panel-body" style="height: 93%; padding: 5px">
|
||||||
<div id="feedDivMap1" style="width:100%; height: 100%;">
|
<div id="feedDivMap1" style="width:100%; height: 100%;">
|
||||||
|
|
Loading…
Reference in New Issue