Fix VM log can not open when VM name has # in it

This commit is contained in:
bergware
2022-06-28 13:03:09 +02:00
parent 491e252c53
commit cea57a7c49

View File

@@ -239,7 +239,7 @@ function openTerminal(tag,name,more) {
return;
}
// open terminal window (run in background)
name = name.replace(/ /g,"_");
name = name.replace(/[ #]/g,"_");
tty_window = makeWindow(name+(more=='.log'?more:''),Math.max(screen.availHeight*3/5,600),Math.min(Math.max(screen.availWidth/2,900),1600));
var socket = ['ttyd','syslog'].includes(tag) ? '/webterminal/'+tag+'/' : '/logterminal/'+name+(more=='.log'?more:'')+'/';
$.get('/webGui/include/OpenTerminal.php',{tag:tag,name:name,more:more},function(){tty_window.location=socket; tty_window.focus();});