Feat: Selectable placement of Terminal Button

Defaults to not display in header.  Also allows GUI search to index 'terminal'
This commit is contained in:
Squidly271
2025-05-23 12:30:06 -04:00
parent e2551e7e9b
commit 6774bce34f
4 changed files with 33 additions and 0 deletions

View File

@@ -203,6 +203,12 @@ _(Page view)_:
:display_page_view_help:
_(Show Terminal Button in header)_:
: <select name="terminalButton">
<?=mk_option($display['terminalButton'],"no",_("No"))?>
<?=mk_option($display['terminalButton'],"yes",_("Yes"))?>
</select>
_(Placement of Users menu)_:
: <select name="users">
<?=mk_option($display['users'], "Tasks:3", _('Header menu'))?>

View File

@@ -0,0 +1,25 @@
Menu="UNRAID-OS"
Title="Open Terminal"
Icon="terminal"
---
<?PHP
/* Copyright 2025, Lime Technology
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*/
?>
<script>
$(function(){
var d = new Date();
openTerminal('ttyd','Web Terminal '+d.getTime(),'');
// Give time for terminal to open then go back to the previous page
setTimeout(function(){
window.location.href = '<?=$_SERVER['HTTP_REFERER']?>';
},5000);
});
</script>

View File

@@ -2,6 +2,7 @@ Menu="Buttons:3"
Title="Terminal"
Icon="icon-u-terminal"
Code="e93f"
Cond="($display['terminalButton'] == 'yes')"
---
<?PHP
/* Copyright 2005-2023, Lime Technology

View File

@@ -17,6 +17,7 @@ banner=""
header=""
background=""
tabs="1"
terminalButton="no"
users="Tasks:3"
usage="0"
text="1"