Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init Command (execute the command after login) #6

Merged
merged 1 commit into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion webssh/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ function updateSSHlink() {
var passwdstr = document.getElementById("password").value;
var passwdstrAfterBase64 = window.btoa(passwdstr);

var initcmdstr = document.getElementById("initcmd").value;
var initcmdstrAfterURI = encodeURIComponent(initcmdstr);

var sshlinkstr;
sshlinkstr = thisPageProtocol+"//"+thisPageUrl+"/?hostname="+hostnamestr+"&port="+portstr+"&username="+usrnamestr+"&password="+passwdstrAfterBase64;
sshlinkstr = thisPageProtocol+"//"+thisPageUrl+"/?hostname="+hostnamestr+"&port="+portstr+"&username="+usrnamestr+"&password="+passwdstrAfterBase64+"&command="+initcmdstrAfterURI;

document.getElementById("sshlink").innerHTML = sshlinkstr;
}
Expand Down
2 changes: 2 additions & 0 deletions webssh/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
<input class="form-control" type="password" id="totp" name="totp" value="">
</div>
<div class="col">
<label for="InitCmd">Init Command (execute the command after login)</label>
<input class="form-control" type="text" id="initcmd" name="initcmd" value="">
</div>
</div>
<input type="hidden" id="term" name="term" value="xterm-256color">
Expand Down