added registration token rotation function to UI
parent
85fd16b457
commit
2ec4734438
|
@ -274,6 +274,23 @@ var ClientView = Backbone.View.extend({
|
||||||
|
|
||||||
$('#modalAlert .modal-body').html(_self.registrationTokenTemplate(savedModel));
|
$('#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({
|
$('#modalAlert').modal({
|
||||||
'backdrop': 'static',
|
'backdrop': 'static',
|
||||||
'keyboard': true,
|
'keyboard': true,
|
||||||
|
|
|
@ -759,4 +759,8 @@
|
||||||
<input type="text" id="registrationToken" readonly style="cursor: text" class="token-full input-xxlarge" value="<%- registrationToken %>" />
|
<input type="text" id="registrationToken" readonly style="cursor: text" class="token-full input-xxlarge" value="<%- registrationToken %>" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button class="btn btn-warning" id="rotate-token"><i class="icon-retweet icon-white"></i> Rotate registration token</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue