Skip to content

Commit dc5ab04

Browse files
authored
Merge pull request #2 from HenilMistry/v2.0
V2.0
2 parents 32b362d + ecd38b6 commit dc5ab04

File tree

15 files changed

+566
-326
lines changed

15 files changed

+566
-326
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Hi Lab team,
2+
Need the below mentioned connections for Provide ACL summary for all security ACLs
3+
4+
Reserved in labtracker
5+
=================
6+
DUT(s) Yes
7+
Ixia Ports Yes
8+
9+
DUTS
10+
=====
11+
bim260 - dm1-rack119-tb42
12+
13+
Ixia Ports to be used
14+
=================================
15+
dm1-rack107-ixia1 --- slot 3/port 4
16+
dm1-rack107-ixia1 --- slot 3/port 6
17+
dm1-rack107-ixia1 --- slot 3/port 7
18+
dm1-rack107-ixia1 --- slot 3/port 8
19+
20+
DUTs to be moved
21+
===============
22+
1. Move bim260 to rack106-tb44 (1RU)
23+
(If the above location is already used, please rack it wherever the below connections can be made)
24+
25+
Older connections to be removed
26+
=================================
27+
bim260 --- Remove all existing connections, if any
28+
dm1-rack107-ixia1 --- Remove all existing connections, if any
29+
dm1-rack107-ixia1 --- Remove all existing connections, if any
30+
dm1-rack107-ixia1 --- Remove all existing connections, if any
31+
dm1-rack107-ixia1 --- Remove all existing connections, if any
32+
33+
IXIA-DUT CONNECTIONS
34+
=====================
35+
1G
36+
====
37+
dm1-rack107-ixia1 Port 3/4 (1G) -------------------- bim260 Et1 (1G)
38+
dm1-rack107-ixia1 Port 3/6 (1G) -------------------- bim260 Et2 (1G)
39+
dm1-rack107-ixia1 Port 3/7 (1G) -------------------- bim260 Et3 (1G)
40+
dm1-rack107-ixia1 Port 3/8 (1G) -------------------- bim260 Et4 (1G)

Asset/ReleaseNotes/v1-2.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
LabRequestor 1.2
2+
========================================
3+
4+
: Points addressed by DEV. :
5+
----------------------------------------
6+
- Closable and Cancellable Node Configuration Dialog Box
7+
- Alerts when necessary
8+
- Add Modern Alerts
9+
- When node tool is selected and clicked on Generate Script button
10+
- When there are no nodes, Connection tool is selected and clicked on Generate Script button
11+
12+
: Points addressed by Users :
13+
----------------------------------------
14+
- New Connection Configuration Dialog Box

