Merge pull request #6 from crazypeace/2024-9-21

Init Command (execute the command after login)
pull/368/head
crazypeace 2024-09-21 16:38:45 +08:00 committed by GitHub
commit 56eee78118
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -52,8 +52,11 @@ function updateSSHlink() {
var passwdstr = document.getElementById("password").value; var passwdstr = document.getElementById("password").value;
var passwdstrAfterBase64 = window.btoa(passwdstr); var passwdstrAfterBase64 = window.btoa(passwdstr);
var initcmdstr = document.getElementById("initcmd").value;
var initcmdstrAfterURI = encodeURIComponent(initcmdstr);
var sshlinkstr; 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; document.getElementById("sshlink").innerHTML = sshlinkstr;
} }

View File

@ -77,6 +77,8 @@
<input class="form-control" type="password" id="totp" name="totp" value=""> <input class="form-control" type="password" id="totp" name="totp" value="">
</div> </div>
<div class="col"> <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>
</div> </div>
<input type="hidden" id="term" name="term" value="xterm-256color"> <input type="hidden" id="term" name="term" value="xterm-256color">