activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1429843 - in /activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console: index.html js/app.js
Date Mon, 07 Jan 2013 15:26:32 GMT
Author: chirino
Date: Mon Jan  7 15:26:31 2013
New Revision: 1429843

URL: http://svn.apache.org/viewvc?rev=1429843&view=rev
Log:
Show destination details when you click on one.

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=1429843&r1=1429842&r2=1429843&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 Mon Jan 
7 15:26:31 2013
@@ -112,7 +112,7 @@
                   <div class="well-title">Details</div>
                   <table class="details table table-bordered table-striped">
                     <tbody>
-                    <tr><td><strong>Up time: </strong>{{App.virtual_host.state_since}}</td></tr>
+                    <tr><td><strong>Up time: </strong>{{App.virtual_host.state_date}}</td></tr>
                     <tr><td><strong>Host Names: </strong>
                       <ul>
                       {{#each App.virtual_host.host_names}}
@@ -152,7 +152,7 @@
                       <th>Consumers</th>
                     </tr>
                     {{#each App.DestinationsController}}
-                    <tr>
+                    <tr {{action "select" . target="App.DestinationsController" on="click"}}>
                       <td>{{view Ember.Checkbox checkedBinding="checked"}}</td>
                       <td><i class=" icon-zoom-in"></i> {{[0]}}</td><td>{{[1]}}</td><td>{{[2]}}</td><td>{{[3]}}</td><td>{{[4]}}</td>
                     </tr>
@@ -165,6 +165,98 @@
                   </div>
               </div>
             </div>
+            {{#if App.destination}}
+            <div class="row">
+                <div class="span12" style="font-size:170%; padding:0.5em;">
+                  <strong>{{App.DestinationsController.kind_label}}:</strong>
{{App.destination.id}}
+                </div>
+                <div class="span4">
+                  <div class="well" style="padding: 8px 8px">
+                    <div class="well-title">Details</div>
+                    <table class="details table table-bordered table-striped">
+                      <tbody>
+                      <tr><td><strong>Up time: </strong>{{App.destination.state_date}}</td></tr>
+                      {{#if App.destination.selector}}
+                      <tr><td><strong>Selector: </strong>{{App.destination.selector}}</td></tr>
+                      {{/if}}
+                      <tr><td><strong>Queue Size: </strong>{{App.destination.metrics.queue_items}}
messages</td></tr>
+                      <tr><td><strong>Enqueued: </strong>{{App.destination.metrics.enqueue_item_counter}}
items /{{App.destination.metrics.enqueue_size_counter}} bytes {{App.destination.metrics.enqueue_date}}
ago</td></tr>
+                      <tr><td><strong>Dequeued: </strong>{{App.destination.metrics.dequeue_item_counter}}
/{{App.destination.metrics.dequeue_size_counter}} bytes {{App.destination.metrics.dequeue_date}}
ago</td></tr>
+                      <tr><td><strong>Nacked: </strong>{{App.destination.metrics.nack_item_counter}}
/{{App.destination.metrics.nack_size_counter}} bytes {{App.destination.metrics.nack_date}}
ago</td></tr>
+                      <tr><td><strong>Expired: </strong>{{App.destination.metrics.expired_item_counter}}
/{{App.destination.metrics.expired_size_counter}} bytes {{App.destination.metrics.expired_date}}
ago</td></tr>
+                      <tr><td><strong>Enqueue Rate Throttle: </strong>{{App.destination.metrics.max_enqueue_rate}}</td></tr>
+                      <tr><td><strong>Swapped In: </strong>{{App.destination.metrics.swapped_in_items}}
msgs {{App.destination.metrics.swapped_in_size}} bytes</td></tr>
+                      <tr><td><strong>Swapping Out: </strong>{{App.destination.metrics.swapping_out_size}}
bytes</td></tr>
+                      <tr><td><strong>Swapping In: </strong>{{App.destination.metrics.swapping_in_size}}
bytes</td></tr>
+                      <tr><td><strong>Total Swap Ins: </strong>{{App.destination.metrics.swap_out_item_counter}}
msgs {{App.destination.metrics.swap_out_size_counter}} bytes</td></tr>
+                      <tr><td><strong>Total Swap Outs: </strong>{{App.destination.metrics.swap_in_item_counter}}
msgs {{App.destination.metrics.swap_in_size_counter}} bytes</td></tr>
+                      </tbody>
+                    </table>
+                  </div>
+                </div>
+                <div class="span8">
+                  {{#if App.destination.producers}}
+                  <div>
+                      <h4>Producers</h4>
+                      <table class="details table table-bordered table-striped" style="">
+                        <tbody>
+                        <tr>
+                          <th>Name</th>
+                          <th>Kind</th>
+                          <th>Items</th>
+                          <th>Size</th>
+                          <th>Last Enqueue</th>
+                        </tr>
+                        {{#each App.destination.producers}}
+                        <tr>
+                          <td>{{label}}</td>
+                          <td>{{kind}}</td>
+                          <td>{{enqueue_item_counter}}</td>
+                          <td>{{enqueue_size_counter}}</td>
+                          <td>{{enqueue_date}}</td>
+                        </tr>
+                        {{/each}}
+                        </tbody>
+                      </table>
+                  </div>
+                  {{/if}}
+                  {{#if App.destination.consumers}}
+                  <div>
+                      <h4>Consumers</h4>
+                      <table class="details table table-bordered table-striped" style="">
+                        <tbody>
+                        <tr>
+                          <th>Name</th>
+                          <th>Kind</th>
+                          <th>Items</th>
+                          <th>Size</th>
+                          <th>Last Enqueue</th>
+                            <th>Acks</th>
+                            <th>Nacks</th>
+                            <th>Last Enqueue</th>
+                            <th>Ack Rate</th>
+                            <th>Status</th>
+                        </tr>
+                        {{#each App.destination.consumers}}
+                        <tr>
+                          <td>{{label}}</td>
+                          <td>{{kind}}</td>
+                          <td>{{enqueue_item_counter}}</td>
+                          <td>{{enqueue_size_counter}}</td>
+                          <td>{{enqueue_date}}</td>
+                          <td>{{total_ack_count}}</td>
+                          <td>{{total_nack_count}}</td>
+                          <td>{{ack_item_rate}} msgs/sec {{ack_size_rate}} bytes/sec</td>
+                          <td>{{waiting_on}}</td>
+                        </tr>
+                        {{/each}}
+                        </tbody>
+                      </table>
+                  </div>
+                  {{/if}}
+                </div>
+            </div>
+            {{/if}}
           </div>
           <div class="tab-pane" id="TAB_Connectors">
               <div class="form-horizontal">
@@ -182,7 +274,7 @@
                     <div class="well-title">Details</div>
                     <table class="details table table-bordered table-striped">
                       <tbody>
-                      <tr><td><strong>Up time: </strong>{{App.connector.state_since}}</td></tr>
+                      <tr><td><strong>Up time: </strong>{{App.connector.state_date}}</td></tr>
                       <tr><td><strong>Bound to: </strong>{{App.connector.local_address}}</td></tr>
                       <tr><td><strong>Protocol: </strong>{{App.connector.protocol}}</td></tr>
                       <tr><td><strong>Currently Connected: </strong>{{App.connector.connection_counter}}</td></tr>

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=1429843&r1=1429842&r2=1429843&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 Mon Jan  7
15:26:31 2013
@@ -1,11 +1,11 @@
 App = Em.Application.create({
   ready: function() {
     var self = this;
-    setInterval(function() {
-      if( App.LoginController.get('is_logged_in') ) {
-        self.refresh();
-      }
-    }, 2000);
+//    setInterval(function() {
+//      if( App.LoginController.get('is_logged_in') ) {
+//        self.refresh();
+//      }
+//    }, 2000);
     App.LoginController.refresh();
     this._super();
   },
@@ -160,6 +160,7 @@ App.ConnectorController = Em.ArrayContro
     var selected = this.get("selected")
     if( selected ) {
       App.ajax("GET", "/broker/connectors/"+selected, function(connector) {
+        connector.state_date = new Date(connector.state_since);
         App.connector.setProperties(connector);
       });
     }
@@ -221,6 +222,7 @@ App.VirtualHostController = Em.ArrayCont
     if( selected ) {
       App.ajax("GET", "/broker/virtual-hosts/"+selected, function(host) {
         App.virtual_host.setProperties(host);
+        host.state_date = new Date(host.state_since);
         if( host.store ) {
           App.ajax("GET", "/broker/virtual-hosts/"+selected+"/store", function(store) {
             App.virtual_host_store.setProperties(store);
@@ -231,7 +233,6 @@ App.VirtualHostController = Em.ArrayCont
   }.observes("selected")
 });
 
-
 App.DestinationsController = Ember. ArrayController.create({
   virtual_hostBinding: "App.VirtualHostController.selected",
   create_name: "",
@@ -246,7 +247,12 @@ App.DestinationsController = Ember. Arra
       return "dsubs";
     }
   }.property("App.VirtualHostController.selected_tab"),
-  
+
+  kind_label: function() {
+    var v = App.VirtualHostController.get('selected_tab')
+    return v.substring(0, v.length-1);
+  }.property("App.VirtualHostController.selected_tab"),
+
   refresh: function(clear) {
     var virtual_host = this.get('virtual_host');
     if( !virtual_host ) {
@@ -302,6 +308,41 @@ App.DestinationsController = Ember. Arra
     });
   },
 
+  selected:null,
+  select: function(event) {
+    this.set("selected", event.context.get(0))
+  },
+
+});
+
+App.destination = null;
+App.DestinationController = Em.Controller.create({
+  destinationBinding:"App.destination",
+  selectedBinding:"App.DestinationsController.selected",
+
+  refresh: function() {
+    var selected = this.get("selected")
+    if( selected==null ) {
+      App.set('destination', null);
+    } else {
+      var virtual_host = App.DestinationsController.get("virtual_host");
+      var kind = App.DestinationsController.get("kind");
+      App.ajax("GET", "/broker/virtual-hosts/"+virtual_host+"/"+kind+"/"+selected+"?consumers=true&producers=true",
function(data) {
+        data.metrics.state_date = new Date(data.state_since);
+        data.metrics.enqueue_date = new Date(data.metrics.enqueue_ts);
+        data.metrics.dequeue_date = new Date(data.metrics.dequeue_ts);
+        data.metrics.nak_date = new Date(data.metrics.nak_ts);
+        data.metrics.expired_date = new Date(data.metrics.expired_ts);
+        data.producers.forEach(function(value){
+          value.enqueue_date = new Date(value.enqueue_ts);
+        });
+        data.consumers.forEach(function(value){
+          value.enqueue_date = new Date(value.enqueue_ts);
+        });
+        App.set('destination', data);
+      });
+    }
+  }.observes("selected"),
 });
 
 Ember.View.create({



Mime
View raw message