qpid-broker-j git commit: QPID-7781: [Java Broker] Move Add Virtual Host into Virtual Host panel and add Virtual Host delete button

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

qpid-broker-j git commit: QPID-7781: [Java Broker] Move Add Virtual Host into Virtual Host panel and add Virtual Host delete button

orudyy
Repository: qpid-broker-j
Updated Branches:
  refs/heads/master 4f43a9bc7 -> a946173df


QPID-7781: [Java Broker] Move Add Virtual Host into Virtual Host panel and add Virtual Host delete button


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/a946173d
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/a946173d
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/a946173d

Branch: refs/heads/master
Commit: a946173df9c08036c9504d07758f6b2085b083b9
Parents: 4f43a9b
Author: Alex Rudyy <[hidden email]>
Authored: Fri Aug 11 11:51:07 2017 +0100
Committer: Alex Rudyy <[hidden email]>
Committed: Fri Aug 11 11:51:19 2017 +0100

----------------------------------------------------------------------
 .../js/qpid/management/VirtualHostNode.js       | 33 +++++++++++++++++---
 .../java/resources/showVirtualHostNode.html     |  5 +--
 2 files changed, 32 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a946173d/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js
index 84a6f3e..9f2e5e1 100644
--- a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js
+++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHostNode.js
@@ -88,7 +88,6 @@ define(["dojo/parser",
             this.startNodeButton = registry.byNode(query(".startNodeButton", containerNode)[0]);
             this.editNodeButton = registry.byNode(query(".editNodeButton", containerNode)[0]);
             this.deleteNodeButton = registry.byNode(query(".deleteNodeButton", containerNode)[0]);
-            this.virtualHostGridPanel = registry.byNode(query(".virtualHostGridPanel", containerNode)[0]);
             this.addVirtualHostButton = registry.byNode(query(".addVHButton", containerNode)[0]);
             this.addVirtualHostButton.on("click", lang.hitch(this, function ()
             {
@@ -107,7 +106,31 @@ define(["dojo/parser",
                     }
                 }));
             }));
-            this.addVirtualHostButton.domNode.style.display = "none";
+
+            this.deleteVirtualHostButton = registry.byNode(query(".deleteVHButton", containerNode)[0]);
+            this.deleteVirtualHostButton.on("click", lang.hitch(this, function ()
+            {
+                if (confirm("Deletion of virtual host will delete messages.\n\n"
+                            + "Are you sure you want to proceed with delete operation?"))
+                {
+                    var modeData = this.vhostNodeUpdater.nodeData;
+                    if (modeData.virtualhosts)
+                    {
+                        var modelObj = virtualHostModelObect = {
+                            name: modeData.virtualhosts[0].name,
+                            type: "virtualhost",
+                            parent: this.modelObj
+                        };
+
+                        this.management.remove(modelObj)
+                            .then(lang.hitch(this, function (result)
+                            {
+                                this.vhostNodeUpdater.update();
+                            }));
+                    }
+                }
+            }));
+
             this.deleteNodeButton.on("click", function (e)
             {
                 if (confirm("Deletion of virtual host node will delete both configuration and message data.\n\n"
@@ -289,9 +312,11 @@ define(["dojo/parser",
                 this.details.update(data);
             }
 
-            this.tabObject.virtualHostGridPanel.domNode.style.display = data.virtualhosts ? "block" : "none";
             util.updateUpdatableStore(this.tabObject.vhostsGrid, data.virtualhosts);
-            this.tabObject.addVirtualHostButton.domNode.style.display =data.virtualhosts ? "none" : "";
+
+            var virtualHostExists = !!data.virtualhosts;
+            this.tabObject.addVirtualHostButton.set("disabled", virtualHostExists);
+            this.tabObject.deleteVirtualHostButton.set("disabled", !virtualHostExists);
         };
 
         return VirtualHostNode;

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/a946173d/broker-plugins/management-http/src/main/java/resources/showVirtualHostNode.html
----------------------------------------------------------------------
diff --git a/broker-plugins/management-http/src/main/java/resources/showVirtualHostNode.html b/broker-plugins/management-http/src/main/java/resources/showVirtualHostNode.html
index cafdbb5..f228b26 100644
--- a/broker-plugins/management-http/src/main/java/resources/showVirtualHostNode.html
+++ b/broker-plugins/management-http/src/main/java/resources/showVirtualHostNode.html
@@ -47,11 +47,12 @@
       <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" data-dojo-props="disabled: true">Edit</button>
       <button data-dojo-type="dijit.form.Button" class="deleteNodeButton" data-dojo-props="iconClass: 'dijitIconDelete'">Delete</button>
-      <button data-dojo-type="dijit.form.Button" class="addVHButton" type="button" >Add Virtual Host</button>
     </div>
     <br/>
-    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Virtual Host'" class="clear virtualHostGridPanel">
+    <div data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Virtual Host'" class="clear">
         <div class="virtualHost"></div>
+        <button data-dojo-type="dijit.form.Button" class="addVHButton" data-dojo-props="disabled: true">Add</button>
+        <button data-dojo-type="dijit.form.Button" class="deleteVHButton" data-dojo-props="disabled: true">Delete</button>
     </div>
 </div>
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...