mirror of https://github.com/huashengdun/webssh
Hide the form when connecting
No need to show the form when connecting to a ssh server if form arguments are passed via urlpull/83/head
parent
a11d5a01e5
commit
4e51d2c3ab
|
@ -38,6 +38,8 @@ var wssh = {};
|
|||
jQuery(function($){
|
||||
var status = $('#status'),
|
||||
btn = $('.btn-primary'),
|
||||
form_container = $('.form-container'),
|
||||
waiter = $('#waiter'),
|
||||
style = {},
|
||||
default_title = 'WebSSH',
|
||||
title_element = document.querySelector('title'),
|
||||
|
@ -314,6 +316,15 @@ jQuery(function($){
|
|||
|
||||
if (fill_form && validated_form_data) {
|
||||
restore_items(fields.concat(['password']), validated_form_data);
|
||||
validated_form_data = undefined;
|
||||
}
|
||||
|
||||
if (waiter.css('display') !== 'none') {
|
||||
waiter.hide();
|
||||
}
|
||||
|
||||
if (form_container.css('display') === 'none') {
|
||||
form_container.show();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -692,6 +703,9 @@ jQuery(function($){
|
|||
data._origin = event_origin;
|
||||
}
|
||||
|
||||
status.text('');
|
||||
btn.prop('disabled', true);
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'post',
|
||||
|
@ -802,9 +816,11 @@ jQuery(function($){
|
|||
log_status('Password via url must be encoded in base64.');
|
||||
} else {
|
||||
if (get_object_length(url_form_data)) {
|
||||
waiter.show();
|
||||
connect(url_form_data);
|
||||
} else {
|
||||
restore_items(fields);
|
||||
form_container.show();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,9 @@
|
|||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div id="waiter" style="display: none"> Connecting ... </div>
|
||||
|
||||
<div class="container form-container" style="display: none">
|
||||
<form id="connect" action="" method="post" enctype="multipart/form-data"{% if debug %} novalidate{% end %}>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
@ -71,7 +73,6 @@
|
|||
<button type="submit" class="btn btn-primary">Connect</button>
|
||||
<button type="reset" class="btn btn-danger">Reset</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
|
|
Loading…
Reference in New Issue