From fdcf1718c110462ee682157e64e7b45c3d9211af Mon Sep 17 00:00:00 2001 From: Sheng Date: Sat, 29 Sep 2018 20:19:45 +0800 Subject: [PATCH] Set default port to 22 --- webssh/static/js/main.js | 6 +++++- webssh/templates/index.html | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/webssh/static/js/main.js b/webssh/static/js/main.js index e1b15f2..cb83713 100644 --- a/webssh/static/js/main.js +++ b/webssh/static/js/main.js @@ -387,7 +387,11 @@ jQuery(function($){ attr = attrs[i]; val = data.get(attr); if (typeof val === 'string') { - data.set(attr, val.trim()); + val = val.trim(); + if (attr === 'port' && val === '') { + val = 22; + } + data.set(attr, val); } } } diff --git a/webssh/templates/index.html b/webssh/templates/index.html index b1532ca..64a8a17 100644 --- a/webssh/templates/index.html +++ b/webssh/templates/index.html @@ -36,7 +36,7 @@
- +