Added next button in order detail view after the user make a payment, Avoid to regenerate SSH Key if the user refresh the page, Now the key is served to download from javascript , Added public_key attribute to VirtualVMPlan in order to store keys created by the user, Now private key has PEM format and public has OpenSSH

This commit is contained in:
Levi 2016-05-24 01:19:49 -05:00
commit b4164e56ab
7 changed files with 140 additions and 33 deletions

View file

@ -0,0 +1,42 @@
$( document ).ready(function() {
// Create a file with ssh private key info
function donwloadKeyFile(){
var key = $('#ssh_key').text();
var a = window.document.createElement('a');
a.href = window.URL.createObjectURL(new Blob([key], {type: 'text'}));
a.download = 'private_key.pem';
// Append anchor to body.
document.body.appendChild(a);
a.click();
// Remove anchor from body
document.body.removeChild(a);
}
// Create a file with ssh private key info
$('#download_ssh_key').on('click',donwloadKeyFile);
$('[data-toggle="tooltip"]').tooltip();
var clipboard = new Clipboard('#copy_to_clipboard');
clipboard.on('success', function(e) {
var selector = "#";
var copy_button_id = selector.concat(e.trigger.id);
setTimeout(function(){
$(copy_button_id).tooltip('hide');
}, 1000);
});
});