mirror of
https://github.com/unraid/webgui.git
synced 2026-04-24 11:19:25 -05:00
Merge branch 'master' into feat/responsive-default-page-layout
This commit is contained in:
+12
-1
@@ -14,6 +14,10 @@ if (isset($_COOKIE[session_name()])) {
|
||||
session_write_close();
|
||||
}
|
||||
|
||||
// Include JS caching functions
|
||||
require_once '/usr/local/emhttp/webGui/include/JSCache.php';
|
||||
|
||||
// Base whitelist of files
|
||||
$arrWhitelist = [
|
||||
'/webGui/styles/clear-sans-bold-italic.eot',
|
||||
'/webGui/styles/clear-sans-bold-italic.woff',
|
||||
@@ -39,8 +43,15 @@ $arrWhitelist = [
|
||||
'/webGui/images/case-model.png',
|
||||
'/webGui/images/green-on.png',
|
||||
'/webGui/images/red-on.png',
|
||||
'/webGui/images/yellow-on.png'
|
||||
'/webGui/images/yellow-on.png',
|
||||
'/webGui/images/UN-logotype-gradient.svg'
|
||||
];
|
||||
|
||||
// Add JS files from the unraid-components directory using cache
|
||||
$webComponentsDirectory = '/usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/';
|
||||
$jsFiles = getCachedJSFiles($webComponentsDirectory);
|
||||
$arrWhitelist = array_merge($arrWhitelist, $jsFiles);
|
||||
|
||||
if (in_array(preg_replace(['/\?v=\d+$/','/\?\d+$/'],'',$_SERVER['REQUEST_URI']),$arrWhitelist)) {
|
||||
// authorized
|
||||
http_response_code(200);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
|
||||
require_once "$docroot/webGui/include/Helpers.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/include/libvirt_helpers.php";
|
||||
|
||||
|
||||
$pci_device_changes = comparePCIData();
|
||||
$pcierror = false;
|
||||
|
||||
@@ -64,18 +64,13 @@ function index($key)
|
||||
return filter_var($key, FILTER_SANITIZE_NUMBER_INT);
|
||||
}
|
||||
|
||||
function metric($eth, $prot, $index)
|
||||
{
|
||||
$system = '/sys/class/net';
|
||||
$bridge = str_replace('eth', 'br', $eth);
|
||||
$bond = str_replace('eth', 'bond', $eth);
|
||||
$port = file_exists("$system/$bridge") ? $bridge : (file_exists("$system/$bond") ? $bond : $eth);
|
||||
$metric = exec("ip -$prot route show default dev $port 2>/dev/null | grep -Pom1 ' metric \K\d+'");
|
||||
if ($metric) {
|
||||
return $metric + $index;
|
||||
}
|
||||
exec("ip -$prot route show default 2>/dev/null | grep -Po ' metric \K\d+'", $metrics);
|
||||
return (count($metrics) ? max($metrics) : 0) + $index + 1;
|
||||
function metric($eth) {
|
||||
$system = '/sys/class/net';
|
||||
$bridge = str_replace('eth', 'br', $eth);
|
||||
$bond = str_replace('eth', 'bond', $eth);
|
||||
$port = file_exists("$system/$bridge") ? $bridge : (file_exists("$system/$bond") ? $bond : $eth);
|
||||
$index = exec("cat $system/$port/ifindex 2>/dev/null");
|
||||
return 1000 + ($index ?: exec("cat $system/*/ifindex | sort -n | tail -1") + 1);
|
||||
}
|
||||
|
||||
// remove non-existing ethernet ports
|
||||
@@ -493,9 +488,9 @@ function addVLAN(port) {
|
||||
}
|
||||
|
||||
function removeVLAN(element) {
|
||||
var id = $(element).prop('id').split('-');
|
||||
var form = $(element).closest('form');
|
||||
$(element).remove();
|
||||
$('#view-'+id[1]).find('select').first().trigger('change');
|
||||
form.find('select').first().trigger('change');
|
||||
}
|
||||
|
||||
function showVLAN(port) {
|
||||
@@ -748,8 +743,8 @@ _(IPv4 address)_:
|
||||
:eth_ipv4_address_help:
|
||||
|
||||
_(IPv4 default gateway)_:
|
||||
: <input type="text" name="GATEWAY:0" maxlength="15" autocomplete="off" spellcheck="false" value="<?=_var($eth0, "GATEWAY:0")?>" class="narrow" pattern="<?=$validIP4?>" title="_(IPv4 address A.B.C.D)_">
|
||||
<input type="text" name="METRIC:0" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($eth0, "METRIC:0") ?: metric('eth0', 4, 0)?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
: <input type="text" name="GATEWAY:0" maxlength="15" autocomplete="off" spellcheck="false" value="<?=_var($eth0,"GATEWAY:0")?>" class="narrow" pattern="<?=$validIP4?>" title="_(IPv4 address A.B.C.D)_">
|
||||
<input type="text" name="METRIC:0" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($eth0,"METRIC:0")?:metric('eth0')?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
|
||||
:eth_ipv4_default_gateway_help:
|
||||
|
||||
@@ -771,8 +766,8 @@ _(IPv6 address)_:
|
||||
:eth_ipv6_address_help:
|
||||
|
||||
_(IPv6 default gateway)_:
|
||||
: <input type="text" name="GATEWAY6:0" maxlength="39" autocomplete="off" spellcheck="false" value="<?=_var($eth0, "GATEWAY6:0")?>" pattern="<?=$validIP6?>" title="_(IPv6 address nnnn:xxxx::yyyy)_">
|
||||
<input type="text" name="METRIC6:0" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($eth0, "METRIC6:0") ?: metric('eth0', 6, 0)?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
: <input type="text" name="GATEWAY6:0" maxlength="39" autocomplete="off" spellcheck="false" value="<?=_var($eth0,"GATEWAY6:0")?>" pattern="<?=$validIP6?>" title="_(IPv6 address nnnn:xxxx::yyyy)_">
|
||||
<input type="text" name="METRIC6:0" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($eth0,"METRIC6:0")?:metric('eth0')?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
|
||||
:eth_ipv6_default_gateway_help:
|
||||
|
||||
@@ -855,8 +850,8 @@ _(IPv4 address)_:
|
||||
|
||||
<div markdown="1" class="more-gw4-eth0-<?=$i?> hide">
|
||||
_(IPv4 default gateway)_:
|
||||
: <input type="text" name="GATEWAY:<?=$i?>" maxlength="15" autocomplete="off" spellcheck="false" value="<?=_var($eth0, "GATEWAY:$i")?>" class="narrow" pattern="<?=$validIP4?>" title="_(IPv4 address A.B.C.D)_">
|
||||
<input type="text" name="METRIC:<?=$i?>" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($eth0, "METRIC:$i") ?: metric('eth0.<?=_var($eth0,"VLANID:$i")?>', 4, $i)?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
: <input type="text" name="GATEWAY:<?=$i?>" maxlength="15" autocomplete="off" spellcheck="false" value="<?=_var($eth0,"GATEWAY:$i")?>" class="narrow" pattern="<?=$validIP4?>" title="_(IPv4 address A.B.C.D)_">
|
||||
<input type="text" name="METRIC:<?=$i?>" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($eth0,"METRIC:$i")?:metric('eth0.'._var($eth0,"VLANID:$i"))?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
|
||||
:eth_ipv4_default_gateway_help:
|
||||
|
||||
@@ -884,8 +879,8 @@ _(IPv6 address)_:
|
||||
|
||||
<div markdown="1" class="more-gw6-eth0-<?=$i?> hide">
|
||||
_(IPv6 default gateway)_:
|
||||
: <input type="text" name="GATEWAY6:<?=$i?>" maxlength="39" autocomplete="off" spellcheck="false" value="<?=_var($eth0, "GATEWAY6:$i")?>" pattern="<?=$validIP6?>" title="_(IPv6 address nnnn:xxxx::yyyy)_">
|
||||
<input type="text" name="METRIC6:<?=$i?>" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($eth0, "METRIC6:$i") ?: metric('eth0.<?=_var($eth0,"VLANID:$i")?>', 6, $i)?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
: <input type="text" name="GATEWAY6:<?=$i?>" maxlength="39" autocomplete="off" spellcheck="false" value="<?=_var($eth0,"GATEWAY6:$i")?>" pattern="<?=$validIP6?>" title="_(IPv6 address nnnn:xxxx::yyyy)_">
|
||||
<input type="text" name="METRIC6:<?=$i?>" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($eth0,"METRIC6:$i")?:metric('eth0.'._var($eth0,"VLANID:$i"))?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
|
||||
:eth_ipv6_default_gateway_help:
|
||||
|
||||
@@ -954,7 +949,7 @@ _(IPv4 address)_:
|
||||
<div markdown="1" class="more-gw4-eth0-INDEX hide">
|
||||
_(IPv4 default gateway)_:
|
||||
: <input type="text" name="GATEWAY:INDEX" maxlength="15" autocomplete="off" spellcheck="false" value="" class="narrow" pattern="<?=$validIP4?>" title="_(IPv4 address A.B.C.D)_">
|
||||
<input type="text" name="METRIC:INDEX" min="1" max="9999" autocomplete="off" spellcheck="false" value="<?=metric('eth0.INDEX', 4, $i + 1)?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
<input type="text" name="METRIC:INDEX" min="1" max="9999" autocomplete="off" spellcheck="false" value="<?=metric('eth0.INDEX')?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -975,7 +970,7 @@ _(IPv6 address)_:
|
||||
<div markdown="1" class="more-gw6-eth0-INDEX hide">
|
||||
_(IPv6 default gateway)_:
|
||||
: <input type="text" name="GATEWAY6:INDEX" maxlength="39" autocomplete="off" spellcheck="false" value="" pattern="<?=$validIP6?>" title="_(IPv6 address nnnn:xxxx::yyyy)_">
|
||||
<input type="text" name="METRIC6:INDEX" min="1" max="9999" autocomplete="off" spellcheck="false" value="<?=metric('eth0.INDEX', 6, $i + 1)?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
<input type="text" name="METRIC6:INDEX" min="1" max="9999" autocomplete="off" spellcheck="false" value="<?=metric('eth0.INDEX')?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -186,7 +186,7 @@ _(IPv4 address)_:
|
||||
<div markdown="1" class="more-gw4-ethX-0 hide">
|
||||
_(IPv4 default gateway)_:
|
||||
: <input type="text" name="GATEWAY:0" maxlength="15" autocomplete="off" spellcheck="false" value="<?=_var($ethX,"GATEWAY:0")?>" class="narrow" pattern="<?=$validIP4?>" title="_(IPv4 address A.B.C.D)_">
|
||||
<input type="text" name="METRIC:0" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($ethX,"METRIC:0")?:metric('ethX',4,0)?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
<input type="text" name="METRIC:0" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($ethX,"METRIC:0")?:metric('ethX')?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
|
||||
:eth_ipv4_default_gateway_help:
|
||||
|
||||
@@ -213,7 +213,7 @@ _(IPv6 address)_:
|
||||
<div markdown="1" class="more-gw6-ethX-0 hide">
|
||||
_(IPv6 default gateway)_:
|
||||
: <input type="text" name="GATEWAY6:0" maxlength="39" autocomplete="off" spellcheck="false" value="<?=_var($ethX,"GATEWAY6:0")?>" pattern="<?=$validIP6?>" title="_(IPv6 address nnnn:xxxx::yyyy)_">
|
||||
<input type="text" name="METRIC6:0" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($ethX,"METRIC6:0")?:metric('ethX',6,0)?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
<input type="text" name="METRIC6:0" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($ethX,"METRIC6:0")?:metric('ethX')?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
|
||||
:eth_ipv6_default_gateway_help:
|
||||
|
||||
@@ -293,7 +293,7 @@ _(IPv4 address)_:
|
||||
<div markdown="1" class="more-gw4-ethX-<?=$i?> hide">
|
||||
_(IPv4 default gateway)_:
|
||||
: <input type="text" name="GATEWAY:<?=$i?>" maxlength="15" autocomplete="off" spellcheck="false" value="<?=_var($ethX,"GATEWAY:$i")?>" class="narrow" pattern="<?=$validIP4?>" title="_(IPv4 address A.B.C.D)_">
|
||||
<input type="text" name="METRIC:<?=$i?>" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($ethX,"METRIC:$i")?:metric('ethX.<?=_var($ethX,"VLANID:$i")?>',4,$i)?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
<input type="text" name="METRIC:<?=$i?>" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($ethX,"METRIC:$i")?:metric('ethX.'._var($ethX,"VLANID:$i"))?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
|
||||
:eth_ipv4_default_gateway_help:
|
||||
|
||||
@@ -320,7 +320,7 @@ _(IPv6 address)_:
|
||||
<div markdown="1" class="more-gw6-ethX-<?=$i?> hide">
|
||||
_(IPv6 default gateway)_:
|
||||
: <input type="text" name="GATEWAY6:<?=$i?>" maxlength="39" autocomplete="off" spellcheck="false" value="<?=_var($ethX,"GATEWAY6:$i")?>" pattern="<?=$validIP6?>" title="_(IPv6 address nnnn:xxxx::yyyy)_">
|
||||
<input type="text" name="METRIC6:<?=$i?>" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($ethX,"METRIC6:$i")?:metric('ethX.<?=_var($ethX,"VLANID:$i")?>',6,$i)?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
<input type="text" name="METRIC6:<?=$i?>" min="0" max="9999" autocomplete="off" spellcheck="false" value="<?=_var($ethX,"METRIC6:$i")?:metric('ethX.'._var($ethX,"VLANID:$i"))?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
|
||||
:eth_ipv6_default_gateway_help:
|
||||
|
||||
@@ -386,7 +386,7 @@ _(IPv4 address)_:
|
||||
<div markdown="1" class="more-gw4-ethX-INDEX hide">
|
||||
_(IPv4 default gateway)_:
|
||||
: <input type="text" name="GATEWAY:INDEX" maxlength="15" autocomplete="off" spellcheck="false" value="" class="narrow" pattern="<?=$validIP4?>" title="_(IPv4 address A.B.C.D)_">
|
||||
<input type="text" name="METRIC:INDEX" min="1" max="9999" autocomplete="off" spellcheck="false" value="<?=metric('ethX.INDEX',4,$i+1)?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
<input type="text" name="METRIC:INDEX" min="1" max="9999" autocomplete="off" spellcheck="false" value="<?=metric('ethX.INDEX')?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -407,7 +407,7 @@ _(IPv6 address)_:
|
||||
<div markdown="1" class="more-gw6-ethX-INDEX hide">
|
||||
_(IPv6 default gateway)_:
|
||||
: <input type="text" name="GATEWAY6:INDEX" maxlength="39" autocomplete="off" spellcheck="false" value="" pattern="<?=$validIP6?>" title="_(IPv6 address nnnn:xxxx::yyyy)_">
|
||||
<input type="text" name="METRIC6:INDEX" min="1" max="9999" autocomplete="off" spellcheck="false" value="<?=metric('ethX.INDEX',6,$i+1)?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
<input type="text" name="METRIC6:INDEX" min="1" max="9999" autocomplete="off" spellcheck="false" value="<?=metric('ethX.INDEX')?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *<?=$metric?>*
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
Menu="UNRAID-OS"
|
||||
Title="Log Viewer (new)"
|
||||
Icon="icon-log"
|
||||
Tag="list"
|
||||
---
|
||||
<unraid-i18n-host>
|
||||
<unraid-log-viewer></unraid-log-viewer>
|
||||
</unraid-i18n-host>
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
// Only start a session to check if they have a cookie that looks like our session
|
||||
$server_name = strtok($_SERVER['HTTP_HOST'], ":");
|
||||
if (!empty($_COOKIE['unraid_'.md5($server_name)])) {
|
||||
if (!empty($_COOKIE['unraid_' . md5($server_name)])) {
|
||||
// Start the session so we can check if $_SESSION has data
|
||||
if (session_status() == PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
@@ -12,7 +12,7 @@ if (!empty($_COOKIE['unraid_'.md5($server_name)])) {
|
||||
// Check if the user is already logged in
|
||||
if ($_SESSION && !empty($_SESSION['unraid_user'])) {
|
||||
// Redirect the user to the start page
|
||||
header("Location: /".$start_page);
|
||||
header("Location: /" . $start_page);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -81,24 +81,64 @@ function cleanupFails(string $failFile, int $time): int
|
||||
|
||||
// Save fails to disk
|
||||
if ($updateFails) {
|
||||
$failText = implode("\n", $fails)."\n";
|
||||
$failText = implode("\n", $fails) . "\n";
|
||||
writeToFile($failFile, $failText);
|
||||
}
|
||||
return count($fails);
|
||||
}
|
||||
|
||||
|
||||
function verifyUsernamePassword(string $username, string $password): bool
|
||||
{
|
||||
if ($username != "root") {
|
||||
return false;
|
||||
}
|
||||
if ($username != "root") return false;
|
||||
|
||||
$output = exec("/usr/bin/getent shadow $username");
|
||||
if ($output === false) {
|
||||
return false;
|
||||
}
|
||||
if ($output === false) return false;
|
||||
$credentials = explode(":", $output);
|
||||
return password_verify($password, $credentials[1]);
|
||||
$valid = password_verify($password, $credentials[1]);
|
||||
if ($valid) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$serverState = new ServerState();
|
||||
// We may have an SSO token - check if SSO is enabled and then validate the token
|
||||
if ($serverState->ssoEnabled && strlen($password) > 500) {
|
||||
if (!preg_match('/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+$/', $password)) {
|
||||
my_logger("SSO Login Attempt Failed: Invalid token format");
|
||||
return false;
|
||||
}
|
||||
$safePassword = escapeshellarg($password);
|
||||
|
||||
$output = array();
|
||||
exec("/etc/rc.d/rc.unraid-api sso validate-token $safePassword 2>&1", $output, $code);
|
||||
my_logger("SSO Login Attempt Code: $code");
|
||||
my_logger("SSO Login Attempt Response: " . print_r($output, true));
|
||||
|
||||
if ($code !== 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (empty($output)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
// Split on first { and take everything after it
|
||||
$jsonParts = explode('{', $output[0], 2);
|
||||
if (count($jsonParts) < 2) {
|
||||
my_logger("SSO Login Attempt Failed: No JSON found in response");
|
||||
return false;
|
||||
}
|
||||
$response = json_decode('{' . $jsonParts[1], true);
|
||||
if (isset($response['valid']) && $response['valid'] === true) {
|
||||
return true;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
my_logger("SSO Login Attempt Exception: " . $e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// Load configs into memory
|
||||
$my_servers = @parse_ini_file('/boot/config/plugins/dynamix.my.servers/myservers.cfg', true);
|
||||
@@ -146,7 +186,7 @@ if (!empty($username) && !empty($password)) {
|
||||
my_logger("Successful login user {$username} from {$remote_addr}");
|
||||
|
||||
// Redirect the user to the start page
|
||||
header("Location: /".$start_page);
|
||||
header("Location: /" . $start_page);
|
||||
exit;
|
||||
} catch (Exception $exception) {
|
||||
// Set error message
|
||||
@@ -154,7 +194,7 @@ if (!empty($username) && !empty($password)) {
|
||||
|
||||
// Log error to syslog
|
||||
my_logger("Unsuccessful login user {$username} from {$remote_addr}");
|
||||
appendToFile($failFile, $time."\n");
|
||||
appendToFile($failFile, $time . "\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,6 +211,7 @@ $isDarkTheme = $themeHelper->isDarkTheme();
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" class="<?= $themeHelper->getThemeHtmlClass() ?>">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
@@ -182,258 +223,366 @@ $isDarkTheme = $themeHelper->isDarkTheme();
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta http-equiv="Content-Security-Policy" content="block-all-mixed-content">
|
||||
<meta name="referrer" content="same-origin">
|
||||
<title><?=$var['NAME']?>/Login</title>
|
||||
<title><?= $var['NAME'] ?>/Login</title>
|
||||
<style>
|
||||
/************************
|
||||
/************************
|
||||
/
|
||||
/ Fonts
|
||||
/
|
||||
/************************/
|
||||
@font-face{font-family:clear-sans;font-weight:normal;font-style:normal; src:url('/webGui/styles/clear-sans.woff?v=20220513') format('woff')}
|
||||
@font-face{font-family:clear-sans;font-weight:bold;font-style:normal; src:url('/webGui/styles/clear-sans-bold.woff?v=20220513') format('woff')}
|
||||
@font-face{font-family:clear-sans;font-weight:normal;font-style:italic; src:url('/webGui/styles/clear-sans-italic.woff?v=20220513') format('woff')}
|
||||
@font-face{font-family:clear-sans;font-weight:bold;font-style:italic; src:url('/webGui/styles/clear-sans-bold-italic.woff?v=20220513') format('woff')}
|
||||
@font-face{font-family:bitstream;font-weight:normal;font-style:normal; src:url('/webGui/styles/bitstream.woff?v=20220513') format('woff')}
|
||||
@font-face{font-family:bitstream;font-weight:bold;font-style:normal; src:url('/webGui/styles/bitstream-bold.woff?v=20220513') format('woff')}
|
||||
@font-face{font-family:bitstream;font-weight:normal;font-style:italic; src:url('/webGui/styles/bitstream-italic.woff?v=20220513') format('woff')}
|
||||
@font-face{font-family:bitstream;font-weight:bold;font-style:italic; src:url('/webGui/styles/bitstream-bold-italic.woff?v=20220513') format('woff')}
|
||||
@font-face {
|
||||
font-family: clear-sans;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
src: url('/webGui/styles/clear-sans.woff?v=20220513') format('woff')
|
||||
}
|
||||
|
||||
/************************
|
||||
@font-face {
|
||||
font-family: clear-sans;
|
||||
font-weight: bold;
|
||||
font-style: normal;
|
||||
src: url('/webGui/styles/clear-sans-bold.woff?v=20220513') format('woff')
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: clear-sans;
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
src: url('/webGui/styles/clear-sans-italic.woff?v=20220513') format('woff')
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: clear-sans;
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
src: url('/webGui/styles/clear-sans-bold-italic.woff?v=20220513') format('woff')
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: bitstream;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
src: url('/webGui/styles/bitstream.woff?v=20220513') format('woff')
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: bitstream;
|
||||
font-weight: bold;
|
||||
font-style: normal;
|
||||
src: url('/webGui/styles/bitstream-bold.woff?v=20220513') format('woff')
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: bitstream;
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
src: url('/webGui/styles/bitstream-italic.woff?v=20220513') format('woff')
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: bitstream;
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
src: url('/webGui/styles/bitstream-bold-italic.woff?v=20220513') format('woff')
|
||||
}
|
||||
|
||||
/************************
|
||||
/
|
||||
/ General styling
|
||||
/
|
||||
/************************/
|
||||
body {
|
||||
background: <?=$isDarkTheme?'#1C1B1B':'#F2F2F2'?>;
|
||||
color: <?=$isDarkTheme?'#fff':'#1c1b1b'?>;
|
||||
font-family: clear-sans, sans-serif;
|
||||
font-size: .875rem;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
a {
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
letter-spacing: 2px;
|
||||
color: #FF8C2F;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
color: #f15a2c;
|
||||
}
|
||||
h1 {
|
||||
font-size: 1.8em;
|
||||
margin: 0;
|
||||
}
|
||||
h2 {
|
||||
font-size: 0.8em;
|
||||
margin-top: 0;
|
||||
margin-bottom: 1.8em;
|
||||
}
|
||||
.button {
|
||||
color: #ff8c2f;
|
||||
font-family: clear-sans, sans-serif;
|
||||
background: -webkit-gradient(linear,left top,right top,from(#e03237),to(#fd8c3c)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e03237),to(#fd8c3c)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e03237),to(#e03237)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#fd8c3c),to(#fd8c3c)) 100% 100% no-repeat;
|
||||
background: linear-gradient(90deg,#e03237 0,#fd8c3c) 0 0 no-repeat,linear-gradient(90deg,#e03237 0,#fd8c3c) 0 100% no-repeat,linear-gradient(0deg,#e03237 0,#e03237) 0 100% no-repeat,linear-gradient(0deg,#fd8c3c 0,#fd8c3c) 100% 100% no-repeat;
|
||||
background-size: 100% 2px,100% 2px,2px 100%,2px 100%;
|
||||
}
|
||||
.button:hover {
|
||||
color: #fff;
|
||||
background-color: #f15a2c;
|
||||
background: -webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));
|
||||
background: linear-gradient(90deg,#e22828 0,#ff8c2f);
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.button--small {
|
||||
font-size: .875rem;
|
||||
font-weight: 600;
|
||||
line-height: 1;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
background-color: transparent;
|
||||
border-radius: .125rem;
|
||||
border: 0;
|
||||
-webkit-transition: none;
|
||||
transition: none;
|
||||
padding: .75rem 1.5rem;
|
||||
}
|
||||
[type=email], [type=number], [type=password], [type=search], [type=tel], [type=text], [type=url], textarea {
|
||||
font-family: clear-sans, sans-serif;
|
||||
font-size: .875rem;
|
||||
background-color: #F2F2F2;
|
||||
width: 100%;
|
||||
margin-bottom: 1rem;
|
||||
border: 2px solid #ccc;
|
||||
padding: .75rem 1rem;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
border-radius: 0;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
[type=email]:active, [type=email]:focus, [type=number]:active, [type=number]:focus, [type=password]:active, [type=password]:focus, [type=search]:active, [type=search]:focus, [type=tel]:active, [type=tel]:focus, [type=text]:active, [type=text]:focus, [type=url]:active, [type=url]:focus, textarea:active, textarea:focus {
|
||||
border-color: #ff8c2f;
|
||||
outline: none;
|
||||
}
|
||||
body {
|
||||
background: <?= $isDarkTheme ? '#1C1B1B' : '#F2F2F2' ?>;
|
||||
color: <?= $isDarkTheme ? '#fff' : '#1c1b1b' ?>;
|
||||
font-family: clear-sans, sans-serif;
|
||||
font-size: .875rem;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/************************
|
||||
a {
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
letter-spacing: 2px;
|
||||
color: #FF8C2F;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #f15a2c;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.8em;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 0.8em;
|
||||
margin-top: 0;
|
||||
margin-bottom: 1.8em;
|
||||
}
|
||||
|
||||
.button {
|
||||
color: #ff8c2f;
|
||||
font-family: clear-sans, sans-serif;
|
||||
background: -webkit-gradient(linear, left top, right top, from(#e03237), to(#fd8c3c)) 0 0 no-repeat, -webkit-gradient(linear, left top, right top, from(#e03237), to(#fd8c3c)) 0 100% no-repeat, -webkit-gradient(linear, left bottom, left top, from(#e03237), to(#e03237)) 0 100% no-repeat, -webkit-gradient(linear, left bottom, left top, from(#fd8c3c), to(#fd8c3c)) 100% 100% no-repeat;
|
||||
background: linear-gradient(90deg, #e03237 0, #fd8c3c) 0 0 no-repeat, linear-gradient(90deg, #e03237 0, #fd8c3c) 0 100% no-repeat, linear-gradient(0deg, #e03237 0, #e03237) 0 100% no-repeat, linear-gradient(0deg, #fd8c3c 0, #fd8c3c) 100% 100% no-repeat;
|
||||
background-size: 100% 2px, 100% 2px, 2px 100%, 2px 100%;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
color: #fff;
|
||||
background-color: #f15a2c;
|
||||
background: -webkit-gradient(linear, left top, right top, from(#e22828), to(#ff8c2f));
|
||||
background: linear-gradient(90deg, #e22828 0, #ff8c2f);
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.button--small {
|
||||
font-size: .875rem;
|
||||
font-weight: 600;
|
||||
line-height: 1;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
background-color: transparent;
|
||||
border-radius: .125rem;
|
||||
border: 0;
|
||||
-webkit-transition: none;
|
||||
transition: none;
|
||||
padding: .75rem 1.5rem;
|
||||
}
|
||||
|
||||
[type=email],
|
||||
[type=number],
|
||||
[type=password],
|
||||
[type=search],
|
||||
[type=tel],
|
||||
[type=text],
|
||||
[type=url],
|
||||
textarea {
|
||||
font-family: clear-sans, sans-serif;
|
||||
font-size: .875rem;
|
||||
background-color: #F2F2F2;
|
||||
width: 100%;
|
||||
margin-bottom: 1rem;
|
||||
border: 2px solid #ccc;
|
||||
padding: .75rem 1rem;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
border-radius: 0;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
[type=email]:active,
|
||||
[type=email]:focus,
|
||||
[type=number]:active,
|
||||
[type=number]:focus,
|
||||
[type=password]:active,
|
||||
[type=password]:focus,
|
||||
[type=search]:active,
|
||||
[type=search]:focus,
|
||||
[type=tel]:active,
|
||||
[type=tel]:focus,
|
||||
[type=text]:active,
|
||||
[type=text]:focus,
|
||||
[type=url]:active,
|
||||
[type=url]:focus,
|
||||
textarea:active,
|
||||
textarea:focus {
|
||||
border-color: #ff8c2f;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/************************
|
||||
/
|
||||
/ Login specific styling
|
||||
/
|
||||
/************************/
|
||||
#login {
|
||||
width: 500px;
|
||||
margin: 6rem auto;
|
||||
border-radius: 10px;
|
||||
background: <?=$isDarkTheme?'#2B2A29':'#fff'?>;
|
||||
}
|
||||
#login::after {
|
||||
content: "";
|
||||
clear: both;
|
||||
display: table;
|
||||
}
|
||||
#login .logo {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
height: 120px;
|
||||
border-radius: 10px 10px 0 0;
|
||||
}
|
||||
#login .wordmark {
|
||||
z-index: 1;
|
||||
position: relative;
|
||||
padding: 2rem;
|
||||
}
|
||||
#login .wordmark svg {
|
||||
width: 100px;
|
||||
}
|
||||
#login .case {
|
||||
float: right;
|
||||
width: 30%;
|
||||
font-size: 6rem;
|
||||
text-align: center;
|
||||
}
|
||||
#login .case img {
|
||||
max-width: 96px;
|
||||
max-height: 96px;
|
||||
}
|
||||
#login .error {
|
||||
color: red;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
#login .content {
|
||||
padding: 2rem;
|
||||
}
|
||||
#login .form {
|
||||
width: 65%;
|
||||
}
|
||||
.angle:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
background-color: #f15a2c;
|
||||
background: -webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));
|
||||
background: linear-gradient(90deg,#e22828 0,#ff8c2f);
|
||||
-webkit-transform-origin: bottom left;
|
||||
transform-origin: bottom left;
|
||||
-webkit-transform: skewY(-6deg);
|
||||
transform: skewY(-6deg);
|
||||
-webkit-transition: -webkit-transform .15s linear;
|
||||
transition: -webkit-transform .15s linear;
|
||||
transition: transform .15s linear;
|
||||
transition: transform .15s linear,-webkit-transform .15s linear;
|
||||
}
|
||||
.shadow {
|
||||
-webkit-box-shadow: 0 2px 8px 0 rgba(0,0,0,.12);
|
||||
box-shadow: 0 2px 8px 0 rgba(0,0,0,.12);
|
||||
}
|
||||
.hidden { display: none; }
|
||||
/************************
|
||||
#login {
|
||||
width: 500px;
|
||||
margin: 6rem auto;
|
||||
border-radius: 10px;
|
||||
background: <?= $isDarkTheme ? '#2B2A29' : '#fff' ?>;
|
||||
}
|
||||
|
||||
#login::after {
|
||||
content: "";
|
||||
clear: both;
|
||||
display: table;
|
||||
}
|
||||
|
||||
#login .logo {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
height: 120px;
|
||||
border-radius: 10px 10px 0 0;
|
||||
}
|
||||
|
||||
#login .wordmark {
|
||||
z-index: 1;
|
||||
position: relative;
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
#login .wordmark svg {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
#login .case {
|
||||
float: right;
|
||||
width: 30%;
|
||||
font-size: 6rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#login .case img {
|
||||
max-width: 96px;
|
||||
max-height: 96px;
|
||||
}
|
||||
|
||||
#login .error {
|
||||
color: red;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
#login .content {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
#login .form {
|
||||
width: 65%;
|
||||
}
|
||||
|
||||
.angle:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
background-color: #f15a2c;
|
||||
background: -webkit-gradient(linear, left top, right top, from(#e22828), to(#ff8c2f));
|
||||
background: linear-gradient(90deg, #e22828 0, #ff8c2f);
|
||||
-webkit-transform-origin: bottom left;
|
||||
transform-origin: bottom left;
|
||||
-webkit-transform: skewY(-6deg);
|
||||
transform: skewY(-6deg);
|
||||
-webkit-transition: -webkit-transform .15s linear;
|
||||
transition: -webkit-transform .15s linear;
|
||||
transition: transform .15s linear;
|
||||
transition: transform .15s linear, -webkit-transform .15s linear;
|
||||
}
|
||||
|
||||
.shadow {
|
||||
-webkit-box-shadow: 0 2px 8px 0 rgba(0, 0, 0, .12);
|
||||
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, .12);
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/************************
|
||||
/
|
||||
/ Cases
|
||||
/
|
||||
/************************/
|
||||
[class^="case-"], [class*=" case-"] {
|
||||
/* use !important to prevent issues with browser extensions that change fonts */
|
||||
font-family: 'cases' !important;
|
||||
speak: none;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
[class^="case-"],
|
||||
[class*=" case-"] {
|
||||
/* use !important to prevent issues with browser extensions that change fonts */
|
||||
font-family: 'cases' !important;
|
||||
speak: none;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
|
||||
/* Better Font Rendering =========== */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
/* Better Font Rendering =========== */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
/************************
|
||||
/************************
|
||||
/
|
||||
/ Media queries for mobile responsive
|
||||
/
|
||||
/************************/
|
||||
@media (max-width: 500px) {
|
||||
body {
|
||||
background: <?=$isDarkTheme?'#2B2A29':'#fff'?>;
|
||||
@media (max-width: 500px) {
|
||||
body {
|
||||
background: <?= $isDarkTheme ? '#2B2A29' : '#fff' ?>;
|
||||
}
|
||||
|
||||
[type=email],
|
||||
[type=number],
|
||||
[type=password],
|
||||
[type=search],
|
||||
[type=tel],
|
||||
[type=text],
|
||||
[type=url],
|
||||
textarea {
|
||||
font-size: 16px;
|
||||
/* This prevents the mobile browser from zooming in on the input-field. */
|
||||
}
|
||||
|
||||
#login {
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#login .logo {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.shadow {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
[type=email], [type=number], [type=password], [type=search], [type=tel], [type=text], [type=url], textarea {
|
||||
font-size: 16px; /* This prevents the mobile browser from zooming in on the input-field. */
|
||||
}
|
||||
#login {
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
width: 100%;
|
||||
}
|
||||
#login .logo {
|
||||
border-radius: 0;
|
||||
}
|
||||
.shadow {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/default-cases.css")?>">
|
||||
<link type="image/png" rel="shortcut icon" href="/webGui/images/<?=$var['mdColor']?>.png">
|
||||
<link type="text/css" rel="stylesheet" href="<? autov("/webGui/styles/default-cases.css") ?>">
|
||||
<link type="image/png" rel="shortcut icon" href="/webGui/images/<?= $var['mdColor'] ?>.png">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<section id="login" class="shadow">
|
||||
<div class="logo angle">
|
||||
<div class="wordmark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 222.4 39" class="Nav__logo--white"><path fill="#ffffff" d="M146.70000000000002 29.5H135l-3 9h-6.5L138.9 0h8l13.4 38.5h-7.1L142.6 6.9l-5.8 16.9h8.2l1.7 5.7zM29.7 0v25.4c0 8.9-5.8 13.6-14.9 13.6C5.8 39 0 34.3 0 25.4V0h6.5v25.4c0 5.2 3.2 7.9 8.2 7.9 5.2 0 8.4-2.7 8.4-7.9V0h6.6zM50.9 12v26.5h-6.5V0h6.1l17 26.5V0H74v38.5h-6.1L50.9 12zM171.3 0h6.5v38.5h-6.5V0zM222.4 24.7c0 9-5.9 13.8-15.2 13.8h-14.5V0h14.6c9.2 0 15.1 4.8 15.1 13.8v10.9zm-6.6-10.9c0-5.3-3.3-8.1-8.5-8.1h-8.1v27.1h8c5.3 0 8.6-2.8 8.6-8.1V13.8zM108.3 23.9c4.3-1.6 6.9-5.3 6.9-11.5 0-8.7-5.1-12.4-12.8-12.4H88.8v38.5h6.5V5.7h6.9c3.8 0 6.2 1.8 6.2 6.7s-2.4 6.8-6.2 6.8h-3.4l9.2 19.4h7.5l-7.2-14.7z"></path></svg></div>
|
||||
<div class="wordmark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 222.4 39" class="Nav__logo--white">
|
||||
<path fill="#ffffff" d="M146.70000000000002 29.5H135l-3 9h-6.5L138.9 0h8l13.4 38.5h-7.1L142.6 6.9l-5.8 16.9h8.2l1.7 5.7zM29.7 0v25.4c0 8.9-5.8 13.6-14.9 13.6C5.8 39 0 34.3 0 25.4V0h6.5v25.4c0 5.2 3.2 7.9 8.2 7.9 5.2 0 8.4-2.7 8.4-7.9V0h6.6zM50.9 12v26.5h-6.5V0h6.1l17 26.5V0H74v38.5h-6.1L50.9 12zM171.3 0h6.5v38.5h-6.5V0zM222.4 24.7c0 9-5.9 13.8-15.2 13.8h-14.5V0h14.6c9.2 0 15.1 4.8 15.1 13.8v10.9zm-6.6-10.9c0-5.3-3.3-8.1-8.5-8.1h-8.1v27.1h8c5.3 0 8.6-2.8 8.6-8.1V13.8zM108.3 23.9c4.3-1.6 6.9-5.3 6.9-11.5 0-8.7-5.1-12.4-12.8-12.4H88.8v38.5h6.5V5.7h6.9c3.8 0 6.2 1.8 6.2 6.7s-2.4 6.8-6.2 6.8h-3.4l9.2 19.4h7.5l-7.2-14.7z"></path>
|
||||
</svg></div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<h1>
|
||||
<?=htmlspecialchars($var['NAME'])?>
|
||||
<?= htmlspecialchars($var['NAME']) ?>
|
||||
</h1>
|
||||
<h2>
|
||||
<?=htmlspecialchars($var['COMMENT'])?>
|
||||
<?= htmlspecialchars($var['COMMENT']) ?>
|
||||
</h2>
|
||||
|
||||
<div class="case">
|
||||
<?if ($myCase):?>
|
||||
<?if (substr($myCase,-4)!='.png'):?>
|
||||
<span class='case-<?=$myCase?>'></span>
|
||||
<?else:?>
|
||||
<img src='<?=autov("/webGui/images/$myCase")?>'>
|
||||
<?endif;?>
|
||||
<?endif;?>
|
||||
<? if ($myCase): ?>
|
||||
<? if (substr($myCase, -4) != '.png'): ?>
|
||||
<span class='case-<?= $myCase ?>'></span>
|
||||
<? else: ?>
|
||||
<img src='<?= autov("/webGui/images/$myCase") ?>'>
|
||||
<? endif; ?>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="form">
|
||||
<form action="/login" method="POST">
|
||||
<p>
|
||||
<input name="username" type="text" placeholder="<?=_('Username')?>" autocapitalize="none" autocomplete="off" spellcheck="false" autofocus required>
|
||||
<input name="password" type="password" placeholder="<?=_('Password')?>" required>
|
||||
<input name="username" type="text" placeholder="<?= _('Username') ?>" autocapitalize="none" autocomplete="off" spellcheck="false" autofocus required>
|
||||
<input name="password" type="password" placeholder="<?= _('Password') ?>" required>
|
||||
</p>
|
||||
<p>
|
||||
<button type="submit" class="button button--small"><?=_('Login')?></button>
|
||||
<button type="submit" class="button button--small"><?= _('Login') ?></button>
|
||||
</p>
|
||||
<?php if ($error) { ?>
|
||||
<p class="error"><?= $error ?></p>
|
||||
@@ -441,24 +590,25 @@ $isDarkTheme = $themeHelper->isDarkTheme();
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<a href="https://docs.unraid.net/go/lost-root-password/" target="_blank"><?=_('Password recovery')?></a>
|
||||
<a href="https://docs.unraid.net/go/lost-root-password/" target="_blank"><?= _('Password recovery') ?></a>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script type="text/javascript">
|
||||
document.cookie = "cookietest=1";
|
||||
cookieEnabled = document.cookie.indexOf("cookietest=")!=-1;
|
||||
cookieEnabled = document.cookie.indexOf("cookietest=") != -1;
|
||||
document.cookie = "cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT";
|
||||
if (!cookieEnabled) {
|
||||
const formParentElement = document.querySelector('.form');
|
||||
const errorElement = document.createElement('p');
|
||||
errorElement.classList.add('error');
|
||||
errorElement.textContent = "<?=_('Please enable cookies to use the Unraid webGUI')?>";
|
||||
errorElement.textContent = "<?= _('Please enable cookies to use the Unraid webGUI') ?>";
|
||||
|
||||
document.body.textContent = '';
|
||||
document.body.appendChild(errorElement);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -28,22 +28,22 @@ $entity = $notify['entity'] & 1 == 1;
|
||||
$alerts = '/tmp/plugins/my_alerts.txt';
|
||||
$wlan0 = file_exists('/sys/class/net/wlan0');
|
||||
|
||||
$safemode = _var($var,'safeMode')=='yes';
|
||||
$safemode = _var($var, 'safeMode') == 'yes';
|
||||
$banner = "$config/webGui/banner.png";
|
||||
|
||||
$notes = '/var/tmp/unRAIDServer.txt';
|
||||
if (!file_exists($notes)) {
|
||||
file_put_contents($notes, shell_exec("$docroot/plugins/dynamix.plugin.manager/scripts/plugin changes $docroot/plugins/unRAIDServer/unRAIDServer.plg"));
|
||||
file_put_contents($notes, shell_exec("$docroot/plugins/dynamix.plugin.manager/scripts/plugin changes $docroot/plugins/unRAIDServer/unRAIDServer.plg"));
|
||||
}
|
||||
|
||||
$taskPages = find_pages('Tasks');
|
||||
$buttonPages = find_pages('Buttons');
|
||||
$pages = []; // finds subpages
|
||||
if (!empty($myPage['text'])) $pages[$myPage['name']] = $myPage;
|
||||
if (_var($myPage,'Type')=='xmenu') $pages = array_merge($pages, find_pages($myPage['name']));
|
||||
if (_var($myPage, 'Type') == 'xmenu') $pages = array_merge($pages, find_pages($myPage['name']));
|
||||
|
||||
// nchan related actions
|
||||
$nchan = ['webGui/nchan/notify_poller','webGui/nchan/session_check'];
|
||||
$nchan = ['webGui/nchan/notify_poller', 'webGui/nchan/session_check'];
|
||||
if ($wlan0) $nchan[] = 'webGui/nchan/wlan0';
|
||||
// build nchan scripts from found pages
|
||||
$allPages = array_merge($taskPages, $buttonPages, $pages);
|
||||
@@ -52,96 +52,94 @@ foreach ($allPages as $page) {
|
||||
}
|
||||
// act on nchan scripts
|
||||
if (count($pages)) {
|
||||
$running = file_exists($nchan_pid) ? file($nchan_pid,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES) : [];
|
||||
$running = file_exists($nchan_pid) ? file($nchan_pid, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) : [];
|
||||
$start = array_diff($nchan, $running); // returns any new scripts to be started
|
||||
$stop = array_diff($running, $nchan); // returns any old scripts to be stopped
|
||||
$running = array_merge($start, $running); // update list of current running nchan scripts
|
||||
// start nchan scripts which are new
|
||||
foreach ($start as $row) {
|
||||
$script = explode(':',$row)[0];
|
||||
$script = explode(':', $row)[0];
|
||||
exec("$docroot/$script &>/dev/null &");
|
||||
}
|
||||
// stop nchan scripts with the :stop option
|
||||
foreach ($stop as $row) {
|
||||
[$script,$opt] = my_explode(':',$row);
|
||||
[$script, $opt] = my_explode(':', $row);
|
||||
if ($opt == 'stop') {
|
||||
exec("pkill -f $docroot/$script &>/dev/null &");
|
||||
array_splice($running,array_search($row,$running),1);
|
||||
array_splice($running, array_search($row, $running), 1);
|
||||
}
|
||||
}
|
||||
if (count($running)) file_put_contents($nchan_pid,implode("\n",$running)."\n"); else @unlink($nchan_pid);
|
||||
if (count($running)) file_put_contents($nchan_pid, implode("\n", $running) . "\n");
|
||||
else @unlink($nchan_pid);
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html <?=$display['rtl']?>lang="<?=strtok($locale, '_') ?: 'en'?>" class="<?= $themeHelper->getThemeHtmlClass() ?>">
|
||||
<html <?= $display['rtl'] ?>lang="<?= strtok($locale, '_') ?: 'en' ?>" class="<?= $themeHelper->getThemeHtmlClass() ?>">
|
||||
|
||||
<head>
|
||||
<title><?=_var($var, 'NAME')?>/<?=_var($myPage, 'name')?></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv="Content-Security-Policy" content="block-all-mixed-content">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta name="referrer" content="same-origin">
|
||||
<link type="image/png" rel="shortcut icon" href="/webGui/images/<?=_var($var, 'mdColor', 'red-on')?>.png">
|
||||
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/default-fonts.css")?>">
|
||||
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/default-cases.css")?>">
|
||||
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/font-awesome.css")?>">
|
||||
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/context.standalone.css")?>">
|
||||
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/jquery.sweetalert.css")?>">
|
||||
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/jquery.ui.css")?>">
|
||||
<title><?= _var($var, 'NAME') ?>/<?= _var($myPage, 'name') ?></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv="Content-Security-Policy" content="block-all-mixed-content">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta name="referrer" content="same-origin">
|
||||
<link type="image/png" rel="shortcut icon" href="/webGui/images/<?= _var($var, 'mdColor', 'red-on') ?>.png">
|
||||
<link type="text/css" rel="stylesheet" href="<? autov("/webGui/styles/default-fonts.css") ?>">
|
||||
<link type="text/css" rel="stylesheet" href="<? autov("/webGui/styles/default-cases.css") ?>">
|
||||
<link type="text/css" rel="stylesheet" href="<? autov("/webGui/styles/font-awesome.css") ?>">
|
||||
<link type="text/css" rel="stylesheet" href="<? autov("/webGui/styles/context.standalone.css") ?>">
|
||||
<link type="text/css" rel="stylesheet" href="<? autov("/webGui/styles/jquery.sweetalert.css") ?>">
|
||||
<link type="text/css" rel="stylesheet" href="<? autov("/webGui/styles/jquery.ui.css") ?>">
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/default-color-palette.css")?>">
|
||||
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/default-base.css")?>">
|
||||
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/default-dynamix.css")?>">
|
||||
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/themes/{$theme}.css")?>">
|
||||
<link type="text/css" rel="stylesheet" href="<? autov("/webGui/styles/default-color-palette.css") ?>">
|
||||
<link type="text/css" rel="stylesheet" href="<? autov("/webGui/styles/default-base.css") ?>">
|
||||
<link type="text/css" rel="stylesheet" href="<? autov("/webGui/styles/default-dynamix.css") ?>">
|
||||
<link type="text/css" rel="stylesheet" href="<? autov("/webGui/styles/themes/{$theme}.css") ?>">
|
||||
|
||||
<style>
|
||||
:root {
|
||||
--customer-header-background-image: url(<?= file_exists($banner) ? autov($banner) : autov('/webGui/images/banner.png') ?>);
|
||||
<?if ($header):?>
|
||||
--customer-header-text-color: #<?=$header?>;
|
||||
<?endif;?>
|
||||
<?if ($backgnd):?>
|
||||
--customer-header-background-color: #<?=$backgnd?>;
|
||||
<?endif;?>
|
||||
<?if ($display['font']):?>
|
||||
--custom-font-size: <?=$display['font']?>%;
|
||||
<?endif;?>
|
||||
}
|
||||
<style>
|
||||
:root {
|
||||
--customer-header-background-image: url(<?= file_exists($banner) ? autov($banner) : autov('/webGui/images/banner.png') ?>);
|
||||
<? if ($header): ?>--customer-header-text-color: #<?= $header ?>;
|
||||
<? endif; ?><? if ($backgnd): ?>--customer-header-background-color: #<?= $backgnd ?>;
|
||||
<? endif; ?><? if ($display['font']): ?>--custom-font-size: <?= $display['font'] ?>%;
|
||||
<? endif; ?>
|
||||
}
|
||||
|
||||
<?php
|
||||
// Generate sidebar icon CSS if using sidebar theme
|
||||
if ($themeHelper->isSidebarTheme()) {
|
||||
echo generate_sidebar_icon_css($taskPages, $buttonPages);
|
||||
}
|
||||
?>
|
||||
</style>
|
||||
<?php
|
||||
// Generate sidebar icon CSS if using sidebar theme
|
||||
if ($themeHelper->isSidebarTheme()) {
|
||||
echo generate_sidebar_icon_css($taskPages, $buttonPages);
|
||||
}
|
||||
?>
|
||||
</style>
|
||||
|
||||
<noscript>
|
||||
<div class="upgrade_notice"><?=_("Your browser has JavaScript disabled")?></div>
|
||||
</noscript>
|
||||
<noscript>
|
||||
<div class="upgrade_notice"><?= _("Your browser has JavaScript disabled") ?></div>
|
||||
</noscript>
|
||||
|
||||
<script src="<?autov('/webGui/javascript/dynamix.js')?>"></script>
|
||||
<script src="<?autov('/webGui/javascript/translate.'.($locale?:'en_US').'.js')?>"></script>
|
||||
<script src="<? autov('/webGui/javascript/dynamix.js') ?>"></script>
|
||||
<script src="<? autov('/webGui/javascript/translate.' . ($locale ?: 'en_US') . '.js') ?>"></script>
|
||||
|
||||
<? require_once "$docroot/webGui/include/DefaultPageLayout/HeadInlineJS.php"; ?>
|
||||
<? require_once "$docroot/webGui/include/DefaultPageLayout/HeadInlineJS.php"; ?>
|
||||
<?php
|
||||
foreach ($buttonPages as $button) {
|
||||
annotate($button['file']);
|
||||
includePageStylesheets($button);
|
||||
eval('?>' . parse_text($button['text']));
|
||||
}
|
||||
|
||||
<?php
|
||||
foreach ($buttonPages as $button) {
|
||||
annotate($button['file']);
|
||||
includePageStylesheets($button);
|
||||
eval('?>'.parse_text($button['text']));
|
||||
}
|
||||
foreach ($pages as $page) {
|
||||
annotate($page['file']);
|
||||
includePageStylesheets($page);
|
||||
}
|
||||
?>
|
||||
|
||||
foreach ($pages as $page) {
|
||||
annotate($page['file']);
|
||||
includePageStylesheets($page);
|
||||
}
|
||||
?>
|
||||
|
||||
<?include "$docroot/plugins/dynamix.my.servers/include/myservers1.php"?>
|
||||
<? include "$docroot/plugins/dynamix.my.servers/include/myservers1.php" ?>
|
||||
<? require_once "$docroot/webGui/include/DefaultPageLayout/GUIModeSessionFix.php"; ?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<? include "$docroot/webGui/include/DefaultPageLayout/Header.php"; ?>
|
||||
<? include "$docroot/webGui/include/DefaultPageLayout/Navigation/Main.php"; ?>
|
||||
@@ -149,5 +147,7 @@ foreach ($pages as $page) {
|
||||
<? include "$docroot/webGui/include/DefaultPageLayout/Footer.php"; ?>
|
||||
<? include "$docroot/webGui/include/DefaultPageLayout/MiscElements.php"; ?>
|
||||
<? include "$docroot/webGui/include/DefaultPageLayout/BodyInlineJS.php"; ?>
|
||||
<? include "$docroot/webGui/include/DefaultPageLayout/ToastSetup.php"; ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</html>
|
||||
@@ -71,32 +71,7 @@ defaultPage.on('message', function(msg,meta) {
|
||||
$('#statusbar').html(status);
|
||||
break;
|
||||
case 2:
|
||||
// notifications
|
||||
var bell1 = 0, bell2 = 0, bell3 = 0;
|
||||
$.each($.parseJSON(msg), function(i, notify){
|
||||
switch (notify.importance) {
|
||||
case 'alert' : bell1++; break;
|
||||
case 'warning': bell2++; break;
|
||||
case 'normal' : bell3++; break;
|
||||
}
|
||||
<?if ($notify['display']==0):?>
|
||||
if (notify.show) {
|
||||
$.jGrowl(notify.subject+'<br>'+notify.description,{
|
||||
group: notify.importance,
|
||||
header: notify.event+': '+notify.timestamp,
|
||||
theme: notify.file,
|
||||
beforeOpen: function(e,m,o){if ($('div.jGrowl-notification').hasClass(notify.file)) return(false);},
|
||||
afterOpen: function(e,m,o){if (notify.link) $(e).css('cursor','pointer');},
|
||||
click: function(e,m,o){if (notify.link) location.replace(notify.link);},
|
||||
close: function(e,m,o){$.post('/webGui/include/Notify.php',{cmd:'hide',file:"<?=$notify['path'].'/unread/'?>"+notify.file,csrf_token:csrf_token}<?if ($notify['life']==0):?>,function(){$.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file,csrf_token:csrf_token});}<?endif;?>);}
|
||||
});
|
||||
}
|
||||
<?endif;?>
|
||||
});
|
||||
$('#bell').removeClass('red-orb yellow-orb green-orb').prop('title',"<?=_('Alerts')?> ["+bell1+']\n'+"<?=_('Warnings')?> ["+bell2+']\n'+"<?=_('Notices')?> ["+bell3+']');
|
||||
if (bell1) $('#bell').addClass('red-orb'); else
|
||||
if (bell2) $('#bell').addClass('yellow-orb'); else
|
||||
if (bell3) $('#bell').addClass('green-orb');
|
||||
// notifications - moved to the Unraid API
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is used to fix the session for the Unraid web interface when booted in GUI mode.
|
||||
* This can be deleted if GUI mode authentication is enabled.
|
||||
*/
|
||||
|
||||
function is_localhost()
|
||||
{
|
||||
// Use the peer IP, not the Host header which can be spoofed
|
||||
return $_SERVER['REMOTE_ADDR'] === '127.0.0.1' || $_SERVER['REMOTE_ADDR'] === '::1';
|
||||
}
|
||||
function is_good_session()
|
||||
{
|
||||
return isset($_SESSION) && isset($_SESSION['unraid_user']) && isset($_SESSION['unraid_login']);
|
||||
}
|
||||
if (is_localhost() && !is_good_session()) {
|
||||
if (session_status() === PHP_SESSION_ACTIVE) {
|
||||
session_destroy();
|
||||
}
|
||||
session_start();
|
||||
$_SESSION['unraid_login'] = time();
|
||||
$_SESSION['unraid_user'] = 'root';
|
||||
session_write_close();
|
||||
my_logger("Unraid GUI-boot: created root session for localhost request.");
|
||||
}
|
||||
?>
|
||||
@@ -477,32 +477,6 @@ function digits(number) {
|
||||
return 'three';
|
||||
}
|
||||
|
||||
function openNotifier() {
|
||||
$.post('/webGui/include/Notify.php',{cmd:'get',csrf_token:csrf_token},function(msg) {
|
||||
$.each($.parseJSON(msg), function(i, notify){
|
||||
$.jGrowl(notify.subject+'<br>'+notify.description,{
|
||||
group: notify.importance,
|
||||
header: notify.event+': '+notify.timestamp,
|
||||
theme: notify.file,
|
||||
sticky: true,
|
||||
beforeOpen: function(e,m,o){if ($('div.jGrowl-notification').hasClass(notify.file)) return(false);},
|
||||
afterOpen: function(e,m,o){if (notify.link) $(e).css('cursor','pointer');},
|
||||
click: function(e,m,o){if (notify.link) location.replace(notify.link);},
|
||||
close: function(e,m,o){$.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file,csrf_token:csrf_token});}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function closeNotifier() {
|
||||
$.post('/webGui/include/Notify.php',{cmd:'get',csrf_token:csrf_token},function(msg) {
|
||||
$.each($.parseJSON(msg), function(i, notify){
|
||||
$.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file,csrf_token:csrf_token});
|
||||
});
|
||||
$('div.jGrowl').find('div.jGrowl-close').trigger('click');
|
||||
});
|
||||
}
|
||||
|
||||
function viewHistory() {
|
||||
location.replace('/Tools/NotificationsArchive');
|
||||
}
|
||||
@@ -536,17 +510,7 @@ $(function() {
|
||||
}
|
||||
$('#'+tab).attr('checked', true);
|
||||
updateTime();
|
||||
$.jGrowl.defaults.closeTemplate = '<i class="fa fa-close"></i>';
|
||||
$.jGrowl.defaults.closerTemplate = '<?=$notify['position'][0]=='b' ? '<div class="bottom">':'<div class="top">'?>[ <?=_("close all notifications")?> ]</div>';
|
||||
$.jGrowl.defaults.position = '<?=$notify['position']?>';
|
||||
$.jGrowl.defaults.theme = '';
|
||||
$.jGrowl.defaults.themeState = '';
|
||||
$.jGrowl.defaults.pool = 10;
|
||||
<?if ($notify['life'] > 0):?>
|
||||
$.jGrowl.defaults.life = <?=$notify['life']*1000?>;
|
||||
<?else:?>
|
||||
$.jGrowl.defaults.sticky = true;
|
||||
<?endif;?>
|
||||
|
||||
Shadowbox.setup('a.sb-enable', {modal:true});
|
||||
// add any pre-existing reboot notices
|
||||
$.post('/webGui/include/Report.php',{cmd:'notice'},function(notices){
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
<div id="header" class="<?=$display['banner']?>">
|
||||
<div class="logo">
|
||||
<a href="https://unraid.net" target="_blank">
|
||||
<?readfile("$docroot/webGui/images/UN-logotype-gradient.svg")?>
|
||||
</a>
|
||||
|
||||
<unraid-i18n-host>
|
||||
<unraid-header-os-version></unraid-header-os-version>
|
||||
</unraid-i18n-host>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<uui-toaster rich-colors close-button position="<?= ($notify['position'] === 'center') ? 'top-center' : $notify['position'] ?>"></uui-toaster>
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
// Function to recursively find JS files in a directory
|
||||
function findJsFiles($directory) {
|
||||
if (!is_dir($directory)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$jsFiles = [];
|
||||
$iterator = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($directory, RecursiveDirectoryIterator::SKIP_DOTS)
|
||||
);
|
||||
|
||||
try {
|
||||
foreach ($iterator as $file) {
|
||||
if ($file->isFile() && $file->getExtension() === 'js') {
|
||||
$path = $file->getPathname();
|
||||
$baseDir = '/usr/local/emhttp';
|
||||
if (strpos($path, $baseDir) === 0) {
|
||||
$path = substr($path, strlen($baseDir));
|
||||
}
|
||||
$jsFiles[] = $path;
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
my_logger("Error scanning for JS files: " . $e->getMessage());
|
||||
return [];
|
||||
}
|
||||
|
||||
return $jsFiles;
|
||||
}
|
||||
|
||||
// Function to get JS files with caching
|
||||
function getCachedJSFiles(string $directory, int $cacheLifetime = 300): array {
|
||||
$cacheDir = sys_get_temp_dir();
|
||||
$cacheFile = "$cacheDir/js_files_cache_" . md5($directory) . ".json";
|
||||
$lockFile = "$cacheFile.lock";
|
||||
|
||||
// Check if cache exists and is still valid
|
||||
$useCache = false;
|
||||
if (file_exists($cacheFile) && (time() - filemtime($cacheFile) < $cacheLifetime)) {
|
||||
$useCache = true;
|
||||
}
|
||||
|
||||
if ($useCache) {
|
||||
$data = @file_get_contents($cacheFile);
|
||||
if ($data === false) {
|
||||
my_logger("Warning: Unable to read JS cache at $cacheFile");
|
||||
$useCache = false;
|
||||
} else {
|
||||
$jsFiles = json_decode($data, true);
|
||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||
my_logger("Warning: Corrupt JSON cache at $cacheFile");
|
||||
$useCache = false;
|
||||
} else {
|
||||
return $jsFiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Acquire lock to rebuild cache safely
|
||||
$lockFp = @fopen($lockFile, 'w');
|
||||
if ($lockFp && flock($lockFp, LOCK_EX | LOCK_NB)) {
|
||||
try {
|
||||
$jsFiles = findJsFiles($directory);
|
||||
if (file_put_contents($cacheFile, json_encode($jsFiles)) === false) {
|
||||
my_logger("Warning: Could not write JS cache to $cacheFile");
|
||||
}
|
||||
flock($lockFp, LOCK_UN);
|
||||
fclose($lockFp);
|
||||
@unlink($lockFile);
|
||||
return $jsFiles;
|
||||
} catch (Exception $e) {
|
||||
my_logger("Error rebuilding JS cache: " . $e->getMessage());
|
||||
flock($lockFp, LOCK_UN);
|
||||
fclose($lockFp);
|
||||
@unlink($lockFile);
|
||||
return findJsFiles($directory);
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback: unable to lock, generate without caching
|
||||
if ($lockFp) {
|
||||
fclose($lockFp);
|
||||
}
|
||||
return findJsFiles($directory);
|
||||
}
|
||||
@@ -26,8 +26,8 @@ case 'Add Route':
|
||||
if ($gateway && $route) exec("/etc/rc.d/rc.inet1 ".escapeshellarg("{$gateway}_{$route}_{$metric}_add"));
|
||||
break;
|
||||
default:
|
||||
exec("ip -4 route show table all|grep -Pv '^(127\\.0\\.0\\.0)|table local|unreachable'",$ipv4);
|
||||
exec("ip -6 route show table all|grep -Pv '^([am:]|(f[ef][0-9][0-9])::)|table local|unreachable'",$ipv6);
|
||||
exec("ip -4 route show table all | grep -Pv '^(127\\.0\\.0\\.0)|table local|unreachable|linkdown|broadcast'",$ipv4);
|
||||
exec("ip -6 route show table all | grep -Pv '^([am:]|(f[ef][0-9][0-9])::)|table local|unreachable|linkdown'",$ipv6);
|
||||
foreach ($ipv4 as $info) {
|
||||
$cell = explode(' ',$info);
|
||||
$route = $cell[0];
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -430,6 +430,11 @@ foreach (glob("$path/*.ini") as $file) {
|
||||
if ($all || $ini != "users") file_put_contents("/$diag/system/vars.txt",preg_replace(["/\n/","/^Array/"],["\r\n",$ini],anonymize(print_r(parse_ini_file($file,true),true),1)),FILE_APPEND);
|
||||
}
|
||||
|
||||
// check for safe mode
|
||||
if (_var($var,'safeMode') == 'yes') {
|
||||
file_put_contents("/$diag/system/safemode.txt", "Unraid safe mode enabled\r\n");
|
||||
}
|
||||
|
||||
// Create loads.txt
|
||||
$cpuload = run("uptime")." Cores: ".run("nproc")."\r\n".(string)@file_get_contents("$path/cpuload.ini")."\r\n";
|
||||
$loadTxt = [];
|
||||
@@ -497,12 +502,20 @@ if (glob("/boot/config/*.conf")) {
|
||||
if (glob("/boot/config/*.dat")) {
|
||||
run("cp -- /boot/config/*.dat ".escapeshellarg("/$diag/config"));
|
||||
}
|
||||
run("cp /boot/config/go ".escapeshellarg("/$diag/config/go.txt"));
|
||||
|
||||
// anonymize go file
|
||||
if (!$all) {
|
||||
run("sed -i -e '/password/c ***line removed***' -e '/user/c ***line removed***' -e '/pass/c ***line removed***' ".escapeshellarg("/$diag/config/go.txt"));
|
||||
// handle go files
|
||||
foreach (['/boot/config/go', '/boot/config/go.safemode'] as $go) {
|
||||
if (file_exists($go)) {
|
||||
$dest = "/$diag/config/" . basename($go) . ".txt";
|
||||
run("cp " . escapeshellarg($go) . " " . escapeshellarg($dest));
|
||||
|
||||
// anonymize go file
|
||||
if (!$all) {
|
||||
run("sed -i -e '/password/c ***line removed***' -e '/user/c ***line removed***' -e '/pass/c ***line removed***' " . escapeshellarg($dest));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// anonymize configuration files
|
||||
if (!$all) {
|
||||
run("find ".escapeshellarg("/$diag/config")." -name '*.cfg' -exec sed -ri 's/^((disk|flash)(Read|Write)List.*=\")[^\"]+/\\1.../' {} \\;");
|
||||
|
||||
@@ -8,9 +8,6 @@ queue(){
|
||||
atq | grep -Pom1 '^\d+'
|
||||
}
|
||||
|
||||
# delayed execution
|
||||
sleep ${1:-1}
|
||||
|
||||
JOB=$(queue)
|
||||
if [[ -n $JOB ]]; then
|
||||
atrm $JOB 2>/dev/null
|
||||
|
||||
@@ -15,6 +15,6 @@ else
|
||||
log "no queued job present"
|
||||
fi
|
||||
|
||||
echo "/usr/local/emhttp/webGui/scripts/reload_services ${1:-1}" | at -M now 2>/dev/null
|
||||
echo "sleep ${1:-1}; /usr/local/emhttp/webGui/scripts/reload_services" | at -M now 2>/dev/null
|
||||
log "queue new job $(queue), wait for ${1:-1}s"
|
||||
exit 0
|
||||
|
||||
@@ -2,27 +2,6 @@
|
||||
* This CSS is specifically for overwriting CSS libraries that dynamix.js uses
|
||||
*/
|
||||
:root {
|
||||
--dynamix-jgrowl-bg-color: var(--gray-500);
|
||||
--dynamix-jgrowl-border-color: var(--gray-600);
|
||||
--dynamix-jgrowl-shadow-color: var(--gray-500);
|
||||
--dynamix-jgrowl-text-color: var(--gray-600);
|
||||
|
||||
--dynamix-jgrowl-alert-bg-color: var(--red-300);
|
||||
--dynamix-jgrowl-alert-border-color: var(--red-600);
|
||||
--dynamix-jgrowl-alert-text-color: var(--red-600);
|
||||
|
||||
--dynamix-jgrowl-warning-bg-color: var(--yellow-200);
|
||||
--dynamix-jgrowl-warning-border-color: var(--orange-300);
|
||||
--dynamix-jgrowl-warning-text-color: var(--orange-300);
|
||||
|
||||
--dynamix-jgrowl-normal-bg-color: var(--green-100);
|
||||
--dynamix-jgrowl-normal-border-color: var(--green-800);
|
||||
--dynamix-jgrowl-normal-text-color: var(--green-800);
|
||||
|
||||
--dynamix-jgrowl-close-text-color: var(--gray-500);
|
||||
--dynamix-jgrowl-close-bg-color: var(--black);
|
||||
--dynamix-jgrowl-close-border: 2px solid var(--gray-300);
|
||||
|
||||
--dynamix-ui-dropdownchecklist-color: var(--gray-100);
|
||||
--dynamix-ui-dropdownchecklist-color-alt1: var(--gray-700);
|
||||
--dynamix-ui-dropdownchecklist-color-alt2: var(--gray-500);
|
||||
@@ -89,132 +68,6 @@
|
||||
--dynamix-awesomplete-mark-selected-bg-color: var(--green-900);
|
||||
}
|
||||
|
||||
.jGrowl {
|
||||
position: fixed;
|
||||
font-size: 1.3rem;
|
||||
z-index: 10001;
|
||||
}
|
||||
.jGrowl.top-left {
|
||||
left: 10px;
|
||||
top: 130px;
|
||||
}
|
||||
.jGrowl.top-right {
|
||||
right: 10px;
|
||||
top: 130px;
|
||||
}
|
||||
.jGrowl.bottom-left {
|
||||
left: 10px;
|
||||
bottom: 24px;
|
||||
}
|
||||
.jGrowl.bottom-right {
|
||||
right: 10px;
|
||||
bottom: 24px;
|
||||
}
|
||||
.jGrowl.center {
|
||||
top: 130px;
|
||||
left: 40%;
|
||||
}
|
||||
.jGrowl.center .jGrowl-closer,
|
||||
.jGrowl.center .jGrowl-notification {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
.jGrowl-notification {
|
||||
opacity: 0.96;
|
||||
min-height: 1.2rem;
|
||||
width: 380px;
|
||||
padding: 10px;
|
||||
margin: 5px 0;
|
||||
text-align: left;
|
||||
border-radius: 6px;
|
||||
|
||||
&.alert {
|
||||
color: var(--dynamix-jgrowl-alert-text-color);
|
||||
background-color: var(--dynamix-jgrowl-alert-bg-color);
|
||||
border: 1px solid var(--dynamix-jgrowl-alert-border-color);
|
||||
box-shadow: 2px 2px 1px var(--dynamix-jgrowl-shadow-color);
|
||||
}
|
||||
|
||||
&.warning {
|
||||
color: var(--dynamix-jgrowl-warning-text-color);
|
||||
background-color: var(--dynamix-jgrowl-warning-bg-color);
|
||||
border: 1px solid var(--dynamix-jgrowl-warning-border-color);
|
||||
box-shadow: 2px 2px 1px var(--dynamix-jgrowl-shadow-color);
|
||||
}
|
||||
|
||||
&.normal {
|
||||
color: var(--dynamix-jgrowl-normal-text-color);
|
||||
background-color: var(--dynamix-jgrowl-normal-bg-color);
|
||||
border: 1px solid var(--dynamix-jgrowl-normal-border-color);
|
||||
box-shadow: 2px 2px 1px var(--dynamix-jgrowl-shadow-color);
|
||||
}
|
||||
|
||||
&.default {
|
||||
color: var(--dynamix-jgrowl-text-color);
|
||||
background-color: var(--dynamix-jgrowl-bg-color);
|
||||
border: 1px solid var(--dynamix-jgrowl-border-color);
|
||||
box-shadow: 2px 2px 1px var(--dynamix-jgrowl-shadow-color);
|
||||
}
|
||||
}
|
||||
.jGrowl-notification .jGrowl-header {
|
||||
font-weight: bold;
|
||||
}
|
||||
.jGrowl-notification .jGrowl-close {
|
||||
float: right;
|
||||
text-align: right;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: none;
|
||||
color: inherit;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-size: 1.8rem;
|
||||
min-width: auto;
|
||||
margin-left: 2rem;
|
||||
line-height: 1;
|
||||
}
|
||||
.jGrowl-notification .jGrowl-close:hover {
|
||||
color: inherit;
|
||||
background: none;
|
||||
}
|
||||
.jGrowl-closer {
|
||||
width: 400px;
|
||||
color: var(--dynamix-jgrowl-close-text-color);
|
||||
background-color: var(--dynamix-jgrowl-close-bg-color);
|
||||
opacity: 0.96;
|
||||
border: 2px solid var(--dynamix-jgrowl-close-border-color);
|
||||
margin: 5px 0;
|
||||
padding: 4px 0;
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
}
|
||||
.jGrowl-closer.top {
|
||||
position: fixed;
|
||||
top: 130px;
|
||||
}
|
||||
#jGrowl {
|
||||
pointer-events: none !important;
|
||||
}
|
||||
.jGrowl-notification:first-of-type {
|
||||
pointer-events: none !important;
|
||||
}
|
||||
.jGrowl-notification {
|
||||
pointer-events: all !important;
|
||||
}
|
||||
.jGrowl-closer.top {
|
||||
pointer-events: all !important;
|
||||
}
|
||||
.jGrowl-closer.bottom {
|
||||
pointer-events: all !important;
|
||||
}
|
||||
@media print {
|
||||
.jGrowl {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
#sb-info-inner,
|
||||
#sb-loading-inner,
|
||||
div.sb-message {
|
||||
@@ -1507,18 +1360,6 @@ div.icon-zip {
|
||||
* @see https://caniuse.com/?search=nesting
|
||||
*/
|
||||
.Theme--sidebar {
|
||||
.jGrowl.top-left {
|
||||
top: 90px;
|
||||
}
|
||||
.jGrowl.top-right {
|
||||
top: 90px;
|
||||
}
|
||||
.jGrowl.center {
|
||||
top: 90px;
|
||||
}
|
||||
.jGrowl-notification {
|
||||
min-height: 4rem;
|
||||
}
|
||||
table.tablesorter thead tr th {
|
||||
font-size: 1.3rem;
|
||||
padding: 5px 20px 5px 6px;
|
||||
|
||||
Reference in New Issue
Block a user