mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-09 22:51:22 +00:00
GUAC-1160: Generalize parameters into fields. Depend on title in field.
This commit is contained in:
@@ -21,20 +21,20 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Service which defines the ProtocolParameter class.
|
||||
* Service which defines the Field class.
|
||||
*/
|
||||
angular.module('rest').factory('ProtocolParameter', [function defineProtocolParameter() {
|
||||
angular.module('rest').factory('Field', [function defineField() {
|
||||
|
||||
/**
|
||||
* The object returned by REST API calls when representing the data
|
||||
* associated with a configuration parameter of a remote desktop protocol.
|
||||
*
|
||||
* @constructor
|
||||
* @param {ProtocolParameter|Object} [template={}]
|
||||
* @param {Field|Object} [template={}]
|
||||
* The object whose properties should be copied within the new
|
||||
* ProtocolParameter.
|
||||
* Field.
|
||||
*/
|
||||
var ProtocolParameter = function ProtocolParameter(template) {
|
||||
var Field = function Field(template) {
|
||||
|
||||
// Use empty object by default
|
||||
template = template || {};
|
||||
@@ -56,12 +56,12 @@ angular.module('rest').factory('ProtocolParameter', [function defineProtocolPara
|
||||
/**
|
||||
* The type string defining which values this parameter may contain,
|
||||
* as well as what properties are applicable. Valid types are listed
|
||||
* within ProtocolParameter.Type.
|
||||
* within Field.Type.
|
||||
*
|
||||
* @type String
|
||||
* @default ProtocolParameter.Type.TEXT
|
||||
* @default Field.Type.TEXT
|
||||
*/
|
||||
this.type = template.type || ProtocolParameter.Type.TEXT;
|
||||
this.type = template.type || Field.Type.TEXT;
|
||||
|
||||
/**
|
||||
* The value to set the parameter to, in the case of a BOOLEAN
|
||||
@@ -75,7 +75,7 @@ angular.module('rest').factory('ProtocolParameter', [function defineProtocolPara
|
||||
* All possible legal values for this parameter. This property is only
|
||||
* applicable to ENUM type parameters.
|
||||
*
|
||||
* @type ProtocolParameterOption[]
|
||||
* @type FieldOption[]
|
||||
*/
|
||||
this.options = template.options;
|
||||
|
||||
@@ -84,7 +84,7 @@ angular.module('rest').factory('ProtocolParameter', [function defineProtocolPara
|
||||
/**
|
||||
* All valid protocol parameter types.
|
||||
*/
|
||||
ProtocolParameter.Type = {
|
||||
Field.Type = {
|
||||
|
||||
/**
|
||||
* The type string associated with parameters that may contain a single
|
||||
@@ -147,6 +147,6 @@ angular.module('rest').factory('ProtocolParameter', [function defineProtocolPara
|
||||
|
||||
};
|
||||
|
||||
return ProtocolParameter;
|
||||
return Field;
|
||||
|
||||
}]);
|
@@ -21,20 +21,20 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Service which defines the ProtocolParameterOption class.
|
||||
* Service which defines the FieldOption class.
|
||||
*/
|
||||
angular.module('rest').factory('ProtocolParameterOption', [function defineProtocolParameterOption() {
|
||||
angular.module('rest').factory('FieldOption', [function defineFieldOption() {
|
||||
|
||||
/**
|
||||
* The object returned by REST API calls when representing a single possible
|
||||
* legal value of a configuration parameter of a remote desktop protocol.
|
||||
*
|
||||
* @constructor
|
||||
* @param {ProtocolParameterOption|Object} [template={}]
|
||||
* @param {FieldOption|Object} [template={}]
|
||||
* The object whose properties should be copied within the new
|
||||
* ProtocolParameterOption.
|
||||
* FieldOption.
|
||||
*/
|
||||
var ProtocolParameterOption = function ProtocolParameterOption(template) {
|
||||
var FieldOption = function FieldOption(template) {
|
||||
|
||||
// Use empty object by default
|
||||
template = template || {};
|
||||
@@ -56,6 +56,6 @@ angular.module('rest').factory('ProtocolParameterOption', [function defineProtoc
|
||||
|
||||
};
|
||||
|
||||
return ProtocolParameterOption;
|
||||
return FieldOption;
|
||||
|
||||
}]);
|
@@ -57,7 +57,7 @@ angular.module('rest').factory('Protocol', [function defineProtocol() {
|
||||
* An array of all known parameters for this protocol, their types,
|
||||
* and other information.
|
||||
*
|
||||
* @type ProtocolParameter[]
|
||||
* @type Field[]
|
||||
* @default []
|
||||
*/
|
||||
this.parameters = template.parameters || [];
|
||||
|
Reference in New Issue
Block a user