mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +00:00
Track list of all groups by ID within GroupView. Soft fail when set*() called on group or connection that isn't present in GroupView.
This commit is contained in:
@@ -940,6 +940,11 @@ GuacUI.GroupView = function(root_group, multiselect) {
|
|||||||
*/
|
*/
|
||||||
var connection_checkboxes = {};
|
var connection_checkboxes = {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set of all connection groups, indexed by ID.
|
||||||
|
*/
|
||||||
|
this.groups = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set of all connections, indexed by ID.
|
* Set of all connections, indexed by ID.
|
||||||
*/
|
*/
|
||||||
@@ -1000,6 +1005,8 @@ GuacUI.GroupView = function(root_group, multiselect) {
|
|||||||
this.setGroupEnabled = function(id, value) {
|
this.setGroupEnabled = function(id, value) {
|
||||||
|
|
||||||
var checkbox = group_checkboxes[id];
|
var checkbox = group_checkboxes[id];
|
||||||
|
if (!checkbox)
|
||||||
|
return;
|
||||||
|
|
||||||
// If enabled, show checkbox, allow select
|
// If enabled, show checkbox, allow select
|
||||||
if (value) {
|
if (value) {
|
||||||
@@ -1025,6 +1032,8 @@ GuacUI.GroupView = function(root_group, multiselect) {
|
|||||||
this.setConnectionEnabled = function(id, value) {
|
this.setConnectionEnabled = function(id, value) {
|
||||||
|
|
||||||
var checkbox = connection_checkboxes[id];
|
var checkbox = connection_checkboxes[id];
|
||||||
|
if (!checkbox)
|
||||||
|
return;
|
||||||
|
|
||||||
// If enabled, show checkbox, allow select
|
// If enabled, show checkbox, allow select
|
||||||
if (value) {
|
if (value) {
|
||||||
@@ -1048,7 +1057,13 @@ GuacUI.GroupView = function(root_group, multiselect) {
|
|||||||
* @param {Boolean} value Whether the group should be selected.
|
* @param {Boolean} value Whether the group should be selected.
|
||||||
*/
|
*/
|
||||||
this.setGroupValue = function(id, value) {
|
this.setGroupValue = function(id, value) {
|
||||||
group_checkboxes[id].checked = value;
|
|
||||||
|
var checkbox = group_checkboxes[id];
|
||||||
|
if (!checkbox)
|
||||||
|
return;
|
||||||
|
|
||||||
|
checkbox.checked = value;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1059,7 +1074,13 @@ GuacUI.GroupView = function(root_group, multiselect) {
|
|||||||
* @param {Boolean} value Whether the connection should be selected.
|
* @param {Boolean} value Whether the connection should be selected.
|
||||||
*/
|
*/
|
||||||
this.setConnectionValue = function(id, value) {
|
this.setConnectionValue = function(id, value) {
|
||||||
connection_checkboxes[id].checked = value;
|
|
||||||
|
var checkbox = connection_checkboxes[id];
|
||||||
|
if (!checkbox)
|
||||||
|
return;
|
||||||
|
|
||||||
|
checkbox.checked = value;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create pager for contents
|
// Create pager for contents
|
||||||
@@ -1078,6 +1099,7 @@ GuacUI.GroupView = function(root_group, multiselect) {
|
|||||||
function addGroup(group, appendChild) {
|
function addGroup(group, appendChild) {
|
||||||
|
|
||||||
var i;
|
var i;
|
||||||
|
group_view.groups[group.id] = group;
|
||||||
|
|
||||||
// Add all contained connections
|
// Add all contained connections
|
||||||
for (i=0; i<group.connections.length; i++) {
|
for (i=0; i<group.connections.length; i++) {
|
||||||
|
Reference in New Issue
Block a user