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,16 +677,18 @@ function postProcessCable(){
// Compile emptyGlobalIDArrayBase64 // Compile emptyGlobalIDArrayBase64
var emptyGlobalIDArrayBase64 = btoa(JSON.stringify([])); var emptyGlobalIDArrayBase64 = btoa(JSON.stringify([]));
// Clear previous remote port(s) if($('#'+localPortGlobalID).length) {
var prevRemotePortGlobalIDArray = JSON.parse(atob($('#'+localPortGlobalID).data('connectedGlobalId'))); // Clear previous remote port(s)
$.each(prevRemotePortGlobalIDArray, function(index, prevRemotePortGlobalID){ var prevRemotePortGlobalIDArray = JSON.parse(atob($('#'+localPortGlobalID).data('connectedGlobalId')));
if($('#'+prevRemotePortGlobalID).length) { $.each(prevRemotePortGlobalIDArray, function(index, prevRemotePortGlobalID){
$('#'+prevRemotePortGlobalID).removeClass('populated').data('connectedGlobalId', emptyGlobalIDArrayBase64); if($('#'+prevRemotePortGlobalID).length) {
} $('#'+prevRemotePortGlobalID).removeClass('populated').data('connectedGlobalId', emptyGlobalIDArrayBase64);
}); }
});
// 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,14 +1021,16 @@ $( document ).ready(function() {
// Compile localPortGlobalID // Compile localPortGlobalID
var localPortGlobalID = 'port-4-'+objID+'-'+objFace+'-'+objDepth+'-'+objPort; var localPortGlobalID = 'port-4-'+objID+'-'+objFace+'-'+objDepth+'-'+objPort;
// Update remote port(s) if($('#'+localPortGlobalID).length) {
var remotePortGlobalIDArray = JSON.parse(atob($('#'+localPortGlobalID).data('connectedGlobalId'))); // Update remote port(s)
$.each(remotePortGlobalIDArray, function(index, remotePortGlobalID){ var remotePortGlobalIDArray = JSON.parse(atob($('#'+localPortGlobalID).data('connectedGlobalId')));
if($('#'+remotePortGlobalID).length) { $.each(remotePortGlobalIDArray, function(index, remotePortGlobalID){
$('#'+remotePortGlobalID).removeClass('populated').data('connectedGlobalId', btoa(JSON.stringify([]))); if($('#'+remotePortGlobalID).length) {
} $('#'+remotePortGlobalID).removeClass('populated').data('connectedGlobalId', btoa(JSON.stringify([])));
}); }
$('#'+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'];