Asset/Scripts/GuiHelpers/ConnectionHelper.js

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
class ConnectionHelper {
2-
constructor(nodeA, nodeB, context) {
3-
this.a = nodeA;
4-
this.b = nodeB;
2+
constructor(nodeA, nodeB, context, portsList) {
53
this.c = context;
64
this.strokeColor = "Black";
7-
this.DutPorts = [];
8-
this.IxiaPort;
5+
this.connectionProperties = new Connection(nodeA, nodeB, portsList);
96
}
107

118
draw() {
129
this.c.beginPath();
1310
this.c.setLineDash([]);
1411
this.c.strokeStyle = this.strokeColor;
1512
this.c.lineWidth = 5;
16-
this.c.moveTo(this.a.x,this.a.y);
17-
this.c.lineTo(this.b.x,this.b.y);
13+
this.c.moveTo(this.connectionProperties.nodeA.x,this.connectionProperties.nodeA.y);
14+
this.c.lineTo(this.connectionProperties.nodeB.x,this.connectionProperties.nodeB.y);
1815
this.c.stroke();
1916
this.c.closePath();
2017
}
@@ -28,12 +25,9 @@ class ConnectionHelper {
2825
// example : lyd592-Et24/1---------100G---------------dm1-rack107-ixia1 - Port 5/5
2926
let finalString = "";
3027
Connections.forEach((connection) => {
31-
if(connection.IxiaPort != null) { // DUT - TO - DUT
32-
if(connection.a.NodeProperties instanceof Dut) {
33-
finalString += connection.a.NodeProperties.alias+"-"+connection.DutPorts[0].identifier+"----------"+connection.DutPorts[0].speed+"----------"+connection.b.NodeProperties.location+"-"+connection.IxiaPort.identifier+"\n";
34-
} else {
35-
finalString += connection.b.NodeProperties.alias+"-"+connection.DutPorts[0].identifier+"----------"+connection.DutPorts[0].speed+"----------"+connection.a.NodeProperties.location+"-"+connection.IxiaPort.identifier+"\n";
36-
}
28+
if(connection.connectionProperties.nodeA.NodeProperties instanceof Ixia || connection.connectionProperties.nodeB.NodeProperties instanceof Ixia) {
29+
// either one of a node is ixia ...
30+
finalString += connection.connectionProperties.getConnections();
3731
}
3832
});
3933
return finalString;
@@ -45,8 +39,8 @@ class ConnectionHelper {
4539
// example : smd420-Et33/1-------------400G------------Et3/1/1-cmp338
4640
let finalString = "";
4741
Connections.forEach((connection) => {
48-
if(connection.IxiaPort == null) { // DUT - TO - DUT
49-
finalString += connection.a.NodeProperties.alias+"-"+connection.DutPorts[0].identifier+"----------"+connection.DutPorts[0].speed+"----------"+connection.DutPorts[1].identifier+"-"+connection.b.NodeProperties.alias+"\n";
42+
if(connection.connectionProperties.nodeA.NodeProperties instanceof Dut && connection.connectionProperties.nodeB.NodeProperties instanceof Dut) {
43+
finalString += connection.connectionProperties.getConnections();
5044
}
5145
});
5246
return finalString;

Asset/Scripts/GuiHelpers/NodeHelper.js

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,12 @@ class Node {
4545
// example : gla358 - DO NOT MOVE
4646
if (this.NodeProperties instanceof Dut) {
4747
if (this.NodeProperties.movement == Dut.NO_MOVETO) {
48-
return this.NodeProperties.alias + " - " + this.NodeProperties.movement;
48+
return this.NodeProperties.alias + " - " + this.NodeProperties.movement+"\n";
4949
} else {
50-
return this.NodeProperties.alias + " - MOVE TO " + this.NodeProperties.movement;
50+
return this.NodeProperties.alias + " - MOVE TO " + this.NodeProperties.movement+"\n";
5151
}
5252
} else {
5353
return "";
5454
}
5555
}
56-
57-
getIxiaPorts() {
58-
// example : dm1-rack107-ixia1 - Port 5/5 (100G)
59-
if (this.NodeProperties instanceof Ixia) {
60-
let finalString = "";
61-
// for(let port in this.NodeProperties.ports) {
62-
63-
// }
64-
this.NodeProperties.ports.forEach((port) => {
65-
finalString += this.NodeProperties.location + " - " + port.identifier + " (" + port.speed + ")\n";
66-
});
67-
return finalString;
68-
} else {
69-
return "";
70-
}
71-
}
7256
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const alertModal = new bootstrap.Modal('#alertModal');
2+
const alertModalLbl = document.getElementById('alertModalLbl');
3+
const alertModalBody = document.getElementById('alertModalBody');
4+
5+
const defaultAlertLbl = "Alert!";
6+
const defaultAlertBody = "There is some alert!";
7+
8+
function openAlertModal() {
9+
openAlertModal(defaultAlertLbl, defaultAlertBody);
10+
}
11+
12+
function openAlertModal(newLbl, newBody) {
13+
changeAlertModalLbl(newLbl);
14+
changeAlertModalBody(newBody);
15+
alertModal.show();
16+
}
17+
18+
function closeAlertModal() {
19+
alertModal.hide();
20+
}
21+
22+
function changeAlertModalLbl(newLbl) {
23+
alertModalLbl.innerText = newLbl;
24+
}
25+
26+
function changeAlertModalBody(newBody) {
27+
alertModalBody.innerText = newBody;
28+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
const confirmationModal = new bootstrap.Modal('#confirmationModal');
2+
const confirmationModalLbl = document.getElementById('confirmationModalLbl');
3+
const confirmationModalBody = document.getElementById('confirmationModalBody');
4+
5+
const defaultConfirmationLbl = "Are you sure ?";
6+
const defaultConfirmationBody = "Are you sure you want to proceed with the changes ?";
7+
8+
function openConfirmationModal() {
9+
openConfirmationModal(defaultConfirmationLbl, defaultConfirmationBody);
10+
}
11+
12+
function openConfirmationModal(newLbl, newBody) {
13+
changeConfirmationModalLbl(newLbl);
14+
changeConfirmationModalBody(newBody);
15+
confirmationModal.show();
16+
17+
return new Promise((resolve) => {
18+
const confirmPositiveBtn = document.getElementById('confirmPositiveBtn');
19+
const confirmNegativeBtn = document.getElementById('confirmNegativeBtn');
20+
21+
confirmPositiveBtn.onclick = () => {
22+
// Just for debugging ...
23+
console.log("Clicked on Yes");
24+
closeConfirmationModal();
25+
resolve(true);
26+
};
27+
28+
confirmNegativeBtn.onclick = () => {
29+
// Just for debugging ...
30+
console.log("Clicked on No");
31+
closeConfirmationModal();
32+
resolve(false);
33+
};
34+
});
35+
}
36+
37+
function closeConfirmationModal() {
38+
confirmationModal.hide();
39+
}
40+
41+
function changeConfirmationModalLbl(newLbl) {
42+
confirmationModalLbl.innerText = newLbl;
43+
}
44+
45+
function changeConfirmationModalBody(newBody) {
46+
confirmationModalBody.innerText = newBody;
47+
}

Asset/Scripts/ToolHelper/nodeToolManager.js

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,37 +26,30 @@ function closeNodeConfig() {
2626
function configureNode() {
2727
let newAlias = field_nodeAlias.value;
2828
let newLocation = field_location.value;
29+
let newIxiaNode, newDutNode, newNode;
30+
let isTypeIxia = false;
2931

3032
// Check if type is ixia and no ports are configured ?...
3133
if(select_nodeType.value == "ixia") {
32-
if(select_nodePorts.options.length == 0) {
33-
alert("Configure at least one ixia port!");
34-
return;
35-
}
36-
// collect the data and store ixia node...
37-
let newPorts = ports; // defined in main.js ...
38-
let newIxiaNode = new Ixia(newAlias, newLocation, newPorts);
34+
newIxiaNode = new Ixia(newAlias, newLocation);
3935
NodeIxia.push(newIxiaNode);
40-
ports = [];
41-
42-
let newNode = new Node(newAlias, lastX, lastY, 20, "Red", c);
43-
newNode.NodeProperties = newIxiaNode;
44-
Nodes.push(newNode);
45-
36+
isTypeIxia = true;
4637
} else { // collect the data and store DUT Node...
47-
let newDutNode;
4838
if(chk_enableMoveTo.checked) {
4939
newDutNode = new Dut(newAlias, newLocation, field_moveTo.value);
5040
} else {
5141
newDutNode = new Dut(newAlias, newLocation, Dut.NO_MOVETO);
5242
}
5343
NodeDut.push(newDutNode);
54-
ports = [];
44+
}
5545

56-
let newNode = new Node(newAlias, lastX, lastY, 20, "Red", c);
46+
newNode = new Node(newAlias, lastX, lastY, 20, "Red", c);
47+
if (isTypeIxia) {
48+
newNode.NodeProperties = newIxiaNode;
49+
} else {
5750
newNode.NodeProperties = newDutNode;
58-
Nodes.push(newNode);
5951
}
52+
Nodes.push(newNode);
6053
closeNodeConfig();
6154
}
6255

Asset/Scripts/ToolHelper/portConfigManager.js

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)