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/01 14:47:44 UTC
svn commit: r1441443 - in
/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console:
css/app.css index.html js/app.js
Author: chirino
Date: Fri Feb 1 13:47:44 2013
New Revision: 1441443
URL: http://svn.apache.org/viewvc?rev=1441443&view=rev
Log:
Only show the delete/disconnect buttons when something is selected. use more colorful buttons.
Modified:
activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/css/app.css
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/css/app.css
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/css/app.css?rev=1441443&r1=1441442&r2=1441443&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/css/app.css (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/css/app.css Fri Feb 1 13:47:44 2013
@@ -4,8 +4,12 @@
.btn { color: #333; }
.btn:hover { color: #222; }
-.btn-primary { color: #fff; }
-.btn-primary:hover { color: #fff; }
+
+.btn-primary:hover, .btn-primary,
+.btn-success:hover, .btn-success,
+.btn-warning:hover, .btn-warning,
+.btn-danger:hover, .btn-danger
+{ color: #fff; }
.well-title {
padding-bottom: .2em;
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=1441443&r1=1441442&r2=1441443&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 Feb 1 13:47:44 2013
@@ -77,7 +77,7 @@
</form>
</div>
<div class="modal-footer">
- <a href="#" class="btn" {{action "hide" target="App.SettingsView" on="click"}}>Close</a>
+ <a href="#" class="btn btn-primary" {{action "hide" target="App.SettingsView" on="click"}}>Close</a>
</div>
</script>
<div class="row" id="notifications" style="padding-top: 1em;" >
@@ -173,9 +173,11 @@
{{/each}}
</tbody>
</table>
+ {{#if App.DestinationsController.has_checked}}
<div style="padding:.5em 0">
- <button class="btn btn-small" {{action "remove" target="App.DestinationsController" on="click"}}>Delete</button>
+ <button class="btn btn-small btn-danger" {{action "remove" target="App.DestinationsController" on="click"}}>Delete</button>
</div>
+ {{/if}}
{{else}}
<div style="padding-left:2em;">No {{App.VirtualHostController.selected_tab}} have been created yet.</div>
{{/if}}
@@ -412,9 +414,9 @@
<div class="controls">
{{view Ember.Select contentBinding="App.broker.connectors" selectionBinding="App.ConnectorController.selected"}}
{{#if App.connector.paused}}
- <button class="btn" {{action "start" target="App.ConnectorController" on="click"}}><i class="icon-play"></i> Start</button>
+ <button class="btn btn-success" {{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>
+ <button class="btn btn-warning" {{action "stop" target="App.ConnectorController" on="click"}}><i class="icon-stop"></i> Stop</button>
{{/if}}
</div>
</div>
@@ -428,7 +430,7 @@
<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>
+ <tr><td><strong>Currently Connected: </strong>{{App.connector.connected}}</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>
@@ -461,9 +463,11 @@
{{/each}}
</tbody>
</table>
+ {{#if App.ConnectionsController.has_checked}}
<div style="padding:.5em 0">
- <button class="btn btn-small" {{action "remove" target="App.ConnectionsController" on="click"}}>Disconnect</button>
+ <button class="btn btn-small btn-danger" {{action "remove" target="App.ConnectionsController" on="click"}}>Disconnect</button>
</div>
+ {{/if}}
{{else}}
<div style="padding-left:2em;">No connections exist at this time.</div>
{{/if}}
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=1441443&r1=1441442&r2=1441443&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 Feb 1 13:47:44 2013
@@ -377,8 +377,7 @@ App.ConnectionsController = Ember. Array
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);
- updateArrayController(App.ConnectionsController, data.rows, function(item){ return item.id; });
+ updateArrayController(App.ConnectionsController, data.rows, function(item){ return item[0]; });
});
}.observes("connector"),
@@ -389,6 +388,11 @@ App.ConnectionsController = Ember. Array
item.set('checked', all_checked);
});
}.observes("all_checked"),
+ has_checked: function() {
+ return this.get('content').find(function(item){
+ return item.get('checked')==true;
+ }) != null;
+ }.property("content.@each.checked"),
remove: function() {
var content = this.get('content');
@@ -506,13 +510,17 @@ App.DestinationsController = Ember. Arra
},
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"),
+ has_checked: function() {
+ return this.get('content').find(function(item){
+ return item.get('checked')==true;
+ }) != null;
+ }.property("content.@each.checked"),
remove: function() {
var virtual_host = this.get('virtual_host');
@@ -603,11 +611,15 @@ function updateArrayController(controlle
var new_content = [];
data.forEach(function(item){
- var obj = keyIndex[item.entry.seq];
+ var obj = keyIndex[keyFn(item)];
if( obj ) {
obj.setProperties(item);
} else {
- obj = Ember.Object.create(item);
+ if( Object.prototype.toString.call(item) == '[object Array]' ) {
+ obj = item;
+ } else {
+ obj = Ember.Object.create(item);
+ }
}
new_content.push(obj);
});