Skip to content

Commit

Permalink
Changed the formatting of the open ports on the dashboard.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeb16157 committed Dec 6, 2020
1 parent a71f59f commit 393a44b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
18 changes: 14 additions & 4 deletions js/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ function animatePacket(packets, allEntities) {


let iterations = map[sliderVal];
console.log(sliderVal);
console.log(iterations);
//console.log(sliderVal);
//console.log(iterations);
for (let packet of packets) {
var dxCompute = (packet.x - packet.nextEntity.x) / iterations;
packet.dx = dxCompute;
Expand Down Expand Up @@ -102,8 +102,18 @@ function allEmpty(entities) {

// dashboard functions

function dashboardOpenPorts(ddd){
document.getElementById("openPorts").textContent = "DDD Open Ports: " + ddd.openPorts;
function dashboardOpenPorts(ddd) {
let printPorts = ddd.openPorts;
console.log(printPorts);
var printOut = new String("");
for (let i = 0; i < printPorts.length; i++) {
if (i == printPorts.length - 1) {
printOut = printOut + " and " + printPorts[i];
} else {
printOut = printOut + printPorts[i] + ", "
}
}
document.getElementById("openPorts").textContent = "DDD Open Ports: " + printOut;
}
function dashboardDroppedPackets(garbage){
document.getElementById("droppedPackets").textContent = "Dropped Packets: " + garbage.droppedPackets;
Expand Down
1 change: 1 addition & 0 deletions js/ddd.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class DDD extends Entity {
this.sendPackets = this.sendPackets.bind(this);
this.passFilter = this.passFilter.bind(this);
this.openNewPorts = this.openNewPorts.bind(this);

}

static generatePort(maxOpenPorts) {
Expand Down

0 comments on commit 393a44b

Please sign in to comment.