all-intern.js 43 KB

12
  1. function updateChart(e){var t,a,o,i,r=e.chart;if(delete e.chart,e.filter=filter.getFilter(),e.detail)if(e.detailChartType=detailChartType,e.filter.start=currentStartDate,e.filter.end=currentEndDate,"typeDate"==detailChartType)e.pie=!0,t={text:"Types of Incidents"},a={text:"per day"},i={text:"Incidents per day"};else{if("countryDate"!=detailChartType)return void console.log("error: unknown type: "+detailChartType);e.pie=!0,t={text:"Source countries"},a={text:"per day"},i={text:"Incidents per day"}}(t||a)&&r.setTitle(t,a),o&&r.xAxis[0].setTitle(o),i&&r.yAxis[0].setTitle(i),r.showLoading("loading.."),socket.emit("getStatistics",e,function(t){if(console.log("getStatistics returned: ",t),!t||0==t.length)return void r.showLoading("No data for that selection!");var a=createChartSeries(t,e);setChartData(r,a)})}function setChartData(e,t){for(var a=e.series.length,o=0;o<t.length;o++)e.addSeries(t[o],!1);e.redraw();for(var i=0;a>i;i++)e.series[0].remove(!1);e.hideLoading(),e.redraw(),$(".highcharts-legend-item > span").each(function(e,t){t.onclick=null})}function createChartSeries(e,t){function a(e){return e%8==0?"#0000FF":e%8==1?"#FF0000":e%8==2?"#00FF00":e%8==3?"#FFFF00":e%8==4?"#FF00FF":e%8==5?"#00FFFF":e%8==6?"#FF7F00":e%8==7?"#808080":void 0}console.log("createChartSeries",e,t);var o,i=[];t.pie&&(o={type:"pie",name:"Total incidents",center:[160,55],size:100,showInLegend:!1,data:[]});for(var r=0;r<e.length;r++){var n=e[r];if(i.push({name:n.name,data:n.data,color:a(r)}),t.pie){for(var s=0,l=0;l<n.data.length;l++)s+=n.data[l][1];o.data.push({name:n.name,y:s,color:a(r)})}}return t.pie&&i.push(o),i}function createDetailChart(){detailChart=$("#chartdivdetail").highcharts({chart:{type:"area"},xAxis:{type:"datetime"},legend:{useHTML:!0},plotOptions:{area:{stacking:"normal",lineColor:"#666666",lineWidth:1,marker:{lineWidth:1,lineColor:"#666666"}}},tooltip:{}}).highcharts(),updateChart({chart:detailChart,detail:!0})}function createMasterChart(){masterChart=$("#chartdivmaster").highcharts({title:{text:null},reflow:!1,borderWidth:0,chart:{type:"area",events:{selection:function(e){var t=e.xAxis[0],a=t.min,o=t.max;currentStartDate=a,currentEndDate=o,updateChart({chart:detailChart,detail:!0});var i=this.xAxis[0];return i.removePlotBand("mask"),i.addPlotBand({id:"mask",from:a,to:o,color:"rgba(255, 144, 0, 0.6)"}),!1}},zoomType:"x"},xAxis:{type:"datetime",plotBands:[{id:"mask",from:defaultStartDate,to:defaultEndDate,color:"rgba(255, 144, 0, 0.6)"}]},yAxis:{gridLineWidth:0,title:{text:null},labels:{enabled:!1}},legend:{enabled:!1},credits:{enabled:!1},tooltip:{formatter:function(){return!1}},plotOptions:{series:{fillColor:{linearGradient:[0,0,0,70],stops:[[0,"#4572A7"],[1,"rgba(0,0,0,0)"]]},lineWidth:1,marker:{enabled:!1},shadow:!1,states:{hover:{lineWidth:1}},enableMouseTracking:!1}}},function(e){createDetailChart(e)}).highcharts(),updateChart({chart:masterChart,detail:!1})}function createCharts(){if(!createdCharts){createdCharts=!0;var e=$("#stats");return e.append("<div id='chartdivdetail' class='chart'></div>"),e.append("<div id='chartdivmaster' class='chart' style='height: 100px;' onHelpActive='help-border'></div><span class='help-block'>Click and drag the mouse across the above timeline to choose a timespan.</span>"),createMasterChart(),!0}return!1}function loadStats(e,t){e&&(detailChartType=e);var a=createCharts();a||(updateChart({chart:detailChart,detail:!0}),t&&updateChart({chart:masterChart,detail:!1}))}function filterUpdateStats(){loadStats(null,!0)}function showLog(e){console.log("showLog "+e),socket.emit("getLog",e,function(t){console.log("showLog content: "+t),$("#showLogLabel").text("Log for id "+e),$("#showLogBody").html(t),$("#showLog").modal()})}function requestAttackUpdate(){requestAttacks()}function requestAttacks(){if(!$("#getIncidents").hasClass("disabled")){$(".bar").css("width",0),refreshMap(),$("#getIncidents").text("Loading Data"),$("#getIncidents").addClass("disabled"),enableRequestControl();var e=filter.getFilter();e.start=$("#jrange").jrange("getStartDate"),e.end=$("#jrange").jrange("getEndDate"),console.log("filter: ",e),socket.emit("requestAttacks",e)}}function enableRequestControl(){$("#stopButton").removeClass("disabled"),$("#playButton").removeClass("disabled"),$("#slowerButton").removeClass("disabled"),$("#fasterButton").removeClass("disabled"),$("#showAllButton").removeClass("disabled")}function disableRequestControl(){$("#stopButton").addClass("disabled"),$("#playButton").addClass("disabled"),$("#slowerButton").addClass("disabled"),$("#fasterButton").addClass("disabled"),$("#showAllButton").addClass("disabled")}function addPanelSelectButton(e){setTimeout(function(){var t=$(e).datepicker("widget").find(".ui-datepicker-buttonpane"),a=$('<button class="ui-datepicker-current ui-state-default ui-priority-primary ui-corner-all" type="button">Select</button>');a.unbind("click").bind("click",function(){setTimeout(function(){$("#hideTable").html("")},300);var t=$("#ui-datepicker-div .ui-datepicker-month :selected").val(),a=$("#ui-datepicker-div .ui-datepicker-year :selected").val();$(e).datepicker("option","defaultDate",new Date(a,t)),$(e).datepicker("setDate",new Date(a,t)),currentRequestID="inputDateNoDay"}),0==t.has("#customClearButton").length&&a.appendTo(t)},1)}function showHelpPopovers(){titleHelp(),mainMenuHelp(),dbHelp(),statsHelp()}function hideHelpPopovers(){help=!1,$("[onHelpActive]").each(function(e,t){$(t).popover("destroy")})}function titleHelp(){$("#header").popover({title:"Project: TraCINg",content:'This project deals with cyber attacks (mostly malware). The attacks origin is marked on one of the maps or on the table below or will be as soon as an attack occurs unless you want to view stored data and switch to database view. It might take some time for an attack to occur, so be patient. We can only show attacks aimed at our sensors (which are not marked on the map). If you need more information, go to our "About" or browse around the "Help". Have fun exploring!',trigger:trigger,placement:"bottom"})}function mainMenuHelp(){$("#toggleView").popover({html:!0,title:"Toogle View",content:"Click one of these buttons to toggle between live and dabase view. <br><strong>Live View</strong>: Shows you attacks currently detected by our sensors, updating with every attack. <br><strong>Database View</strong>: Enables you to request past attacks which will be shown on the maps and globe and in the table.",trigger:trigger,placement:"bottom"}),$("#2DViewEntry").popover({title:"2D Map View",content:"Click here for a 2D view of the attacks. This map shows the sources of attacks detected by our sensors. For more detailed information, hover over countries and markers. A countries color represents the number of attacks originating from there; the darker the red, the more attacks originate from this country. You can also zoom in and out using the mouse wheel and move around the map by moving the mouse while holding down the left mouse button (if zoomed in). Keyboard controls are described in the bottom left corner.",trigger:trigger,placement:"bottom"}),$("#StreetViewEntry").popover({title:"Streetmap View",content:"Click here for a streetmap view of the attacks (also in 2D). This map shows the sources of attacks detected by our sensors. For more detailed information, click the markers. Coloring and country hover is not supported here. You can also zoom in and out using the mouse wheel and move around the map by moving the mouse while holding down the left mouse button. Keyboard controls are described in the bottom left corner.",trigger:trigger,placement:"bottom"}),$("#3DViewEntry").popover({title:"3D Globe View",content:'Click here for a 3D view of the attacks. This globe shows the sources of attacks detected by our sensors. For more detailed information, hover over countries and markers. A countries color represents the number of attacks originating from there; the darker the red, the more attacks originate from this country. Toggle a heatmap by pressing "t" on your keyboard. You can also zoom in and out using the mouse wheel and move the globe by moving the mouse while holding down the left mouse button. Keyboard controls are described in the bottom left corner.',trigger:trigger,placement:"bottom"}),$("#tableViewEntry").popover({title:"Table View",content:'Click here for a table representation of the attack data received from the sensors. This table always shows exactly the attacks which are currently represented on the maps/globe (no less, no more). This behavior is independent from live or database view. Hover over the entries in "Attack Types" to learn more about them.',trigger:trigger,placement:"bottom"}),$("#statsEntry").popover({title:"Statistic View",content:"Click here for a statistic on our assembled attack data. The top left pie chart gives you an overview of the relative distribution of the number of attacks given attack types or countries. The major statistic shows the number of attacks by type or country over time (addatively).",trigger:trigger,placement:"bottom"});var e;"hover"==trigger&&(e='To view helpful information hover over the elements (marked with a green frame). Click "Help" again to deactivate the information display.'),"click"==trigger&&(e='To view helpful information click the elements (marked with a green frame). Click "Help" again to deactivate the information display.'),"focus"==trigger&&(e='To view helpful information focus the elements (marked with a green frame). Click "Help" again to deactivate the information display.'),$("#helpEntry").popover({title:"Help",content:e,trigger:trigger,placement:"bottom"}),$("#aboutViewEntry").popover({title:"About View",content:"Click here for information about the project, about what you see on the page and which software is being used.",trigger:trigger,placement:"bottom"}),$("#advMarkerInfo").popover({title:"Display Advanced Marker Information",content:"Activate this button to get more information on marker hover. Deactivate it to show less information.",trigger:trigger,placement:"bottom"}),$("#resetMap").popover({title:"Reset Map Button",content:"Click here to reset the map, i.e. delete all markers plus marker and region information and change the region coloring to default. The table will also be cleared in the progress.",trigger:trigger,placement:"bottom"})}function dbHelp(){$("#jrange").popover({title:"Datepicker",content:'Click here to open a datepicker and choose a date for a request. You may select a single day or a range of days by clicking either one day or a start and end day. You can pick a range longer than a month. The "Done" button will save your selection and close the datepicker. If you have not selected anything the selection will not change. If you want to choose the current month you can click on "Select Month". Click on the "Get Incidents" button to start the request or use "Filter" at the bottom.',trigger:trigger,placement:function(){return $(window).width()<980?"bottom":"right"}}),$("#getIncidents").popover({html:"true",title:"Request Incidents Button (resets map automatically)",content:"Click here to load the entries from the Database which correspond to the request specified in the above menu. If no request is specified todays attack data will be requested automatically. The attacks will load one after the other starting with the first of the day so you may interact with the loading progress using the control buttons below. <br> <strong>Warning: This will reset the map, i.e. delete all markers plus marker and region information and change the region coloring to default!</strong>",trigger:trigger,placement:function(){return $(window).width()<980?"bottom":"right"}}),$("#loadingProgressBar").popover({title:"Request Progress Bar",content:"This bar will show you the progress of your database request, i.e. the percentage of the data which is already shown.",trigger:trigger,placement:function(){return $(window).width()<980?"bottom":"right"}}),$("#stopButton").popover({title:"Stop Request",content:"Click here to cancel the request so you will be able to make a new request. It will not reset the map automatically. Note: Switching back to live view will always stop the loading progress!",trigger:trigger,placement:function(){return $(window).width()<980?"top":"right"}}),$("#playButton").popover({title:"Pause or Play Data",content:"Click here to toggle between pause and play which enables you to pause the loading, explore the maps/globe, table etc. and start the request from where you paused it again whenever you like. This will not work however, if you switch back to the live view because switching to live view will stop the loading progress!",trigger:trigger,placement:function(){return $(window).width()<980?"top":"right"}}),$("#fasterSlowerButton").popover({title:"Speed Control",content:"These buttons enable you to control the loading speed in which database requests show. The left button will slow down the speed with which attacks will be shown, the right button will make it faster.",trigger:trigger,placement:function(){return $(window).width()<980?"top":"right"}}),$("#showAllButton").popover({title:"Show All Data At Once",content:"Click here to immediately load all the data.",trigger:trigger,placement:function(){return $(window).width()<980?"top":"right"}}),$("#selectStatsCountries2").popover({html:!0,title:"Filter Request",content:"Click here to open a filter menu to do a customized request. <br> <strong>Warning: This will reset the map, i.e. delete all markers plus marker and region information and change the region coloring to default!</strong>",trigger:trigger,placement:"top"})}function statsHelp(){$("#getStatstypeDate").popover({title:"Show Timeline of attacks by Type",content:"Click here to show a statistic of the number of attacks over time by attack type.",trigger:trigger,placement:function(){return $(window).width()<980?"top":"right"}}),$("#getStatscountryDate").popover({title:"Show Timeline of attacks by Country",content:"Click here to show a statistic of the number of attacks over time by country (from which the attack originated).",trigger:trigger,placement:function(){return $(window).width()<980?"top":"right"}}),$("#chartdivmaster").popover({title:"Timeline",content:"This timeline shows a miniature graph of all available database data. Click and drag the mouse here to show a more detailed excerpt of the data. The time range you choose will be marked in orange and the statistics graph will update to show you the data that has been collected within the orange timespan.",trigger:trigger,placement:"top"}),$("#selectStatsCountries1").popover({title:"Filter Graph",content:"Click here to open a filter menu to customize the statistics graph.",trigger:trigger,placement:function(){return $(window).width()<980?"top":"right"}})}function setLeftContent(e){$("#leftWin").children("div").each(function(t,a){a.id==e?$(a).show():$(a).hide()})}function updateMainWidth(){$("[LeftWinAdd], [LeftWinRemove]").each(function(e,t){var a=$(t).attr("LeftWinAdd"),o=$(t).attr("LeftWinRemove");$("#leftWin").is(":visible")?(toggleCenterDivs(),$(t).removeClass(o),$(t).addClass(a)):($(t).removeClass(a),$(t).addClass(o),toggleCenterDivs())})}function updateWins(e,t,a,o){setLeftContent(e),t?$("#leftWin").show():$("#leftWin").hide(),a?($("#liveView").removeClass("disabled"),$("#dbView").removeClass("disabled")):($("#liveView").addClass("disabled"),$("#dbView").addClass("disabled")),o?filter.load(o):filter.unload(),updateMainWidth()}function updateHelpElements(){$("[onHelpActive]").each(function(e,t){var a=$(t).attr("onHelpActive");help?$(t).addClass(a):$(t).removeClass(a)})}function updateMenu(e){if("map"==e)world.showMap(),world.jvmHasMarker()?$("#tableWaitingAlert").remove():showInfoNoData(),help&&$("#helpEntry").addClass("active"),$("#map").resize(),updateWins("dbWin",!live,!0,!live&&requestAttackUpdate),$("#advMarkerInfo").removeClass("disabled"),$("#resetMap").removeClass("disabled");else if("streetmap"==e)world.showStreetmap(),world.stMapHasMarker()?$("#tableWaitingAlert").remove():showInfoNoData(),help&&$("#helpEntry").addClass("active"),updateWins("dbWin",!live,!0,!live&&requestAttackUpdate),$("#advMarkerInfo").removeClass("disabled"),$("#resetMap").removeClass("disabled");else if("globe"==e)world.showGlobe(),world.globeHasMarker()?$("#tableWaitingAlert").remove():showInfoNoData(),help&&$("#helpEntry").addClass("active"),updateWins("dbWin",!live,!0,!live&&requestAttackUpdate),$("#advMarkerInfo").removeClass("disabled"),$("#resetMap").removeClass("disabled");else if("table"==e)world.leaveMap(),help&&$("#helpEntry").addClass("active"),$("#table .dataTables_empty").length>0?showInfoNoData():$("#tableWaitingAlert").remove(),updateWins("dbWin",!live,!0,!live&&requestAttackUpdate),$("#advMarkerInfo").addClass("disabled"),$("#resetMap").removeClass("disabled"),world.resize();else if("stats"==e){world.leaveMap(),$("#tableWaitingAlert").remove(),help&&$("#helpEntry").addClass("active"),updateWins("statsWin",!0,!1,filterUpdateStats);var t=createCharts();t||filterUpdateStats(),$("#advMarkerInfo").addClass("disabled"),$("#resetMap").addClass("disabled")}else console.log("menue: unknown tab: "+e)}function showInfoNoData(){!$("#tableWaitingAlert").length>0&&showalert("tableWaitingAlert","Waiting for data...","Once attacks occur or are requested in the dabase view they will show up below. To display attacks on both maps and the globe you need to load them separately (i.e. click their menu entry once). Otherwise they will stay empty even if attacks occur until you load them.","info",!1)}function refreshMap(){$("#stats").is(":visible")||showInfoNoData(),world.reset(),world.resetTable()}function jVectorMap2GeoIP(e){return"_"!=e[0]?e:"_0"==e?"TR":"_1"==e?"RS":"_2"==e?"EH":"_3"==e?"SO":void console.log("Can not map cc '"+e+"' to GeoIP!")}function GeoIP2jVectorMap(e){return"TR"==e?["_0","TR"]:"RS"==e?["_1","RS"]:"EH"==e?["_2"]:"SO"==e?["_3","SO"]:-1!=$.inArray(e,filter.allCountriesJVectorMap)?[e]:[]}function goToLocationHash(){if(!window.location.hash)return void(window.location.hash="/map");$("#mainContent > div").hide(),$("#errorOutput").show(),$("#menutabs > li").removeClass("active");var e=window.location.hash&&window.location.hash.split("/")[1]||"map",t=$("#"+e);t.show(),updateMenu(e);var a=$("#tab_"+e).parent();a&&a.addClass("active")}function toggleCenterDivs(){$("#leftWin").is(":visible")?$(".center").css("margin-left",""):$(".center").css("margin-left",function(){return $(window).width()/20})}function showalert(e,t,a,o,i){var r='<div id="'+e+'" class="alert alert-'+o+'"><button type="button" class="close" data-dismiss="alert" id="errorOutput">&times;</button><h4>'+t+"</h4>"+a+"</div>";$("#errorOutput").append(r),i&&setTimeout(function(){$("#"+e).remove()},1e4)}function typeid2str(e){return fields&&fields.type.hasOwnProperty(e)?fields.type[e]:fields&&fields.type[0]||"Unknown"}function typeid2descr(e){return fields&&fields.type_description.hasOwnProperty(e)?fields.type_description[e]:fields&&fields.type_description[0]||""}var countryName={A1:"Anonymous Proxy",A2:"Satellite Provider",O1:"Other Country",AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AP:"Asia/Pacific Region",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Aland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Bartelemey",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Saint Eustatius and Saba Bonaire",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"The Democratic Republic of the Congo",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"Cote d'Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cape Verde",CW:"Curacao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",EU:"Europe",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands (Malvinas)",FM:"Federated States of Micronesia",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and McDonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Islamic Republic of Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"Democratic People's Republic of Korea",KR:"Republic of Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Lao People's Democratic Republic",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libyan Arab Jamahiriya",MA:"Morocco",MC:"Monaco",MD:"Republic of Moldova",ME:"Montenegro",MF:"Saint Martin",MG:"Madagascar",MH:"Marshall Islands",MK:"Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PS:"Palestinian Territory",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russian Federation",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syrian Arab Republic",SZ:"Swaziland",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"United Republic of Tanzania",UA:"Ukraine",UG:"Uganda",UM:"United States Minor Outlying Islands",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Holy See (Vatican City State)",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"British Virgin Islands",VI:"U.S. Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},map=function(e,t,a){function o(e){var t=c[e];s[t]>0&&(l--,s[t]=s[t]-1,d.removeMarkers([e]),i())}function i(){d.series.regions[0].setValues(s)}var r=0,n=500,s={},l=0,c=[n],d=new jvm.Map({container:e,map:t,backgroundColor:a,markers:[],series:{regions:[{attribute:"fill",min:-1,max:-2,scale:["#FFFFFF","#FF0000"],normalizeFunction:function(e){return-1==e?0:-2==e?1:0==l?0:Math.pow(e/l,1/3)}}]},onRegionLabelShow:function(e,t,a){var o=s[a]||0;t.html(1==o?t.html()+" ("+o+" attack of "+l+" total)":t.html()+" ("+o+" attacks of "+l+" total)")},onMarkerLabelShow:function(e,t){if(advInfo)t.html(t.text());else{var a=t.text().split(";");t.html(a[0])}}});this.reset=function(){d.removeAllMarkers(),d.series.regions[0].clear(),r=0,l=0,s={}},this.zoom=function(e){d.setScale(d.scale*e,d.width/2,d.height/2)},this.move=function(e,t){var a=d.scale;d.transX+=e/a,d.transY+=t/a,d.applyTransform()},this.addMarker=function(e,t,a,u){void 0!=d.markers[r]&&o(r),l++,s[e]=(0|s[e])+1,c[r]=e,d.addMarker(r,{latLng:t.reverse(),style:{r:5,fill:a},name:u},[]),i();var h=r;return r=(r+1)%n,h},this.removeMarker=o,this.getPosition=function(e,t){return d.latLngToPoint(e,t)},this.hasMarker=function(){return l>0?!0:!1}},streetmap=function(e){function t(e){void 0!=i[e]&&(a.removeLayer(i[e]),i[e]=void 0)}var a=new L.Map(e),o=500,i=[o],r=0,n=100,s=0;a.setView([35,0],3,{animate:!1}),a.keyboard.disable(),L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png",{attribution:"&copy; <a href='http://osm.org/copyright'>OpenStreetMap</a> contributors",noWrap:!0,minZoom:1}).addTo(a),a.setMaxBounds(new L.LatLngBounds([-190,-290],[190,290])),this.addMarker=function(e,l,c){s++;var d=500,u=new L.LatLng(e[0],e[1]),h=L.circle(u,d,{color:l,fillColor:l,fillOpacity:.5});h.addTo(a);var p=new L.Popup({autoPan:!1}).setContent(c);h.bindPopup(p);var f;h.on("mouseover",function(){var e=c.split(";");this._popup.setContent(advInfo?c:e[0]),this.openPopup();var t=this;p._container.addEventListener("mouseleave",function(){f=setTimeout(function(){t.closePopup()},n)}),p._container.addEventListener("mouseenter",function(){clearTimeout(f)})}),t(r),i[r]=h;var m=r;return r=(r+1)%o,m},this.removeMarker=t,this.reset=function(){for(var e=0;e<i.length;e++)t(e);r=0,s=0},this.getPosition=function(e,t){return a.latLngToContainerPoint(new L.LatLng(e,t))},this.zoom=function(e){a.zoomIn(e)},this.move=function(e,t){a.panBy([-e,-t])},this.hasMarker=function(){return s>0?!0:!1}};$(function(){$("body").on("shown","#StreetViewEntry",function(){stmap.invalidateSize(!1)})});var detailChartType="typeDate",defaultEndDate=Date.now(),defaultStartDate=defaultEndDate-12096e5,currentStartDate=defaultStartDate,currentEndDate=defaultEndDate,detailChart,masterChart,createdCharts=!1,Controller=function(){function e(e){o={},l=!0,i={IN:0,OUT:1,UP:2,DOWN:3,LEFT:4,RIGHT:5},document.addEventListener("keydown",a,!1),document.addEventListener("keyup",t,!1),e.args=i}function t(e){var t=e.keyCode;17==t&&(o.STRG=!1),18==t&&(o.ALT=!1),91==t&&(o.SUPER=!1),225==t&&(o.ALT_GR=!1)}function a(e){var t=e.keyCode;17==t&&(o.STRG=!0),18==t&&(o.ALT=!0),91==t&&(o.SUPER=!0),225==t&&(o.ALT_GR=!0);var a=!1;for(var c in o)a|=o[c];if(!a&&l)switch(t){case 38:void 0!=r&&(e.preventDefault(),r(i.IN));break;case 40:void 0!=r&&(e.preventDefault(),r(i.OUT));break;case 87:void 0!=n&&(e.preventDefault(),n(i.UP));break;case 65:void 0!=n&&(e.preventDefault(),n(i.LEFT));break;case 83:void 0!=n&&(e.preventDefault(),n(i.DOWN));break;case 68:void 0!=n&&(e.preventDefault(),n(i.RIGHT));break;case 84:void 0!=s&&(e.preventDefault(),s())}}var o,i,r,n,s,l;this.registerCallbacks=function(e){r=e.zoom,n=e.move,s=e.toggle},this.unregisterCallbacks=function(){r=void 0,n=void 0,s=void 0},this.toggleEnabled=function(){return l=!l},e(this)},world=new function(){function e(e,a){var o="";o+=a?"Live data":"Database data";var i=new String(e.src.ll?e.src.ll[0]:"")+new String(e.src.ll?e.src.ll[1]:""),r=b[i];null!=r&&(o+=1==r?": "+r+" attack":": "+r+" attacks"),o+="<br />Attack source (marked here): ",""!=e.src.city&&void 0!=e.src.city&&(o+=e.src.city+", "),o+=e.src.country,o+=";<br />Destination: ",""!=e.dst.city&&void 0!=e.dst.city&&(o+=e.dst.city+", "),o+=""!=e.dst.country&&void 0!=e.dst.country?e.dst.country:"Unknown",o+=";<br />Date: "+t(e);var n=typeid2str(e.type);return o+=";<br />Type: "+n,o+=e.authorized?";<br />Authorized Sensor":";<br />Unauthorized Sensor"}function t(e){var t=e.date&&new Date(e.date)||new Date,a=t.getDate();t.getDate()<10&&(a="0"+t.getDate());var o=t.getMonth()+1;t.getMonth()+1<10&&(o="0"+(t.getMonth()+1));var i=t.getHours();t.getHours()<10&&(i="0"+t.getHours());var r=t.getMinutes();t.getMinutes()<10&&(r="0"+t.getMinutes());var n=a+"."+o+"."+t.getFullYear()+" "+i+":"+r;return n}function a(e){void 0==e.src.city&&(e.src.city=""),void 0==e.dst.country&&(e.dst.country=""),void 0==e.dst.city&&(e.dst.city=""),0==e.src.port&&(e.src.port=""),0==e.dst.port&&(e.dst.port=""),dateFormat=t(e);var a="";e.hasLog&&(a="<a href='#showLog' data-toggle='modal' onclick='javascript:showLog("+e.id+");'>show log</a>");var o=typeid2str(e.type),i=typeid2descr(e.type),r="";if(e.md5sum&&""!=e.md5sum){var n="https://www.virustotal.com/en/search/?query="+e.md5sum,s="Md5sum of malware hash: "+e.md5sum+"<br \\> Get more information about this malware from virustotal: <a href='"+n+"' target='_blank'>Click here</a> (by doing so you will open a different website)!",l='"./extern/bootstrap/images/glyphicons-halflings.png"';r="<a class='btn' rel='popover' data-html='true' data-content=\""+s+"\" data-animation='false' data-placement='left'><i class='icon-info-sign' style='background-image: url("+l+");'></i></a>"}var c="";c=e.authorized?"<p class='text-success'>Yes</p>":"<p class='text-error'>No</p>";var d=[e.sensortype,e.sensorname,'<span title="'+i+'">'+o+"</span>",dateFormat,e.src.country,e.src.city,e.src.port,e.dst.country,e.dst.city,e.dst.port,c,r,a];return d}function o(e){$("#attackTable").dataTable().fnAddData(e),i()}function i(){console.log("makePopovers"),$("a[rel=popover]").popover({})}function r(e,t,a,o,i){var r={"background-color":a,position:"absolute","border-radius":"100px",height:"40px",width:"40px","margin-top":"-20px","margin-left":"-20px",left:e+"px",top:t+"px"};$(o).append('<div class="markerAnimation" id='+i+"></div>"),$("#"+i+".markerAnimation").css(r),$("#"+i+".markerAnimation").fadeOut(1e3,$("#"+i+".markerAnimation").remove)}function n(){var e=($("#attackTable").dataTable(),$(window).height());e-=$("#table .dataTables_scrollBody").offset().top,e-=$("#table .dataTables_scroll + div").height(),console.log("attackTableHeight: "+e),$("#table .dataTables_scrollBody").css({"max-height":e})}function s(){n(),$("#attackTable").dataTable().fnDraw()}var l,c,d,u,h={MAP:0,STREETMAP:1,GLOBE:2,NULL:3},p=300,f=null,m=0,g=null,v=".",b={},w=new Controller;this.toggleEnabled=w.toggleEnabled,this.leaveMap=function(){l=h.NULL,w.unregisterCallbacks()},this.showMap=function(){void 0===d&&(d=new map($("#map"),"world_mill_en","navy")),l=h.MAP,w.registerCallbacks({zoom:function(e){e==w.args.IN&&d.zoom(1.6),e==w.args.OUT&&d.zoom(.625)},move:function(e){var t=120;e==w.args.LEFT&&d.move(t,0),e==w.args.RIGHT&&d.move(-t,0),e==w.args.UP&&d.move(0,t),e==w.args.DOWN&&d.move(0,-t)},toggle:void 0})},this.showStreetmap=function(){void 0===u&&(u=new streetmap("streetmap")),l=h.STREETMAP,w.registerCallbacks({zoom:function(e){e==w.args.IN&&u.zoom(1),e==w.args.OUT&&u.zoom(-1)},move:function(e){var t=120;e==w.args.LEFT&&u.move(t,0),e==w.args.RIGHT&&u.move(-t,0),e==w.args.UP&&u.move(0,t),e==w.args.DOWN&&u.move(0,-t)},toggle:void 0})},this.showGlobe=function(){if(void 0===c){var e=document.getElementById("globe"),t=function(e){if(!advInfo){var t=e.split(";");e=t[0]}return e},a=function(e,t,a){var o=countryName[e];return o+" ("+t+" attacks of "+a+" total)"};c=new GLOBE.main(e,"extern/globe/images/",{modifyMarkerLabel:t,setCountryLabel:a})}else c.resize();l=h.GLOBE,w.registerCallbacks({zoom:function(e){e==w.args.IN&&c.zoom(100),e==w.args.OUT&&c.zoom(-100)},move:function(e){e==w.args.LEFT&&c.rotate(-1e-6,0),e==w.args.RIGHT&&c.rotate(1e-6,0),e==w.args.UP&&c.rotate(0,5e-7),e==w.args.DOWN&&c.rotate(0,-5e-7)},toggle:function(){c.toggleView()}})},this.delayedMarking=function y(e,t){g=e;var i=0;if(m>0&&(i=m/e.length*100),$(".bar").css("width",function(){return i+"%"}),$("#requestInfo").text("Current loading state: "+m+"/"+e.length+" attacks."),$("#requestSpeedInfo").text("Current speed: "+Math.round(100*(1e3/p))/100+" attacks/second"+v),m<e.length&&0!=p)f=setTimeout(function(){world.markIncident(e[m],t),o(a(e[m])),m++,y(e,t)},p);else{if(0==p){for(var r=[],n=m;n<e.length;n++)world.markIncident(e[n],t,!0),r.push(a(e[n]));o(r)
  2. }world.finishLoading(e.length>0?!0:!1),e.length>0&&$("#requestInfo").text("Successfully loaded "+e.length+" attacks.")}},this.finishLoading=function(e){clearTimeout(f),f=null,g=null,m=0,p=500,e?$(".bar").css("width","100%"):$(".bar").css("width",0),$("#playButton i").hasClass("icon-play")&&($("#playButton i").addClass("icon-pause"),$("#playButton i").removeClass("icon-play")),$("#getIncidents").text("Get Incidents"),$("#getIncidents").removeClass("disabled"),disableRequestControl(),$("#requestInfo").text(""),$("#requestSpeedInfo").text("")},this.changeTimer=function(e){0>=p+e&&(e=-100),0>p-e&&(e=100),0>=p+e&&(e=0),p+=e,0>p&&(p=0),$("#requestSpeedInfo").text("Current speed: "+Math.round(100*(1e3/p))/100+" attacks/second"+v)},this.resetTimer=function(){p=0,$("#requestSpeedInfo").text("")},this.stopTimer=function(){clearTimeout(f),v=" (currently paused).",$("#requestSpeedInfo").text("Current speed: "+Math.round(100*(1e3/p))/100+" attacks/second"+v)},this.restartTimer=function(){this.delayedMarking(g,live),v=".",$("#requestSpeedInfo").text("Current speed: "+Math.round(100*(1e3/p))/100+" attacks/second"+v)},this.markIncident=function(t,a,o){$("#tableWaitingAlert").remove(),llHash=new String(t.src.ll?t.src.ll[1]:"")+new String(t.src.ll?t.src.ll[0]:""),void 0!=b[llHash]?b[llHash]++:b[llHash]=1;var i,n,s,p="red",f=e(t,a);if(void 0!=d&&(i=d.addMarker(t.src.cc,t.src.ll,p,f),l==h.MAP&&!o)){var m=d.getPosition(t.src.ll[0],t.src.ll[1]);r(m.x,m.y,p,"#map",i)}if(void 0!=u&&(n=u.addMarker(t.src.ll,p,f),l==h.STREETMAP&&!o)){var m=u.getPosition(t.src.ll[0],t.src.ll[1]);r(m.x,m.y,p,"#streetmap",n)}if(void 0!=c&&void 0!=c.addMarker&&(s=c.addMarker(t.src.cc,t.src.ll[0],t.src.ll[1],f)),a){var g=3e5;setTimeout(function(){llHash=new String(t.src.ll[1])+new String(t.src.ll[0]),b[llHash]>0?b[llHash]--:b[llHash]=void 0,void 0!=i&&void 0!=d&&d.removeMarker(i),void 0!=n&&void 0!=u&&u.removeMarker(n),void 0!=s&&void 0!=c&&c.removeMarker(s)},g)}},this.jvmHasMarker=function(){return void 0!=d?d.hasMarker():!1},this.stMapHasMarker=function(){return void 0!=u?u.hasMarker():!1},this.globeHasMarker=function(){return void 0!=c&&void 0!=c.hasMarker?c.hasMarker():!1},this.reset=function(){d&&d.reset(),u&&u.reset(),c&&c.reset(),b={},$(".bar").css("width",0),$("#requestInfo").text("")},this.resetTable=function(){$("#attackTable").dataTable().fnClearTable()},this.generateTableEntry=a,this.makeTableEntry=o,this.makePopovers=i,this.resize=s};$(function(){$("#attackTable").dataTable({aaSorting:[[3,"desc"]],sScrollY:"100%",fnDrawCallback:function(){world.makePopovers()}}),setTimeout(function(){world.resize()},10)}),$(window).resize($.throttle(250,function(){world.resize()})),$(function(){$("#stopButton").click(function(){$(this).hasClass("disabled")||world.finishLoading(!1)}),$("#playButton").click(function(){$(this).hasClass("disabled")||($("#playButton i").hasClass("icon-play")?(world.restartTimer(),$("#playButton i").addClass("icon-pause"),$("#playButton i").removeClass("icon-play")):$("#playButton i").hasClass("icon-pause")&&(world.stopTimer(),$("#playButton i").addClass("icon-play"),$("#playButton i").removeClass("icon-pause")))}),$("#slowerButton").click(function(){$(this).hasClass("disabled")||world.changeTimer(500)}),$("#fasterButton").click(function(){$(this).hasClass("disabled")||world.changeTimer(-500)}),$("#showAllButton").click(function(){$(this).hasClass("disabled")||world.resetTimer()})}),$(function(){$("#jrange").jrange()});var help=!1,live=!0,trigger="hover";$(function(){$("#helpEntry a").click(function(e){e.preventDefault(),help?(help=!1,$("#helpEntry").removeClass("active"),hideHelpPopovers()):(help=!0,$("#helpEntry").addClass("active"),showHelpPopovers(),$("#helpEntry").popover("show")),updateHelpElements()}),$("#liveView").click(function(){$(this).hasClass("disabled")||(live=!0,$(leftWin).hide(),setLeftContent("dbWin"),filter.unload(),updateMainWidth(),help&&showHelpPopovers(),world.finishLoading(!1),$("#liveView").addClass("active"),$("#dbView").removeClass("active"),world.resize())}),$("#dbView").click(function(){$(this).hasClass("disabled")||(live=!1,$(leftWin).show(),setLeftContent("dbWin"),filter.load(requestAttackUpdate),updateMainWidth(),help&&showHelpPopovers(),$("#dbView").addClass("active"),$("#liveView").removeClass("active"),world.resize())}),$("#advMarkerInfo").click(function(){$(this).hasClass("disabled")||(1==advInfo?(advInfo=!1,$("#advMarkerInfo").removeClass("active")):(advInfo=!0,$("#advMarkerInfo").addClass("active")))}),$("#resetMap").click(function(){$(this).hasClass("disabled")||refreshMap()})}),$(function(){$("#aboutView").keydown(function(e){var t=50;40==e.keyCode&&(e.preventDefault(),$(".modal-body").scrollTop($(".modal-body").scrollTop()+t)),38==e.keyCode&&(e.preventDefault(),$(".modal-body").scrollTop($(".modal-body").scrollTop()-t))}),$("#aboutView").on("show",function(){world.toggleEnabled()}),$("#aboutView").on("hide",function(){world.toggleEnabled()})});var filter=new function(){this.initialized=!1,this.disableOnRegionSelected=!1,this.allCountriesJVectorMap=[],this.allCountriesGeoIP=Object.keys(countryName),this.countries=null,this.countriesMap=null,this.types=null,this.sensors=null,this.updateCallback=null,this.countrySelectionMap=null,this.countrySelection,this.authorizedCheckbox,this.attackTypeSelection,this.sensorTypeSelection,this.initialize=function(){filter.authorizedCheckbox=$("#filterAuthorized"),filter.initCountrySelection(),$("#selectStatsCountries1").click(filter.show),$("#selectStatsCountries2").click(filter.show),$("#resetFilter").click(filter.reset),$("#selectCountriesFinish").click(filter.finish),filter.initialized=!0},this.initCountrySelection=function(){filter.countrySelectionMap=new jvm.Map({container:$("#selectCountriesMap"),map:"world_mill_en",backgroundColor:"navy",regionsSelectable:!0,onRegionLabelShow:function(e,t){t.html(t.html())},onRegionSelected:filter.clickJVectorMap}),$("#selectCountriesView").on("shown",function(){$("#selectCountriesView").resize()}),html="";for(var e in countryName)html+="<option value='"+e+"'>"+countryName[e]+"</option>";$("#selectCountriesSelection").html(html),filter.countrySelection=$("#selectCountriesSelection").multiselect({selectedText:"# of # countries selected",noneSelectedText:"Pick countries manually by clicking on the map or choose them here",position:{my:"left bottom",at:"left top"},minWidth:550,header:!1,click:filter.clickGeoIP});for(var e in filter.countrySelectionMap.regions)filter.allCountriesJVectorMap.push(e);$("#selectCountriesAll").click(filter.selectAllCountries),$("#selectCountriesClear").click(filter.clearCountries)},this.initAttackTypes=function(){this.attackTypeSelection=$("#filterAttackType").multiselect({selectedText:"# of # attack types selected",noneSelectedText:"Filter attack types",position:{my:"left bottom",at:"left top"}})},this.initSensorTypes=function(){this.sensorTypeSelection=$("#filterSensorType").multiselect({selectedText:"# of # sensor types selected",noneSelectedText:"Filter sensor types",position:{my:"left bottom",at:"left top"}})},this.show=function(){filter.countrySelection.val(filter.countries),filter.countrySelection.multiselect("refresh"),filter.disableOnRegionSelected=!0,filter.countrySelectionMap.setSelectedRegions(filter.countriesMap),filter.disableOnRegionSelected=!1,filter.attackTypeSelection.val(filter.types),filter.attackTypeSelection.multiselect("refresh"),filter.sensorTypeSelection.val(filter.sensors),filter.sensorTypeSelection.multiselect("refresh"),$("#selectCountriesView").modal("show")},this.finish=function(){filter.countries=filter.countrySelection.val(),filter.countriesMap=filter.countrySelectionMap.getSelectedRegions(),filter.types=filter.attackTypeSelection.val(),filter.sensors=filter.sensorTypeSelection.val(),$("#selectCountriesView").modal("hide"),filter.updateCallback?filter.updateCallback():console.log("filter.updateCallback is null")},this.selectAllCountries=function(){filter.disableOnRegionSelected=!0,filter.countrySelectionMap.setSelectedRegions(filter.allCountriesJVectorMap),filter.countrySelection.multiselect("checkAll"),filter.disableOnRegionSelected=!1},this.clearCountries=function(){filter.disableOnRegionSelected=!0,filter.countrySelectionMap.clearSelectedRegions(),filter.countrySelection.multiselect("uncheckAll"),filter.disableOnRegionSelected=!1},this.reset=function(){filter.clearCountries(),filter.attackTypeSelection.multiselect("uncheckAll"),filter.sensorTypeSelection.multiselect("uncheckAll"),filter.countrySelection.multiselect("uncheckAll"),filter.authorizedCheckbox.prop("checked",!1)},this.clickJVectorMap=function(e,t,a){if(!filter.disableOnRegionSelected){var o=jVectorMap2GeoIP(t);filter.updateJVectorMap(o,a),filter.updateGeoIP(o,a)}},this.clickGeoIP=function(e,t){filter.updateJVectorMap(t.value,t.checked)},this.updateJVectorMap=function(e,t){var a=GeoIP2jVectorMap(e);if(a&&a.length>0){for(var o={},i=0;i<a.length;i++){var r=a[i];o[r]=t}filter.countrySelectionMap.setSelectedRegions(o)}},this.updateGeoIP=function(e,t){var a=filter.countrySelection.val();if(a||(a=[]),t)a.push(e);else{var o=$.inArray(e,a);-1!=o&&a.splice(o,1)}filter.countrySelection.val(a),filter.countrySelection.multiselect("refresh")},this.load=function(e){return filter.initialized?void(filter.updateCallback=e?e:null):void setTimeout(function(){filter.load(e)},50)},this.unload=function(){return filter.initialized?void(filter.updateCallback=null):void setTimeout(filter.unload,50)},this.getFilter=function(){var e={};return filter.authorizedCheckbox&&filter.authorizedCheckbox.prop("checked")&&(e.authorized=!0),filter.types&&filter.types.length>0&&(e.types=filter.types),filter.sensors&&filter.sensors.length>0&&(e.sensors=filter.sensors),filter.countries&&0!=filter.countries.length&&filter.countries.length!=filter.allCountriesGeoIP.length&&(e.countries=filter.countries),e}};$(function(){filter.initialize()});var socket=io.connect("/");$(function(){$("[rel=tooltip]").tooltip(),advInfo=!1,$("#map").css("height",function(){return Math.min($("#map").width()/2+50,.8*$(window).height())}),$(leftWin).hide(),toggleCenterDivs(),goToLocationHash(),$(window).on("hashchange",goToLocationHash),disableRequestControl(),$("#inputDateDay").datepicker("setDate","null"),$("#inputDateNoDay").datepicker("setDate","null"),$("div.jvectormap-zoomin").each(function(){$(this).rel+="tooltip",$(this).attr("title","Zoom in")}),$("div.jvectormap-zoomout").each(function(){$(this).rel+="tooltip",$(this).attr("title","Zoom out")})}),$(window).resize(function(){toggleCenterDivs(),$("#map").css("height",function(){return Math.min($("#map").width()/2+50,.8*$(window).height())})}),socket.on("error",function(e){var t="Errno: "+e.errno+"<br>Code: "+e.code;showalert("dbAlert","Database Error!",t,"error",!0),$("#getIncidents").text("Get Incidents"),$("#getIncidents").removeClass("disabled"),disableRequestControl()}),socket.on("incidents",function(e){console.log(e),world.delayedMarking(e,live),0==e.length&&showalert("noDataAlert","Request Error!","No data found for this request.","error",!0)}),socket.on("markIncident",function(e){if(live){world.markIncident(e,live);var t=world.generateTableEntry(e);world.makeTableEntry(t)}});var fields;socket.on("setFields",function(e){fields=e;var t="";for(var a in e.type)t+="<option value='"+a+"'>"+e.type[a]+"</option>";$("#filterAttackType").html(t),filter.initAttackTypes()}),socket.on("setSensors",function(e){for(var t="",a=0;a<e.length;a++){var o=e[a];t+="<option value='"+o+"'>"+o+"</option>"}$("#filterSensorType").html(t),filter.initSensorTypes()});