Merge pull request #2210 from Squidly271/Terminal

Feat: Terminal - Add button to manually open if popup blocked
This commit is contained in:
tom mortensen
2025-05-28 08:47:34 -07:00
committed by GitHub
2 changed files with 19 additions and 5 deletions

View File

@@ -163,6 +163,9 @@ function openTerminal(tag,name,more) {
// open terminal window (run in background)
name = name.replace(/[ #]/g,"_");
tty_window = makeWindow(name+(more=='.log'?more:''),Math.min(screen.availHeight,800),Math.min(screen.availWidth,1200));
if ( tty_window === null ) {
throw new Error('Failed to open terminal window');
}
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(){setTimeout(function(){tty_window.location=socket; tty_window.focus();},200);});
}