Files
deployd/lib/resources/dashboard/js/auth.js
2012-07-26 11:31:38 -07:00

25 lines
475 B
JavaScript

$(document).ready(function() {
$('.save').click(function() {
$('#error').hide();
var key = $.trim($('textarea[name=key]').val());
$.cookie('DpdSshKey', key);
//Make sure it works
$.ajaxSetup({
headers: {
'dpd-ssh-key': key || true
}
});
dpd('dashboard').get('__is-root', function(res) {
if (res && res.isRoot) {
window.location.reload();
} else {
$('#error').show();
}
});
});
});