diff options
| author | Keith Wall <kwall@apache.org> | 2014-07-17 10:24:52 +0000 |
|---|---|---|
| committer | Keith Wall <kwall@apache.org> | 2014-07-17 10:24:52 +0000 |
| commit | cb1fbd9ab2250ea775f7c1783339dfaf42dbd3bd (patch) | |
| tree | 56837ba3ba55b26439abd2b1318800ee612e78cc /qpid/java/broker-plugins | |
| parent | 51b062ebe177c251748f8ed6eebd1b0057552047 (diff) | |
| download | qpid-python-cb1fbd9ab2250ea775f7c1783339dfaf42dbd3bd.tar.gz | |
QPID-5413: [Java Broker] Add VHN/VH creation dialog for BDB HA.
Work completed by Andrew MacBean <macbean@apache.org> and me.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1611314 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins')
2 files changed, 70 insertions, 14 deletions
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css b/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css index eafa5f0619..2291fdf816 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/css/common.css @@ -92,7 +92,7 @@ div .messages { .formBox { border: .1em solid lightgrey; - margin: 10px 0px 20px 0px; + margin: 10px 5px; border-radius: 5px; } @@ -104,7 +104,7 @@ div .messages { } .formBox fieldset { - padding: 10px 0px 10px 0px; + padding: 5px; } .formBox .formLabel-labelCell { @@ -187,4 +187,10 @@ div .messages { background: url("../images/help.png") no-repeat; width: 16px; height: 16px; +} + +.infoMessage +{ + padding: 5px; + font-style: italic; }
\ No newline at end of file diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js index e335f51d33..1b1b2914e3 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js @@ -86,18 +86,18 @@ define(["dojo/_base/xhr", //VH Type BDB_HA_REPLICA is not user creatable. This is only needed until we have model meta data available. this.supportedVirtualHostTypes = array.filter(this.supportedVirtualHostTypes, function(item){ - return item != "BDB_HA_REPLICA"; + return item != "BDB_HA_REPLICA" && item != "BDB_HA"; }); var virtualHostNodeTypeStore = this._makeTypeStore(this.supportedVirtualHostNodeTypes); this.virtualHostNodeType.set("store", virtualHostNodeTypeStore); this.virtualHostNodeType.set("disabled", false); - this.virtualHostNodeType.on("change", function(type){that._typeChanged(type, that.virtualHostNodeTypeFieldsContainer, "qpid/management/virtualhostnode/");}); + this.virtualHostNodeType.on("change", function(type){that._vhnTypeChanged(type, that.virtualHostNodeTypeFieldsContainer, "qpid/management/virtualhostnode/");}); - var virtualHostTypeStore = this._makeTypeStore(this.supportedVirtualHostTypes); - this.virtualHostType.set("store", virtualHostTypeStore); + this.virtualHostTypeStore = this._makeTypeStore(this.supportedVirtualHostTypes); + this.virtualHostType.set("store", this.virtualHostTypeStore); this.virtualHostType.set("disabled", false); - this.virtualHostType.on("change", function(type){that._typeChanged(type, that.virtualHostTypeFieldsContainer, "qpid/management/virtualhost/");}); + this.virtualHostType.on("change", function(type){that._vhTypeChanged(type, that.virtualHostTypeFieldsContainer, "qpid/management/virtualhost/");}); }, show: function() { @@ -122,6 +122,16 @@ define(["dojo/_base/xhr", this.containerNode = null; } }, + _vhnTypeChanged: function (type, typeFieldsContainer, urlStem) + { + this._processDropDownsForBdbHa(type); + this._processDropDownsForJson(type); + this._typeChanged(type, typeFieldsContainer, urlStem); + }, + _vhTypeChanged: function (type, typeFieldsContainer, urlStem) + { + this._typeChanged(type, typeFieldsContainer, urlStem); + }, _typeChanged: function (type, typeFieldsContainer, urlStem) { var widgets = registry.findWidgets(typeFieldsContainer); @@ -146,6 +156,52 @@ define(["dojo/_base/xhr", ); } }, + _processDropDownsForBdbHa: function (type) + { + if (type == "BDB_HA") + { + this.virtualHostType.set("disabled", true); + if (!this.virtualHostTypeStore.get("BDB_HA")) + { + this.virtualHostTypeStore.add({id: "BDB_HA", name: "BDB_HA"}); + } + this.virtualHostType.set("value", "BDB_HA"); + } + else + { + if (this.virtualHostType.value == "BDB_HA") + { + if (this.virtualHostTypeStore.get("BDB_HA")) + { + this.virtualHostTypeStore.remove("BDB_HA"); + } + this.virtualHostType.set("value", ""); + } + this.virtualHostType.set("disabled", false); + } + }, + _processDropDownsForJson: function (type) + { + if (type == "JSON") + { + if (this.virtualHostType.value == "ProvidedStore") + { + this.virtualHostType.set("value", ""); + } + + if (this.virtualHostTypeStore.get("ProvidedStore")) + { + this.virtualHostTypeStore.remove("ProvidedStore"); + } + } + else + { + if (!this.virtualHostTypeStore.get("ProvidedStore")) + { + this.virtualHostTypeStore.add({id: "ProvidedStore", name: "ProvidedStore"}); + } + } + }, _cancel: function(e) { this.dialog.hide(); @@ -164,12 +220,6 @@ define(["dojo/_base/xhr", var virtualHostNodeData = this._getValues(this.virtualHostNodeForm); var virtualHostData = this._getValues(this.virtualHostForm); - if (virtualHostNodeData["type"] == "JSON" && virtualHostData["type"] == "ProvidedStore") - { - alert('Cannot use a JSON Virtual Host Node with a ProvidedStore Virtual Host'); - return; - } - //Default the VH name to be the same as the VHN name. virtualHostData["name"] = virtualHostNodeData["name"]; @@ -184,7 +234,7 @@ define(["dojo/_base/xhr", error: function(error) {success = false; failureReason = error;} }); - if(success === true) + if(success === true && virtualHostNodeData["type"] != "BDB_HA") { var encodedVirtualHostName = encodeURIComponent(virtualHostData.name); xhr.put({ |
