activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1428699 - in /activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console: index.html js/app.js
Date Fri, 04 Jan 2013 01:26:52 GMT
Author: chirino
Date: Fri Jan  4 01:26:51 2013
New Revision: 1428699

URL: http://svn.apache.org/viewvc?rev=1428699&view=rev
Log:
Expose connectors and connections for management.

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=1428699&r1=1428698&r2=1428699&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 Fri Jan 
4 01:26:51 2013
@@ -88,8 +88,8 @@
     <div class="span12">
       <ul class="nav nav-tabs">
         <li class="active"><a href="#TAB_Virtual_Hosts" data-toggle="tab">Virtual
Hosts</a></li>
-        <!--
         <li><a href="#TAB_Connectors" data-toggle="tab">Connectors</a></li>
+          <!--
         <li><a href="#TAB_Connections" data-toggle="tab">Connections</a></li>
         -->
         <li><a href="#TAB_Operating_Environment" data-toggle="tab">Operating
Environment</a></li>
@@ -166,20 +166,64 @@
               </div>
             </div>
           </div>
-          <!--
           <div class="tab-pane" id="TAB_Connectors">
-            <h3>Connectors</h3>
-            <p>
-              How client connect to the broker, select
-              a connector to view more details about it.
-            </p>
-            <p>
-              <ul>
-                <li>61613</li>
-                <li>61616</li>
-              </ul>
-            </p>
+              <div class="form-horizontal">
+                <div class="control-group">
+                  <label class="control-label"><strong style="font-size:170%">Connector:</strong></label>
+                  <div class="controls">
+                    {{view Ember.Select contentBinding="App.broker.connectors" selectionBinding="App.ConnectorController.selected"}}
+                    <!-- <a class="btn" href="#"><i class="icon-stop icon-white"></i>
Stop</a> -->
+                  </div>
+                </div>
+              </div>
+              <div class="row">
+                <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.connector.state_since}}</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>
+                      <tr><td><strong>Connection Counter: </strong>{{App.connector.connection_counter}}</td></tr>
+                      <tr><td><strong>Outbound Messages: </strong>{{App.connector.messages_sent}}</td></tr>
+                      <tr><td><strong>Inbound Messages: </strong>{{App.connector.messages_received}}</td></tr>
+                      <tr><td><strong>Data Transferred In: </strong>{{App.connector.read_counter}}</td></tr>
+                      <tr><td><strong>Data Transferred Out: </strong>{{App.connector.write_counter}}</td></tr>
+                      </tbody>
+                    </table>
+                  </div>
+                </div>
+                <div class="span8">
+                  <h3>Connections</h3>
+                  <table class="details table table-bordered table-striped" style="">
+                    <tbody>
+                    <tr>
+                      <th>{{view Ember.Checkbox checkedBinding="App.ConnectionsController.all_checked"}}</th>
+                      <th>Remote Address</th>
+                      <th>Protocol</th>
+                      <th>User</th>
+                      <th>Data In</th>
+                      <th>Data Out</th>
+                      <th>Msgs In</th>
+                      <th>Msgs out</th>
+                    </tr>
+                    {{#each App.ConnectionsController}}
+                    <tr>
+                      <td>{{view Ember.Checkbox checkedBinding="checked"}}</td>
+                      <td><i class=" icon-zoom-in"></i>{{[1]}}</td><td>{{[2]}}</td><td>{{[3]}}</td><td>{{[4]}}</td><td>{{[5]}}</td><td>{{[6]}}</td><td>{{[7]}}</td>
+                    </tr>
+                    {{/each}}
+                    </tbody>
+                  </table>
+                  <div style="padding:.5em 0">
+                    <button class="btn btn-small" {{action "remove" target="App.ConnectionsController"
on="click"}}>Disconnect</button>
+                  </div>
+                </div>
+              </div>
           </div>
+          <!--
           <div class="tab-pane" id="TAB_Connections">
             <h3>Connections</h3>
             <p>

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=1428699&r1=1428698&r2=1428699&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 Fri Jan  4
01:26:51 2013
@@ -13,6 +13,7 @@ App = Em.Application.create({
   refresh: function() {
     App.BrokerController.refresh();
     App.VirtualHostController.refresh();
+    App.ConnectorController.refresh();
   },
 
   default_error_handler:function(xhr, status, thrown) {
@@ -146,11 +147,68 @@ App.BrokerController = Ember.Controller.
       App.broker.setProperties(json);
       if( App.VirtualHostController.get('selected') == null && json.virtual_hosts.length
> 0 ) {
         App.VirtualHostController.set('selected', json.virtual_hosts[0]);
+        App.ConnectorController.set('selected', json.connectors[0]);
       }
     });
   }
 });
 
+App.connector = Ember.Object.create({});
+App.ConnectorController = Em.ArrayController.create({
+  selected:null,
+  refresh: function() {
+    var selected = this.get("selected")
+    if( selected ) {
+      App.ajax("GET", "/broker/connectors/"+selected, function(connector) {
+        App.connector.setProperties(connector);
+      });
+    }
+  }.observes("selected")
+});
+
+
+App.ConnectionsController = Ember. ArrayController.create({
+  connectorBinding: "App.ConnectorController.selected",
+
+  refresh: function(clear) {
+    var connector = this.get('connector');
+    if( !connector ) {
+      App.ConnectionsController.set('content', []);
+      return;
+    }
+    if( clear ) {
+      App.ConnectionsController.set('content', []);
+    }
+    var kind = this.get('kind')
+    var fields = ['id', 'remote_address', 'protocol', 'user', 'read_counter', 'write_counter',
'messages_received', 'messages_sent'];
+
+    App.ajax("GET", "/broker/connections?q=connector='"+connector+"'&ps=10000&f="+fields.join("&f="),
function(data) {
+      App.ConnectionsController.set('content', data.rows);
+    });
+  }.observes("connector"),
+
+  all_checked:false,
+  check_all_toggle: function() {
+    var all_checked= this.get("all_checked");
+    this.get('content').forEach(function(item){
+      item.set('checked', all_checked);
+    });
+  }.observes("all_checked"),
+
+  remove: function() {
+    var content = this.get('content');
+    content.forEach(function(item){
+      var checked = item.get('checked');
+      if( checked ) {
+        var id = item.get(0);
+        App.ajax("DELETE", "/broker/connections/"+id, function(data) {
+          App.ConnectionsController.refresh();
+        });
+      }
+    });
+  },
+
+});
 
 App.virtual_host = Ember.Object.create({});
 App.virtual_host_store = Ember.Object.create({});
@@ -173,6 +231,7 @@ App.VirtualHostController = Em.ArrayCont
   }.observes("selected")
 });
 
+
 App.DestinationsController = Ember. ArrayController.create({
   virtual_hostBinding: "App.VirtualHostController.selected",
   create_name: "",



Mime
View raw message