From 18ef0d2f77dc5bba5160cef3b27ee692513c25da Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 14 Aug 2013 13:43:45 -0700 Subject: [PATCH] Remove connection name textbox. Add separate buttons for connection and group creation. --- guacamole/src/main/webapp/admin.xhtml | 2 +- guacamole/src/main/webapp/scripts/admin-ui.js | 25 +++++++++++++++---- guacamole/src/main/webapp/styles/ui.css | 4 ++- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/guacamole/src/main/webapp/admin.xhtml b/guacamole/src/main/webapp/admin.xhtml index baebf8b0e..ec98b1289 100644 --- a/guacamole/src/main/webapp/admin.xhtml +++ b/guacamole/src/main/webapp/admin.xhtml @@ -71,7 +71,7 @@

-
+
diff --git a/guacamole/src/main/webapp/scripts/admin-ui.js b/guacamole/src/main/webapp/scripts/admin-ui.js index 16d00099f..fd9c8eab2 100644 --- a/guacamole/src/main/webapp/scripts/admin-ui.js +++ b/guacamole/src/main/webapp/scripts/admin-ui.js @@ -29,14 +29,14 @@ var GuacAdmin = { }, "buttons" : { - "back" : document.getElementById("back"), - "logout" : document.getElementById("logout"), - "add_connection" : document.getElementById("add-connection"), - "add_user" : document.getElementById("add-user") + "back" : document.getElementById("back"), + "logout" : document.getElementById("logout"), + "add_connection" : document.getElementById("add-connection"), + "add_connection_group" : document.getElementById("add-connection-group"), + "add_user" : document.getElementById("add-user") }, "fields" : { - "connection_name" : document.getElementById("connection-name"), "username" : document.getElementById("username") }, @@ -1149,6 +1149,21 @@ GuacAdmin.reset = function() { } + // Connection group creation + if (GuacAdmin.cached_permissions.administer + || GuacAdmin.cached_permissions.create_connection_group) { + GuacUI.addClass(document.body, "add-connection-groups"); + + GuacAdmin.buttons.add_connection_group.onclick = function() { + + // Open group creation dialog + var group_dialog = new GuacAdmin.ConnectionGroupEditor(null, parameters); + document.body.appendChild(group_dialog.getElement()); + + }; + + } + // User creation if (GuacAdmin.cached_permissions.administer || GuacAdmin.cached_permissions.create_user) { diff --git a/guacamole/src/main/webapp/styles/ui.css b/guacamole/src/main/webapp/styles/ui.css index 445aff627..60c181b5c 100644 --- a/guacamole/src/main/webapp/styles/ui.css +++ b/guacamole/src/main/webapp/styles/ui.css @@ -443,6 +443,7 @@ div.section { } #connections #add-connection, +#connections #add-connection-group, #users #add-user { font-size: 0.8em; } @@ -457,7 +458,8 @@ body:not(.manage-users) .require-manage-users { display: none; } -body:not(.add-connections) #connection-add-form, +body:not(.add-connections) #add-connection, +body:not(.add-connection-groups) #add-connection-group, body:not(.add-users) #user-add-form { display: none; display: none;