summaryrefslogtreecommitdiff
path: root/qpid/java/broker-plugins
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2013-03-31 21:45:08 +0000
committerRobert Gemmell <robbie@apache.org>2013-03-31 21:45:08 +0000
commit32a75682236f06ad5bf4c9b2fb5a1980b882ca67 (patch)
tree8150f49e662ba6b01195d9e64ed214d309981c59 /qpid/java/broker-plugins
parentfaeeb12b58e688c6ef6ab91849d8033d17424d3e (diff)
downloadqpid-python-32a75682236f06ad5bf4c9b2fb5a1980b882ca67.tar.gz
QPID-4657, QPID-4683: review changes for new port configuration functionality
- Fix ability to select SSL for a port - Add ability to set SSL Client Auth attributes for a port - Enforce that you have SSL keystores/trustures in place when creating new ports that will fail to work without them - Update names and placeholder text in UI to convey what happens when you dont fill out an optional attribute. - Remove the default AMQP port value in form, makes the user specify port and avoid near definite clash. - Removed requirement to specify Transport since it is actually optional. - Ensure the port state is set accurately for newly added ports - Fix the ability to override the management ports in ManagementMode - Allow editing the management ports in Management Mode without having to override them first. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1463060 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins')
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html32
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js79
2 files changed, 89 insertions, 22 deletions
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html
index fddd52138b..2f49ab1448 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html
@@ -22,20 +22,20 @@
<div data-dojo-type="dijit.Dialog" style="width:600px;" data-dojo-props="title:'Port'" id="addPort">
<form id="formAddPort" method="post" dojoType="dijit.form.Form">
<div id="formAddPort:fields">
- <input type="text" required="true" name="name" id="formAddPort.name" placeholder="Port Name"
- data-dojo-props="label: 'Port Name*:'" dojoType="dijit.form.ValidationTextBox"
+ <input type="text" required="true" name="name" id="formAddPort.name" placeholder="Name"
+ data-dojo-props="label: 'Name*:'" dojoType="dijit.form.ValidationTextBox"
missingMessage="A name must be supplied" />
- <input data-dojo-type="dijit.form.NumberSpinner" id="formAddPort.port" data-dojo-props="label: 'Port*:'"
- name="port" value="5672" smallDelta="1" constraints="{min:1,max:65535,places:0, pattern: '#####'}" />
- <select id="formAddPort.transport" data-dojo-type="dijit.form.FilteringSelect"
- data-dojo-props="name: 'transport',label: 'Transport:',searchAttr: 'name',required:false,placeHolder: 'Select Transports', value: '' "
+ <input data-dojo-type="dijit.form.NumberSpinner" id="formAddPort.port" required="true" data-dojo-props="label: 'Port Number*:'"
+ name="port" smallDelta="1" constraints="{min:1,max:65535,places:0, pattern: '#####'}"
+ missingMessage="A port number must be supplied" />
+ <select id="formAddPort.transports" data-dojo-type="dijit.form.FilteringSelect"
+ data-dojo-props="name: 'transports',label: 'Transport:',searchAttr: 'name',required:false,placeHolder: 'TCP', value: '' "
style="margin: 0;">
<option value="TCP">TCP</option>
<option value="SSL">SSL</option>
</select>
<select id="formAddPort.authenticationProvider" data-dojo-type="dijit.form.FilteringSelect" style="margin: 0;"
- data-dojo-props="name:'authenticationProvider',label:'Authentication Provider:', searchAttr: 'name', required: false, placeHolder: 'Select Authentication', value: '' "
- missingMessage="Transport must be supplied">
+ data-dojo-props="name:'authenticationProvider',label:'Authentication Provider:', searchAttr: 'name', required: false, placeHolder: 'Default', value: '' ">
</select>
<select id="formAddPort.type" data-dojo-type="dijit.form.FilteringSelect"
data-dojo-props="name: 'type', value: '',placeHolder: 'Select Port Type', label: 'Port Type:'">
@@ -44,13 +44,19 @@
<option value="HTTP">HTTP</option>
</select>
</div>
+ <div id="formAddPort:fieldsClientAuth">
+ <input id="formAddPort.needClientAuth" type="checkbox" name="needClientAuth"
+ dojoType="dijit.form.CheckBox" data-dojo-props="label: 'Need SSL Client Certificate:'"/>
+ <input id="formAddPort.wantClientAuth" type="checkbox" name="wantClientAuth"
+ dojoType="dijit.form.CheckBox" data-dojo-props="label: 'Want SSL Client Certificate:'"/>
+ </div>
<div id="formAddPort:fieldsAMQP">
- <input id="formAddPort.bindingAddress" type="text" name="bindingAddress"
+ <input id="formAddPort.bindingAddress" type="text" name="bindingAddress" placeholder="*"
dojoType="dijit.form.TextBox" data-dojo-props="label: 'Binding address:'"/>
<input id="formAddPort.protocolsDefault" type="checkbox" name="protocolsDefault" checked="checked"
- dojoType="dijit.form.CheckBox" data-dojo-props="label: 'Use broker default AMQP protocols:'"/>
+ dojoType="dijit.form.CheckBox" data-dojo-props="label: 'Support broker default AMQP versions:'"/>
<select id="formAddPort.protocolsAMQP" name="protocols" data-dojo-type="dijit.form.MultiSelect" multiple="true"
- data-dojo-props="name: 'protocols', value: '', placeHolder: 'Select Protocols', label: 'AMQP protocols:'"
+ data-dojo-props="name: 'protocols', value: '', placeHolder: 'Select AMQP versions', label: 'AMQP versions:'"
missingMessage="AMQP protocol(s) must be supplied">
<option value="AMQP_0_8">AMQP 0.8</option>
<option value="AMQP_0_9">AMQP 0.9</option>
@@ -61,14 +67,14 @@
</div>
<div id="formAddPort:fieldsJMX">
<select id="formAddPort.protocolsJMX" name="protocols" data-dojo-type="dijit.form.FilteringSelect"
- data-dojo-props="name: 'protocols', value: '', label: 'JMX protocols*:'" missingMessage="JMX protocol must be supplied">
+ data-dojo-props="name: 'protocols', value: '', label: 'JMX protocol*:'" missingMessage="JMX protocol must be supplied">
<option value="RMI">RMI</option>
<option value="JMX_RMI">JMX RMI</option>
</select>
</div>
<div id="formAddPort:fieldsHTTP">
<select id="formAddPort.protocolsHTTP" name="protocols" data-dojo-type="dijit.form.FilteringSelect"
- data-dojo-props="name: 'protocols', value: '', label: 'HTTP protocols*:'" missingMessage="HTTP protocol must be supplied">
+ data-dojo-props="name: 'protocols', value: '', label: 'HTTP protocol*:'" missingMessage="HTTP protocol must be supplied">
<option value="HTTP">HTTP</option>
<option value="HTTPS">HTTPS</option>
</select>
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js
index dec04e604e..4d1e268d4d 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js
@@ -75,8 +75,7 @@ define(["dojo/_base/xhr",
{
continue;
}
-
- if (propName === "protocols")
+ else if (propName === "protocols")
{
var val = formValues[propName];
if (!lang.isArray(val))
@@ -85,6 +84,21 @@ define(["dojo/_base/xhr",
}
newPort[ propName ] = val;
}
+ else if (propName === "transports")
+ {
+ var val = formValues[propName];
+
+ if(val === "")
+ {
+ continue;
+ }
+
+ if (!lang.isArray(val))
+ {
+ val = [ val ];
+ }
+ newPort[ propName ] = val;
+ }
else if(formValues[ propName ] !== "")
{
newPort[ propName ] = formValues[propName];
@@ -92,6 +106,18 @@ define(["dojo/_base/xhr",
}
}
+
+ var needClientAuth = dijit.byId("formAddPort.needClientAuth");
+ var wantClientAuth = dijit.byId("formAddPort.wantClientAuth");
+ if(!needClientAuth.disabled)
+ {
+ newPort.needClientAuth = needClientAuth.checked;
+ }
+ if(!wantClientAuth.disabled)
+ {
+ newPort.wantClientAuth = wantClientAuth.checked;
+ }
+
return newPort;
};
@@ -115,26 +141,41 @@ define(["dojo/_base/xhr",
registry.byId("formAddPort.protocols" + option.value).set("disabled", true);
registry.byId("formAddPort:fields" + option.value).domNode.style.display = "none";
});
+
+ if ("AMQP" == newValue)
+ {
+ registry.byId("formAddPort:fieldsClientAuth").domNode.style.display = "block";
+ registry.byId("formAddPort.needClientAuth").set("disabled", false);
+ registry.byId("formAddPort.wantClientAuth").set("disabled", false);
+ }
+ else
+ {
+ registry.byId("formAddPort:fieldsClientAuth").domNode.style.display = "none";
+ registry.byId("formAddPort.needClientAuth").set("checked", false);
+ registry.byId("formAddPort.wantClientAuth").set("checked", false);
+ registry.byId("formAddPort.needClientAuth").set("disabled", true);
+ registry.byId("formAddPort.wantClientAuth").set("disabled", true);
+ }
+
registry.byId("formAddPort:fields" + newValue).domNode.style.display = "block";
var defaultsAMQPProtocols = registry.byId("formAddPort.protocolsDefault");
defaultsAMQPProtocols.set("disabled", "AMQP" != newValue)
var protocolsWidget = registry.byId("formAddPort.protocols" + newValue);
- var transportWidget = registry.byId("formAddPort.transport");
if (protocolsWidget)
{
if ("AMQP" == newValue && defaultsAMQPProtocols.checked)
{
protocolsWidget.set("disabled", true);
- transportWidget.set("required", false);
}
else
{
- // the transport has to be set for a management port
- // disabling the default option
- transportWidget.set("required", true);
protocolsWidget.set("disabled", false);
}
- transportWidget.startup();
+ }
+ var transportsWidget = registry.byId("formAddPort.transports");
+ if (transportsWidget)
+ {
+ transportsWidget.startup();
}
});
theForm = registry.byId("formAddPort");
@@ -186,6 +227,14 @@ define(["dojo/_base/xhr",
customClass: "formLabel"
}, dom.byId("formAddPort:fields"));
addPort.fields.startup();
+ addPort.fieldsClientAuth = new dojox.layout.TableContainer( {
+ cols: 1,
+ labelWidth: labelWidthValue,
+ showLabels: true,
+ orientation: "horiz",
+ customClass: "formLabel"
+ }, dom.byId("formAddPort:fieldsClientAuth"));
+ addPort.fieldsClientAuth.startup();
addPort.fieldsAMQP = new dojox.layout.TableContainer( {
cols: 1,
labelWidth: labelWidthValue,
@@ -240,7 +289,7 @@ define(["dojo/_base/xhr",
nameField.set("disabled", true);
dom.byId("formAddPort.id").value=port.id;
providerWidget.set("value", port.authenticationProvider ? port.authenticationProvider : "");
- registry.byId("formAddPort.transport").set("value", port.transports ? port.transports[0] : "");
+ registry.byId("formAddPort.transports").set("value", port.transports ? port.transports[0] : "");
registry.byId("formAddPort.port").set("value", port.port);
var protocols = port.protocols;
var typeWidget = registry.byId("formAddPort.type");
@@ -250,6 +299,12 @@ define(["dojo/_base/xhr",
registry.byId("formAddPort:fields" + option.value).domNode.style.display = "none";
});
+ registry.byId("formAddPort.needClientAuth").set("checked", false);
+ registry.byId("formAddPort.wantClientAuth").set("checked", false);
+ registry.byId("formAddPort.needClientAuth").set("disabled", true);
+ registry.byId("formAddPort.wantClientAuth").set("disabled", true);
+ registry.byId("formAddPort:fieldsClientAuth").domNode.style.display = "none";
+
// identify the type of port using first protocol specified in protocol field if provided
if ( !protocols || protocols.length == 0 || protocols[0].indexOf("AMQP") == 0)
{
@@ -270,6 +325,12 @@ define(["dojo/_base/xhr",
defaultProtocolsWidget.set("checked", true);
amqpProtocolsWidget.set("disabled", true)
}
+
+ registry.byId("formAddPort.needClientAuth").set("disabled", false);
+ registry.byId("formAddPort.wantClientAuth").set("disabled", false);
+ registry.byId("formAddPort.needClientAuth").set("checked", port.needClientAuth);
+ registry.byId("formAddPort.wantClientAuth").set("checked", port.wantClientAuth);
+ registry.byId("formAddPort:fieldsClientAuth").domNode.style.display = "block";
}
else if (protocols[0].indexOf("RMI") != -1)
{