mirror of https://github.com/status-im/consul.git
Merge pull request #2551 from hashicorp/jbs-2541
Remove Deregister from UI for #2541
This commit is contained in:
commit
fa5dbc2597
|
@ -520,7 +520,6 @@
|
||||||
|
|
||||||
<h3 class="no-margin">
|
<h3 class="no-margin">
|
||||||
{{ model.Node }} <small> {{ model.Address }}</small>
|
{{ 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>
|
</h3>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
|
|
@ -275,34 +275,6 @@ App.NodesShowController = Ember.ObjectController.extend({
|
||||||
dc: Ember.computed.alias("controllers.dc"),
|
dc: Ember.computed.alias("controllers.dc"),
|
||||||
|
|
||||||
actions: {
|
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) {
|
invalidateSession: function(sessionId) {
|
||||||
this.set('isLoading', true);
|
this.set('isLoading', true);
|
||||||
var controller = this;
|
var controller = this;
|
||||||
|
|
Loading…
Reference in New Issue