This commit is contained in:
Garrett 2020-12-28 05:44:46 +00:00
parent 81cca94787
commit 1cebdf1303
5 changed files with 31 additions and 9 deletions

View File

@ -443,9 +443,8 @@ function makeCabCloseClickable(){
} }
function resizeCanvas() { function resizeCanvas() {
$('#canvasBuildSpace').attr('width', $('#canvasBuildSpace').parent().width()); $('#canvasBuildSpace').attr('width', $(document).width());
$('#canvasBuildSpace').attr('height', $('#canvasBuildSpace').parent().height()); $('#canvasBuildSpace').attr('height', $(document).height());
//redraw();
} }
function redraw() { function redraw() {

View File

@ -27,7 +27,6 @@ $qls->Security->check_auth_page('user.php');
<!-- Make server data available to client via hidden inputs --> <!-- Make server data available to client via hidden inputs -->
<?php include_once('includes/content-build-serverData.php'); ?> <?php include_once('includes/content-build-serverData.php'); ?>
<canvas id="canvasBuildSpace" style="z-index:1000;position:absolute; pointer-events:none;"></canvas>
<!-- Page-Title --> <!-- Page-Title -->
<div class="row"> <div class="row">

View File

@ -1952,6 +1952,8 @@ var $qls;
function buildPathFull($path, $connectorCode39){ function buildPathFull($path, $connectorCode39){
error_log('Debug (buildPathFull $path): '.json_encode($path));
$htmlPathFull = ''; $htmlPathFull = '';
$htmlPathFull .= '<table>'; $htmlPathFull .= '<table>';
@ -1959,6 +1961,7 @@ var $qls;
$pathOrientation = $this->qls->user_info['pathOrientation']; $pathOrientation = $this->qls->user_info['pathOrientation'];
// Cable Adjacent
if($pathOrientation == 0) { if($pathOrientation == 0) {
foreach($path as $objectIndex => $object) { foreach($path as $objectIndex => $object) {
$objType = $object['type']; $objType = $object['type'];
@ -1967,12 +1970,16 @@ var $qls;
case 'connector': case 'connector':
error_log('here1');
$addConnector = false; $addConnector = false;
if(isset($path[$objectIndex+1])) { if(isset($path[$objectIndex+1])) {
error_log('here2');
if($path[$objectIndex+1]['type'] != 'object') { if($path[$objectIndex+1]['type'] != 'object') {
error_log('here3');
$addConnector = true; $addConnector = true;
} }
} else { } else {
error_log('here4');
$addConnector = true; $addConnector = true;
} }
@ -1985,7 +1992,7 @@ var $qls;
$connectorTypeID = $object['data']['connectorType']; $connectorTypeID = $object['data']['connectorType'];
if($connectorTypeID != 0) { if($connectorTypeID != 0) {
$connectorTypeName = $this->connectorTypeValueArray[$connectorTypeID]['name']; $connectorTypeName = $this->portTypeValueArray[$connectorTypeID]['name'];
$connectorHTML = '<div title="'.$connectorTypeName.'" class="port '.$connectorTypeName.'"></div>'; $connectorHTML = '<div title="'.$connectorTypeName.'" class="port '.$connectorTypeName.'"></div>';
} else { } else {
$connectorTypeName = 'Unk'; $connectorTypeName = 'Unk';
@ -2045,12 +2052,12 @@ var $qls;
$htmlString = '<td>'.$objBox.'</td>'; $htmlString = '<td>'.$objBox.'</td>';
array_push($tableArray[count($tableArray)-1], $htmlString); array_push($tableArray[count($tableArray)-1], $htmlString);
if($path[$objectIndex+1]['type'] == 'trunk') { if($path[$objectIndex+1]['type'] == 'trunk' or !isset($path[$objectIndex+1])) {
if(isset($path[$objectIndex-1])) { if(isset($path[$objectIndex-1])) {
$connectorTypeID = $path[$objectIndex-1]['data']['connectorType']; $connectorTypeID = $path[$objectIndex-1]['data']['connectorType'];
if($connectorTypeID != 0) { if($connectorTypeID != 0) {
$connectorTypeName = $this->connectorTypeValueArray[$connectorTypeID]['name']; $connectorTypeName = $this->portTypeValueArray[$connectorTypeID]['name'];
$connectorHTML = '<div title="'.$connectorTypeName.'" class="port '.$connectorTypeName.'"></div>'; $connectorHTML = '<div title="'.$connectorTypeName.'" class="port '.$connectorTypeName.'"></div>';
} else { } else {
$connectorTypeName = 'Unk'; $connectorTypeName = 'Unk';
@ -2088,6 +2095,7 @@ var $qls;
} }
} }
// Cable inline
} else { } else {
foreach($path as $objectIndex => $object) { foreach($path as $objectIndex => $object) {

View File

@ -83,12 +83,25 @@ for($x=0; $x<2; $x++){
$remoteAttrPrefix = $inventory['remoteAttrPrefix']; $remoteAttrPrefix = $inventory['remoteAttrPrefix'];
$connection = $qls->App->inventoryAllArray[$inventoryID]; $connection = $qls->App->inventoryAllArray[$inventoryID];
// Retrieve local connector type
$localObj = $qls->App->objectArray[$objID];
$localTemplateID = $localObj['template_id'];
$localConnectorType = $qls->App->compatibilityArray[$localTemplateID][$objFace][$objDepth]['portType'];
// Retrieve remote connector type
$remoteObjID = $inventory['id'];
$remoteObjFace = $inventory['face'];
$remoteObjDepth = $inventory['depth'];
$remoteObj = $qls->App->objectArray[$remoteObjID];
$remoteTemplateID = $remoteObj['template_id'];
$remoteConnectorType = $qls->App->compatibilityArray[$remoteTemplateID][$remoteObjFace][$remoteObjDepth]['portType'];
// Local Connection // Local Connection
$connector1WorkingArray = array( $connector1WorkingArray = array(
'type' => 'connector', 'type' => 'connector',
'data' => array( 'data' => array(
'code39' => $connection[$localAttrPrefix.'_code39'], 'code39' => $connection[$localAttrPrefix.'_code39'],
'connectorType' => $connection[$localAttrPrefix.'_connector'] 'connectorType' => $localConnectorType
) )
); );
@ -110,7 +123,7 @@ for($x=0; $x<2; $x++){
'type' => 'connector', 'type' => 'connector',
'data' => array( 'data' => array(
'code39' => $connection[$remoteAttrPrefix.'_code39'], 'code39' => $connection[$remoteAttrPrefix.'_code39'],
'connectorType' => $connection[$remoteAttrPrefix.'_connector'] 'connectorType' => $remoteConnectorType
) )
); );

View File

@ -17,6 +17,9 @@
<body> <body>
<!-- Canvas for drawing connections -->
<canvas id="canvasBuildSpace" style="z-index:1000;position:absolute; pointer-events:none;"></canvas>
<?php require 'topbar.php'; ?> <?php require 'topbar.php'; ?>
<!-- User Settings --> <!-- User Settings -->