Update main.js

pull/393/head
crazypeace 2023-11-13 02:45:49 +08:00 committed by GitHub
parent c6bed4a679
commit 176e6c6fa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

View File

@ -32,8 +32,28 @@ var wssh = {};
data[name] = value;
};
}
document.querySelector('#sshlinkBtn').addEventListener("click", updateSSHlink);
}());
function updateSSHlink() {
var thisPageProtocol = window.location.protocol;
var thisPageUrl = window.location.host;
var hostnamestr = document.getElementById("hostname").value;
var portstr = document.getElementById("port").value;
if (portstr == "") {
portstr = "22"
}
var usrnamestr = document.getElementById("username").value;
var passwdstr = document.getElementById("password").value;
var passwdstrAfterBase64 = window.btoa(passwdstr);
var sshlinkstr;
sshlinkstr = thisPageProtocol+"//"+thisPageUrl+"/?hostname="+hostnamestr+"&port="+portstr+"&username="+usrnamestr+"&password="+passwdstrAfterBase64;
document.getElementById("sshlink").innerHTML = sshlinkstr;
}
jQuery(function($){
var status = $('#status'),