added registration token rotation function to UI

pull/695/head
Justin Richer 2014-10-07 18:24:51 -04:00
parent 78ebcd030d
commit f12d37f84e
2 changed files with 21 additions and 0 deletions

View File

@ -274,6 +274,23 @@ var ClientView = Backbone.View.extend({
$('#modalAlert .modal-body').html(_self.registrationTokenTemplate(savedModel));
$('#modalAlert .modal-body #rotate-token').click(function(e) {
token.save(null, {success: function() {
console.log('token:' + token.get('value'));
$('#modalAlert .modal-body #registrationToken').val(token.get('value'));
},
error: function() {
$('#modalAlert .modal-body').html('There was a problem rotating the registration access token for this client.');
$('#modalAlert').modal({
'backdrop': 'static',
'keyboard': true,
'show': true
});
}
});
});
$('#modalAlert').modal({
'backdrop': 'static',
'keyboard': true,

View File

@ -759,4 +759,8 @@
<input type="text" id="registrationToken" readonly style="cursor: text" class="token-full input-xxlarge" value="<%- registrationToken %>" />
</div>
<div>
<button class="btn btn-warning" id="rotate-token"><i class="icon-retweet icon-white"></i> Rotate registration token</button>
</div>
</script>