activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1438022 - in /activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console: index.html js/app.js
Date Thu, 24 Jan 2013 14:44:57 GMT
Author: chirino
Date: Thu Jan 24 14:44:57 2013
New Revision: 1438022

URL: http://svn.apache.org/viewvc?rev=1438022&view=rev
Log:
Add support for starting/stopping connectors.

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=1438022&r1=1438021&r2=1438022&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 Thu Jan 24
14:44:57 2013
@@ -391,7 +391,11 @@
             <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> -->
+              {{#if App.connector.paused}}
+              <button class="btn" {{action "start" target="App.ConnectorController" on="click"}}><i
class="icon-play"></i> Start</button>
+              {{else}}
+              <button class="btn" {{action "stop" target="App.ConnectorController" on="click"}}><i
class="icon-stop"></i> Stop</button>
+              {{/if}}
             </div>
           </div>
         </div>
@@ -401,7 +405,7 @@
               <div class="well-title">Details</div>
               <table class="details table table-bordered table-striped">
                 <tbody>
-                <tr><td><strong>Up Since: </strong>{{App.connector.state_date}}</td></tr>
+                <tr><td><strong>{{App.connector.state_label}} Since: </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=1438022&r1=1438021&r2=1438022&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 Thu Jan 24
14:44:57 2013
@@ -79,7 +79,7 @@ App = Em.Application.create({
   ready: function() {
     setInterval(function() {
       if( App.LoginController.get('is_logged_in') ) {
-        App.auto_refresh();
+//        App.auto_refresh();
       }
     }, 2000);
     this._super();
@@ -287,11 +287,32 @@ App.ConnectorController = Em.ArrayContro
     if( selected ) {
       App.ajax("GET", "/broker/connectors/"+selected, function(connector) {
         connector.state_date = date_to_string(connector.state_since);
+        connector.paused = connector.state != "STARTED";
+        if( connector.paused ) {
+          connector.state_label = "Stopped";
+        } else {
+          connector.state_label = "Started";
+        }
         App.connector.setProperties(connector);
       });
     }
     App.ConnectionsController.refresh();
-  }.observes("selected")
+  }.observes("selected"),
+
+  start: function() {
+    var selected = this.get("selected")
+    App.ajax("POST", "/broker/connectors/"+selected+"/action/start", function(connector)
{
+      App.ConnectorController.refresh();
+    });
+  },
+
+  stop: function() {
+    var selected = this.get("selected")
+    App.ajax("POST", "/broker/connectors/"+selected+"/action/stop", function(connector) {
+      App.ConnectorController.refresh();
+    });
+  },
+
 });
 
 



Mime
View raw message