From dcd82f9e63d980731c148649d7b50ea9ba549ea0 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 8 Jun 2015 16:15:31 -0700 Subject: [PATCH] GUAC-1176: Remove all human-readable title properties from the REST form objects. --- .../guacamole/auth/jdbc/user/ModeledUser.java | 6 +- .../guacamole/auth/jdbc/user/UserService.java | 4 +- .../guacamole/form/BooleanField.java | 15 +- .../glyptodon/guacamole/form/EnumField.java | 9 +- .../org/glyptodon/guacamole/form/Field.java | 52 +----- .../org/glyptodon/guacamole/form/Form.java | 43 +---- .../guacamole/form/MultilineField.java | 9 +- .../guacamole/form/NumericField.java | 9 +- .../guacamole/form/PasswordField.java | 9 +- .../glyptodon/guacamole/form/TextField.java | 9 +- .../guacamole/form/UsernameField.java | 9 +- .../net/auth/credentials/CredentialsInfo.java | 4 +- .../guacamole/protocols/ProtocolInfo.java | 43 +---- .../glyptodon/guacamole/protocols/rdp.json | 148 ++---------------- .../glyptodon/guacamole/protocols/ssh.json | 82 +--------- .../glyptodon/guacamole/protocols/telnet.json | 74 +-------- .../glyptodon/guacamole/protocols/vnc.json | 70 +-------- .../controllers/checkboxFieldController.js | 4 +- .../app/form/templates/selectField.html | 2 +- .../src/main/webapp/app/rest/types/Field.js | 9 +- .../main/webapp/app/rest/types/FieldOption.js | 61 -------- .../src/main/webapp/app/rest/types/Form.js | 12 +- .../main/webapp/app/rest/types/Protocol.js | 7 - 23 files changed, 79 insertions(+), 611 deletions(-) delete mode 100644 guacamole/src/main/webapp/app/rest/types/FieldOption.js diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/ModeledUser.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/ModeledUser.java index aba2d4f02..0e0e840ff 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/ModeledUser.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/ModeledUser.java @@ -69,9 +69,9 @@ public class ModeledUser extends ModeledDirectoryObject implements Us * All attributes related to restricting user accounts, within a logical * form. */ - public static final Form ACCOUNT_RESTRICTIONS = new Form("restrictions", "Account Restrictions", Arrays.asList( - new BooleanField(DISABLED_ATTRIBUTE_NAME, "Disabled", "true"), - new BooleanField(EXPIRED_ATTRIBUTE_NAME, "Password expired", "true") + public static final Form ACCOUNT_RESTRICTIONS = new Form("restrictions", Arrays.asList( + new BooleanField(DISABLED_ATTRIBUTE_NAME, "true"), + new BooleanField(EXPIRED_ATTRIBUTE_NAME, "true") )); /** diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/UserService.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/UserService.java index 3e1752eff..969741bf4 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/UserService.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/glyptodon/guacamole/auth/jdbc/user/UserService.java @@ -82,7 +82,7 @@ public class UserService extends ModeledDirectoryObjectService options) { - super(name, title, Field.Type.ENUM, options); + public EnumField(String name, Collection options) { + super(name, Field.Type.ENUM, options); } } diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Field.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Field.java index 4f29ee8e0..c463c47b3 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Field.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Field.java @@ -91,11 +91,6 @@ public class Field { */ private String name; - /** - * A human-readable name to be presented to the user. - */ - private String title; - /** * The type of this field. */ @@ -104,52 +99,42 @@ public class Field { /** * A collection of all legal values of this field. */ - private Collection options; + private Collection options; /** - * Creates a new Parameter with no associated name, title, or type. + * Creates a new Parameter with no associated name or type. */ public Field() { } /** - * Creates a new Field with the given name, title, and type. + * Creates a new Field with the given name and type. * * @param name * The unique name to associate with this field. * - * @param title - * The human-readable title to associate with this field. - * * @param type * The type of this field. */ - public Field(String name, String title, String type) { + public Field(String name, String type) { this.name = name; - this.title = title; this.type = type; } /** - * Creates a new Field with the given name, title, type, and possible - * values. + * Creates a new Field with the given name, type, and possible values. * * @param name * The unique name to associate with this field. * - * @param title - * The human-readable title to associate with this field. - * * @param type * The type of this field. * * @param options * A collection of all possible valid options for this field. */ - public Field(String name, String title, String type, - Collection options) { + public Field(String name, String type, Collection options) { this.name = name; - this.title = title; this.type = type; this.options = options; } @@ -174,27 +159,6 @@ public class Field { this.name = name; } - /** - * Returns the human-readable title associated with this field. - * - * @return - * The human-readable title associated with this field. - */ - public String getTitle() { - return title; - } - - /** - * Sets the title associated with this field. The title must be a human- - * readable string which describes accurately this field. - * - * @param title - * A human-readable string describing this field. - */ - public void setTitle(String title) { - this.title = title; - } - /** * Returns the type of this field. * @@ -223,7 +187,7 @@ public class Field { * A mutable collection of field options, or null if the field has no * options. */ - public Collection getOptions() { + public Collection getOptions() { return options; } @@ -233,7 +197,7 @@ public class Field { * @param options * The options to associate with this field. */ - public void setOptions(Collection options) { + public void setOptions(Collection options) { this.options = options; } diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Form.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Form.java index f85f755f3..3052d6283 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Form.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/Form.java @@ -40,41 +40,32 @@ public class Form { */ private String name; - /** - * The a human-readable title describing this form. - */ - private String title; - /** * All fields associated with this form. */ private Collection fields; /** - * Creates a new Form object with no associated fields. The name and title - * of the form are left unset as null. If no form name is provided, this - * form must not be used in the same context as another unnamed form. + * Creates a new Form object with no associated fields. The name is left + * unset as null. If no form name is provided, this form must not be used + * in the same context as another unnamed form. */ public Form() { fields = new ArrayList(); } /** - * Creates a new Form object having the given name and title, and - * containing the given fields. + * Creates a new Form object having the given name and containing the given + * fields. * * @param name * A name which uniquely identifies this form. * - * @param title - * A human-readable title describing this form. - * * @param fields * The fields to provided within the new Form. */ - public Form(String name, String title, Collection fields) { + public Form(String name, Collection fields) { this.name = name; - this.title = title; this.fields = fields; } @@ -120,26 +111,4 @@ public class Form { this.name = name; } - /** - * Returns the human-readable title associated with this form. A form's - * title describes the form, but need not be unique. - * - * @return - * A human-readable title describing this form. - */ - public String getTitle() { - return title; - } - - /** - * Sets the human-readable title associated with this form. A form's title - * describes the form, but need not be unique. - * - * @param title - * A human-readable title describing this form. - */ - public void setTitle(String title) { - this.title = title; - } - } diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/MultilineField.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/MultilineField.java index f216a45f6..158eec786 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/MultilineField.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/MultilineField.java @@ -30,16 +30,13 @@ package org.glyptodon.guacamole.form; public class MultilineField extends Field { /** - * Creates a new MultilineField with the given name and title. + * Creates a new MultilineField with the given name. * * @param name * The unique name to associate with this field. - * - * @param title - * The human-readable title to associate with this field. */ - public MultilineField(String name, String title) { - super(name, title, Field.Type.MULTILINE); + public MultilineField(String name) { + super(name, Field.Type.MULTILINE); } } diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/NumericField.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/NumericField.java index 3b4b992c1..5e06cb33e 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/NumericField.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/NumericField.java @@ -30,16 +30,13 @@ package org.glyptodon.guacamole.form; public class NumericField extends Field { /** - * Creates a new NumericField with the given name and title. + * Creates a new NumericField with the given name. * * @param name * The unique name to associate with this field. - * - * @param title - * The human-readable title to associate with this field. */ - public NumericField(String name, String title) { - super(name, title, Field.Type.NUMERIC); + public NumericField(String name) { + super(name, Field.Type.NUMERIC); } } diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/PasswordField.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/PasswordField.java index e8197563a..c48a6596b 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/PasswordField.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/PasswordField.java @@ -31,16 +31,13 @@ package org.glyptodon.guacamole.form; public class PasswordField extends Field { /** - * Creates a new PasswordField with the given name and title. + * Creates a new PasswordField with the given name. * * @param name * The unique name to associate with this field. - * - * @param title - * The human-readable title to associate with this field. */ - public PasswordField(String name, String title) { - super(name, title, Field.Type.PASSWORD); + public PasswordField(String name) { + super(name, Field.Type.PASSWORD); } } diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/TextField.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/TextField.java index 60a6e9467..75cae7bb6 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/TextField.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/TextField.java @@ -31,16 +31,13 @@ package org.glyptodon.guacamole.form; public class TextField extends Field { /** - * Creates a new TextField with the given name and title. + * Creates a new TextField with the given name. * * @param name * The unique name to associate with this field. - * - * @param title - * The human-readable title to associate with this field. */ - public TextField(String name, String title) { - super(name, title, Field.Type.TEXT); + public TextField(String name) { + super(name, Field.Type.TEXT); } } diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/UsernameField.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/UsernameField.java index 60879ee28..9b2701df4 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/UsernameField.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/form/UsernameField.java @@ -31,16 +31,13 @@ package org.glyptodon.guacamole.form; public class UsernameField extends Field { /** - * Creates a new UsernameField with the given name and title. + * Creates a new UsernameField with the given name. * * @param name * The unique name to associate with this field. - * - * @param title - * The human-readable title to associate with this field. */ - public UsernameField(String name, String title) { - super(name, title, Field.Type.USERNAME); + public UsernameField(String name) { + super(name, Field.Type.USERNAME); } } diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/credentials/CredentialsInfo.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/credentials/CredentialsInfo.java index e693dbc79..a0c471686 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/credentials/CredentialsInfo.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/net/auth/credentials/CredentialsInfo.java @@ -73,13 +73,13 @@ public class CredentialsInfo { * A field describing the username HTTP parameter expected by Guacamole * during login, if usernames are being used. */ - public static final Field USERNAME = new UsernameField("username", "username"); + public static final Field USERNAME = new UsernameField("username"); /** * A field describing the password HTTP parameter expected by Guacamole * during login, if passwords are being used. */ - public static final Field PASSWORD = new PasswordField("password", "password"); + public static final Field PASSWORD = new PasswordField("password"); /** * CredentialsInfo object which describes standard username/password diff --git a/guacamole-ext/src/main/java/org/glyptodon/guacamole/protocols/ProtocolInfo.java b/guacamole-ext/src/main/java/org/glyptodon/guacamole/protocols/ProtocolInfo.java index 69b7966f1..36d88b4a8 100644 --- a/guacamole-ext/src/main/java/org/glyptodon/guacamole/protocols/ProtocolInfo.java +++ b/guacamole-ext/src/main/java/org/glyptodon/guacamole/protocols/ProtocolInfo.java @@ -35,11 +35,6 @@ import org.glyptodon.guacamole.form.Form; */ public class ProtocolInfo { - /** - * The human-readable title associated with this protocol. - */ - private String title; - /** * The unique name associated with this protocol. */ @@ -51,65 +46,37 @@ public class ProtocolInfo { private Collection
forms; /** - * Creates a new ProtocolInfo with no associated name, title, or - * forms. + * Creates a new ProtocolInfo with no associated name or forms. */ public ProtocolInfo() { this.forms = new ArrayList(); } /** - * Creates a new ProtocolInfo having the given name and title, but without - * any forms. + * Creates a new ProtocolInfo having the given name, but without any forms. * * @param name * The unique name associated with the protocol. - * - * @param title - * The human-readable title to associate with the protocol. */ - public ProtocolInfo(String name, String title) { + public ProtocolInfo(String name) { this.name = name; - this.title = title; this.forms = new ArrayList(); } /** - * Creates a new ProtocolInfo having the given name, title, and forms. + * Creates a new ProtocolInfo having the given name and forms. * * @param name * The unique name associated with the protocol. * - * @param title - * The human-readable title to associate with the protocol. - * * @param forms * The forms to associate with the protocol. */ - public ProtocolInfo(String name, String title, Collection forms) { + public ProtocolInfo(String name, Collection forms) { this.name = name; - this.title = title; this.forms = forms; } - /** - * Returns the human-readable title associated with this protocol. - * - * @return The human-readable title associated with this protocol. - */ - public String getTitle() { - return title; - } - - /** - * Sets the human-readable title associated with this protocol. - * - * @param title The human-readable title to associate with this protocol. - */ - public void setTitle(String title) { - this.title = title; - } - /** * Returns the unique name of this protocol. The protocol name is the * value required by the corresponding protocol plugin for guacd. diff --git a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/rdp.json b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/rdp.json index 98f64ab94..739ab2af2 100644 --- a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/rdp.json +++ b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/rdp.json @@ -1,272 +1,156 @@ { - "title" : "RDP", "name" : "rdp", "forms" : [ { - "title" : "Network", "name" : "network", "fields" : [ { "name" : "hostname", - "title" : "Hostname", "type" : "TEXT" }, { "name" : "port", - "title" : "Port", "type" : "NUMERIC" } ] }, { - "title" : "Authentication", "name" : "authentication", "fields" : [ { "name" : "username", - "title" : "Username", "type" : "USERNAME" }, { "name" : "password", - "title" : "Password", "type" : "PASSWORD" }, { "name" : "domain", - "title" : "Domain", "type" : "TEXT" }, { "name" : "security", - "title" : "Security mode", "type" : "ENUM", - "options" : [ - { - "value" : "", - "title" : "" - }, - { - "value" : "rdp", - "title" : "RDP encryption" - }, - { - "value" : "tls", - "title" : "TLS encryption" - }, - { - "value" : "nla", - "title" : "NLA (Network Level Authentication)" - }, - { - "value" : "any", - "title" : "Any" - } - ] + "options" : [ "", "rdp", "tls", "nla", "any" ] }, { "name" : "disable-auth", - "title" : "Disable authentication", "type" : "BOOLEAN", - "options" : [{ - "value" : "true", - "title" : "true" - }] + "options" : [ "true" ] }, { "name" : "ignore-cert", - "title" : "Ignore server certificate", "type" : "BOOLEAN", - "options" : [{ - "value" : "true", - "title" : "true" - }] + "options" : [ "true" ] } ] }, { - "title" : "Basic Parameters", "name" : "basic-parameters", "fields" : [ { "name" : "initial-program", - "title" : "Initial program", "type" : "TEXT" }, { "name" : "client-name", - "title" : "Client name", "type" : "TEXT" }, { "name" : "server-layout", - "title" : "Keyboard layout", "type" : "ENUM", "options" : [ - { - "value" : "", - "title" : "" - }, - { - "value" : "en-us-qwerty", - "title" : "US English (Qwerty)" - }, - { - "value" : "fr-fr-azerty", - "title" : "French (Azerty)" - }, - { - "value" : "de-de-qwertz", - "title" : "German (Qwertz)" - }, - { - "value" : "it-it-qwerty", - "title" : "Italian (Qwerty)" - }, - { - "value" : "sv-se-qwerty", - "title" : "Swedish (Qwerty)" - }, - { - "value" : "failsafe", - "title" : "Unicode" - } + "", + "en-us-qwerty", + "fr-fr-azerty", + "de-de-qwertz", + "it-it-qwerty", + "sv-se-qwerty", + "failsafe" ] }, { "name" : "console", - "title" : "Administrator console", "type" : "BOOLEAN", - "options" : [{ - "value" : "true", - "title" : "true" - }] + "options" : [ "true" ] } ] }, { - "title" : "Display", "name" : "display", "fields" : [ { "name" : "width", - "title" : "Display width", "type" : "NUMERIC" }, { "name" : "height", - "title" : "Display height", "type" : "NUMERIC" }, { "name" : "dpi", - "title" : "Display resolution (DPI)", "type" : "NUMERIC" }, { "name" : "color-depth", - "title" : "Color depth", "type" : "ENUM", - "options" : [ - { - "value" : "", - "title" : "" - }, - { - "value" : "8", - "title" : "256 color" - }, - { - "value" : "16", - "title" : "Low color (16-bit)" - }, - { - "value" : "24", - "title" : "True color (24-bit)" - }, - { - "value" : "32", - "title" : "True color (32-bit)" - } - ] + "options" : [ "", "8", "16", "24", "32" ] } ] }, { - "title" : "Device Redirection", "name" : "device-redirection", "fields" : [ { "name" : "console-audio", - "title" : "Support audio in console", "type" : "BOOLEAN", - "options" : [{ - "value" : "true", - "title" : "true" - }] + "options" : [ "true" ] }, { "name" : "disable-audio", - "title" : "Disable audio", "type" : "BOOLEAN", - "options" : [{ - "value" : "true", - "title" : "true" - }] + "options" : [ "true" ] }, { "name" : "enable-printing", - "title" : "Enable printing", "type" : "BOOLEAN", - "options" : [{ - "value" : "true", - "title" : "true" - }] + "options" : [ "true" ] }, { "name" : "enable-drive", - "title" : "Enable drive", "type" : "BOOLEAN", - "options" : [{ - "value" : "true", - "title" : "true" - }] + "options" : [ "true" ] }, { "name" : "drive-path", - "title" : "Drive path", "type" : "TEXT" }, { "name" : "static-channels", - "title" : "Static channel names", "type" : "TEXT" } ] }, { - "title" : "RemoteApp", "name" : "remoteapp", "fields" : [ { "name" : "remote-app", - "title" : "RemoteApp program", "type" : "TEXT" }, { "name" : "remote-app-dir", - "title" : "RemoteApp working directory", "type" : "TEXT" }, { "name" : "remote-app-args", - "title" : "RemoteApp parameters", "type" : "TEXT" } ] diff --git a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/ssh.json b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/ssh.json index 4efbfaf44..0e6fdb38b 100644 --- a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/ssh.json +++ b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/ssh.json @@ -1,143 +1,65 @@ { - "title" : "SSH", "name" : "ssh", "forms" : [ { - "title" : "Network", "name" : "network", "fields" : [ { "name" : "hostname", - "title" : "Hostname", "type" : "TEXT" }, { "name" : "port", - "title" : "Port", "type" : "NUMERIC" } ] }, { - "title" : "Authentication", "name" : "authentication", "fields" : [ { "name" : "username", - "title" : "Username", "type" : "USERNAME" }, { "name" : "password", - "title" : "Password", "type" : "PASSWORD" }, { "name" : "private-key", - "title" : "Private key", "type" : "MULTILINE" }, { "name" : "passphrase", - "title" : "Passphrase", "type" : "PASSWORD" } ] }, { - "title" : "Display", "name" : "display", "fields" : [ { "name" : "font-name", - "title" : "Font name", "type" : "TEXT" }, { "name" : "font-size", - "title" : "Font size", "type" : "ENUM", - "options" : [ - { - "value" : "", - "title" : "" - }, - { - "value" : "8", - "title" : "8" - }, - { - "value" : "9", - "title" : "9" - }, - { - "value" : "10", - "title" : "10" - }, - { - "value" : "11", - "title" : "11" - }, - { - "value" : "12", - "title" : "12" - }, - { - "value" : "14", - "title" : "14" - }, - { - "value" : "18", - "title" : "18" - }, - { - "value" : "24", - "title" : "24" - }, - { - "value" : "30", - "title" : "30" - }, - { - "value" : "36", - "title" : "36" - }, - { - "value" : "48", - "title" : "48" - }, - { - "value" : "60", - "title" : "60" - }, - { - "value" : "72", - "title" : "72" - }, - { - "value" : "96", - "title" : "96" - } - ] + "options" : [ "", "8", "9", "10", "11", "12", "14", "18", "24", "30", "36", "48", "60", "72", "96" ] } ] }, { - "title" : "SFTP", "name" : "sftp", "fields" : [ { "name" : "enable-sftp", - "title" : "Enable SFTP", "type" : "BOOLEAN", - "options" : [{ - "value" : "true", - "title" : "true" - }] + "options" : [ "true" ] } ] } diff --git a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/telnet.json b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/telnet.json index 12f30407f..d09457114 100644 --- a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/telnet.json +++ b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/telnet.json @@ -1,122 +1,50 @@ { - "title" : "Telnet", "name" : "telnet", "forms" : [ { - "title" : "Network", "name" : "network", "fields" : [ { "name" : "hostname", - "title" : "Hostname", "type" : "TEXT" }, { "name" : "port", - "title" : "Port", "type" : "NUMERIC" } ] }, { - "title" : "Authentication", "name" : "authentication", "fields" : [ { "name" : "username", - "title" : "Username", "type" : "USERNAME" }, { "name" : "password", - "title" : "Password", "type" : "PASSWORD" }, { "name" : "password-regex", - "title" : "Password regular expression", "type" : "TEXT" } ] }, { - "title" : "Display", "name" : "display", "fields" : [ { "name" : "font-name", - "title" : "Font name", "type" : "TEXT" }, { "name" : "font-size", - "title" : "Font size", "type" : "ENUM", - "options" : [ - { - "value" : "", - "title" : "" - }, - { - "value" : "8", - "title" : "8" - }, - { - "value" : "9", - "title" : "9" - }, - { - "value" : "10", - "title" : "10" - }, - { - "value" : "11", - "title" : "11" - }, - { - "value" : "12", - "title" : "12" - }, - { - "value" : "14", - "title" : "14" - }, - { - "value" : "18", - "title" : "18" - }, - { - "value" : "24", - "title" : "24" - }, - { - "value" : "30", - "title" : "30" - }, - { - "value" : "36", - "title" : "36" - }, - { - "value" : "48", - "title" : "48" - }, - { - "value" : "60", - "title" : "60" - }, - { - "value" : "72", - "title" : "72" - }, - { - "value" : "96", - "title" : "96" - } - ] + "options" : [ "", "8", "9", "10", "11", "12", "14", "18", "24", "30", "36", "48", "60", "72", "96" ] } ] } diff --git a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/vnc.json b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/vnc.json index d91cdb2e9..a1dc13d8f 100644 --- a/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/vnc.json +++ b/guacamole-ext/src/main/resources/org/glyptodon/guacamole/protocols/vnc.json @@ -1,141 +1,81 @@ { - "title" : "VNC", "name" : "vnc", "forms" : [ { - "title" : "Network", "name" : "network", "fields" : [ { "name" : "hostname", - "title" : "Hostname", "type" : "TEXT" }, { "name" : "port", - "title" : "Port", "type" : "NUMERIC" } ] }, { - "title" : "Authentication", "name" : "authentication", "fields" : [ { "name" : "password", - "title" : "Password", "type" : "PASSWORD" } ] }, { - "title" : "Display", "name" : "display", "fields" : [ { "name" : "read-only", - "title" : "Read-only", "type" : "BOOLEAN", - "options" : [{ - "value" : "true", - "title" : "true" - }] + "options" : [ "true" ] }, { "name" : "swap-red-blue", - "title" : "Swap red/blue components", "type" : "BOOLEAN", - "options" : [{ - "value" : "true", - "title" : "true" - }] + "options" : [ "true" ] }, { "name" : "cursor", - "title" : "Cursor", "type" : "ENUM", - "options" : [ - { - "value" : "", - "title" : "" - }, - { - "value" : "local", - "title" : "Local" - }, - { - "value" : "remote", - "title" : "Remote" - } - ] + "options" : [ "", "local", "remote" ] }, { "name" : "color-depth", - "title" : "Color depth", "type" : "ENUM", - "options" : [ - { - "value" : "", - "title" : "" - }, - { - "value" : "8", - "title" : "256 color" - }, - { - "value" : "16", - "title" : "Low color (16-bit)" - }, - { - "value" : "24", - "title" : "True color (24-bit)" - }, - { - "value" : "32", - "title" : "True color (32-bit)" - } - ] + "options" : [ "", "8", "16", "24", "32" ] } ] }, { - "title" : "Repeater", "name" : "repeater", "fields" : [ { "name" : "dest-host", - "title" : "Repeater destination host", "type" : "TEXT" }, { "name" : "dest-port", - "title" : "Repeater destination port", "type" : "NUMERIC" } ] }, { - "title" : "Audio", "name" : "audio", "fields" : [ { "name" : "enable-audio", - "title" : "Enable audio", "type" : "BOOLEAN", - "options" : [{ - "value" : "true", - "title" : "true" - }] + "options" : [ "true" ] }, { "name" : "audio-servername", - "title" : "Audio server name", "type" : "TEXT" } ] diff --git a/guacamole/src/main/webapp/app/form/controllers/checkboxFieldController.js b/guacamole/src/main/webapp/app/form/controllers/checkboxFieldController.js index 830ef0d23..3f9da9534 100644 --- a/guacamole/src/main/webapp/app/form/controllers/checkboxFieldController.js +++ b/guacamole/src/main/webapp/app/form/controllers/checkboxFieldController.js @@ -29,12 +29,12 @@ angular.module('form').controller('checkboxFieldController', ['$scope', // Update typed value when model is changed $scope.$watch('model', function modelChanged(model) { - $scope.typedValue = (model === $scope.field.options[0].value); + $scope.typedValue = (model === $scope.field.options[0]); }); // Update string value in model when typed value is changed $scope.$watch('typedValue', function typedValueChanged(typedValue) { - $scope.model = (typedValue ? $scope.field.options[0].value : ''); + $scope.model = (typedValue ? $scope.field.options[0] : ''); }); }]); diff --git a/guacamole/src/main/webapp/app/form/templates/selectField.html b/guacamole/src/main/webapp/app/form/templates/selectField.html index 9df1f0769..3bd2bb876 100644 --- a/guacamole/src/main/webapp/app/form/templates/selectField.html +++ b/guacamole/src/main/webapp/app/form/templates/selectField.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/guacamole/src/main/webapp/app/rest/types/Field.js b/guacamole/src/main/webapp/app/rest/types/Field.js index d1e2b0a85..77dd8fff7 100644 --- a/guacamole/src/main/webapp/app/rest/types/Field.js +++ b/guacamole/src/main/webapp/app/rest/types/Field.js @@ -46,13 +46,6 @@ angular.module('rest').factory('Field', [function defineField() { */ this.name = template.name; - /** - * A human-readable name for this parameter. - * - * @type String - */ - this.title = template.title; - /** * The type string defining which values this parameter may contain, * as well as what properties are applicable. Valid types are listed @@ -66,7 +59,7 @@ angular.module('rest').factory('Field', [function defineField() { /** * All possible legal values for this parameter. * - * @type FieldOption[] + * @type String[] */ this.options = template.options; diff --git a/guacamole/src/main/webapp/app/rest/types/FieldOption.js b/guacamole/src/main/webapp/app/rest/types/FieldOption.js deleted file mode 100644 index 7c4f9a933..000000000 --- a/guacamole/src/main/webapp/app/rest/types/FieldOption.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2014 Glyptodon LLC - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * Service which defines the FieldOption class. - */ -angular.module('rest').factory('FieldOption', [function defineFieldOption() { - - /** - * The object returned by REST API calls when representing a single possible - * legal value of a field. - * - * @constructor - * @param {FieldOption|Object} [template={}] - * The object whose properties should be copied within the new - * FieldOption. - */ - var FieldOption = function FieldOption(template) { - - // Use empty object by default - template = template || {}; - - /** - * A human-readable name for this parameter value. - * - * @type String - */ - this.title = template.title; - - /** - * The actual value to set the parameter to, if this option is - * selected. - * - * @type String - */ - this.value = template.value; - - }; - - return FieldOption; - -}]); \ No newline at end of file diff --git a/guacamole/src/main/webapp/app/rest/types/Form.js b/guacamole/src/main/webapp/app/rest/types/Form.js index a402ccc07..d73604426 100644 --- a/guacamole/src/main/webapp/app/rest/types/Form.js +++ b/guacamole/src/main/webapp/app/rest/types/Form.js @@ -40,21 +40,13 @@ angular.module('rest').factory('Form', [function defineForm() { template = template || {}; /** - * The name which uniquely identifies this parameter, or null if this - * field has no name. + * The name which uniquely identifies this form, or null if this form + * has no name. * * @type String */ this.name = template.name; - /** - * A human-readable name for this form, or null if this form has no - * name. - * - * @type String - */ - this.title = template.title; - /** * All fields contained within this form. * diff --git a/guacamole/src/main/webapp/app/rest/types/Protocol.js b/guacamole/src/main/webapp/app/rest/types/Protocol.js index 73e66506c..fff1049d6 100644 --- a/guacamole/src/main/webapp/app/rest/types/Protocol.js +++ b/guacamole/src/main/webapp/app/rest/types/Protocol.js @@ -46,13 +46,6 @@ angular.module('rest').factory('Protocol', [function defineProtocol() { */ this.name = template.name; - /** - * A human-readable name for this protocol. - * - * @type String - */ - this.title = template.title; - /** * An array of forms containing all known parameters for this protocol, * their types, and other information.