commit 02fbdab78deed3a11c338b3cec18a5dd757b81f5
parent 23f48e21e95309e01b8da7b9f539e3a4de43d066
Author: Sheng <webmaster0115@gmail.com>
Date: Wed, 7 Feb 2018 07:40:17 +0800
Check form data required before submission
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/static/js/main.js b/static/js/main.js
@@ -11,6 +11,11 @@ jQuery(function($){
type = form.attr('type'),
data = new FormData(this);
+ if (!data.get('hostname') || !data.get('port') || !data.get('username')) {
+ status.text('Hostname, port and username are required.');
+ return;
+ }
+
var pk = data.get('privatekey');
if (pk && pk.size > 16384) {
status.text('Key size exceeds maximum value.');