Merge pull request #1057 from bergware/master

Miscellaneous updates and fixes
This commit is contained in:
tom mortensen
2022-03-23 11:33:51 -07:00
committed by GitHub
24 changed files with 94 additions and 84 deletions

View File

@@ -3,8 +3,8 @@ Title="Install Plugin"
Tag="download"
---
<?PHP
/* Copyright 2005-2020, Lime Technology
* Copyright 2012-2020, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -22,7 +22,7 @@ function installPlugin(name) {
if (file) openBox("/plugins/dynamix.plugin.manager/scripts/plugin&arg1=install&arg2="+file,"_(Install Plugin)_",600,900,true,func,plugin);
}
function reloadToList() {
$.removeCookie('tab',{path:'/'});
$.removeCookie('tab');
window.location.href = '/Plugins';
};
</script>

View File

@@ -130,10 +130,10 @@ function toggle_id(itemID){
var cookie = $.cookie('vmshow')||'';
if ((document.getElementById(itemID).style.display == 'none')) {
slideDownRows($('#'+itemID));
if (cookie.indexOf(itemID)<0) $.cookie('vmshow',cookie+itemID+',',{path:'/'});
if (cookie.indexOf(itemID)<0) $.cookie('vmshow',cookie+itemID+',');
} else {
slideUpRows($('#'+itemID));
if (cookie.indexOf(itemID)>=0) $.cookie('vmshow',cookie.replace(itemID+',',''),{path:'/'});
if (cookie.indexOf(itemID)>=0) $.cookie('vmshow',cookie.replace(itemID+',',''));
}
return false;
}

View File

@@ -3,8 +3,8 @@ Title="Array Devices"
Tag="database"
---
<?PHP
/* Copyright 2005-2021, Lime Technology
* Copyright 2012-2021, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -45,7 +45,7 @@ function display_diskio() {
}
function toggle_diskio(init) {
if (!init) {
if ($.cookie('diskio')===undefined) $.cookie('diskio','diskio',{path:'/',expires:3650}); else $.removeCookie('diskio',{path:'/'});
if ($.cookie('diskio')===undefined) $.cookie('diskio','diskio',{expires:3650}); else $.removeCookie('diskio');
}
if ($.cookie('diskio')===undefined) {
$('i.toggle').removeClass('fa-tachometer').addClass('fa-list');

View File

@@ -186,8 +186,8 @@ function parityWarning(form) {
swal({title:"_(Proceed to start)_",text:text,html:true,type:'warning',showCancelButton:true,confirmButtonText:"_(Proceed)_",cancelButtonText:"_(Cancel)_"},function(){prepareInput(form);});
}
function tab0() {
$.removeCookie('one',{path:'/'});
$.cookie('tab','tab0',{path:'/'});
$.removeCookie('one');
$.cookie('tab','tab0');
}
function stopArray(form) {
$(form).append('<input type="hidden" name="cmdStop" value="Stop">');
@@ -260,7 +260,7 @@ mymonitor.on('message', function(state) {
<?endif;?>
<?if ($var['shareUser']=='e' && $pool_devices):?>
$('#mover-button').prop('disabled',false);
$('#mover-text').html("<b>_(Move)_</b> _(will immediately invoke the Mover)_.&nbsp;<a href=\"/Main/Settings/Scheduler\"<?if($tabbed):?> onclick=\"$.cookie('one','tab2',{path:'/'})\"<?endif;?>>(_(Schedule)_)</a>");
$('#mover-text').html("<b>_(Move)_</b> _(will immediately invoke the Mover)_.&nbsp;<a href=\"/Main/Settings/Scheduler\"<?if($tabbed):?> onclick=\"$.cookie('one','tab2')\"<?endif;?>>(_(Schedule)_)</a>");
<?endif;?>
break;
case '1': // parity running
@@ -419,7 +419,7 @@ function formatWarning(val) {
<tr><td></td><td><input type="submit" name="cmdCheck" value="_(Clear)_"></td><td>**_(Clear)_** _(will start **Disk-Clear** of new data disk(s))_.</td></tr>
<? else:
if ($action[0]=="check" && count($action)>1):?>
<tr><td>_(Parity is valid)_.</td><td><input type="submit" name="cmdCheck" value="_(Check)_"></td><td>**_(Check)_** _(will start **Parity-Check**)_.&nbsp;<a href="/Main/Settings/Scheduler"<?if ($tabbed):?> onclick="$.cookie('one','tab1',{path:'/'})"<?endif;?>>(_(Schedule)_)</a>
<tr><td>_(Parity is valid)_.</td><td><input type="submit" name="cmdCheck" value="_(Check)_"></td><td>**_(Check)_** _(will start **Parity-Check**)_.&nbsp;<a href="/Main/Settings/Scheduler"<?if ($tabbed):?> onclick="$.cookie('one','tab1')"<?endif;?>>(_(Schedule)_)</a>
<br><input type="checkbox" name="optionCorrect" value="correct" checked><small>_(Write corrections to parity)_</small></td></tr>
<? elseif ($action[0]=="check"):?>
<tr><td></td><td><input type="submit" name="cmdCheck" value="_(Check)_"></td><td>**_(Check)_** _(will start **Read-Check** of all array disks)_.</td></tr>

View File

@@ -3,8 +3,8 @@ Tag="navicon"
Markdown="false"
---
<?PHP
/* Copyright 2005-2021, Lime Technology
* Copyright 2012-2021, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -45,8 +45,8 @@ $(function(){
table.html(data);
table.bind('sortEnd',function(e,t){
var sort = e.target.config.sortList.toString().split(',');
$.cookie('col',sort[0],{path:'/'});
$.cookie('dir',sort[1],{path:'/'});
$.cookie('col',sort[0]);
$.cookie('dir',sort[1]);
});
$('div.spinner.fixed').hide('slow');
table.tablesorter({sortList:[[col,dir],[1,0]],sortAppend:[[1,0]],textAttribute:'data'});

View File

@@ -831,17 +831,17 @@ function update900() {
}
function attributes(page,disk) {
var tab = page=='New' ? 'tab2' : 'tab3';
$.cookie('one',tab,{path:'/'});
$.cookie('one',tab);
location.replace('/Dashboard/'+page+'?name='+disk);
}
function capabilities(page,disk) {
var tab = page=='New' ? 'tab3' : 'tab4';
$.cookie('one',tab,{path:'/'});
$.cookie('one',tab);
location.replace('/Dashboard/'+page+'?name='+disk);
}
function identity(page,disk) {
var tab = page=='New' ? 'tab4' : 'tab5';
$.cookie('one',tab,{path:'/'});
$.cookie('one',tab);
location.replace('/Dashboard/'+page+'?name='+disk);
}
function acknowledge(id,disk) {

View File

@@ -4,8 +4,8 @@ Tag="user-circle-o"
Cond="$var['fsState']!='Stopped' && $var['shareDisk']!='no'"
---
<?PHP
/* Copyright 2005-2020, Lime Technology
* Copyright 2012-2020, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -18,12 +18,12 @@ Cond="$var['fsState']!='Stopped' && $var['shareDisk']!='no'"
<script>
function displayDisks(all) {
if (all == 'yes') {
$.cookie('ssz','ssz',{path:'/'});
$.cookie('ssz','ssz');
$('#disk_list').html("<tr><td colspan='8'><div class='spinner'></div></td></tr>");
$('div.spinner').html(unraid_logo);
}
$.get('/webGui/include/DiskList.php',{compute:all,path:'<?=$path?>',scale:'<?=$display['scale']?>',number:'<?=$display['number']?>',fill:$.cookie('ssz')},function(data){
$.removeCookie('ssz',{path:'/'})
$.removeCookie('ssz')
$('#disk_list').html(data);
$('#compute-disks').prop('disabled',!data || data.indexOf('colspan=')!=-1);
});

View File

@@ -4,8 +4,8 @@ Icon="icon-u-help"
Code="e934"
---
<?PHP
/* Copyright 2005-2020, Lime Technology
* Copyright 2012-2020, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -19,10 +19,10 @@ Code="e934"
function HelpButton() {
if ($('#nav-item.HelpButton').toggleClass('active').hasClass('active')) {
$('.inline_help').show('slow');
$.cookie('help','help',{path:'/'});
$.cookie('help','help');
} else {
$('.inline_help').hide('slow');
$.removeCookie('help',{path:'/'});
$.removeCookie('help');
}
}
</script>

View File

@@ -4,8 +4,8 @@ Icon="icon-u-switch"
Code="e982"
---
<?PHP
/* Copyright 2005-2020, Lime Technology
* Copyright 2012-2020, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -25,7 +25,7 @@ function LanguageButton() {
var locale = '<?=$locale?>';
if (locale) {
switchLanguage('');
$.cookie('locale',locale,{path:'/'});
$.cookie('locale',locale);
} else {
switchLanguage($.cookie('locale'));
$.removeCookie('locale');

View File

@@ -4,8 +4,8 @@ Tag="linux"
Cond="(($var['shareNFSEnabled']!='no') && (isset($name)?array_key_exists($name,$sec_nfs):0))"
---
<?PHP
/* Copyright 2005-2021, Lime Technology
* Copyright 2012-2021, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -90,7 +90,7 @@ $(function() {
var host = $('input[name="shareHostListNFS"]');
host.val($.cookie('hostList'));
setTimeout(function(){host.trigger('change');},100);
$.removeCookie('hostList',{path:'/'});
$.removeCookie('hostList');
}
<?if ($tabbed):?>
<?$path=='Shares/Share' ? $t=2 : $t=1;?>
@@ -110,7 +110,7 @@ function readNFS() {
var data = $.parseJSON(json);
form.shareExportNFS.value = data.export;
form.shareSecurityNFS.value = data.security;
if (data.hostList != '') $.cookie('hostList',data.hostList,{path:'/'});
if (data.hostList != '') $.cookie('hostList',data.hostList);
$(form).find('select').trigger('change');
});
}

View File

@@ -85,7 +85,7 @@ function testUpdate(init) {
$('#short_test').val("_(Start)_");
$('#long_test').val("_(Start)_");
if (!init) {
$.removeCookie('test.<?=addslashes(htmlspecialchars($dev))?>',{path:'/'});
$.removeCookie('test.<?=addslashes(htmlspecialchars($dev))?>');
}
}
});
@@ -104,11 +104,11 @@ function startShortTest() {
if ($('#short_test').val()=="_(Start)_") {
$('#short_test').val("_(Stop)_");
$('#long_test').attr('disabled','disabled');
$.cookie('test.<?=addslashes(htmlspecialchars($dev))?>','short',{path:'/',expires:365});
$.cookie('test.<?=addslashes(htmlspecialchars($dev))?>','short',{expires:365});
$.post('/webGui/include/SmartInfo.php',{cmd:'short',port:'<?=addslashes(htmlspecialchars($dev))?>',name:'<?=addslashes(htmlspecialchars($name))?>'},function(){timers.testUpdate = setTimeout(testUpdate,0);});
} else {
clearTimeout(timers.testUpdate);
$.removeCookie('test.<?=addslashes(htmlspecialchars($dev))?>',{path:'/'});
$.removeCookie('test.<?=addslashes(htmlspecialchars($dev))?>');
$.post('/webGui/include/SmartInfo.php',{cmd:'stop',port:'<?=addslashes(htmlspecialchars($dev))?>',name:'<?=addslashes(htmlspecialchars($name))?>'},function(){setTimeout(testUpdate,0);});
}
}
@@ -116,11 +116,11 @@ function startLongTest() {
if ($('#long_test').val()=="_(Start)_") {
$('#long_test').val("_(Stop)_");
$('#short_test').attr('disabled','disabled');
$.cookie('test.<?=addslashes(htmlspecialchars($dev))?>','long',{path:'/',expires:365});
$.cookie('test.<?=addslashes(htmlspecialchars($dev))?>','long',{expires:365});
$.post('/webGui/include/SmartInfo.php',{cmd:'long',port:'<?=addslashes(htmlspecialchars($dev))?>',name:'<?=addslashes(htmlspecialchars($name))?>'},function(){timers.testUpdate = setTimeout(testUpdate,0);});
} else {
clearTimeout(timers.testUpdate);
$.removeCookie('test.<?=addslashes(htmlspecialchars($dev))?>',{path:'/'});
$.removeCookie('test.<?=addslashes(htmlspecialchars($dev))?>');
$.post('/webGui/include/SmartInfo.php',{cmd:'stop',port:'<?=addslashes(htmlspecialchars($dev))?>',name:'<?=addslashes(htmlspecialchars($name))?>'},function(){setTimeout(testUpdate,0);});
}
}

View File

@@ -4,8 +4,8 @@ Tag="user-circle"
Cond="$var['fsState']!='Stopped' && $var['shareUser']=='e'"
---
<?PHP
/* Copyright 2005-2020, Lime Technology
* Copyright 2012-2020, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -18,12 +18,12 @@ Cond="$var['fsState']!='Stopped' && $var['shareUser']=='e'"
<script>
function displayShares(all) {
if (all == 'yes') {
$.cookie('ssz','ssz',{path:'/'});
$.cookie('ssz','ssz');
$('#shareslist').html("<tr><td colspan='8'><div class='spinner'></div></td></tr>");
$('div.spinner').html(unraid_logo);
}
$.get('/webGui/include/ShareList.php',{compute:all,path:'<?=addslashes(htmlspecialchars($path))?>',scale:'<?=$display['scale']?>',number:'<?=$display['number']?>',raw:'<?=$display['raw']?>',fill:$.cookie('ssz')},function(data){
$.removeCookie('ssz',{path:'/'})
$.removeCookie('ssz')
$('#shareslist').html(data);
$('#compute-shares').prop('disabled',!data || data.indexOf('colspan=')!=-1);
});

View File

@@ -4,8 +4,8 @@ Tag="icon-vpn"
Nchan="wg_poller"
---
<?PHP
/* Copyright 2005-2021, Lime Technology
* Copyright 2012-2021, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -27,6 +27,8 @@ exec("ip -6 addr show scope global|grep -PA2 ': (eth|br|bond)\d+'|awk '/inet6 .+
exec("ls --indicator-style=none $etc/wg*.conf*|grep -Po wg[0-9]+",$vtuns);
exec("docker network ls --filter driver='macvlan' --filter driver='ipvlan' --format='{{.Name}}' 2>/dev/null",$filter);
$nginx = (array)parse_ini_file('state/nginx.ini');
// add subnets defined in Docker custom networks
if (count($filter)) {
exec("docker network inspect --format='{{range .IPAM.Config}}{{println .Subnet}}{{end}}' ".implode(' ',$filter),$docker);
@@ -122,7 +124,7 @@ function readConf(&$peer_wg,&$wg,$vtun) {
foreach ($peer_wg as $i) if ((int)$wg["TYPE:$i"]==7) {$vpn = true; break;}
return [$conf,$cfg,$file,$vpn];
}
$public = strpos($_SERVER['HTTP_HOST'],'unraid.net')!==false && $remote['wanaccess']=='yes' ? (substr($_SERVER['HTTP_HOST'],0,4)!='www.'?'www.':'').explode(':',$_SERVER['HTTP_HOST'])[0] : '';
$public = $nginx['NGINX_WANFQDN'];
$active = (array)explode(' ',exec('wg show interfaces'));
$autostart = (array)explode(' ',@file_get_contents("$etc/autostart"));
$build = false;
@@ -1289,7 +1291,7 @@ _(Local tunnel address IPv6)_:
</div>
</div>
_(Local endpoint)_:
: <span class="input"><input type="text" id="endpoint-wg0" name="Endpoint:0" class="subnet" value="<?=$vpn_wg0?'':$wg0['Endpoint:0']?>" onchange="toLC(this);quickValidate(this);" pattern="<?=$validText?>" title="_(IP address or FQDN)_" placeholder="<?=$vpn_wg0?'(not used)':preg_replace('/^(www\.).+(\.unraid.net)$/','$1<hash>$2',$public)?>">:
: <span class="input"><input type="text" id="endpoint-wg0" name="Endpoint:0" class="subnet" value="<?=$vpn_wg0?'':$wg0['Endpoint:0']?>" onchange="toLC(this);quickValidate(this);" pattern="<?=$validText?>" title="_(IP address or FQDN)_" placeholder="<?=$vpn_wg0?'(not used)':preg_replace('/^(.+?\.)[0-9a-zA-Z]+(\.(my)?unraid.net)$/','$1<hash>$2',$public)?>">:
<input type="number" name="gui:ListenPort:0" class="port" min="1" max="65535" value="<?=$vpn_wg0?'':$wg0['ListenPort:0']?>" onchange="if(quickValidate(this)) {portRemark($(document.wg0),'wg0',this.value)}" placeholder="<?=$vpn_wg0?'':$netport['wg0']?>"></span>
<span class="remark block" style="display:none">_(Remark)_: _(configure your router with port forwarding of port)_ **<span id="my-port-wg0"><?=$wg0['ListenPort:0']?:$netport['wg0']?></span>/_(UDP)_** _(to)_ **<?=$server?>:<?=$wg0['ListenPort:0']?:$netport['wg0']?>**</span><span class="upnp wg0 block"></span>
<input type="hidden" name="ListenPort:0" value=""><dl id="endpoint4-wg0" style="display:none"></dl><dl id="endpoint6-wg0" style="display:none"></dl>

View File

@@ -157,34 +157,34 @@ function refresh(top) {
for (var i=0,link; link=document.getElementsByTagName('a')[i]; i++) { link.style.color = "gray"; } //fake disable
location.reload();
} else {
$.cookie('top',top,{path:'/'});
$.cookie('top',top);
location.reload();
}
}
function initab() {
$.removeCookie('one',{path:'/'});
$.removeCookie('tab',{path:'/'});
$.removeCookie('one');
$.removeCookie('tab');
}
function settab(tab) {
<?switch ($myPage['name']):?>
<?case'Main':?>
$.cookie('tab',tab,{path:'/'});
$.cookie('tab',tab);
<?if ($var['fsState']=='Started'):?>
$.cookie('one','tab1',{path:'/'});
$.cookie('one','tab1');
<?endif;?>
<?break;?>
<?case'Cache':case'Data':case'Flash':case'Parity':?>
$.cookie('one',tab,{path:'/'});
$.cookie('one',tab);
<?break;?>
<?default:?>
$.cookie(($.cookie('one')==null?'tab':'one'),tab,{path:'/'});
$.cookie(($.cookie('one')==null?'tab':'one'),tab);
<?endswitch;?>
}
function done(key) {
var url = location.pathname.split('/');
var path = '/'+url[1];
if (key) for (var i=2; i<url.length; i++) if (url[i]==key) break; else path += '/'+url[i];
$.removeCookie('one',{path:'/'});
$.removeCookie('one');
location.replace(path);
}
function chkDelete(form, button) {
@@ -228,7 +228,7 @@ function openTerminal(tag,name,more) {
}
// open terminal window (run in background)
name = name.replace(/ /g,"_");
tty_window = makeWindow(name,Math.max(screen.availHeight*3/5,600),Math.min(Math.max(screen.availWidth/2,900),1600));
tty_window = makeWindow(name+(more=='.log'?more:''),Math.max(screen.availHeight*3/5,600),Math.min(Math.max(screen.availWidth/2,900),1600));
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(){tty_window.location=socket; tty_window.focus();});
}
@@ -266,7 +266,7 @@ function addBannerWarning(text,warning=true,noDismiss=false) {
}
function dismissBannerWarning(entry,cookieText) {
$.cookie(cookieText,"true",{expires:365,path:'/'});
$.cookie(cookieText,"true",{expires:365});
removeBannerWarning(entry);
}
@@ -318,9 +318,9 @@ function showUpgrade(text,noDismiss=false) {
function hideUpgrade(set) {
removeBannerWarning(osUpgradeWarning);
if (set)
$.cookie('os_upgrade','true',{path:'/'});
$.cookie('os_upgrade','true');
else
$.removeCookie('os_upgrade',{path:'/'});
$.removeCookie('os_upgrade');
}
function openUpgrade() {
hideUpgrade();
@@ -506,7 +506,7 @@ foreach ($pages as $page) {
if (substr($icon,0,3)!='fa-') $icon = "fa-$icon";
$icon = "<i class='fa $icon PanelIcon'></i>";
}
echo "<div class=\"Panel\"><a href=\"/$path/{$pg['name']}\" onclick=\"$.cookie('one','tab1',{path:'/'})\"><span>$icon</span><div class=\"PanelText\">"._($title)."</div></a></div>";
echo "<div class=\"Panel\"><a href=\"/$path/{$pg['name']}\" onclick=\"$.cookie('one','tab1')\"><span>$icon</span><div class=\"PanelText\">"._($title)."</div></a></div>";
}
}
// create list of nchan scripts to be started
@@ -715,7 +715,7 @@ $(function() {
});
var top = ($.cookie('top')||0) - $('.tabs').offset().top - 75;
if (top>0) {$('html,body').scrollTop(top);}
$.removeCookie('top',{path:'/'});
$.removeCookie('top');
<?if ($safemode):?>
showNotice("<?=_('System running in')?> <b><?=('safe mode')?></b>");
<?else:?>

View File

@@ -1,6 +1,6 @@
<?PHP
/* Copyright 2005-2021, Lime Technology
* Copyright 2012-2021, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -88,7 +88,7 @@ foreach ($disks as $name => $disk) {
default: $luks = "<a class='info' onclick='return false'><i class='padlock fa fa-lock red-text'></i><span>"._('Unknown encryption state')."</span></a>"; break;
} else $luks = "";
echo "<tr>";
echo "<td><a class='info nohand' onclick='return false'><i class='fa fa-$orb orb $color-orb'></i><span style='left:18px'>$help</span></a>$luks<a href=\"/$path/Disk?name=$name\" onclick=\"$.cookie('one','tab1',{path:'/'})\">".compress($name)."</a></td>";
echo "<td><a class='info nohand' onclick='return false'><i class='fa fa-$orb orb $color-orb'></i><span style='left:18px'>$help</span></a>$luks<a href=\"/$path/Disk?name=$name\" onclick=\"$.cookie('one','tab1')\">".compress($name)."</a></td>";
echo "<td>{$disk['comment']}</td>";
echo "<td>".disk_share_settings($var['shareSMBEnabled'], $sec[$name])."</td>";
echo "<td>".disk_share_settings($var['shareNFSEnabled'], $sec_nfs[$name])."</td>";
@@ -117,7 +117,7 @@ foreach ($disks as $name => $disk) {
}
} else {
echo "<td>$type</td>";
echo "<td><a href=\"/update.htm?cmd=$cmd&csrf_token={$var['csrf_token']}\" target=\"progressFrame\" onclick=\"$.cookie('ssz','ssz',{path:'/'});$(this).text('"._('Please wait')."...')\">"._('Compute')."...</a></td>";
echo "<td><a href=\"/update.htm?cmd=$cmd&csrf_token={$var['csrf_token']}\" target=\"progressFrame\" onclick=\"$.cookie('ssz','ssz');$(this).text('"._('Please wait')."...')\">"._('Compute')."...</a></td>";
echo "<td>".my_scale($disk['fsFree']*1024, $unit)." $unit</td>";
echo "<td><a href=\"/$path/Browse?dir=/mnt/$name\"><i class=\"icon-u-tab\" title=\""._('Browse')." /mnt/$name\"></i></a></td>";
echo "</tr>";

View File

@@ -1,6 +1,6 @@
<?PHP
/* Copyright 2005-2021, Lime Technology
* Copyright 2012-2021, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -91,7 +91,7 @@ foreach ($shares as $name => $share) {
default: $luks = "<a class='info' onclick='return false'><i class='padlock fa fa-lock red-text'></i><span>"._('Unknown encryption state')."</span></a>"; break;
} else $luks = "";
echo "<tr>";
echo "<td><a class='info nohand' onclick='return false'><i class='fa fa-$orb orb $color-orb'></i><span style='left:18px'>$help</span></a>$luks<a href=\"/$path/Share?name=".urlencode($name)."\" onclick=\"$.cookie('one','tab1',{path:'/'})\">".compress($name)."</a></td>";
echo "<td><a class='info nohand' onclick='return false'><i class='fa fa-$orb orb $color-orb'></i><span style='left:18px'>$help</span></a>$luks<a href=\"/$path/Share?name=".urlencode($name)."\" onclick=\"$.cookie('one','tab1')\">".compress($name)."</a></td>";
echo "<td>{$share['comment']}</td>";
echo "<td>".user_share_settings($var['shareSMBEnabled'], $sec[$name])."</td>";
echo "<td>".user_share_settings($var['shareNFSEnabled'], $sec_nfs[$name])."</td>";
@@ -120,7 +120,7 @@ foreach ($shares as $name => $share) {
}
} else {
echo "<td>$cache</td>";
echo "<td><a href=\"/update.htm?cmd=$cmd&csrf_token={$var['csrf_token']}\" target=\"progressFrame\" onclick=\"$.cookie('ssz','ssz',{path:'/'});$(this).text('"._('Please wait')."...')\">"._('Compute')."...</a></td>";
echo "<td><a href=\"/update.htm?cmd=$cmd&csrf_token={$var['csrf_token']}\" target=\"progressFrame\" onclick=\"$.cookie('ssz','ssz');$(this).text('"._('Please wait')."...')\">"._('Compute')."...</a></td>";
echo "<td>".my_scale($share['free']*1024, $unit)." $unit</td>";
echo "<td><a href=\"/$path/Browse?dir=/mnt/user/".urlencode($name)."\"><i class=\"icon-u-tab\" title=\""._('Browse')." /mnt/user/".urlencode($name)."\"></i></a></td>";
echo "</tr>";

View File

@@ -93,7 +93,7 @@ function verbose_output($httpcode, $result) {
echo (rebindDisabled()) ? "{$icon_ok}Rebind protection is disabled" : "{$icon_warn}Rebind protection is enabled";
echo " for ".($isLegacyCert ? "unraid.net" : "myunraid.net").PHP_EOL;
if ($post) {
$wanip = trim(@file_get_contents("https://wanip.unraid.net/"));
$wanip = trim(@file_get_contents("https://wanip4.unraid.net/"));
// check the data
$certhostname = $nginx['NGINX_CERTNAME'];
if ($certhostname) {
@@ -331,7 +331,7 @@ if ($isRegistered) {
}
if ($remoteaccess == 'yes') {
// include wanip in the cache file so we can track if it changes
$post['_wanip'] = trim(@file_get_contents("https://wanip.unraid.net/"));
$post['_wanip'] = trim(@file_get_contents("https://wanip4.unraid.net/"));
$post['externalhostname'] = $externalhostname;
$post['externalport'] = $externalport;
$post['externalprotocol'] = $externalprotocol;
@@ -345,7 +345,7 @@ if ($post['_wanip'] && ($post['_wanip'] != $nginx['NGINX_WANIP']) && version_com
// if remoteaccess is currently disabled (perhaps because a wanip was not available when nginx was started)
// BUT the system is configured to have it enabled AND a wanip is now available
// then reload nginx
if ($remoteaccess == 'no' && $nginx['NGINX_WANACCESS'] == 'yes' && !empty(trim(@file_get_contents("https://wanip.unraid.net/")))) $reloadNginx = true;
if ($remoteaccess == 'no' && $nginx['NGINX_WANACCESS'] == 'yes' && !empty(trim(@file_get_contents("https://wanip4.unraid.net/")))) $reloadNginx = true;
if ($reloadNginx) {
exec("/etc/rc.d/rc.nginx reload &>/dev/null");
}

View File

@@ -1,6 +1,6 @@
<?PHP
/* Copyright 2005-2021, Lime Technology
* Copyright 2012-2021, Bergware International.
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -296,9 +296,9 @@ case 'public':
$v6 = $_POST['#prot']!='';
$context = stream_context_create(['https'=>['timeout'=>12]]);
$int_ipv4 = $v4 ? (preg_match("/^$validIP4$/", $ip) ? $ip : (@dns_get_record($ip, DNS_A)[0]['ip'] ?: '')) : '';
$ext_ipv4 = $v4 ? (@file_get_contents('https://api.ipify.org',false,$context) ?: '') : '';
$ext_ipv4 = $v4 ? (@file_get_contents('https://wanip4.unraid.net',false,$context) ?: '') : '';
$int_ipv6 = $v6 ? (preg_match("/^$validIP6$/", $ip) ? $ip : (@dns_get_record($ip, DNS_AAAA)[0]['ipv6'] ?: '')) : '';
$ext_ipv6 = $v6 ? (@file_get_contents('https://api6.ipify.org',false,$context) ?: '') : '';
$ext_ipv6 = $v6 ? (@file_get_contents('https://wanip6.unraid.net',false,$context) ?: '') : '';
echo "$int_ipv4;$ext_ipv4;$int_ipv6;$ext_ipv6";
break;
case 'addtunnel':

File diff suppressed because one or more lines are too long

View File

@@ -97,9 +97,9 @@ while (true) {
if (new_parity_log($timestamp)) {
$idle = []; while (count($synced)>1) $idle[] = array_pop($synced)-array_pop($synced);
[$action,$size] = file_exists($resync) ? my_explode(',',file_get_contents($resync)) : [$var['mdResyncAction'],$var['mdResyncSize']];
$duration = $var['sbSynced2']-$sbSynced;
$duration = $var['sbSynced2']-$sbSynced-array_sum($idle);
$status = $var['sbSyncExit'];
$speed = $status==0 ? round($size*1024/($duration-array_sum($idle))) : 0;
$speed = $status==0 ? round($size*1024/$duration) : 0;
$error = $var['sbSyncErrs'];
file_put_contents($log,"$timestamp|$duration|$speed|$status|$error|$action|$size\n",FILE_APPEND);
}

View File

@@ -336,8 +336,10 @@ dt{clear:left;float:left;width:35%}
dd{margin-bottom:12px;white-space:nowrap}
dd p{margin:0 0 4px 0}
dd blockquote{padding-left:0}
blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border:1px solid #bce8f1;color:#3a87ad;background-color:#d9edf7;box-sizing:border-box}
blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border:1px solid #bce8f1;color:#222222;background-color:#d9edf7;box-sizing:border-box}
blockquote.ontop{margin-top:0;margin-bottom:46px}
blockquote a{color:#ff8c2f;font-weight:600}
blockquote a:hover,blockquote a:focus{color:#f15a2c}
label.checkbox{display:block;position:relative;padding-left:28px;margin:3px 0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
label.checkbox input{position:absolute;opacity:0;cursor:pointer}
span.checkmark{position:absolute;top:0;left:6px;height:14px;width:14px;background-color:#d4d2d4;border-radius:100%}

View File

@@ -313,8 +313,10 @@ dt{clear:left;float:left;width:35%;font-weight:normal}
dd{margin-bottom:12px;white-space:nowrap}
dd p{margin:0 0 4px 0}
dd blockquote{padding-left:0}
blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border-top:2px solid #bce8f1;border-bottom:2px solid #bce8f1;color:#3a87ad;background-color:#d9edf7}
blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border-top:2px solid #bce8f1;border-bottom:2px solid #bce8f1;color:#222222;background-color:#d9edf7}
blockquote.ontop{margin-top:-20px;margin-bottom:46px}
blockquote a{color:#ff8c2f;font-weight:600}
blockquote a:hover,blockquote a:focus{color:#f15a2c}
label.checkbox{display:block;position:relative;padding-left:28px;margin:3px 0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
label.checkbox input{position:absolute;opacity:0;cursor:pointer}
span.checkmark{position:absolute;top:0;left:6px;height:14px;width:14px;background-color:#2b2b2b;border-radius:100%}

View File

@@ -336,8 +336,10 @@ dt{clear:left;float:left;width:35%}
dd{margin-bottom:12px;white-space:nowrap}
dd p{margin:0 0 4px 0}
dd blockquote{padding-left:0}
blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border:1px solid #bce8f1;color:#3a87ad;background-color:#d9edf7;box-sizing:border-box}
blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border:1px solid #bce8f1;color:#222222;background-color:#d9edf7;box-sizing:border-box}
blockquote.ontop{margin-top:0;margin-bottom:46px}
blockquote a{color:#ff8c2f;font-weight:600}
blockquote a:hover,blockquote a:focus{color:#f15a2c}
label.checkbox{display:block;position:relative;padding-left:28px;margin:3px 0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
label.checkbox input{position:absolute;opacity:0;cursor:pointer}
span.checkmark{position:absolute;top:0;left:6px;height:14px;width:14px;background-color:#2b2d2b;border-radius:100%}

View File

@@ -313,8 +313,10 @@ dt{clear:left;float:left;width:35%;font-weight:normal}
dd{margin-bottom:12px;white-space:nowrap}
dd p{margin:0 0 4px 0}
dd blockquote{padding-left:0}
blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border-top:2px solid #bce8f1;border-bottom:2px solid #bce8f1;color:#3a87ad;background-color:#d9edf7}
blockquote{width:90%;margin:10px auto;text-align:left;padding:4px 20px;border-top:2px solid #bce8f1;border-bottom:2px solid #bce8f1;color:#222222;background-color:#d9edf7}
blockquote.ontop{margin-top:-20px;margin-bottom:46px}
blockquote a{color:#ff8c2f;font-weight:600}
blockquote a:hover,blockquote a:focus{color:#f15a2c}
label.checkbox{display:block;position:relative;padding-left:28px;margin:3px 0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
label.checkbox input{position:absolute;opacity:0;cursor:pointer}
span.checkmark{position:absolute;top:0;left:6px;height:14px;width:14px;background-color:#e3e3e3;border-radius:100%}