This commit is contained in:
Garrett K 2021-04-04 05:14:32 +00:00
parent 4305dd39fb
commit 64c46c802f
2 changed files with 24 additions and 20 deletions

View File

@ -677,6 +677,7 @@ function postProcessCable(){
// Compile emptyGlobalIDArrayBase64 // Compile emptyGlobalIDArrayBase64
var emptyGlobalIDArrayBase64 = btoa(JSON.stringify([])); var emptyGlobalIDArrayBase64 = btoa(JSON.stringify([]));
if($('#'+localPortGlobalID).length) {
// Clear previous remote port(s) // Clear previous remote port(s)
var prevRemotePortGlobalIDArray = JSON.parse(atob($('#'+localPortGlobalID).data('connectedGlobalId'))); var prevRemotePortGlobalIDArray = JSON.parse(atob($('#'+localPortGlobalID).data('connectedGlobalId')));
$.each(prevRemotePortGlobalIDArray, function(index, prevRemotePortGlobalID){ $.each(prevRemotePortGlobalIDArray, function(index, prevRemotePortGlobalID){
@ -687,6 +688,7 @@ function postProcessCable(){
// Update local port // Update local port
$('#'+localPortGlobalID).addClass('populated').data('connectedGlobalId', remotePortGlobalIDArrayBase64); $('#'+localPortGlobalID).addClass('populated').data('connectedGlobalId', remotePortGlobalIDArrayBase64);
}
// Update remote port(s) // Update remote port(s)
$.each(remotePortGlobalIDArray, function(index, remotePortGlobalID){ $.each(remotePortGlobalIDArray, function(index, remotePortGlobalID){
@ -1019,6 +1021,7 @@ $( document ).ready(function() {
// Compile localPortGlobalID // Compile localPortGlobalID
var localPortGlobalID = 'port-4-'+objID+'-'+objFace+'-'+objDepth+'-'+objPort; var localPortGlobalID = 'port-4-'+objID+'-'+objFace+'-'+objDepth+'-'+objPort;
if($('#'+localPortGlobalID).length) {
// Update remote port(s) // Update remote port(s)
var remotePortGlobalIDArray = JSON.parse(atob($('#'+localPortGlobalID).data('connectedGlobalId'))); var remotePortGlobalIDArray = JSON.parse(atob($('#'+localPortGlobalID).data('connectedGlobalId')));
$.each(remotePortGlobalIDArray, function(index, remotePortGlobalID){ $.each(remotePortGlobalIDArray, function(index, remotePortGlobalID){
@ -1027,6 +1030,7 @@ $( document ).ready(function() {
} }
}); });
$('#'+localPortGlobalID).removeClass('populated').data('connectedGlobalId', btoa(JSON.stringify([]))); $('#'+localPortGlobalID).removeClass('populated').data('connectedGlobalId', btoa(JSON.stringify([])));
}
var interfaceSelectionElem = $('#selectPort').find(':selected'); var interfaceSelectionElem = $('#selectPort').find(':selected');
$('#checkboxPopulated').prop("checked", false); $('#checkboxPopulated').prop("checked", false);

View File

@ -1165,11 +1165,11 @@ var $qls;
} }
} }
$query = $this->qls->SQL->select('*', 'app_object', array('env_tree_id' => array('=', $cabinetID), 'AND', 'parent_id' => array('=', 0)), array($objSortAttr, $objSortDir)); $query = $this->qls->SQL->select('*', 'app_object', array('env_tree_id' => array('=', $cabinetID)), array($objSortAttr, $objSortDir));
$counter = 1; $counter = 1;
while($objectNode = $this->qls->SQL->fetch_assoc($query)) { while($objectNode = $this->qls->SQL->fetch_assoc($query)) {
if($objectNode['env_tree_id'] == $cabinetID and $objectNode['parent_id'] == 0) { if($objectNode['parent_id'] == 0 or $objectNode['parent_id'] == Null) {
$objectID = $objectNode['id']; $objectID = $objectNode['id'];
$objectName = $objectNode['name']; $objectName = $objectNode['name'];
$objectTemplateID = $objectNode['template_id']; $objectTemplateID = $objectNode['template_id'];