Merge pull request #1019 from zackspear/master

fix(DisplaySettings): javascript error
This commit is contained in:
tom mortensen
2022-01-28 12:39:52 -08:00
committed by GitHub
3 changed files with 28 additions and 16 deletions

View File

@@ -340,6 +340,12 @@
],
'signOut' => [
'heading' => _('Unraid.net Sign Out'),
'warnings' => [
'remoteAccessDisabled' => _('Remote access will be disabled'),
'remoteAccessInaccessible' => sprintf(_('You will no longer have access to this server using <abbr title="%s" class="italic">this url</abbr>'), '{0}'),
'disablingFlashBackup' => _('Automated flash backups will be disabled until you sign in again'),
'downloadFlashBackup' => _('Download latest backup from My Servers Dashboard'),
],
],
'success' => [
'heading' => [
@@ -412,12 +418,18 @@
],
'verifyEmail' => [
'heading' => _('Verify Email'),
'subheading' => sprintf(_('We have sent a verifcation email to %s'), '{0}'),
'form' => [
'verificationCode' => _('verification code'),
'verifyCode' => _('Paste or Enter code'),
],
'noCode' => _("Didn't get code?"),
],
'verifyEmailResend' => [
'heading' => _('Resend Email Verification Code'),
'goBack' => _("Have the code now? Go Back"),
'resend' => _("Resend Code"),
],
'whatIsUnraidNet' => [
'heading' => _('What is Unraid.net?'),
'subheading' => _('Expand your servers capabilities'),
@@ -463,15 +475,19 @@
"nokeyserver" => 'NO_KEY_SERVER',
"withdrawn" => 'WITHDRAWN',
];
// feeds server vars to Vuex store in a slightly different array than state.php
$serverstate = [
$nginx = parse_ini_file('/var/local/emhttp/nginx.ini');
$serverstate = [ // feeds server vars to Vuex store in a slightly different array than state.php
"avatar" => $remote['avatar'],
"config" => [
'valid' => $var['configValid'] === 'yes',
'error' => $var['configValid'] !== 'yes' ? (array_key_exists($var['configValid'], $configErrorEnum) ? $configErrorEnum[$var['configValid']] : 'UNKNOWN_ERROR') : null,
],
"deviceCount" => $var['deviceCount'],
"email" => ($remote['email']) ? $remote['email'] : '',
"email" => $remote['email'] ?? '',
"flashproduct" => $var['flashProduct'],
"flashvendor" => $var['flashVendor'],
"guid" => $var['flashGUID'],
"regGuid" => $var['regGUID'],
'hasUnraidNetSSL' => file_exists('/boot/config/ssl/certs/certificate_bundle.pem') ? preg_match('/.*\.unraid\.net$/', $_SERVER['SERVER_NAME']) : 0, // required for boolean to check if user has unraid.net Let's Encrypt cert. Using for a less expensive check w/ $_SERVER['SERVER_NAME'] compared to reading cert file contents on every page load
"internalip" => ipaddr(),
"internalport" => $_SERVER['SERVER_PORT'],
"keyfile" => str_replace(['+','/','='], ['-','_',''], trim(base64_encode(@file_get_contents($var['regFILE'])))),
@@ -479,24 +495,19 @@
"plgVersion" => 'base-'.$var['version'],
"protocol" => $_SERVER['REQUEST_SCHEME'],
"reggen" => (int)$var['regGen'],
"registered" => empty($remote['username']) ? 0 : 1,
"regGuid" => $var['regGUID'],
"registered" => !empty($remote['username']),
"servername" => $var['NAME'],
"site" => $_SERVER['REQUEST_SCHEME']."://".$_SERVER['HTTP_HOST'],
"state" => strtoupper(empty($var['regCheck']) ? $var['regTy'] : $var['regCheck']),
"ts" => time(),
"username" => $remote['username'],
"config" => [
'valid' => $var['configValid'] === 'yes',
'error' => $var['configValid'] !== 'yes'
? (array_key_exists($var['configValid'], $configErrorEnum) ? $configErrorEnum[$var['configValid']] : 'UNKNOWN_ERROR')
: null,
],
'hasUnraidNetSSL' => file_exists('/boot/config/ssl/certs/certificate_bundle.pem') ? preg_match('/.*\.unraid\.net$/', $_SERVER['SERVER_NAME']) : 0, // required for boolean to check if user has unraid.net Let's Encrypt cert. Using for a less expensive check w/ $_SERVER['SERVER_NAME'] compared to reading cert file contents on every page load
"wanFQDN" => $nginx['NGINX_WANFQDN'] ?? '',
];
?>
<unraid-user-profile
apikey="<?=@$upc['apikey']?>"
banner="<?=($display['banner']) ? $display['banner'] : ''?>"
banner="<?=$display['banner'] ?? ''?>"
bgcolor="<?=($backgnd) ? '#'.$backgnd : ''?>"
csrf="<?=$var['csrf_token']?>"
displaydesc="<?=($display['headerdescription']!='no') ? 'true' : ''?>"
@@ -506,7 +517,7 @@
locale-messages="<?=rawurlencode(json_encode($upc_translations, JSON_UNESCAPED_SLASHES, JSON_UNESCAPED_UNICODE))?>"
metacolor="<?=($display['headermetacolor']) ? '#'.$display['headermetacolor'] : ''?>"
plg-path="dynamix.my.servers"
reg-wiz-time="<?=($remote['regWizTime']) ? $remote['regWizTime'] : ''?>"
reg-wiz-time="<?=$remote['regWizTime'] ?? ''?>"
serverdesc="<?=$var['COMMENT']?>"
servermodel="<?=$var['SYS_MODEL']?>"
serverstate="<?=rawurlencode(json_encode($serverstate, JSON_UNESCAPED_SLASHES))?>"

File diff suppressed because one or more lines are too long

View File

@@ -46,6 +46,7 @@ function upload() {
} else if (filename) {
$.post("/webGui/include/FileUpload.php",{cmd:'save',path:path,filename:filename,output:'banner.png'});
}
}
function presetTime(form) {
var system = form.date.selectedIndex==0;
if (system) form.time.selectedIndex = 0;