Skip to content

Commit

Permalink
Merge pull request #2551 from hashicorp/jbs-2541
Browse files Browse the repository at this point in the history
Remove Deregister from UI for #2541
  • Loading branch information
slackpad authored Dec 1, 2016
2 parents f794dea + f333392 commit fa5dbc2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
1 change: 0 additions & 1 deletion ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,6 @@ <h4 class="list-group-item-heading">

<h3 class="no-margin">
{{ model.Node }} <small> {{ model.Address }}</small>
<button {{ action "deregisterNode" }} {{ bind-attr class=":btn :btn-danger :pull-right :btn-mini isLoading:btn-warning" }}>Deregister</button>
</h3>
<hr>

Expand Down
28 changes: 0 additions & 28 deletions ui/javascripts/app/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,34 +275,6 @@ App.NodesShowController = Ember.ObjectController.extend({
dc: Ember.computed.alias("controllers.dc"),

actions: {
deregisterNode: function() {
this.set('isLoading', true);
var controller = this;
var node = controller.get('model');
var dc = controller.get('dc').get('datacenter');
var token = App.get('settings.token');

if (window.confirm("Are you sure you want to deregister this node?")) {
// Deregister node
Ember.$.ajax({
url: formatUrl(consulHost + '/v1/catalog/deregister', dc, token),
type: 'PUT',
data: JSON.stringify({
'Datacenter': dc,
'Node': node.Node
})
}).then(function(response) {
var nodes = controller.get('controllers.nodes').get('nodes');
controller.get('controllers.nodes').set('nodes', nodes.filter(function(n) {
return n.Node !== node.Node;
}));
controller.transitionToRoute('nodes');
}).fail(function(response) {
controller.set('errorMessage', 'Received error while processing: ' + response.statusText);
});
}
},

invalidateSession: function(sessionId) {
this.set('isLoading', true);
var controller = this;
Expand Down

0 comments on commit fa5dbc2

Please sign in to comment.