diff --git a/guacamole/src/main/webapp/index.xhtml b/guacamole/src/main/webapp/index.xhtml index ba719cff0..87d28b02b 100644 --- a/guacamole/src/main/webapp/index.xhtml +++ b/guacamole/src/main/webapp/index.xhtml @@ -83,9 +83,6 @@
diff --git a/guacamole/src/main/webapp/scripts/guac-ui.js b/guacamole/src/main/webapp/scripts/guac-ui.js
index 46e5dcc8f..1a09c79ef 100644
--- a/guacamole/src/main/webapp/scripts/guac-ui.js
+++ b/guacamole/src/main/webapp/scripts/guac-ui.js
@@ -875,3 +875,96 @@ GuacUI.ListGroup = function(caption) {
};
}
+
+/**
+ * Component which displays a paginated tree view of all groups and their
+ * connections.
+ *
+ * @constructor
+ * @param {GuacamoleService.ConnectionGroup} root_group The group to display
+ * within the view.
+ */
+GuacUI.GroupView = function(root_group) {
+
+ /**
+ * Reference to this GroupView.
+ * @private
+ */
+ var group_view = this;
+
+ // Group view components
+ var element = GuacUI.createElement("div", "group-view");
+ var list = GuacUI.createChildElement(element, "div", "list");
+
+ /**
+ * Set of all connections, indexed by ID.
+ */
+ this.connections = {};
+
+ /**
+ * Returns the element representing this group view.
+ */
+ this.getElement = function() {
+ return element;
+ };
+
+ // Create pager for contents
+ var pager = new GuacUI.Pager(list);
+ pager.page_capacity = 20;
+
+ /**
+ * Adds the given group to the given display parent object. This object
+ * must have an addElement() function, which will be used for adding all
+ * child elements representing child connections and groups.
+ *
+ * @param {GuacamoleService.ConnectionGroup} group The group to add.
+ * @param {Function} appendChild A function which, given an element, will add that
+ * element the the display as desired.
+ */
+ function addGroup(group, appendChild) {
+
+ var i;
+
+ // Add all contained connections
+ for (i=0; i