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
var emptyGlobalIDArrayBase64 = btoa(JSON.stringify([]));
// Clear previous remote port(s)
var prevRemotePortGlobalIDArray = JSON.parse(atob($('#'+localPortGlobalID).data('connectedGlobalId')));
$.each(prevRemotePortGlobalIDArray, function(index, prevRemotePortGlobalID){
if($('#'+prevRemotePortGlobalID).length) {
$('#'+prevRemotePortGlobalID).removeClass('populated').data('connectedGlobalId', emptyGlobalIDArrayBase64);
}
});
if($('#'+localPortGlobalID).length) {
// Clear previous remote port(s)
var prevRemotePortGlobalIDArray = JSON.parse(atob($('#'+localPortGlobalID).data('connectedGlobalId')));
$.each(prevRemotePortGlobalIDArray, function(index, prevRemotePortGlobalID){
if($('#'+prevRemotePortGlobalID).length) {
$('#'+prevRemotePortGlobalID).removeClass('populated').data('connectedGlobalId', emptyGlobalIDArrayBase64);
}
});
// Update local port
$('#'+localPortGlobalID).addClass('populated').data('connectedGlobalId', remotePortGlobalIDArrayBase64);
// Update local port
$('#'+localPortGlobalID).addClass('populated').data('connectedGlobalId', remotePortGlobalIDArrayBase64);
}
// Update remote port(s)
$.each(remotePortGlobalIDArray, function(index, remotePortGlobalID){
@ -1019,14 +1021,16 @@ $( document ).ready(function() {
// Compile localPortGlobalID
var localPortGlobalID = 'port-4-'+objID+'-'+objFace+'-'+objDepth+'-'+objPort;
// Update remote port(s)
var remotePortGlobalIDArray = JSON.parse(atob($('#'+localPortGlobalID).data('connectedGlobalId')));
$.each(remotePortGlobalIDArray, function(index, remotePortGlobalID){
if($('#'+remotePortGlobalID).length) {
$('#'+remotePortGlobalID).removeClass('populated').data('connectedGlobalId', btoa(JSON.stringify([])));
}
});
$('#'+localPortGlobalID).removeClass('populated').data('connectedGlobalId', btoa(JSON.stringify([])));
if($('#'+localPortGlobalID).length) {
// Update remote port(s)
var remotePortGlobalIDArray = JSON.parse(atob($('#'+localPortGlobalID).data('connectedGlobalId')));
$.each(remotePortGlobalIDArray, function(index, remotePortGlobalID){
if($('#'+remotePortGlobalID).length) {
$('#'+remotePortGlobalID).removeClass('populated').data('connectedGlobalId', btoa(JSON.stringify([])));
}
});
$('#'+localPortGlobalID).removeClass('populated').data('connectedGlobalId', btoa(JSON.stringify([])));
}
var interfaceSelectionElem = $('#selectPort').find(':selected');
$('#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;
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'];
$objectName = $objectNode['name'];
$objectTemplateID = $objectNode['template_id'];