Skip to content

Commit

Permalink
Set default port to 22
Browse files Browse the repository at this point in the history
  • Loading branch information
huashengdun committed Sep 29, 2018
1 parent 0f542ed commit fdcf171
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion webssh/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion webssh/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</div>
<div class="col">
<label for="Port">Port</label>
<input class="form-control" type="number" id="port" name="port" value="" min=1 max=65535 required>
<input class="form-control" type="number" id="port" name="port" placeholder="22" value="" min=1 max=65535>
</div>
</div>
<div class="row">
Expand Down

0 comments on commit fdcf171

Please sign in to comment.