0.3.12
This commit is contained in:
parent
e71860e9f4
commit
1ffad1a8fe
@ -34,7 +34,9 @@ Contents
|
|||||||
**Changes introduced in 0.3.12
|
**Changes introduced in 0.3.12
|
||||||
[Fix] Corrected nested insert size as displayed in "Available Templates" box
|
[Fix] Corrected nested insert size as displayed in "Available Templates" box
|
||||||
[Fix] Template port ID add/remove field not refreshing when shown for different connectable partitions
|
[Fix] Template port ID add/remove field not refreshing when shown for different connectable partitions
|
||||||
|
[Fix] Fresh install inserted data in a way that would cause a "duplicate cabinet order" error on backup restore
|
||||||
[Enhance] When configuring template port ID, show last port ID in long abreviated list
|
[Enhance] When configuring template port ID, show last port ID in long abreviated list
|
||||||
|
[Enhance] Cable path connections generated programatically instead of static images
|
||||||
|
|
||||||
**Changes introduced in 0.3.11
|
**Changes introduced in 0.3.11
|
||||||
[Enhance] Added ability to create inserts with enclosure partitions
|
[Enhance] Added ability to create inserts with enclosure partitions
|
||||||
|
|||||||
@ -60,11 +60,13 @@ function crawlCabinet(){
|
|||||||
|
|
||||||
if(connectedPortIDArray.length) {
|
if(connectedPortIDArray.length) {
|
||||||
var peerPortFound = false;
|
var peerPortFound = false;
|
||||||
|
var sourceSelectedPort = selectedPort;
|
||||||
|
var tempTrunkArray = [];
|
||||||
$.each(connectedPortIDArray, function(index, connectedPortID){
|
$.each(connectedPortIDArray, function(index, connectedPortID){
|
||||||
var connectedPort = $('#'+connectedPortID);
|
var connectedPort = $('#'+connectedPortID);
|
||||||
if($(connectedPort).length) {
|
if($(connectedPort).length) {
|
||||||
|
|
||||||
connectionArray.push([selectedPort, connectedPort]);
|
connectionArray.push([sourceSelectedPort, connectedPort]);
|
||||||
|
|
||||||
var connectedPartition = $(connectedPort).closest('.partition');
|
var connectedPartition = $(connectedPort).closest('.partition');
|
||||||
var connectedPartitionPeerID = $(connectedPartition).data('peerGlobalId');
|
var connectedPartitionPeerID = $(connectedPartition).data('peerGlobalId');
|
||||||
@ -72,7 +74,8 @@ function crawlCabinet(){
|
|||||||
if($('#'+connectedPartitionPeerID).length) {
|
if($('#'+connectedPartitionPeerID).length) {
|
||||||
|
|
||||||
var connectedPartitionPeer = $('#'+connectedPartitionPeerID);
|
var connectedPartitionPeer = $('#'+connectedPartitionPeerID);
|
||||||
trunkArray.push([connectedPartition, connectedPartitionPeer]);
|
tempTrunkArray = [connectedPartition, connectedPartitionPeer];
|
||||||
|
//trunkArray.push([connectedPartition, connectedPartitionPeer]);
|
||||||
|
|
||||||
var connectedPartitionPeerIDArray = connectedPartitionPeerID.split('-');
|
var connectedPartitionPeerIDArray = connectedPartitionPeerID.split('-');
|
||||||
var peerID = connectedPartitionPeerIDArray[2];
|
var peerID = connectedPartitionPeerIDArray[2];
|
||||||
@ -85,7 +88,8 @@ function crawlCabinet(){
|
|||||||
peerPortFound = true;
|
peerPortFound = true;
|
||||||
} else {
|
} else {
|
||||||
if(connectedPartitionPeerID != 'none') {
|
if(connectedPartitionPeerID != 'none') {
|
||||||
trunkArray.push([connectedPartition, connectedPartitionPeerID]);
|
tempTrunkArray = [connectedPartition, connectedPartitionPeerID];
|
||||||
|
//trunkArray.push([connectedPartition, connectedPartitionPeerID]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,6 +97,9 @@ function crawlCabinet(){
|
|||||||
connectionArray.push([selectedPort, connectedPortID]);
|
connectionArray.push([selectedPort, connectedPortID]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if(tempTrunkArray.length) {
|
||||||
|
trunkArray.push(tempTrunkArray);
|
||||||
|
}
|
||||||
if(peerPortFound == false) {
|
if(peerPortFound == false) {
|
||||||
selectedPort = false;
|
selectedPort = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -706,14 +706,6 @@ function postProcessCable(){
|
|||||||
|
|
||||||
$( document ).ready(function() {
|
$( document ).ready(function() {
|
||||||
|
|
||||||
$('#checkboxBreakoutCable').on('change', function(){
|
|
||||||
if($(this).is(':checked')) {
|
|
||||||
$('#objTree').jstree(true).settings.core.multiple = true;
|
|
||||||
} else {
|
|
||||||
$('#objTree').jstree(true).settings.core.multiple = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#printFullPath').on('click', function(event){
|
$('#printFullPath').on('click', function(event){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$('#containerFullPath').parent().printThis({
|
$('#containerFullPath').parent().printThis({
|
||||||
@ -1173,7 +1165,7 @@ $( document ).ready(function() {
|
|||||||
})
|
})
|
||||||
.jstree({
|
.jstree({
|
||||||
'core' : {
|
'core' : {
|
||||||
'multiple': false,
|
'multiple': true,
|
||||||
'check_callback': function(operation, node, node_parent, node_position, more){
|
'check_callback': function(operation, node, node_parent, node_position, more){
|
||||||
if(operation == 'move_node'){
|
if(operation == 'move_node'){
|
||||||
return node_parent.type === 'location';
|
return node_parent.type === 'location';
|
||||||
|
|||||||
@ -172,10 +172,27 @@ if($_SERVER['REQUEST_METHOD'] == 'POST'){
|
|||||||
$objDepth = $data['objDepth'];
|
$objDepth = $data['objDepth'];
|
||||||
$objPort = $data['objPort'];
|
$objPort = $data['objPort'];
|
||||||
if(isset($qls->App->inventoryArray[$objID][$objFace][$objDepth][$objPort])) {
|
if(isset($qls->App->inventoryArray[$objID][$objFace][$objDepth][$objPort])) {
|
||||||
|
$deleteRowArray = array();
|
||||||
$port = $qls->App->inventoryArray[$objID][$objFace][$objDepth][$objPort];
|
$port = $qls->App->inventoryArray[$objID][$objFace][$objDepth][$objPort];
|
||||||
foreach($port as $connection) {
|
foreach($port as $connection) {
|
||||||
// Clear inventory table entry
|
|
||||||
$rowID = $connection['rowID'];
|
$peerID = $connection['id'];
|
||||||
|
$peerFace = $connection['face'];
|
||||||
|
$peerDepth = $connection['depth'];
|
||||||
|
$peerPort = $connection['port'];
|
||||||
|
// Account for remote port being breakout cable
|
||||||
|
if(isset($qls->App->inventoryArray[$peerID][$peerFace][$peerDepth][$peerPort])) {
|
||||||
|
$peerPort = $qls->App->inventoryArray[$peerID][$peerFace][$peerDepth][$peerPort];
|
||||||
|
foreach($peerPort as $peerConnection) {
|
||||||
|
array_push($deleteRowArray, $peerConnection['rowID']);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
array_push($deleteRowArray, $peerConnection['rowID']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete inventory entries
|
||||||
|
foreach($deleteRowArray as $rowID) {
|
||||||
if($connection['localEndID'] or $connection['remoteEndID']) {
|
if($connection['localEndID'] or $connection['remoteEndID']) {
|
||||||
clearTableInventory($qls, $connection['localAttrPrefix'], $rowID);
|
clearTableInventory($qls, $connection['localAttrPrefix'], $rowID);
|
||||||
} else {
|
} else {
|
||||||
@ -201,6 +218,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST'){
|
|||||||
}
|
}
|
||||||
$remotePortString = implode('<br>', $remotePortArray);
|
$remotePortString = implode('<br>', $remotePortArray);
|
||||||
$actionString = 'Deleted connection: <strong>'.$localPort.'</strong> to <strong>'.$remotePortString.'</strong>';
|
$actionString = 'Deleted connection: <strong>'.$localPort.'</strong> to <strong>'.$remotePortString.'</strong>';
|
||||||
|
error_log('Debug (actionString): '.$actionString);
|
||||||
$qls->App->logAction(3, 3, $actionString);
|
$qls->App->logAction(3, 3, $actionString);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -443,6 +461,34 @@ function validate($data, &$validate, &$qls){
|
|||||||
array_push($validate->returnData['error'], $errMsg);
|
array_push($validate->returnData['error'], $errMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(count($remotePortArray) > 1) {
|
||||||
|
|
||||||
|
$breakoutCableValid = true;
|
||||||
|
$localObj = $qls->App->objectArray[$localID];
|
||||||
|
$localTemplateID = $localObj['template_id'];
|
||||||
|
$localTemplate = $qls->App->templateArray[$localTemplateID];
|
||||||
|
$localTemplateFunction = $localTemplate['templateFunction'];
|
||||||
|
if($remoteTemplateFunction != 'Endpoint') {
|
||||||
|
$localTemplateFunction = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($remotePortArray as $remotePortData) {
|
||||||
|
$remoteID = $remotePortData['remoteID'];
|
||||||
|
$remoteObj = $qls->App->objectArray[$remoteID];
|
||||||
|
$remoteTemplateID = $remoteObj['template_id'];
|
||||||
|
$remoteTemplate = $qls->App->templateArray[$remoteTemplateID];
|
||||||
|
$remoteTemplateFunction = $remoteTemplate['templateFunction'];
|
||||||
|
if($remoteTemplateFunction != 'Endpoint') {
|
||||||
|
$breakoutCableValid = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$breakoutCableValid) {
|
||||||
|
$errMsg = 'One-to-many connections must be between two endpoints.';
|
||||||
|
array_push($validate->returnData['error'], $errMsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -1638,6 +1638,7 @@ function validateImportedConnections(&$qls, &$importedConnectionArray, $portArra
|
|||||||
|
|
||||||
// Check to see if object port exists
|
// Check to see if object port exists
|
||||||
$portNameHash = $connection['portNameHash'];
|
$portNameHash = $connection['portNameHash'];
|
||||||
|
$peerPortNameHash = $connection['peerPortNameHash'];
|
||||||
if(isset($portArray[$portNameHash]) or isset($importedTrunkArray[$portNameHash])) {
|
if(isset($portArray[$portNameHash]) or isset($importedTrunkArray[$portNameHash])) {
|
||||||
if(!in_array($portNameHash, $portNameHashArray)) {
|
if(!in_array($portNameHash, $portNameHashArray)) {
|
||||||
array_push($portNameHashArray, $portNameHash);
|
array_push($portNameHashArray, $portNameHash);
|
||||||
@ -1725,9 +1726,48 @@ function validateImportedConnections(&$qls, &$importedConnectionArray, $portArra
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
$validOneToManyConnection = false;
|
||||||
|
|
||||||
|
$port = $portArray[$portNameHash];
|
||||||
|
$objID = $port['objID'];
|
||||||
|
$face = $port['face'];
|
||||||
|
$depth = $port['depth'];
|
||||||
|
$portID = $port['portID'];
|
||||||
|
$obj = $qls->App->objectArray[$objID];
|
||||||
|
$templateID = $obj['template_id'];
|
||||||
|
$template = $qls->App->templateArray[$templateID];
|
||||||
|
$templateFunction = $template['templateFunction'];
|
||||||
|
|
||||||
|
if(isset($portArray[$peerPortNameHash])) {
|
||||||
|
$peerPort = $portArray[$peerPortNameHash];
|
||||||
|
$peerObjID = $peerPort['objID'];
|
||||||
|
$peerFace = $peerPort['face'];
|
||||||
|
$peerDepth = $peerPort['depth'];
|
||||||
|
$peerPortID = $peerPort['portID'];
|
||||||
|
$peerObj = $qls->App->objectArray[$peerObjID];
|
||||||
|
$peerTemplateID = $peerObj['template_id'];
|
||||||
|
$peerTemplate = $qls->App->templateArray[$peerTemplateID];
|
||||||
|
$peerTemplateFunction = $peerTemplate['templateFunction'];
|
||||||
|
|
||||||
|
if($templateFunction == 'Endpoint' and $peerTemplateFunction == 'Endpoint') {
|
||||||
|
$connection['objID'] = $objID;
|
||||||
|
$connection['face'] = $face;
|
||||||
|
$connection['depth'] = $depth;
|
||||||
|
$connection['portID'] = $portID;
|
||||||
|
$connection['peerObjID'] = $peerObjID;
|
||||||
|
$connection['peerFace'] = $peerFace;
|
||||||
|
$connection['peerDepth'] = $peerDepth;
|
||||||
|
$connection['peerPortID'] = $peerPortID;
|
||||||
|
$validOneToManyConnection = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$validOneToManyConnection) {
|
||||||
$errMsg = 'PortA on line '.$connection['line'].' of file "'.$connection['fileName'].'" is a duplicate.';
|
$errMsg = 'PortA on line '.$connection['line'].' of file "'.$connection['fileName'].'" is a duplicate.';
|
||||||
array_push($validate->returnData['error'], $errMsg);
|
array_push($validate->returnData['error'], $errMsg);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if($connection['code39']) {
|
if($connection['code39']) {
|
||||||
// Managed cable is not connected to anything.
|
// Managed cable is not connected to anything.
|
||||||
|
|||||||
1
debug-portArray.json
Normal file
1
debug-portArray.json
Normal file
File diff suppressed because one or more lines are too long
@ -26,14 +26,6 @@
|
|||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<?php if($page == 'explore.php') { ?>
|
|
||||||
<div class="checkbox">
|
|
||||||
<input id="checkboxBreakoutCable" type="checkbox">
|
|
||||||
<label for="checkboxBreakoutCable">
|
|
||||||
Breakout Cable
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
|
||||||
<div class="card-box">
|
<div class="card-box">
|
||||||
<div id="objTree" class="navTree"></div>
|
<div id="objTree" class="navTree"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -498,11 +498,11 @@ var $install_error = array();
|
|||||||
|
|
||||||
$env_tree = array(
|
$env_tree = array(
|
||||||
"'Location', '#', 'location', 42, NULL, 0, 1",
|
"'Location', '#', 'location', 42, NULL, 0, 1",
|
||||||
"'Sub-Location', '1', 'location', 42, NULL, 0, 1",
|
"'Sub-Location', '1', 'location', 42, NULL, 0, 2",
|
||||||
"'Pod', '2', 'pod', 42, NULL, 0, 1",
|
"'Pod', '2', 'pod', 42, NULL, 0, 3",
|
||||||
"'Cab1', '3', 'cabinet', 42, NULL, 0, 1",
|
"'Cab1', '3', 'cabinet', 42, NULL, 0, 4",
|
||||||
"'Cab2', '3', 'cabinet', 42, NULL, 0, 1",
|
"'Cab2', '3', 'cabinet', 42, NULL, 0, 5",
|
||||||
"'Cab3', '3', 'cabinet', 42, NULL, 0, 1"
|
"'Cab3', '3', 'cabinet', 42, NULL, 0, 6"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add environment tree data
|
// Add environment tree data
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user