You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2013/02/09 21:33:00 UTC

svn commit: r1444426 - in /activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console: index.html js/app.js

Author: chirino
Date: Sat Feb  9 20:33:00 2013
New Revision: 1444426

URL: http://svn.apache.org/r1444426
Log:
Optionally display the store status.

Modified:
    activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/index.html
    activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/js/app.js

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/index.html
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/index.html?rev=1444426&r1=1444425&r2=1444426&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/index.html (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/index.html Sat Feb  9 20:33:00 2013
@@ -137,7 +137,17 @@
             </div>
             {{#if App.virtual_host.store}}
             <div class="well" style="padding: 8px 8px">
-              <div class="well-title">{{App.virtual_host_store.kind}} Store Status</div>
+              <div class="well-title" {{action "toggle_show_store" target="App.VirtualHostController" on="click"}}>
+                <a>
+                {{#if App.VirtualHostController.show_store}}
+                <i class="icon-caret-down"></i>
+                {{else}}
+                <i class="icon-caret-right"></i>
+                {{/if}}
+                </a>
+                {{App.virtual_host_store.kind}} Store Status
+              </div>
+              {{#if App.VirtualHostController.show_store}}
               <table class="details table table-bordered table-striped">
                 <tbody>
                 <tr><td><strong>Location: </strong>{{App.virtual_host_store.location}}</td></tr>
@@ -199,6 +209,7 @@
                 </td></tr>
                 </tbody>
               </table>
+              {{/if}}
             </div>
             {{/if}}
           </div>

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/js/app.js
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/js/app.js?rev=1444426&r1=1444425&r2=1444426&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/js/app.js (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/js/app.js Sat Feb  9 20:33:00 2013
@@ -373,6 +373,10 @@ App.VirtualHostController = Em.ArrayCont
     }
   }.property("App.destination"),
 
+  toggle_show_store: function(event) {
+    this.set("show_store", !this.get("show_store"));
+  },
+
   auto_refresh: function() {
     if( App.MainController.get("is_virtual_hosts_selected")) {
       var dest = App.get("destination");
@@ -387,19 +391,22 @@ App.VirtualHostController = Em.ArrayCont
 
   refresh: function() {
     var selected = this.get("selected")
+    var self = this;
     if( selected ) {
       App.ajax("GET", "/broker/virtual-hosts/"+selected, function(host) {
         host.state_date = date_to_string(host.state_since);
         App.virtual_host.setProperties(host);
         if( host.store ) {
-          App.ajax("GET", "/broker/virtual-hosts/"+selected+"/store", function(store) {
-            if( App.virtual_host_store.get("kind") == store.kind) {
-              App.virtual_host_store.setProperties(store);
-            } else {
-              App.set("virtual_host_store", Ember.Object.create(store));
-            }
-          });
-        } 
+          if( self.get("show_store") ) {
+            App.ajax("GET", "/broker/virtual-hosts/"+selected+"/store", function(store) {
+              if( App.virtual_host_store.get("kind") == store.kind) {
+                App.virtual_host_store.setProperties(store);
+              } else {
+                App.set("virtual_host_store", Ember.Object.create(store));
+              }
+            });
+          }
+        }
       });
     }