mirror of
https://github.com/unraid/webgui.git
synced 2026-05-03 16:29:45 -05:00
Check for access via connect remote
This commit is contained in:
@@ -353,27 +353,34 @@ function shutdown_now(form, cmd) {
|
||||
<?
|
||||
$nginx = parse_ini_file("/var/local/emhttp/nginx.ini");
|
||||
$tailscaleUI = false;
|
||||
$connectRemote = false;
|
||||
foreach ($nginx as $key => $value) {
|
||||
if (stripos($key, 'tailscale') !== false && $value == $_SERVER['HTTP_HOST']) {
|
||||
if (strpos($key, 'NGINX_TAILSCALE') !== false && $value == $_SERVER['HTTP_HOST']) {
|
||||
$tailscaleUI = true;
|
||||
break;
|
||||
}
|
||||
if (strpos($key, 'NGINX_WANFQDN') !== false && $value == $_SERVER['HTTP_HOST']) {
|
||||
$connectRemote = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
var text = "_(This will reboot the system in safe mode)_\n\n";
|
||||
var text = text.concat("_(No plugins will be loaded in safe mode.)_");
|
||||
<? if (is_file("/var/log/plugins/tailscale.plg") || is_file("/var/log/plugins/tailscale-preview.plg")): ?>
|
||||
var text = text.concat(" _(If you use Tailscale to access the GUI or services of the server, this access will be lost.)_");
|
||||
var text = "_(This will reboot the server in safe mode.)_\n\n" + "_(No plugins will be loaded in safe mode.)_";
|
||||
<? if (is_file("/var/log/plugins/tailscale.plg") || is_file("/var/log/plugins/tailscale-preview.plg" || is_file("/var/log/plugins/dynamix.unraid.net.plg"))): ?>
|
||||
text += " _(If you use Tailscale or Unraid Connect Remote Access to access the webGUI or services of the server, this access will be lost.)_";
|
||||
<? if ($tailscaleUI): ?>
|
||||
var text = text.concat("\n\n<span class='font-bold'>_(You are currently accessing the GUI of the server via Tailscale.)_</span>");
|
||||
text += "\n\n<span class='font-bold'>_(You are currently accessing the webGUI of the server via Tailscale.)_</span>";
|
||||
<? endif; ?>
|
||||
<? if ($connectRemote): ?>
|
||||
text += "\n\n<span class='font-bold'>_(You are currently accessing the webGUI of the server via Unraid Connect Remote Access.)_</span>";
|
||||
<? endif; ?>
|
||||
<? endif; ?>
|
||||
} else {
|
||||
var text = "_(This will reboot the system)_";
|
||||
var text = "_(This will reboot the server.)_";
|
||||
}
|
||||
break;
|
||||
case 'shutdown':
|
||||
var text = "_(This will shutdown the system)_";
|
||||
var text = "_(This will shutdown the server.)_";
|
||||
break;
|
||||
}
|
||||
swal({
|
||||
|
||||
Reference in New Issue
Block a user