mirror of https://github.com/huashengdun/webssh
Check private key size before submission
parent
664fe685b5
commit
906fcac436
|
@ -5,14 +5,21 @@ jQuery(function($){
|
|||
|
||||
$('form#connect').submit(function(event) {
|
||||
event.preventDefault();
|
||||
status.text('');
|
||||
btn.prop('disabled', true);
|
||||
|
||||
var form = $(this),
|
||||
url = form.attr('action'),
|
||||
type = form.attr('type'),
|
||||
data = new FormData(this);
|
||||
|
||||
var pk = data.get('privatekey');
|
||||
if (pk && pk.size > 16384) {
|
||||
status.text('Key size exceeds maximum value.');
|
||||
return;
|
||||
}
|
||||
|
||||
status.text('');
|
||||
btn.prop('disabled', true);
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: type,
|
||||
|
|
Loading…
Reference in New Issue