Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make join node more explicit. #83

Merged
merged 4 commits into from
Apr 30, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions priv/admin/js/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ minispade.register('cluster', function() {
*/
ringNotReady: false,

/**
* Returns whether this is a standalone node or not.
*/
standalone: function() {
return this.get('content.currentCluster.length') <= 1;
}.property('content.currentCluster', 'content.currentCluster.@each'),

/**
* Return nodes from the current cluster which have not been deleted.
*
Expand Down Expand Up @@ -257,17 +264,20 @@ minispade.register('cluster', function() {
},

/**
* Add a new node.
* Join a node.
*
* @returns {void}
*/
addNode: function(ev) {
joinNode: function(ev) {
ev.preventDefault();

var self = this;
var node = this.get('addNodeField');
var self = this;
var node = this.get('joinNodeField');
var success = function() {
self.set('joinNodeField', undefined);
};

this.stageChange(node, "join", "");
this.stageChange(node, "join", "", success, undefined);
},

/**
Expand All @@ -287,17 +297,17 @@ minispade.register('cluster', function() {
/**
* @class
*
* Add Node text field.
* Join Node text field.
*
*/
RiakControl.AddNodeView = Ember.TextField.extend(
/** @scope RiakControl.AddNodeView.prototype */ {
valueBinding: 'controller.addNodeField',
RiakControl.JoinNodeView = Ember.TextField.extend(
/** @scope RiakControl.JoinNodeView.prototype */ {
valueBinding: 'controller.joinNodeField',
classNames: ['gui-input', 'gui-text'],

/**
* When the user presses the enter/return key in the
* add nodes field, calls the 'addNode' method of
* add nodes field, calls the 'joinNode' method of
* the controller.
*
* @param {Object} ev - The keyup event.
Expand All @@ -307,7 +317,7 @@ minispade.register('cluster', function() {
keyUp: function (ev) {
var controller = this.get('controller');
if(ev.keyCode === 13){
controller.get('addNode').call(controller, ev);
controller.get('joinNode').call(controller, ev);
}
}
});
Expand Down
Loading