зеркало из https://github.com/mozilla/MozDef.git
Clean up redundant code
Remove create incident text Block IP looks like btn
This commit is contained in:
Родитель
ec85d397e5
Коммит
2e528c133d
|
@ -22,6 +22,7 @@ Yash Mehrotra yashmehrotra95@gmail.com
|
||||||
|
|
||||||
.blockip {
|
.blockip {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
#date {
|
#date {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
@ -45,8 +46,7 @@ Yash Mehrotra yashmehrotra95@gmail.com
|
||||||
<h5>Severity: {{attackDetails.severity}}</h5>
|
<h5>Severity: {{attackDetails.severity}}</h5>
|
||||||
<h5>IP: {{attackDetails.details.sourceipv4address}}</h5>
|
<h5>IP: {{attackDetails.details.sourceipv4address}}</h5>
|
||||||
<h5>Seen: <span id="date">{{displayDate attackDetails.timestamp}}</span></h5>
|
<h5>Seen: <span id="date">{{displayDate attackDetails.timestamp}}</span></h5>
|
||||||
<h5 class="blockip" data-ipaddress={{attackDetails.details.sourceipv4address}}>BLOCK IP</h5>
|
<h5 class="blockip btn" data-ipaddress={{attackDetails.details.sourceipv4address}}>BLOCK IP</h5><br/>
|
||||||
<h5>Create Incident</h5>
|
|
||||||
{{#if attackDetails.read}}
|
{{#if attackDetails.read}}
|
||||||
<input type="checkbox" class="cbox" name="attack-isread" checked/> Mark as Read
|
<input type="checkbox" class="cbox" name="attack-isread" checked/> Mark as Read
|
||||||
{{else}}
|
{{else}}
|
||||||
|
|
|
@ -182,12 +182,10 @@ if (Meteor.isClient) {
|
||||||
cssRenderer.render(scene, camera);
|
cssRenderer.render(scene, camera);
|
||||||
}
|
}
|
||||||
|
|
||||||
function parsedb() {
|
function getAttackers() {
|
||||||
Meteor.subscribe("attackers-summary-landmass", onReady = function() {
|
Meteor.subscribe("attackers-summary-landmass", onReady = function() {
|
||||||
|
|
||||||
// var filterType = Session.get('filterType');
|
|
||||||
attackers.find().forEach(function(element) {
|
attackers.find().forEach(function(element) {
|
||||||
// TODO: Take care of timestamp
|
|
||||||
element.events.forEach(function(evt) {
|
element.events.forEach(function(evt) {
|
||||||
var evtHost = evt.documentsource.details.host;
|
var evtHost = evt.documentsource.details.host;
|
||||||
var doc = evt.documentsource;
|
var doc = evt.documentsource;
|
||||||
|
@ -197,39 +195,24 @@ if (Meteor.isClient) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (filterType === 'read') {
|
|
||||||
// if (!doc.read || doc.read == undefined) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (filterType === 'unread') {
|
|
||||||
// if (doc.read) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
if (world[evtHost]) {
|
if (world[evtHost]) {
|
||||||
world[evtHost].push(doc);
|
world[evtHost].push(doc);
|
||||||
} else {
|
} else {
|
||||||
world[evtHost] = [doc];
|
world[evtHost] = [doc];
|
||||||
// TODO: Is the below line required
|
|
||||||
world[evtHost].rank = attackedIds++;
|
world[evtHost].rank = attackedIds++;
|
||||||
// world[evtHost].host = evtHost || 'hard-coded';
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(world);
|
|
||||||
|
|
||||||
var attacks = Object.keys(world).sort(function(prev, current) {
|
var attacks = Object.keys(world).sort(function(prev, current) {
|
||||||
return world[current].length - world[prev].length;
|
return world[current].length - world[prev].length;
|
||||||
});
|
});
|
||||||
console.log('attacks', attacks);
|
|
||||||
attacks.forEach(function(host, index) {
|
attacks.forEach(function(host, index) {
|
||||||
var attackRank = world[host].rank;
|
var attackRank = world[host].rank;
|
||||||
// Create enclosing transparent sphere
|
// Create enclosing transparent sphere
|
||||||
var sphereGeometry = new THREE.SphereGeometry(70);
|
var sphereGeometry = new THREE.SphereGeometry(70);
|
||||||
var sphereMaterial = new THREE.MeshBasicMaterial({ transparent: true, opacity: 0 });
|
var sphereMaterial = new THREE.MeshBasicMaterial({ transparent: true, opacity: 0 });
|
||||||
// var sphereMaterial = new THREE.MeshBasicMaterial();
|
|
||||||
var sphere = new THREE.Mesh(sphereGeometry, sphereMaterial);
|
var sphere = new THREE.Mesh(sphereGeometry, sphereMaterial);
|
||||||
sphere.position.x = RANK_COORDINATES[attackRank].x;
|
sphere.position.x = RANK_COORDINATES[attackRank].x;
|
||||||
sphere.position.z = RANK_COORDINATES[attackRank].z;
|
sphere.position.z = RANK_COORDINATES[attackRank].z;
|
||||||
|
@ -241,12 +224,11 @@ if (Meteor.isClient) {
|
||||||
world[host].forEach(function(attack) {
|
world[host].forEach(function(attack) {
|
||||||
if (typeof attack === "object") {
|
if (typeof attack === "object") {
|
||||||
attackType = attack.category;
|
attackType = attack.category;
|
||||||
console.log("attacks - ", attackType);
|
|
||||||
sphere.attacks.push(attack);
|
sphere.attacks.push(attack);
|
||||||
if (Object.keys(ATTACK_ANIMATIONS).indexOf(attackType) > -1) {
|
if (Object.keys(ATTACK_ANIMATIONS).indexOf(attackType) > -1) {
|
||||||
mappedAttack = ATTACK_ANIMATIONS[attackType];
|
mappedAttack = ATTACK_ANIMATIONS[attackType];
|
||||||
|
// Display animation
|
||||||
restartEngine(mappedAttack, RANK_COORDINATES[index].x, RANK_COORDINATES[index].z);
|
restartEngine(mappedAttack, RANK_COORDINATES[index].x, RANK_COORDINATES[index].z);
|
||||||
console.log(RANK_COORDINATES[index].x, RANK_COORDINATES[index].z);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -265,8 +247,8 @@ if (Meteor.isClient) {
|
||||||
Template.vr.rendered = function () {
|
Template.vr.rendered = function () {
|
||||||
init();
|
init();
|
||||||
render();
|
render();
|
||||||
parsedb();
|
getAttackers();
|
||||||
};//end template.attackers.rendered
|
};
|
||||||
|
|
||||||
Template.vr.helpers({
|
Template.vr.helpers({
|
||||||
hostAttacks: function() {
|
hostAttacks: function() {
|
||||||
|
@ -298,10 +280,11 @@ if (Meteor.isClient) {
|
||||||
return index + 1
|
return index + 1
|
||||||
},
|
},
|
||||||
displayDate: function(date) {
|
displayDate: function(date) {
|
||||||
MM = {Jan:"January", Feb:"February", Mar:"March", Apr:"April", May:"May", Jun:"June",
|
var MM = {Jan:"January", Feb:"February", Mar:"March", Apr:"April",
|
||||||
Jul:"July", Aug:"August", Sep:"September", Oct:"October", Nov:"November", Dec:"December"};
|
May:"May", Jun:"June", Jul:"July", Aug:"August", Sep:"September",
|
||||||
|
Oct:"October", Nov:"November", Dec:"December"};
|
||||||
|
|
||||||
parsed_date = String(new Date(date)).replace(
|
var parsed_date = String(new Date(date)).replace(
|
||||||
/\w{3} (\w{3}) (\d{2}) (\d{4}) (\d{2}):(\d{2}):[^(]+\(([A-Z]{3})\)/,
|
/\w{3} (\w{3}) (\d{2}) (\d{4}) (\d{2}):(\d{2}):[^(]+\(([A-Z]{3})\)/,
|
||||||
function($0,$1,$2,$3,$4,$5,$6){
|
function($0,$1,$2,$3,$4,$5,$6){
|
||||||
return MM[$1]+" "+$2+", "+$3+" - "+$4%12+":"+$5+(+$4>12?"PM":"AM")+" "+$6
|
return MM[$1]+" "+$2+", "+$3+" - "+$4%12+":"+$5+(+$4>12?"PM":"AM")+" "+$6
|
||||||
|
@ -324,11 +307,9 @@ if (Meteor.isClient) {
|
||||||
var raycaster = new THREE.Raycaster(camera.position, mouseVector.sub( camera.position).normalize() );
|
var raycaster = new THREE.Raycaster(camera.position, mouseVector.sub( camera.position).normalize() );
|
||||||
var intersects = raycaster.intersectObjects(sceneObjects, true);
|
var intersects = raycaster.intersectObjects(sceneObjects, true);
|
||||||
var sideNav = $('#attack-sidenav');
|
var sideNav = $('#attack-sidenav');
|
||||||
console.log(intersects);
|
|
||||||
|
|
||||||
if (intersects.length) {
|
if (intersects.length) {
|
||||||
intersects.forEach(function(intersect) {
|
intersects.forEach(function(intersect) {
|
||||||
// console.log(intersect);
|
|
||||||
var attackRank = intersect.object.rank;
|
var attackRank = intersect.object.rank;
|
||||||
var attackRegion = intersect.object.host;
|
var attackRegion = intersect.object.host;
|
||||||
var attacks = intersect.object.attacks;
|
var attacks = intersect.object.attacks;
|
||||||
|
@ -442,7 +423,7 @@ if (Meteor.isClient) {
|
||||||
WIDTH = window.innerWidth;
|
WIDTH = window.innerWidth;
|
||||||
HEIGHT = window.innerHeight;
|
HEIGHT = window.innerHeight;
|
||||||
SPEED = 0.01;
|
SPEED = 0.01;
|
||||||
};//end template.attackers.destroyed
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче