diff options
8 files changed, 49 insertions, 18 deletions
diff --git a/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb/show.js b/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb/show.js index 704f7a197c..b38d7eddc0 100644 --- a/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb/show.js +++ b/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb/show.js @@ -31,8 +31,10 @@ define(["dojo/_base/xhr", "dojo/domReady!"], function (xhr, lang, connect, parser, json, entities, query, json, registry, UpdatableStore) { - function BdbNode(containerNode) + function BdbNode(data) { + var containerNode = data.containerNode; + this.parent = data.parent; var that = this; xhr.get({url: "virtualhostnode/bdb/show.html", sync: true, diff --git a/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js b/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js index 49501990ca..c4ac3f3d91 100644 --- a/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js +++ b/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js @@ -34,6 +34,7 @@ define(["dojo/_base/xhr", "dojo/domReady!"], function (xhr, lang, connect, parser, json, entities, query, json, registry, EnhancedGrid, UpdatableStore, UserPreferences, edit) { + var priorityNames = {'_0': 'Never', '_1': 'Default', '_2': 'Normal', '_3': 'High'}; var nodeFields = ["storePath", "groupName", "role", "address", "coalescingSync", "designatedPrimary", "durability", "priority", "quorumOverride"]; function findNode(nodeClass, containerNode) @@ -79,9 +80,13 @@ define(["dojo/_base/xhr", { alert("Error:" + failureReason); } + return success; } - function BDBHA(containerNode) { + function BDBHA(data) + { + var containerNode = data.containerNode; + this.parent = data.parent; var that = this; xhr.get({url: "virtualhostnode/bdb_ha/show.html", sync: true, @@ -186,8 +191,10 @@ define(["dojo/_base/xhr", { if (confirm("Deletion of virtual host node will delete both configuration and message data.\n\n Are you sure you want to delete virtual host node?")) { - sendRequest(that.data.name, that.data.name, "DELETE"); - // TODO: close tab + if (sendRequest(that.data.name, that.data.name, "DELETE")) + { + that.parent.destroy(); + } } } ); @@ -200,7 +207,18 @@ define(["dojo/_base/xhr", for(var i = 0; i < nodeFields.length; i++) { var name = nodeFields[i]; - this[name].innerHTML = entities.encode(String(data[name])); + if (name == "priority") + { + this[name].innerHTML = priorityNames["_" + data[name]]; + } + else if (name == "quorumOverride") + { + this[name].innerHTML = (data[name] == 0 ? "MAJORITY" : entities.encode(String(data[name]))); + } + else + { + this[name].innerHTML = entities.encode(String(data[name])); + } } this._updateGrid(this._convertConfig(data.environmentConfiguration), this.environmentConfigurationPanel, this.environmentConfigurationGrid ); @@ -233,7 +251,6 @@ define(["dojo/_base/xhr", this.priorityContainer.style.display="block"; this.quorumOverrideContainer.style.display="block"; } - this.deleteNodeButton.set("disabled", data.role=="MASTER"); }; BDBHA.prototype._updateGrid=function(conf, panel, updatableGrid) diff --git a/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/show.html b/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/show.html index 18da913948..579ec12608 100644 --- a/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/show.html +++ b/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/show.html @@ -55,7 +55,6 @@ <div class="formLabel-labelCell" style="float:left; width: 200px;">Required minimum number of nodes:</div> <div style="float:left;"> <span class="quorumOverride" >N/A</span> - <span style="margin-left: 20px;">[ 0 signifies simple majority ]</span> </div> </div> <div style="clear:both"></div> @@ -73,7 +72,7 @@ <button data-dojo-type="dijit.form.Button" class="startNodeButton" type="button" data-dojo-props="disabled: true">Start</button> <button data-dojo-type="dijit.form.Button" class="stopNodeButton" type="button" data-dojo-props="disabled: true">Stop</button> <button data-dojo-type="dijit.form.Button" class="editNodeButton" type="button">Edit</button> - <button data-dojo-type="dijit.form.Button" class="deleteNodeButton" data-dojo-props="iconClass: 'dijitIconDelete', disabled: true">Delete Node</button> + <button data-dojo-type="dijit.form.Button" class="deleteNodeButton" data-dojo-props="iconClass: 'dijitIconDelete'">Delete Node</button> </div> <br/> diff --git a/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhostnode/derby/show.js b/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhostnode/derby/show.js index d72b41d0c4..5272e76e4c 100644 --- a/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhostnode/derby/show.js +++ b/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhostnode/derby/show.js @@ -29,8 +29,10 @@ define(["dojo/_base/xhr", "dojo/domReady!"], function (xhr, lang, connect, parser, json, entities, query, json) { - function DerbyNode(containerNode) + function DerbyNode(data) { + var containerNode = data.containerNode; + this.parent = data.parent; var that = this; xhr.get({url: "virtualhostnode/derby/show.html", sync: true, diff --git a/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js b/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js index 20637da6c2..eb58b3e7c7 100644 --- a/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js +++ b/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js @@ -31,8 +31,10 @@ define(["dojo/_base/xhr", { var fieldNames = ["connectionUrl", "bigIntType", "varBinaryType", "blobType", "bytesForBlob", "connectionPoolType"]; - function JdbcNode(containerNode) + function JdbcNode(data) { + var containerNode = data.containerNode; + this.parent = data.parent; var that = this; xhr.get({url: "virtualhostnode/jdbc/show.html", sync: true, diff --git a/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js index e2cd763fba..b608663512 100644 --- a/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js +++ b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js @@ -57,7 +57,7 @@ define(["dojo/_base/xhr", contentPane.containerNode.innerHTML = data; parser.parse(contentPane.containerNode); - that.vhostNodeUpdater = new Updater(contentPane.containerNode, that.modelObj, that.controller); + that.vhostNodeUpdater = new Updater(contentPane.containerNode, that.modelObj, that); that.vhostNodeUpdater.update(); updater.add( that.vhostNodeUpdater ); @@ -70,13 +70,22 @@ define(["dojo/_base/xhr", updater.remove( this.vhostNodeUpdater ); }; - function Updater(node, vhost, controller) + VirtualHostNode.prototype.destroy = function() { + this.close(); + this.contentPane.onClose() + this.controller.tabContainer.removeChild(this.contentPane); + this.contentPane.destroyRecursive(); + } + + function Updater(domNode, nodeObject, virtualHostNode) + { + this.virtualHostNode = virtualHostNode; var that = this; function findNode(name) { - return query("." + name, node)[0]; + return query("." + name, domNode)[0]; } function storeNodes(names) @@ -90,7 +99,7 @@ define(["dojo/_base/xhr", storeNodes(["name", "state", "type", "messageStoreProviderYes","messageStoreProviderNo"]); this.detailsDiv = findNode("virtualhostnodedetails"); - this.query = "api/latest/virtualhostnode/" + encodeURIComponent(vhost.name); + this.query = "api/latest/virtualhostnode/" + encodeURIComponent(nodeObject.name); } Updater.prototype.update = function() @@ -117,7 +126,7 @@ define(["dojo/_base/xhr", require(["qpid/management/virtualhostnode/" + data.type.toLowerCase() + "/show"], function(VirtualHostNodeDetails) { - that.details = new VirtualHostNodeDetails(that.detailsDiv); + that.details = new VirtualHostNodeDetails({containerNode:that.detailsDiv, parent: that.virtualHostNode}); that.details.update(data); } ); diff --git a/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js index 3b65ffaacf..06faf3c9da 100644 --- a/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js +++ b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js @@ -229,8 +229,6 @@ define(["dojo/_base/xhr", details[ type ] = object.name; details.parent = parent; } else { - details[ type ] = object.name; - var parentObject ={ type: type, name: object.name diff --git a/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhostnode/json/show.js b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhostnode/json/show.js index e912cf2fb0..bbff43c706 100644 --- a/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhostnode/json/show.js +++ b/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhostnode/json/show.js @@ -29,8 +29,10 @@ define(["dojo/_base/xhr", "dojo/domReady!"], function (xhr, lang, connect, parser, json, entities, query, json) { - function JsonNode(containerNode) + function JsonNode(data) { + var containerNode = data.containerNode; + this.parent = data.parent; var that = this; xhr.get({url: "virtualhostnode/json/show.html", sync: true, |