From 84a95d0ed3b5b8c6392d9cb904e485e2bf79017d Mon Sep 17 00:00:00 2001 From: crazypeace Date: Sat, 21 Sep 2024 15:49:46 +0800 Subject: [PATCH] Init Command (execute the command after login) --- webssh/static/js/main.js | 5 ++++- webssh/templates/index.html | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/webssh/static/js/main.js b/webssh/static/js/main.js index 814610a..1de6aa0 100644 --- a/webssh/static/js/main.js +++ b/webssh/static/js/main.js @@ -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; } diff --git a/webssh/templates/index.html b/webssh/templates/index.html index 1f56af8..fe5ce2d 100644 --- a/webssh/templates/index.html +++ b/webssh/templates/index.html @@ -77,6 +77,8 @@
+ +