qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject svn commit: r1593252 - in /qpid/trunk/qpid/java: bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb/ bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/ bdbstore/src/main/java/resources/virtualhostnode/bdb_h...
Date Thu, 08 May 2014 12:33:15 GMT
Author: orudyy
Date: Thu May  8 12:33:14 2014
New Revision: 1593252

URL: http://svn.apache.org/r1593252
Log:
QPID-5413: Add functionality to close the deleted tab of virtual host node.
           Display user friendly values for BDB HA VHN priority and quorum override
           Fix tree view

Modified:
    qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb/show.js
    qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js
    qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/show.html
    qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhostnode/derby/show.js
    qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js
    qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhostnode/json/show.js

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb/show.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb/show.js?rev=1593252&r1=1593251&r2=1593252&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb/show.js
(original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb/show.js
Thu May  8 12:33:14 2014
@@ -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,

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js?rev=1593252&r1=1593251&r2=1593252&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js
(original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/resources/js/qpid/management/virtualhostnode/bdb_ha/show.js
Thu May  8 12:33:14 2014
@@ -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)

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/show.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/show.html?rev=1593252&r1=1593251&r2=1593252&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/show.html
(original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/resources/virtualhostnode/bdb_ha/show.html
Thu May  8 12:33:14 2014
@@ -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/>

Modified: qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhostnode/derby/show.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhostnode/derby/show.js?rev=1593252&r1=1593251&r2=1593252&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhostnode/derby/show.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/resources/js/qpid/management/virtualhostnode/derby/show.js
Thu May  8 12:33:14 2014
@@ -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,

Modified: qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js?rev=1593252&r1=1593251&r2=1593252&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/resources/js/qpid/management/virtualhostnode/jdbc/show.js
Thu May  8 12:33:14 2014
@@ -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,

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js?rev=1593252&r1=1593251&r2=1593252&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js
Thu May  8 12:33:14 2014
@@ -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);
                  }
                );

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js?rev=1593252&r1=1593251&r2=1593252&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js
Thu May  8 12:33:14 2014
@@ -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

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhostnode/json/show.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhostnode/json/show.js?rev=1593252&r1=1593251&r2=1593252&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhostnode/json/show.js
(original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhostnode/json/show.js
Thu May  8 12:33:14 2014
@@ -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,



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message