diff --git a/assets/pages/jquery.drawConnections.js b/assets/pages/jquery.drawConnections.js index 2256740..18174cf 100755 --- a/assets/pages/jquery.drawConnections.js +++ b/assets/pages/jquery.drawConnections.js @@ -38,7 +38,7 @@ function drawConnection(elementArray){ context.strokeStyle = 'LightSkyBlue'; context.lineWidth = 3; context.beginPath(); - console.log('Debug (elementArray): '+JSON.stringify(elementArray)); + //console.log('Debug (elementArray): '+JSON.stringify(elementArray)); $.each(elementArray, function(index, element){ var elemA = element[0]; @@ -236,19 +236,15 @@ function crawlPath(selectedPort){ } while($(selectedPort).length) { - console.log('here1'); portArray.push(selectedPort); // Crawl connection peer var connectedPortIDString = $(selectedPort).data('connectedGlobalId'); var connectedPortIDArray = JSON.parse(atob(connectedPortIDString)); - console.log('Debug (connectedPortIDString): '+atob(connectedPortIDString)); - if(connectedPortIDArray.length) { var peerPortFound = false; $.each(connectedPortIDArray, function(index, connectedPortID){ - console.log('Debug (connectedPortID): '+connectedPortID); var connectedPort = $('#'+connectedPortID); if($(connectedPort).length) { @@ -277,14 +273,10 @@ function crawlPath(selectedPort){ if(connectedPartitionPeerID != 'none') { trunkArray.push([connectedPartition, connectedPartitionPeerID]); } - //selectedPort = false; - //return false; } } else { connectionArray.push([selectedPort, connectedPortID]); - //selectedPort = false; - //return false; } }); if(peerPortFound == false) { @@ -304,6 +296,30 @@ function crawlPath(selectedPort){ }; } +function crawlPathDiagram(){ + var pathElementArray = {}; + var connectorElementArray = $('#containerFullPath').find('.port'); + $.each(connectorElementArray, function(index, element){ + console.log('here1'); + if($(element).data('connectionPairId') !== undefined) { + console.log('here2'); + var connectionPairID = $(element).data('connectionPairId'); + if(pathElementArray[connectionPairID] === undefined) { + console.log('here3'); + pathElementArray[connectionPairID] = []; + } + pathElementArray[connectionPairID].push($(element)); + } + }); + return pathElementArray; +} + +function drawPathDiagram(){ + var pathElementArray = crawlPathDiagram(); + console.log(JSON.stringify(pathElementArray)); + drawConnection(pathElementArray); +} + function makePortsHoverable(){ resizeCanvas(); diff --git a/assets/pages/jquery.explore.js b/assets/pages/jquery.explore.js index 938dbc5..3c6ba53 100755 --- a/assets/pages/jquery.explore.js +++ b/assets/pages/jquery.explore.js @@ -261,6 +261,7 @@ function retrievePortPath(objID, objFace, partitionDepth, portID){ } else { $('#containerFullPath').html(responseJSON.success); makeCableConnectorsClickable(); + drawPathDiagram(); } }); } diff --git a/includes/App.class.php b/includes/App.class.php index a3d31d5..f9ecbde 100755 --- a/includes/App.class.php +++ b/includes/App.class.php @@ -1990,17 +1990,9 @@ var $qls; } $connectorTypeID = $object['data']['connectorType']; - - if($connectorTypeID != 0) { - $connectorTypeName = $this->portTypeValueArray[$connectorTypeID]['name']; - $connectorHTML = '
'; - } else { - $connectorTypeName = 'Unk'; - $connectorHTML = ''; - } - - // Wrap in