mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-08 06:01:22 +00:00
Implement renaming.
This commit is contained in:
@@ -646,21 +646,32 @@ GuacAdmin.ConnectionEditor = function(connection, parameters) {
|
|||||||
var connection_header = GuacUI.createChildElement(dialog.getHeader(), "h2");
|
var connection_header = GuacUI.createChildElement(dialog.getHeader(), "h2");
|
||||||
var form_element = GuacUI.createChildElement(dialog.getBody(), "div", "form");
|
var form_element = GuacUI.createChildElement(dialog.getBody(), "div", "form");
|
||||||
|
|
||||||
// Set header
|
|
||||||
if (connection)
|
|
||||||
connection_header.textContent = connection.name;
|
|
||||||
else
|
|
||||||
connection_header.textContent = "New Connection";
|
|
||||||
|
|
||||||
var sections = GuacUI.createChildElement(
|
var sections = GuacUI.createChildElement(
|
||||||
GuacUI.createChildElement(form_element, "div", "settings section"),
|
GuacUI.createChildElement(form_element, "div", "settings section"),
|
||||||
"dl");
|
"dl");
|
||||||
|
|
||||||
// Parameter header
|
// Header section
|
||||||
var protocol_header = GuacUI.createChildElement(sections, "dt");
|
var header_table = GuacUI.createChildElement(
|
||||||
protocol_header.textContent = "Protocol:";
|
GuacUI.createChildElement(sections, "dt"),
|
||||||
|
"table", "fields section");
|
||||||
var protocol_field = GuacUI.createChildElement(protocol_header, "select");
|
|
||||||
|
// Header parameter containers
|
||||||
|
var name_container = GuacUI.createTabulatedContainer(header_table, "Name:");
|
||||||
|
var protocol_container = GuacUI.createTabulatedContainer(header_table, "Protocol:");
|
||||||
|
|
||||||
|
var name_field = GuacUI.createChildElement(name_container, "input");
|
||||||
|
var protocol_field = GuacUI.createChildElement(protocol_container, "select");
|
||||||
|
name_field.setAttribute("type", "text");
|
||||||
|
|
||||||
|
// Set header
|
||||||
|
if (connection) {
|
||||||
|
name_field.value =
|
||||||
|
connection_header.textContent = connection.name;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
name_field.value =
|
||||||
|
connection_header.textContent = "New Connection";
|
||||||
|
}
|
||||||
|
|
||||||
// Associative set of protocols
|
// Associative set of protocols
|
||||||
var available_protocols = {};
|
var available_protocols = {};
|
||||||
@@ -842,7 +853,7 @@ GuacAdmin.ConnectionEditor = function(connection, parameters) {
|
|||||||
var updated_connection = new GuacamoleService.Connection(
|
var updated_connection = new GuacamoleService.Connection(
|
||||||
protocol_field.value,
|
protocol_field.value,
|
||||||
connection && connection.id,
|
connection && connection.id,
|
||||||
connection && connection.name /* FIXME: Actually allow rename */
|
name_field.value
|
||||||
);
|
);
|
||||||
|
|
||||||
// Populate parameters
|
// Populate parameters
|
||||||
@@ -942,20 +953,32 @@ GuacAdmin.ConnectionGroupEditor = function(group, parameters) {
|
|||||||
var group_header = GuacUI.createChildElement(dialog.getHeader(), "h2");
|
var group_header = GuacUI.createChildElement(dialog.getHeader(), "h2");
|
||||||
var form_element = GuacUI.createChildElement(dialog.getBody(), "div", "form");
|
var form_element = GuacUI.createChildElement(dialog.getBody(), "div", "form");
|
||||||
|
|
||||||
// Set title
|
|
||||||
if (group)
|
|
||||||
group_header.textContent = group.name;
|
|
||||||
else
|
|
||||||
group_header.textContent = "New Group";
|
|
||||||
|
|
||||||
var sections = GuacUI.createChildElement(
|
var sections = GuacUI.createChildElement(
|
||||||
GuacUI.createChildElement(form_element, "div", "settings section"),
|
GuacUI.createChildElement(form_element, "div", "settings section"),
|
||||||
"dl");
|
"dl");
|
||||||
|
|
||||||
// Type parameter
|
// Header section
|
||||||
var type_header = GuacUI.createChildElement(sections, "dt");
|
var header_table = GuacUI.createChildElement(
|
||||||
type_header.textContent = "Type:";
|
GuacUI.createChildElement(sections, "dt"),
|
||||||
var type_field = GuacUI.createChildElement(type_header, "select");
|
"table", "fields section");
|
||||||
|
|
||||||
|
// Header parameter containers
|
||||||
|
var name_container = GuacUI.createTabulatedContainer(header_table, "Name:");
|
||||||
|
var type_container = GuacUI.createTabulatedContainer(header_table, "Type:");
|
||||||
|
|
||||||
|
var name_field = GuacUI.createChildElement(name_container, "input");
|
||||||
|
var type_field = GuacUI.createChildElement(type_container, "select");
|
||||||
|
name_field.setAttribute("type", "text");
|
||||||
|
|
||||||
|
// Set title
|
||||||
|
if (group) {
|
||||||
|
name_field.value =
|
||||||
|
group_header.textContent = group.name;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
name_field.value =
|
||||||
|
group_header.textContent = "New Group";
|
||||||
|
}
|
||||||
|
|
||||||
// Organizational type
|
// Organizational type
|
||||||
var org_type = GuacUI.createChildElement(type_field, "option");
|
var org_type = GuacUI.createChildElement(type_field, "option");
|
||||||
@@ -990,7 +1013,7 @@ GuacAdmin.ConnectionGroupEditor = function(group, parameters) {
|
|||||||
var updated_group = new GuacamoleService.ConnectionGroup(
|
var updated_group = new GuacamoleService.ConnectionGroup(
|
||||||
type,
|
type,
|
||||||
group && group.id,
|
group && group.id,
|
||||||
group && group.name /* FIXME: Allow renaming */
|
name_field.value
|
||||||
);
|
);
|
||||||
|
|
||||||
// Update group if provided
|
// Update group if provided
|
||||||
|
Reference in New Issue
Block a user