mirror of
https://github.com/unraid/webgui.git
synced 2026-03-15 23:41:29 -05:00
merge in changes from unRAID 6.1.8
This commit is contained in:
@@ -109,123 +109,6 @@ function export_settings($protocol,$share) {
|
||||
?>
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/context.standalone.css">
|
||||
<script src="/webGui/javascript/context.js"></script>
|
||||
<script>
|
||||
var timer2,timer30;
|
||||
|
||||
function changeMode(item) {
|
||||
$.cookie('shareMode',item,{path:'/',expires:3650});
|
||||
<?if ($var['shareSMBEnabled']=='yes'):?>
|
||||
if (item==0) $('.smb').show(); else $('.smb').hide();
|
||||
<?endif;?>
|
||||
<?if ($var['shareAFPEnabled']=='yes'):?>
|
||||
if (item==1) $('.afp').show(); else $('.afp').hide();
|
||||
<?endif;?>
|
||||
<?if ($var['shareNFSEnabled']=='yes'):?>
|
||||
if (item==2) $('.nfs').show(); else $('.nfs').hide();
|
||||
<?endif;?>
|
||||
}
|
||||
function changeView(item) {
|
||||
$.cookie('viewMode',item,{path:'/',expires:3650});
|
||||
if (item==0) $('.view1').show(); else $('.view1').hide();
|
||||
if (item==1) $('.view2').show(); else $('.view2').hide();
|
||||
if (item==2) $('.view3').show(); else $('.view3').hide();
|
||||
clearTimeout(timer30);
|
||||
update30();
|
||||
}
|
||||
function update3() {
|
||||
var tag = $('.smb').is(':visible') ? 'smb' : $('.afp').is(':visible') ? 'afp' : $('.nfs').is(':visible') ? 'nfs' : '';
|
||||
<?if ($var['fsState']=='Started'):?>
|
||||
$.post('<?=$url?>',{cmd:'shares',com:tag,names:'<?=addslashes($names)?>'},function(data) {
|
||||
if (data) $.each(data.split('#'),function(k,v) {$('#share'+(k+1)).html(v);});
|
||||
});
|
||||
<?endif;?>
|
||||
$.post('<?=$url?>',{cmd:'sys'},function(data) {
|
||||
if (data) $.each(data.split('#'),function(k,v) {$('#sys'+k).animate({width:v},{step:function(){$('#sys'+k).css("overflow","visible");}}).text(v);});
|
||||
});
|
||||
<?if ($fans>0):?>
|
||||
$.post('<?=$url?>',{cmd:'fan'},function(data) {
|
||||
if (data) $.each(data.split('#'),function(k,v) {$('#fan'+k).html(v);});
|
||||
});
|
||||
<?endif;?>
|
||||
$.post('<?=$url?>',{cmd:'cpu'},function(data) {
|
||||
if (data) $.each(data.split('#'),function(k,v) {$('#cpu'+k).html(v);});
|
||||
<?if ($display['refresh']>0 || ($display['refresh']<0 && $var['mdResync']==0)):?>
|
||||
setTimeout(update3,<?=max(abs($display['refresh']),3000)?>);
|
||||
<?endif;?>
|
||||
});
|
||||
}
|
||||
function update30() {
|
||||
var tag = $('.view1').is(':visible') ? 'main' : $('.view2').is(':visible') ? 'port' : $('.view3').is(':visible') ? 'link' : '';
|
||||
$.post('<?=$url?>',{cmd:'port',view:tag,ports:'<?=implode(',',$ports)?>'},function(data) {
|
||||
if (data) $.each(data.split('#'),function(k,v) {$('#'+tag+k).html(v);});
|
||||
});
|
||||
$.post('<?=$url?>',{cmd:'disk',hot:'<?=$display['hot']?>',max:'<?=$display['max']?>',unit:'<?=$display['unit']?>'},function(data) {
|
||||
if (data) $('#dash1').html(data);
|
||||
clearTimeout(timer2);
|
||||
timer2 = setTimeout(heatAlarm,2000);
|
||||
$('[id^="smart-"]').each(function() {
|
||||
var opts = [];
|
||||
var id = '#'+$(this).attr('id');
|
||||
var page = $(this).attr('name');
|
||||
var view = $(this).attr('class');
|
||||
var disk = id.substr(id.indexOf('-')+1);
|
||||
opts.push({text:'Attributes',icon:'fa-sitemap',action:function(e){e.preventDefault();attributes(page,disk);}});
|
||||
opts.push({text:'Capabilities',icon:'fa-user',action:function(e){e.preventDefault();capabilities(page,disk);}});
|
||||
opts.push({text:'Identity',icon:'fa-home',action:function(e){e.preventDefault();identity(page,disk);}});
|
||||
if (view == 'alert') opts.push({text:'Acknowledge',icon:'fa-check-square-o',action:function(e){e.preventDefault();acknowledge(disk);}});
|
||||
context.attach(id,opts);
|
||||
});
|
||||
<?if ($display['refresh']>0 || ($display['refresh']<0 && $var['mdResync']==0)):?>
|
||||
timer30 = setTimeout(update30,<?=max(abs($display['refresh']),30000)?>);
|
||||
<?endif;?>
|
||||
});
|
||||
}
|
||||
function update60() {
|
||||
<?if ((strstr($var['mdResyncAction'],"clear") || strstr($var['mdResyncAction'],"check")) && $var['mdResync']>0):?>
|
||||
$.post('<?=$url?>',{cmd:'parity'},function(data) {
|
||||
if (data) $('#parity').html(data);
|
||||
<?if ($display['refresh']>0 || ($display['refresh']<0 && $var['mdResync']==0)):?>
|
||||
setTimeout(update60,<?=max(abs($display['refresh']),60000)?>);
|
||||
<?endif;?>
|
||||
});
|
||||
<?endif;?>
|
||||
}
|
||||
function heatAlarm() {
|
||||
if ($('.heat-img').length) {
|
||||
if ($('.heat-text').is(':visible')) {$('.heat-text').hide(); $('.heat-img').show();} else {$('.heat-img').hide(); $('.heat-text').show();}
|
||||
}
|
||||
timer2 = setTimeout(heatAlarm,2000);
|
||||
}
|
||||
function attributes(page,disk) {
|
||||
var tab = page=='New' ? 'tab2' : 'tab3';
|
||||
$.cookie('one',tab,{path:'/'});
|
||||
location.replace('/Dashboard/'+page+'?name='+disk);
|
||||
}
|
||||
function capabilities(page,disk) {
|
||||
var tab = page=='New' ? 'tab3' : 'tab4';
|
||||
$.cookie('one',tab,{path:'/'});
|
||||
location.replace('/Dashboard/'+page+'?name='+disk);
|
||||
}
|
||||
function identity(page,disk) {
|
||||
var tab = page=='New' ? 'tab4' : 'tab5';
|
||||
$.cookie('one',tab,{path:'/'});
|
||||
location.replace('/Dashboard/'+page+'?name='+disk);
|
||||
}
|
||||
function acknowledge(disk) {
|
||||
$.post('/webGui/include/Acknowledge.php',{disk:disk},function(data){clearTimeout(timer30);update30();});
|
||||
}
|
||||
$(function() {
|
||||
if ($.cookie('shareMode')!=null) { $('select[name="enter_share"] option')[$.cookie('shareMode')].selected = true; $('select[name="enter_share"]').change(); }
|
||||
if ($.cookie('viewMode')!=null) { $('select[name="enter_view"] option')[$.cookie('viewMode')].selected = true; $('select[name="enter_view"]').change(); }
|
||||
update3();
|
||||
update60();
|
||||
update30();
|
||||
<?if ($display['refresh']==0 || ($display['refresh']<0 && $var['mdResync']>0)):?>
|
||||
$('.tabs').append("<span class='status vhshift'><input type='button' value='Refresh' onclick='refresh()'></span>");
|
||||
<?endif;?>
|
||||
context.init({preventDoubleContext:false});
|
||||
});
|
||||
</script>
|
||||
|
||||
<table class='share_status fixed'>
|
||||
<thead><tr>
|
||||
@@ -464,3 +347,127 @@ if (!count($shares)) echo "<tr><td colspan='4'><center>No shares present</center
|
||||
</tbody>
|
||||
<?endif;?>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
var timer2,timer30;
|
||||
|
||||
function changeMode(item) {
|
||||
if (item==0) $.removeCookie('enter_share',{path:'/'}); else $.cookie('enter_share',item,{path:'/',expires:3650});
|
||||
<?if ($var['shareSMBEnabled']=='yes'):?>
|
||||
if (item==0) $('.smb').show(); else $('.smb').hide();
|
||||
<?endif;?>
|
||||
<?if ($var['shareAFPEnabled']=='yes'):?>
|
||||
if (item==1) $('.afp').show(); else $('.afp').hide();
|
||||
<?endif;?>
|
||||
<?if ($var['shareNFSEnabled']=='yes'):?>
|
||||
if (item==2) $('.nfs').show(); else $('.nfs').hide();
|
||||
<?endif;?>
|
||||
}
|
||||
function changeView(item) {
|
||||
if (item==0) $.removeCookie('enter_view',{path:'/'}); else $.cookie('enter_view',item,{path:'/',expires:3650});
|
||||
if (item==0) $('.view1').show(); else $('.view1').hide();
|
||||
if (item==1) $('.view2').show(); else $('.view2').hide();
|
||||
if (item==2) $('.view3').show(); else $('.view3').hide();
|
||||
clearTimeout(timer30);
|
||||
update30();
|
||||
}
|
||||
function update3() {
|
||||
var tag = $('.smb').is(':visible') ? 'smb' : $('.afp').is(':visible') ? 'afp' : $('.nfs').is(':visible') ? 'nfs' : '';
|
||||
<?if ($var['fsState']=='Started'):?>
|
||||
$.post('<?=$url?>',{cmd:'shares',com:tag,names:'<?=addslashes($names)?>'},function(data) {
|
||||
if (data) $.each(data.split('#'),function(k,v) {$('#share'+(k+1)).html(v);});
|
||||
});
|
||||
<?endif;?>
|
||||
$.post('<?=$url?>',{cmd:'sys'},function(data) {
|
||||
if (data) $.each(data.split('#'),function(k,v) {$('#sys'+k).animate({width:v},{step:function(){$('#sys'+k).css("overflow","visible");}}).text(v);});
|
||||
});
|
||||
<?if ($fans>0):?>
|
||||
$.post('<?=$url?>',{cmd:'fan'},function(data) {
|
||||
if (data) $.each(data.split('#'),function(k,v) {$('#fan'+k).html(v);});
|
||||
});
|
||||
<?endif;?>
|
||||
$.post('<?=$url?>',{cmd:'cpu'},function(data) {
|
||||
if (data) $.each(data.split('#'),function(k,v) {$('#cpu'+k).html(v);});
|
||||
<?if ($display['refresh']>0 || ($display['refresh']<0 && $var['mdResync']==0)):?>
|
||||
setTimeout(update3,<?=max(abs($display['refresh']),3000)?>);
|
||||
<?endif;?>
|
||||
});
|
||||
}
|
||||
function update30() {
|
||||
var tag = $('.view1').is(':visible') ? 'main' : $('.view2').is(':visible') ? 'port' : $('.view3').is(':visible') ? 'link' : '';
|
||||
$.post('<?=$url?>',{cmd:'port',view:tag,ports:'<?=implode(',',$ports)?>'},function(data) {
|
||||
if (data) $.each(data.split('#'),function(k,v) {$('#'+tag+k).html(v);});
|
||||
});
|
||||
$.post('<?=$url?>',{cmd:'disk',hot:'<?=$display['hot']?>',max:'<?=$display['max']?>',unit:'<?=$display['unit']?>'},function(data) {
|
||||
if (data) $('#dash1').html(data);
|
||||
clearTimeout(timer2);
|
||||
timer2 = setTimeout(heatAlarm,2000);
|
||||
$('[id^="smart-"]').each(function() {
|
||||
var opts = [];
|
||||
var id = '#'+$(this).attr('id');
|
||||
var page = $(this).attr('name');
|
||||
var view = $(this).attr('class');
|
||||
var disk = id.substr(id.indexOf('-')+1);
|
||||
opts.push({text:'Attributes',icon:'fa-sitemap',action:function(e){e.preventDefault();attributes(page,disk);}});
|
||||
opts.push({text:'Capabilities',icon:'fa-user',action:function(e){e.preventDefault();capabilities(page,disk);}});
|
||||
opts.push({text:'Identity',icon:'fa-home',action:function(e){e.preventDefault();identity(page,disk);}});
|
||||
if (view == 'alert') opts.push({text:'Acknowledge',icon:'fa-check-square-o',action:function(e){e.preventDefault();acknowledge(disk);}});
|
||||
context.attach(id,opts);
|
||||
});
|
||||
<?if ($display['refresh']>0 || ($display['refresh']<0 && $var['mdResync']==0)):?>
|
||||
timer30 = setTimeout(update30,<?=max(abs($display['refresh']),30000)?>);
|
||||
<?endif;?>
|
||||
});
|
||||
}
|
||||
function update60() {
|
||||
<?if ($var['mdNumInvalid']==0 && $var['mdResync']>0):?>
|
||||
$.post('<?=$url?>',{cmd:'parity'},function(data) {
|
||||
if (data) $('#parity').html(data);
|
||||
<?if ($display['refresh']>0 || ($display['refresh']<0 && $var['mdResync']==0)):?>
|
||||
setTimeout(update60,<?=max(abs($display['refresh']),60000)?>);
|
||||
<?endif;?>
|
||||
});
|
||||
<?endif;?>
|
||||
}
|
||||
function heatAlarm() {
|
||||
if ($('.heat-img').length) {
|
||||
if ($('.heat-text').is(':visible')) {$('.heat-text').hide(); $('.heat-img').show();} else {$('.heat-img').hide(); $('.heat-text').show();}
|
||||
}
|
||||
timer2 = setTimeout(heatAlarm,2000);
|
||||
}
|
||||
function attributes(page,disk) {
|
||||
var tab = page=='New' ? 'tab2' : 'tab3';
|
||||
$.cookie('one',tab,{path:'/'});
|
||||
location.replace('/Dashboard/'+page+'?name='+disk);
|
||||
}
|
||||
function capabilities(page,disk) {
|
||||
var tab = page=='New' ? 'tab3' : 'tab4';
|
||||
$.cookie('one',tab,{path:'/'});
|
||||
location.replace('/Dashboard/'+page+'?name='+disk);
|
||||
}
|
||||
function identity(page,disk) {
|
||||
var tab = page=='New' ? 'tab4' : 'tab5';
|
||||
$.cookie('one',tab,{path:'/'});
|
||||
location.replace('/Dashboard/'+page+'?name='+disk);
|
||||
}
|
||||
function acknowledge(disk) {
|
||||
$.post('/webGui/include/Acknowledge.php',{disk:disk},function(data){clearTimeout(timer30);update30();});
|
||||
}
|
||||
function dropdown(menu) {
|
||||
var select = 'select[name="'+menu+'"]';
|
||||
if ($.cookie(menu) == null || $.cookie(menu) >= $(select+' option').length) return;
|
||||
$(select+' option')[$.cookie(menu)].selected = true;
|
||||
$(select).change();
|
||||
}
|
||||
$(function() {
|
||||
dropdown('enter_share');
|
||||
dropdown('enter_view');
|
||||
update3();
|
||||
update60();
|
||||
update30();
|
||||
<?if ($display['refresh']==0 || ($display['refresh']<0 && $var['mdResync']>0)):?>
|
||||
$('.tabs').append("<span class='status vhshift'><input type='button' value='Refresh' onclick='refresh()'></span>");
|
||||
<?endif;?>
|
||||
context.init({preventDoubleContext:false});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -151,28 +151,37 @@ Spin down delay:
|
||||
<?=mk_option($disk['spindownDelay'], "9", "9 hours")?>
|
||||
</select><span id="smart_selftest" class='orange-text'></span>
|
||||
|
||||
Warning disk utilization level (%):
|
||||
: <input type="number" min="0" max="99" name="<?=$name?>_warning" class="narrow" value="<?=!empty($disk['warning'])?$disk['warning']:''?>" placeholder="<?=$display['warning']?>">
|
||||
<?if ($disk['type'] != 'Parity'):?>
|
||||
Warning disk utilization threshold (%):
|
||||
: <input type="number" min="0" max="100" name="<?=$name?>_warning" class="narrow" value="<?=strlen($disk['warning'])?$disk['warning']:''?>" placeholder="<?=$display['warning']?>">
|
||||
|
||||
> *Warning disk utilization* sets the warning threshold for this hard disk utilization. Exceeding this threshold will result in a warning notification.
|
||||
>
|
||||
> When the warning level is set equal or greater than the critical level, there will be only critical notifications (warnings are not existing).
|
||||
> When the warning threshold is set equal or greater than the critical threshold, there will be only critical notifications (warnings are not existing).
|
||||
>
|
||||
> A value of zero will disable the warning threshold (including notifications).
|
||||
|
||||
Critical disk utilization level (%):
|
||||
: <input type="number" min="0" max="100" name="<?=$name?>_critical" class="narrow" value="<?=!empty($disk['critical'])?$disk['critical']:''?>" placeholder="<?=$display['critical']?>")>
|
||||
Critical disk utilization threshold (%):
|
||||
: <input type="number" min="0" max="100" name="<?=$name?>_critical" class="narrow" value="<?=strlen($disk['critical'])?$disk['critical']:''?>" placeholder="<?=$display['critical']?>")>
|
||||
|
||||
> *Critical disk utilization* sets the critical threshold for this hard disk utilization. Exceeding this threshold will result in an alert notification.
|
||||
>
|
||||
> A value of zero will disable the critical threshold (including notifications).
|
||||
|
||||
<?endif;?>
|
||||
Warning disk temperature threshold (°<?=$display['unit']?>):
|
||||
: <input type="number" min="1" max="300" name="<?=$name?>_hotTemp" class="narrow" value="<?=!empty($disk['hotTemp'])?displayTemp($disk['hotTemp']):''?>" placeholder="<?=displayTemp($display['hot'])?>">
|
||||
: <input type="number" min="0" max="300" name="<?=$name?>_hotTemp" class="narrow" value="<?=strlen($disk['hotTemp'])?displayTemp($disk['hotTemp']):''?>" placeholder="<?=displayTemp($display['hot'])?>">
|
||||
|
||||
> *Warning disk temperature* sets the warning threshold for this hard disk temperature. Exceeding this threshold will result in a warning notification.
|
||||
>
|
||||
> A value of zero will disable the warning threshold (including notifications).
|
||||
|
||||
Critical disk temperature threshold (°<?=$display['unit']?>):
|
||||
: <input type="number" min="1" max="300" name="<?=$name?>_maxTemp" class="narrow" value="<?=!empty($disk['maxTemp'])?displayTemp($disk['maxTemp']):''?>" placeholder="<?=displayTemp($display['max'])?>">
|
||||
: <input type="number" min="0" max="300" name="<?=$name?>_maxTemp" class="narrow" value="<?=strlen($disk['maxTemp'])?displayTemp($disk['maxTemp']):''?>" placeholder="<?=displayTemp($display['max'])?>">
|
||||
|
||||
> *Critical disk temperature* sets the critical threshold for this hard disk temperature. Exceeding this threshold will result in an alert notification.
|
||||
|
||||
>
|
||||
> A value of zero will disable the critical threshold (including notifications).
|
||||
|
||||
<?if (($var['spinupGroups']=="yes")&&($disk['name']!="cache")):?>
|
||||
|
||||
|
||||
@@ -31,7 +31,8 @@ function cleanUp() {
|
||||
function diagnostics() {
|
||||
$('input[value="Download"]').val('Downloading...').prop('disabled',true);
|
||||
$('#pleaseWait').show('slow');
|
||||
$.post('/webGui/include/Download.php',{cmd:'diag',file:'<?=$zip?>'},function(zip) {
|
||||
var anonymize = $('#anonymize').is(':checked') ? '' : '-a';
|
||||
$.post('/webGui/include/Download.php',{cmd:'diag',file:'<?=$zip?>',anonymize:anonymize},function(zip) {
|
||||
location = zip;
|
||||
setTimeout(cleanUp,4000);
|
||||
});
|
||||
@@ -65,10 +66,13 @@ and configuration files are collected:
|
||||
Clicking **Download** will start the collection process and then instruct your browser to save the zip file locally.
|
||||
|
||||
*No personal information such as user names, passwords, or any other file contents not specified above is included
|
||||
by unRAID Server OS; however, your server name, IP address, and user share names* **will** *be included.*
|
||||
by unRAID Server OS; however, your server name, IP address, and user share names* **will** *be included.*
|
||||
|
||||
*Note that 3rd-party plugins **may** or may not store personal information in plugin-specific configuration files and/or output
|
||||
to the system log.*
|
||||
|
||||
<input type="button" value="Download" onclick="diagnostics()"><input type="button" value="Done" onclick="done()">
|
||||
*Use* **Anonymize diagnostics** *when publishing the diagnostics file in the public forum. In private communication with Limetech it is recommended to uncheck this setting and capture all information unaltered.*
|
||||
|
||||
<input type="button" value="Download" onclick="diagnostics()"><input type="button" value="Done" onclick="done()"><input type="checkbox" id="anonymize" checked>Anonymize diagnostics
|
||||
|
||||
<br><div id="pleaseWait" style="display:none;font-weight:bold;color:red;text-align:center">Please wait, collecting diagnostic information...</div>
|
||||
|
||||
@@ -16,7 +16,7 @@ Cond="$var['fsState']=='Started' && $var['shareDisk']!='no'"
|
||||
?>
|
||||
<script>
|
||||
function displayDisks(all) {
|
||||
$('#disk_list').html("<tr><td colspan='8' style='text-align:center'><i class='fa fa-spinner fa-spin icon'></i>Please wait... computing disk shares!</td></tr>");
|
||||
if (all == 'yes') $('#disk_list').html("<tr><td colspan='8' style='text-align:center'><i class='fa fa-spinner fa-spin icon'></i>Please wait... computing disk shares!</td></tr>");
|
||||
$.get('/webGui/include/DiskList.php',{compute:all,path:'<?=$path?>',prev:'<?=$prev?>',scale:'<?=$display['scale']?>',number:'<?=$display['number']?>'},function(data){
|
||||
$('#disk_list').html(data);
|
||||
$('#compute-disks').prop('disabled',!data || data.indexOf('colspan=')!=-1);
|
||||
|
||||
@@ -171,27 +171,35 @@ Tunable (md_write_method):
|
||||
>
|
||||
> *Auto* selects `read/modify/write`.
|
||||
|
||||
Default warning disk utilization level (%):
|
||||
: <input type="number" min="0" max="99" name="display_warning" class="narrow" value="<?=$display['warning']?>">
|
||||
Default warning disk utilization threshold (%):
|
||||
: <input type="number" min="0" max="100" name="display_warning" class="narrow" value="<?=$display['warning']?>">
|
||||
|
||||
> *Warning disk utilization* sets the default warning threshold for all hard disks utilization. Exceeding this threshold will result in a warning notification.
|
||||
>
|
||||
> When the warning level is set equal or greater than the critical level, there will be only critical notifications (warnings are not existing).
|
||||
> When the warning threshold is set equal or greater than the critical threshold, there will be only critical notifications (warnings are not existing).
|
||||
>
|
||||
> A value of zero will disable the warning threshold (including notifications).
|
||||
|
||||
Default critical disk utilization level (%):
|
||||
Default critical disk utilization threshold (%):
|
||||
: <input type="number" min="0" max="100" name="display_critical" class="narrow" value="<?=$display['critical']?>">
|
||||
|
||||
> *Critical disk utilization* sets the default critical threshold for all hard disks utilization. Exceeding this threshold will result in an alert notification.
|
||||
>
|
||||
> A value of zero will disable the critical threshold (including notifications).
|
||||
|
||||
Default warning disk temperature threshold (°<?=$display['unit']?>):
|
||||
: <input type="number" min="1" max="300" name="display_hot" class="narrow" value="<?=displayTemp($display['hot'])?>">
|
||||
: <input type="number" min="0" max="300" name="display_hot" class="narrow" value="<?=displayTemp($display['hot'])?>">
|
||||
|
||||
> *Warning disk temperature* sets the default warning threshold for all hard disks temperature. Exceeding this threshold will result in a warning notification.
|
||||
>
|
||||
> A value of zero will disable the warning threshold (including notifications).
|
||||
|
||||
Default critical disk temperature threshold (°<?=$display['unit']?>):
|
||||
: <input type="number" min="1" max="300" name="display_max" class="narrow" value="<?=displayTemp($display['max'])?>">
|
||||
: <input type="number" min="0" max="300" name="display_max" class="narrow" value="<?=displayTemp($display['max'])?>">
|
||||
|
||||
> *Critical disk temperature* sets the default critical threshold for all hard disks temperature. Exceeding this threshold will result in an alert notification.
|
||||
>
|
||||
> A value of zero will disable the critical threshold (including notifications).
|
||||
|
||||
|
||||
: <input type="submit" name="changeDisk" value="Apply"><input type="button" value="Done" onclick="done()">
|
||||
|
||||
@@ -16,7 +16,6 @@ Icon="display-settings.png"
|
||||
?>
|
||||
|
||||
<?
|
||||
$file = "/boot/config/plugins/dynamix/banner.png";
|
||||
$void = "<img src='/webGui/images/banner.png' id='image' width='330' height='30' onclick='$("#drop").click()' style='cursor:pointer' title='Click to select PNG file'>";
|
||||
$icon = "<i class='fa fa-trash top' title='Restore default image' onclick='restore()'></i>";
|
||||
?>
|
||||
@@ -37,16 +36,12 @@ function restore() {
|
||||
$('select[name="banner"]').trigger('change');
|
||||
filename = 'reset';
|
||||
}
|
||||
function forceReload() {
|
||||
window.onload = parent.location.reload(true);
|
||||
}
|
||||
function upload(remove) {
|
||||
// gets invoked when the user clicks APPLY, at this point image will be saved or deleted
|
||||
if (remove || filename=='reset') {
|
||||
$.post("/webGui/include/FileUpload.php",{cmd:'delete',filename:filename,path:path,output:"banner"});
|
||||
function upload() {
|
||||
// save or delete upload when APPLY is pressed
|
||||
if (filename=='reset') {
|
||||
$.post("/webGui/include/FileUpload.php",{cmd:'delete',path:path,filename:'banner.png'});
|
||||
} else if (filename) {
|
||||
$.post("/webGui/include/FileUpload.php",{cmd:'save',filename:filename,path:path,output:"banner"});
|
||||
window.onload = forceReload();
|
||||
$.post("/webGui/include/FileUpload.php",{cmd:'save',path:path,filename:filename,output:'banner.png'});
|
||||
}
|
||||
}
|
||||
function presetTime(form) {
|
||||
@@ -64,8 +59,6 @@ function presetPassive(index) {
|
||||
if (index==0) $('#passive').hide(); else $('#passive').show();
|
||||
}
|
||||
$(function() {
|
||||
// appending a time dummy will make the browser think/realize the image has changed
|
||||
$('#image').attr('src', $('#image').attr('src')+'?t='+new Date().getTime());
|
||||
var dropbox = $('#dropbox');
|
||||
// attach the drag-n-drop feature to the 'dropbox' element
|
||||
dropbox.filedrop({
|
||||
@@ -100,7 +93,7 @@ $(function() {
|
||||
reader.readAsDataURL(file);
|
||||
},
|
||||
uploadFinished:function(i,file,response) {
|
||||
if (response == '200 OK') {
|
||||
if (response == 'OK 200') {
|
||||
if (!filename || filename=='reset') $(dropbox).append("<?=$icon?>");
|
||||
$('select[name="banner"]').trigger('change');
|
||||
filename = file.name;
|
||||
@@ -123,7 +116,7 @@ $(function() {
|
||||
>
|
||||
> You can experiment with these settings as desired, they only affect visual properties.
|
||||
|
||||
<form markdown="1" name="display_settings" method="POST" action="/update.php" target="progressFrame">
|
||||
<form markdown="1" name="display_settings" method="POST" action="/update.php" target="progressFrame" onsubmit="upload()">
|
||||
<input type="hidden" name="#file" value="dynamix/dynamix.cfg">
|
||||
<input type="hidden" name="#section" value="display">
|
||||
Date format:
|
||||
@@ -217,10 +210,10 @@ Show banner:
|
||||
|
||||
<div id="custom" markdown="1" style="display:none">
|
||||
Custom banner:
|
||||
<input type="hidden" name="custom" value="custom">
|
||||
<input type="hidden" name="#custom" value="">
|
||||
: <span id="dropbox">
|
||||
<?if (file_exists($file)):?>
|
||||
<img src="<?=$file?>" width="330" height="30" onclick="$('#drop').click()" style="cursor:pointer" title="Click to select PNG file"><?=$icon?>
|
||||
<?if (file_exists($banner)):?>
|
||||
<img src="<?=autov($banner)?>" width="330" height="30" onclick="$('#drop').click()" style="cursor:pointer" title="Click to select PNG file"><?=$icon?>
|
||||
<?else:?>
|
||||
<?=$void?>
|
||||
<?endif;?>
|
||||
@@ -279,6 +272,6 @@ Page update frequency:
|
||||
>
|
||||
> A special option exists to disable screen updates while a parity operation is in progress. Use this option when degradation of the parity operation is observed.
|
||||
|
||||
<input type="submit" name="#default" value="Default" onclick="filename='reset';upload()">
|
||||
: <input type="submit" name="#apply" value="Apply" onclick="upload()"><input type="button" value="Done" onclick="done()">
|
||||
<input type="submit" name="#default" value="Default" onclick="filename='reset'">
|
||||
: <input type="submit" name="#apply" value="Apply"><input type="button" value="Done" onclick="done()">
|
||||
</form>
|
||||
|
||||
@@ -16,7 +16,7 @@ Cond="$var['fsState']=="Started" && $var['shareUser']=='e'"
|
||||
?>
|
||||
<script>
|
||||
function displayShares(all) {
|
||||
$('#share_list').html("<tr><td colspan='8' style='text-align:center'><i class='fa fa-spinner fa-spin icon'></i>Please wait... computing user shares!</td></tr>");
|
||||
if (all == 'yes') $('#share_list').html("<tr><td colspan='8' style='text-align:center'><i class='fa fa-spinner fa-spin icon'></i>Please wait... computing user shares!</td></tr>");
|
||||
$.get('/webGui/include/ShareList.php',{compute:all,path:'<?=$path?>',prev:'<?=$prev?>',scale:'<?=$display['scale']?>',number:'<?=$display['number']?>'},function(data){
|
||||
$('#share_list').html(data);
|
||||
$('#compute-shares').prop('disabled',!data || data.indexOf('colspan=')!=-1);
|
||||
|
||||
@@ -39,12 +39,6 @@ function restore() {
|
||||
filename = '';
|
||||
}
|
||||
|
||||
function upload() {
|
||||
// gets invoked when the user clicks APPLY, at this point image will be saved
|
||||
var username = document.user_edit.userName.value.trim();
|
||||
if (username && filename) $.post("/webGui/include/FileUpload.php",{cmd:'save',filename:filename,path:path,output:username});
|
||||
}
|
||||
|
||||
function checkUsername(form) {
|
||||
var username = form.userName.value.trim();
|
||||
if (username.length==0) {
|
||||
@@ -59,6 +53,9 @@ function checkUsername(form) {
|
||||
swal({title:"Invalid user name",text:"Do not use reserved names",type:"error"});
|
||||
return false;
|
||||
}
|
||||
if (filename) {
|
||||
$.post("/webGui/include/FileUpload.php",{cmd:'save',path:path,filename:filename,output:username+'.png'});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -98,7 +95,7 @@ $(function(){
|
||||
reader.readAsDataURL(file);
|
||||
},
|
||||
uploadFinished:function(i,file,response) {
|
||||
if (response == '200 OK') {
|
||||
if (response == 'OK 200') {
|
||||
if (!filename) $(dropbox).append("<?=$icon?>");
|
||||
$('input[name="userDesc"]').trigger('change');
|
||||
filename = file.name;
|
||||
@@ -122,7 +119,7 @@ User name:
|
||||
> Usernames may be up to 32 characters long and must start with a **lower case letter** or an underscore,
|
||||
> followed by **lower case letters**, digits, underscores, or dashes. They can end with a dollar sign.
|
||||
> In regular expression terms: `[a-z_][a-z0-9_-]*[$]?`
|
||||
|
||||
|
||||
Description:
|
||||
: <input type="text" name="userDesc" maxlength="64">
|
||||
|
||||
@@ -142,5 +139,5 @@ Retype password:
|
||||
: <input type="password" name="userPasswordConf" maxlength="40" onKeyUp="this.form.cmdUserEdit.disabled=(this.form.userPassword.value!=this.form.userPasswordConf.value);">
|
||||
|
||||
|
||||
: <input type="submit" name="cmdUserEdit" value="Add" onclick="upload()"><input type="button" value="Done" onclick="done()">
|
||||
: <input type="submit" name="cmdUserEdit" value="Add"><input type="button" value="Done" onclick="done()">
|
||||
</form>
|
||||
|
||||
@@ -21,7 +21,7 @@ Title="Edit User"
|
||||
<?endif;?>
|
||||
|
||||
<?
|
||||
$file = "/boot/config/plugins/dynamix/users/$name.png";
|
||||
$user = "/boot/config/plugins/dynamix/users/$name.png";
|
||||
$void = "<img src='/webGui/images/user.png' width='48' height='48' id='image' onclick='$("#drop").click()' style='cursor:pointer' title='Click to select PNG file'>";
|
||||
$icon = "<i class='fa fa-trash top' title='Restore default image' onclick='restore()'></i>";
|
||||
?>
|
||||
@@ -47,23 +47,16 @@ function restore() {
|
||||
filename = 'reset';
|
||||
}
|
||||
|
||||
function forceReload() {
|
||||
window.onload = parent.location.reload(true);
|
||||
}
|
||||
|
||||
function upload(remove) {
|
||||
// gets invoked when the user clicks APPLY, at this point image will be saved or deleted
|
||||
// save or delete upload when APPLY is pressed
|
||||
if (remove || filename=='reset') {
|
||||
$.post("/webGui/include/FileUpload.php",{cmd:'delete',filename:filename,path:path,output:"<?=$name?>"});
|
||||
$.post("/webGui/include/FileUpload.php",{cmd:'delete',path:path,filename:'<?=$name?>.png'});
|
||||
} else if (filename) {
|
||||
$.post("/webGui/include/FileUpload.php",{cmd:'save',filename:filename,path:path,output:"<?=$name?>"});
|
||||
window.onload = forceReload();
|
||||
$.post("/webGui/include/FileUpload.php",{cmd:'save',path:path,filename:filename,output:'<?=$name?>.png'});
|
||||
}
|
||||
}
|
||||
|
||||
$(function(){
|
||||
// appending a time dummy will make the browser think/realize the image has changed
|
||||
$('#image').attr('src', $('#image').attr('src')+'?t='+new Date().getTime());
|
||||
var dropbox = $('#dropbox');
|
||||
// attach the drag-n-drop feature to the 'dropbox' element
|
||||
dropbox.filedrop({
|
||||
@@ -98,7 +91,7 @@ $(function(){
|
||||
reader.readAsDataURL(file);
|
||||
},
|
||||
uploadFinished:function(i,file,response) {
|
||||
if (response == '200 OK') {
|
||||
if (response == 'OK 200') {
|
||||
if (!filename || filename=='reset') $(dropbox).append("<?=$icon?>");
|
||||
$('input[name="userDesc"]').trigger('change');
|
||||
filename = file.name;
|
||||
@@ -115,7 +108,7 @@ $(function(){
|
||||
});
|
||||
</script>
|
||||
|
||||
<form markdown="1" method="POST" action="/update.htm" target="progressFrame">
|
||||
<form markdown="1" method="POST" action="/update.htm" target="progressFrame" onsubmit="upload(<?=$name=="root" ? 'false' : 'this.confirmDelete.checked'?>)">
|
||||
<input type="hidden" name="userName" value="<?=$name?>">
|
||||
User name:
|
||||
: <?=$name?>
|
||||
@@ -125,8 +118,8 @@ Description:
|
||||
|
||||
Custom image:
|
||||
: <span id="dropbox">
|
||||
<?if (file_exists($file)):?>
|
||||
<img src="<?=$file?>" id="image" width="48" height="48" onclick="$('#drop').click()" style="cursor:pointer" title="Click to select PNG file"><?=$icon?>
|
||||
<?if (file_exists($user)):?>
|
||||
<img src="<?=autov($user)?>" id="image" width="48" height="48" onclick="$('#drop').click()" style="cursor:pointer" title="Click to select PNG file"><?=$icon?>
|
||||
<?else:?>
|
||||
<?=$void?>
|
||||
<?endif;?>
|
||||
@@ -139,7 +132,7 @@ Custom image:
|
||||
<?else:?>
|
||||
Delete<input type="checkbox" name="confirmDelete" onChange="chkDelete(this.form, this.form.cmdUserEdit)">
|
||||
<?endif;?>
|
||||
: <input type="submit" name="cmdUserEdit" value="Apply" onclick="upload(<?=$name=="root" ? 'false' : 'this.form.confirmDelete.checked'?>)"><input type="button" value="Done" onclick="done()">
|
||||
: <input type="submit" name="cmdUserEdit" value="Apply"><input type="button" value="Done" onclick="done()">
|
||||
</form>
|
||||
<br><br>
|
||||
<form markdown="1" method="POST" action="/update.htm" target="progressFrame">
|
||||
|
||||
@@ -15,7 +15,8 @@ Title="Users"
|
||||
?>
|
||||
|
||||
<?foreach ($users as $user):?>
|
||||
<div class="user-list"><center><a class="<?=(!empty($user['desc']) ? 'info' : '')?>" href="<?=$path?>/UserEdit?name=<?=$user['name'];?>"><img src="<?=(is_file($img='/boot/config/plugins/dynamix/users/'.$user['name'].'.png') ? $img : '/webGui/images/user.png')?>" class="picture" border="0" width="48" height="48"><br><?=$user['name']?><span><?=$user['desc']?></span></a></center></div>
|
||||
<?$img = "/boot/config/plugins/dynamix/users/{$user['name']}.png"?>
|
||||
<div class="user-list"><center><a class="<?=(!empty($user['desc']) ? 'info' : '')?>" href="<?=$path?>/UserEdit?name=<?=$user['name'];?>"><img src="<?=(file_exists($img) ? autov($img) : '/webGui/images/user.png')?>" class="picture" border="0" width="48" height="48"><br><?=$user['name']?><span><?=$user['desc']?></span></a></center></div>
|
||||
<?endforeach;?>
|
||||
<div style='clear:both'></div>
|
||||
<form method="GET" action="<?=$path?>/UserAdd">
|
||||
|
||||
@@ -107,7 +107,10 @@ case 'disk':
|
||||
my_insert($row4[$n],"<img src=$path/$state.png>");
|
||||
break;}
|
||||
$temp = $disk['temp'];
|
||||
if ($temp>=$_POST['hot']) my_insert($row5[$n],"<span class='heat-img'><img src='$path/".($temp>=$_POST['max']?'max':'hot').".png'></span><span class='heat-text' style='display:none'>".my_temp($temp,$_POST['unit'])."</span>");
|
||||
$hot = strlen($disk['hotTemp']) ? $disk['hotTemp'] : $_POST['hot'];
|
||||
$max = strlen($disk['maxTemp']) ? $disk['maxTemp'] : $_POST['max'];
|
||||
$beep = $temp>=$max && $max>0 ? 'max' : ($temp>=$hot && $hot>0 ? 'hot' : '');
|
||||
if ($beep) my_insert($row5[$n],"<span class='heat-img'><img src='$path/$beep.png'></span><span class='heat-text' style='display:none'>".my_temp($temp,$_POST['unit'])."</span>");
|
||||
if ($disk['device'] && !strpos($state,'blink')) my_smart($row6[$n],$disk['name'],'Device');
|
||||
my_usage($row7[$n],($disk['type']!='Parity' && $disk['fsStatus']=='Mounted')?(round((1-$disk['fsFree']/$disk['fsSize'])*100).'%'):'');
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@ case 'save':
|
||||
copy($source, $tmp);
|
||||
exec("zip -qlj $docroot/$file $tmp");
|
||||
@unlink($tmp);
|
||||
}
|
||||
}
|
||||
echo "/$file";
|
||||
break;
|
||||
case 'delete':
|
||||
@unlink("$docroot/$file");
|
||||
break;
|
||||
case 'diag':
|
||||
exec("$docroot/webGui/scripts/diagnostics $docroot/$file");
|
||||
exec("$docroot/webGui/scripts/diagnostics {$_POST['anonymize']} $docroot/$file");
|
||||
echo "/$file";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -8,22 +8,17 @@ switch ($cmd) {
|
||||
case 'load':
|
||||
if (isset($_POST['filedata'])) {
|
||||
exec("rm -f $temp/*.png");
|
||||
$result = file_put_contents("$temp/$file", base64_decode(str_replace(array('data:image/png;base64,',' '),array('','+'),$_POST['filedata'])));
|
||||
$result = file_put_contents("$temp/$file", base64_decode(str_replace(['data:image/png;base64,',' '],['','+'],$_POST['filedata'])));
|
||||
}
|
||||
break;
|
||||
case 'save':
|
||||
exec("mkdir -p $path");
|
||||
if (isset($_POST['flash'])) @copy("$temp/$file", $_POST['flash']);
|
||||
$result = @rename("$temp/$file", "$path/{$_POST['output']}.png");
|
||||
$result = @rename("$temp/$file", "$path/{$_POST['output']}");
|
||||
break;
|
||||
case 'delete':
|
||||
@unlink("$path/{$_POST['output']}.png");
|
||||
exec("rm -f $path/$file");
|
||||
$result = true;
|
||||
break;
|
||||
case 'reset':
|
||||
if (isset($_POST['flash'])) @unlink($_POST['flash']);
|
||||
$result = @copy("$path/$file", "$path/{$_POST['output']}.png");
|
||||
break;
|
||||
}
|
||||
echo ($result ? '200 OK' : '500 Internal Error');
|
||||
echo ($result ? 'OK 200' : 'Internal Error 500');
|
||||
?>
|
||||
|
||||
@@ -82,12 +82,12 @@ function usage_color(&$disk,$limit,$free) {
|
||||
$critical = !empty($disk['critical']) ? $disk['critical'] : $display['critical'];
|
||||
$warning = !empty($disk['warning']) ? $disk['warning'] : $display['warning'];
|
||||
if (!$free) {
|
||||
if ($limit>=$critical) return 'redbar';
|
||||
if ($limit>=$warning) return 'orangebar';
|
||||
if ($limit>=$critical && $critical>0) return 'redbar';
|
||||
if ($limit>=$warning && $warning>0) return 'orangebar';
|
||||
return 'greenbar';
|
||||
} else {
|
||||
if ($limit<=100-$critical) return 'redbar';
|
||||
if ($limit<=100-$warning) return 'orangebar';
|
||||
if ($limit<=100-$critical && $critical>0) return 'redbar';
|
||||
if ($limit<=100-$warning && $warning>0) return 'orangebar';
|
||||
return 'greenbar';
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -12,13 +12,38 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
if ($argv[1]) {
|
||||
// script is called from GUI
|
||||
$zip = $argv[1];
|
||||
$diag = basename($zip, '.zip');
|
||||
$split = explode('-', $diag);
|
||||
$date = "{$split[2]}-{$split[3]}";
|
||||
} else {
|
||||
$opt = getopt('a',['all']);
|
||||
$all = isset($opt['a']) || isset($opt['all']);
|
||||
$zip = $all ? $argv[2] : $argv[1];
|
||||
$cli = empty($zip);
|
||||
|
||||
function anonymize($text,$select) {
|
||||
global $all;
|
||||
if ($all) return $text;
|
||||
switch ($select) {
|
||||
case 1:
|
||||
$rows = explode("\n", $text);
|
||||
foreach ($rows as &$row) {
|
||||
if (!preg_match("/\b(disk|cache|parity|flash)\d*\b/", $row)) {
|
||||
$row = preg_replace("/^(\s*\[\S).*(\S\])( => Array)$/","$1..$2$3",$row);
|
||||
$row = preg_replace("/^(\s*\[(name|nameOrig|comment|flashGUID|regGUID|regTo|readList|writeList)\] => \S).*(\S)$/","$1..$3",$row);
|
||||
}
|
||||
}
|
||||
return implode("\n", $rows);
|
||||
case 2:
|
||||
$name = basename($text,'.cfg');
|
||||
$len = strlen($name);
|
||||
if ($len>2) {
|
||||
$dash = str_repeat('-',$len-2);
|
||||
$name = preg_replace("/^(\S).*(\S)/","$1$dash$2",$name);
|
||||
$i = 1;
|
||||
while (file_exists(dirname($text)."/$name.cfg")) {$name = substr($name,0,$len)." ($i)"; $i++;}
|
||||
}
|
||||
return dirname($text)."/$name.cfg";
|
||||
}
|
||||
}
|
||||
|
||||
if ($cli) {
|
||||
// script is called from CLI
|
||||
echo "Starting diagnostics collection... ";
|
||||
exec("mkdir -p /boot/logs");
|
||||
@@ -27,17 +52,20 @@ if ($argv[1]) {
|
||||
$date = date('Ymd-Hi');
|
||||
$diag = "$server-diagnostics-$date";
|
||||
$zip = "/boot/logs/$diag.zip";
|
||||
} else {
|
||||
// script is called from GUI
|
||||
$diag = basename($zip, '.zip');
|
||||
$split = explode('-', $diag);
|
||||
$date = "{$split[2]}-{$split[3]}";
|
||||
}
|
||||
// create folder structure
|
||||
exec("mkdir -p /$diag/system /$diag/config /$diag/logs /$diag/shares /$diag/smart /$diag/qemu");
|
||||
// copy ini variables
|
||||
foreach (glob("/var/local/emhttp/*.ini") as $file) {
|
||||
$ini = basename($file,".ini");
|
||||
// skip users file
|
||||
if ($ini != "users") file_put_contents("/$diag/system/vars.txt",preg_replace(array("/\n/","/^Array/"),array("\r\n",$ini),print_r(parse_ini_file($file,true),true)),FILE_APPEND);
|
||||
// skip users file in anonymized mode
|
||||
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);
|
||||
}
|
||||
// remove registration and flash info and anonymize user names
|
||||
exec("sed -r -i '/\[(reg|flash).*\]/d;s/(\[(read|write)List\] => )\S+/\\1xxx/' /$diag/system/vars.txt");
|
||||
// individual commands execution (suppress errors)
|
||||
exec("lsscsi -vgl 2>/dev/null|todos >/$diag/system/lsscsi.txt");
|
||||
exec("lspci -knn 2>/dev/null|todos >/$diag/system/lspci.txt");
|
||||
@@ -58,17 +86,38 @@ exec("find /sys/kernel/iommu_groups/ -type l 2>/dev/null|todos >/$diag/system/io
|
||||
exec("todos </proc/cmdline >/$diag/system/cmdline.txt");
|
||||
// copy configuration files (suppress errors)
|
||||
exec("cp /boot/config/*.{cfg,conf,dat} /boot/config/go /$diag/config 2>/dev/null");
|
||||
if (is_dir("/boot/config/shares")) exec("cp /boot/config/shares/*.cfg /$diag/shares 2>/dev/null");
|
||||
// anonymize configuration files
|
||||
if (!$all) exec("sed -ri 's/^((disk|flash)(Read|Write)List.*=\")[^\"]+/\\1.../' /$diag/config/*.cfg 2>/dev/null");
|
||||
|
||||
// copy share information (anonymize if applicable)
|
||||
$files = glob("/boot/config/shares/*.cfg");
|
||||
foreach ($files as $file) {
|
||||
$dest = anonymize("/$diag/shares/".basename($file),2);
|
||||
@copy($file, $dest);
|
||||
if (!$all) exec("sed -ri 's/^(share(Comment|ReadList|WriteList)=\")[^\"]+/\\1.../' '$dest' 2>/dev/null");
|
||||
}
|
||||
// create default user shares information
|
||||
$ini = "/var/local/emhttp/shares.ini";
|
||||
$shares = file_exists($ini) ? parse_ini_file($ini, true) : array();
|
||||
$shares = file_exists($ini) ? parse_ini_file($ini, true) : [];
|
||||
foreach ($shares as $share) {
|
||||
$file = "/$diag/shares/${share['name']}.cfg";
|
||||
if (!file_exists($file)) file_put_contents($file,"# This share has default settings.\r\n");
|
||||
$name = $share['name'];
|
||||
if (!in_array("/boot/config/shares/$name.cfg",$files)) file_put_contents(anonymize("/$diag/shares/$name.cfg",2),"# This share has default settings.\r\n");
|
||||
}
|
||||
// copy syslog information
|
||||
// copy syslog information (anonymize if applicable)
|
||||
foreach (glob("/var/log/syslog*") as $file) {
|
||||
exec("todos <$file >/$diag/logs/".basename($file).".txt");
|
||||
$dest = "/$diag/logs/".basename($file).".txt";
|
||||
exec("todos <$file >$dest");
|
||||
if (!$all) {
|
||||
unset($titles,$rows);
|
||||
exec("grep -Po 'logger: moving \"\K[^\"]+' $dest 2>/dev/null|sort|uniq", $titles);
|
||||
exec("sed -ri 's|\b\S+@\S+\.\S+\b|xxx@removed.com|;s|\b(username\|password)([=:])\S+\b|\\1\\2xxx|;s|(GUID: \S)\S+(\S) |\\1..\\2 |;s|(moving \"\S\|\"/mnt/user/\S).*(\S)\"|\\1..\\2\"|' $dest");
|
||||
foreach ($titles as $mover) {
|
||||
$title = "/{$mover[0]}..".substr($mover,-1)."/...";
|
||||
exec("sed -ri 's|(logger: [.>cr].*)[ /]$mover/.*$|\\1 file: $title|' $dest 2>/dev/null");
|
||||
}
|
||||
exec("grep -n ' cache_dirs: -' $dest 2>/dev/null|cut -d: -f1", $rows);
|
||||
for ($i = 0; $i < count($rows); $i += 2) for ($row = $rows[$i]+1; $row < $rows[$i+1]; $row++) exec("sed -ri '$row s|(cache_dirs: \S).*(\S)|\\1..\\2|' $dest 2>/dev/null");
|
||||
}
|
||||
}
|
||||
// copy docker information (if existing)
|
||||
$docker = "/var/log/docker.log";
|
||||
@@ -88,5 +137,5 @@ foreach ($devices as $device) {
|
||||
}
|
||||
// create resulting zip file and remove temp folder
|
||||
exec("zip -qmr $zip /$diag");
|
||||
if (!$argv[1]) echo "done.\nZIP file '$zip' created.\n";
|
||||
if ($cli) echo "done.\nZIP file '$zip' created.\n";
|
||||
?>
|
||||
|
||||
@@ -88,15 +88,15 @@ function read_write_parity_log($epoch,$duration,$speed,$status) {
|
||||
function check_temp($name,$temp,$text,$info) {
|
||||
global $notify,$disks,$saved,$unraid,$server;
|
||||
$disk = &$disks[$name];
|
||||
$hot = !empty($disk['hotTemp']) ? $disk['hotTemp'] : $unraid['display']['hot'];
|
||||
$max = !empty($disk['maxTemp']) ? $disk['maxTemp'] : $unraid['display']['max'];
|
||||
$warn = $temp>=$max ? 'alert' : ($temp>=$hot ? 'warning' : '');
|
||||
$hot = strlen($disk['hotTemp']) ? $disk['hotTemp'] : $unraid['display']['hot'];
|
||||
$max = strlen($disk['maxTemp']) ? $disk['maxTemp'] : $unraid['display']['max'];
|
||||
$warn = $temp>=$max && $max>0 ? 'alert' : ($temp>=$hot && $hot>0 ? 'warning' : '');
|
||||
$item = 'temp';
|
||||
$last = isset($saved[$item][$name]) ? $saved[$item][$name] : 0;
|
||||
if ($warn) {
|
||||
if ($temp>$last) {
|
||||
exec("$notify -e \"unRAID $text temperature\" -s \"".ucfirst($warn)." [$server] - $text ".($warn=='alert'?'overheated (':'is hot (').my_temp($temp).")\" -d \"$info\" -i \"$warn\"");
|
||||
$saved[$item][$name] = $temp;
|
||||
$saved[$item][$name] = $max>0 && $temp<=$max ? $max : $temp;
|
||||
}
|
||||
} else {
|
||||
if ($last) {
|
||||
@@ -177,15 +177,15 @@ function check_usage($name,$used,$text,$info) {
|
||||
global $notify,$disks,$saved,$unraid,$server;
|
||||
if ($used == -1) return;
|
||||
$disk = &$disks[$name];
|
||||
$warning = !empty($disk['warning']) ? $disk['warning'] : $unraid['display']['warning'];
|
||||
$critical = !empty($disk['critical']) ? $disk['critical'] : $unraid['display']['critical'];
|
||||
$warn = $used>=$critical ? 'alert' : ($used>=$warning ? 'warning' : '');
|
||||
$warning = strlen($disk['warning']) ? $disk['warning'] : $unraid['display']['warning'];
|
||||
$critical = strlen($disk['critical']) ? $disk['critical'] : $unraid['display']['critical'];
|
||||
$warn = $used>=$critical && $critical>0 ? 'alert' : ($used>=$warning && $warning>0 ? 'warning' : '');
|
||||
$item = 'used';
|
||||
$last = isset($saved[$item][$name]) ? $saved[$item][$name] : 0;
|
||||
if ($warn) {
|
||||
if ($used>$last) {
|
||||
exec("$notify -e \"unRAID $text disk utilization\" -s \"".ucfirst($warn)." [$server] - $text is ".($warn=='alert'?'low on space':'high on usage')." (${used}%)\" -d \"$info\" -i \"$warn\"");
|
||||
$saved[$item][$name] = $used;
|
||||
$saved[$item][$name] = $critical>0 && $used<=$critical ? $critical : $used;
|
||||
}
|
||||
} else {
|
||||
if ($last) {
|
||||
@@ -336,12 +336,12 @@ if ($retval===0) {
|
||||
} else
|
||||
$info = "Docker image file not specified";
|
||||
|
||||
if ($warn>=$high1) {
|
||||
if ($warn>=$high1 && $high1>0) {
|
||||
if ($warn>$last) {
|
||||
exec("$notify -e \"Docker critical image disk utilization\" -s \"Alert [$server] - Docker image disk utilization of ${warn}%\" -d \"$info\" -i \"alert\"");
|
||||
$saved[$item][$name] = $warn;
|
||||
}
|
||||
} else if ($warn>=$high2) {
|
||||
} else if ($warn>=$high2 && $high2>0) {
|
||||
if ($warn>$last) {
|
||||
exec("$notify -e \"Docker high image disk utilization\" -s \"Warning [$server] - Docker image disk utilization of ${warn}%\" -d \"$info\" -i \"warning\"");
|
||||
$saved[$item][$name] = $warn;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
function process {
|
||||
echo "$1"
|
||||
if [ -d $1 ] ; then
|
||||
if [ -d "$1" ] ; then
|
||||
owner=nobody
|
||||
group=users
|
||||
if [ $# -ge 2 ]; then
|
||||
|
||||
@@ -26,4 +26,4 @@ while (!feof($handle)) {
|
||||
flush();
|
||||
}
|
||||
pclose($handle);
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -24,6 +24,7 @@ input:focus[type=text],input:focus[type=password],input:focus[type=number],input
|
||||
input:hover[type=button],input:hover[type=reset],input:hover[type=submit],button:hover,a.button:hover{border-color:#6AB034;color:#FFFFFF;background:-webkit-radial-gradient(#5E9E2E,#8FD956);background:linear-gradient(#5E9E2E,#8FD956);}
|
||||
input:active[type=button],input:active[type=reset],input:active[type=submit],button:active{border-color:#6AB034;box-shadow:inset 0 0 8px 4px #548C29,0 1px 0 0 #101010;}
|
||||
input[disabled],button[disabled],input:hover[type=button][disabled],input:hover[type=reset][disabled],input:hover[type=submit][disabled],button:hover[disabled],input:active[type=button][disabled],input:active[type=reset][disabled],input:active[type=submit][disabled],button:active[disabled],textarea[disabled]{color:#505050;border-color:#181818;background:linear-gradient(#202020,#101010);background:-webkit-radial-gradient(#202020,#101010);cursor:default;}
|
||||
input::-webkit-input-placeholder{color:#486DBA;}
|
||||
select{min-width:150px;max-width:320px;font-family:arimo;font-size:11px;color:#A0A0A0;background:-webkit-radial-gradient(#505050,#303030);background:linear-gradient(#505050,#303030);padding:3px 6px;margin:0 10px 0 0;border:none;box-shadow:0 2px 0 #404040;border-radius:4px;outline:none;display:inline-block;cursor:pointer;}
|
||||
select[disabled]{color:#505050;background:-webkit-radial-gradient(#303030,#101010);background:linear-gradient(#303030,#101010);box-shadow:0 2px 0 #202020;cursor:default;}
|
||||
select[name=enter_view]{padding:0;float:right;}
|
||||
|
||||
@@ -3,7 +3,7 @@ html,body{font-family:arimo;font-size:12px;color:#303030;background-color:#FFFFF
|
||||
img{border:0;text-decoration:none;vertical-align:middle;}
|
||||
p{text-align:justify;}
|
||||
p.centered{text-align:left;}
|
||||
a{color:#3B5998;text-decoration:none;}
|
||||
a{color:#00529B;text-decoration:none;}
|
||||
a.none{color:#303030;}
|
||||
a.img{text-decoration:none;border:none;}
|
||||
a.info{position:relative;z-index:1;}
|
||||
@@ -24,6 +24,7 @@ input:focus[type=text],input:focus[type=password],input:focus[type=number],input
|
||||
input:hover[type=button],input:hover[type=reset],input:hover[type=submit],button:hover,a.button:hover{border-color:#6AB034;color:#FFFFFF;background:-webkit-radial-gradient(#5E9E2E,#8FD956);background:linear-gradient(#5E9E2E,#8FD956);}
|
||||
input:active[type=button],input:active[type=reset],input:active[type=submit],button:active{border-color:#6AB034;box-shadow:inset 0 0 8px 4px #548C29,0 1px 0 0 #E0E0E0;}
|
||||
input[disabled],button[disabled],input:hover[type=button][disabled],input:hover[type=reset][disabled],input:hover[type=submit][disabled],button:hover[disabled],input:active[type=button][disabled],input:active[type=reset][disabled],input:active[type=submit][disabled],button:active[disabled],textarea[disabled]{color:#808080;border-color:#F0F0F0;background:linear-gradient(#F0F0F0,#F8F8F8);background:-webkit-radial-gradient(#F0F0F0,#F8F8F8);cursor:default;}
|
||||
input::-webkit-input-placeholder{color:#00529B;}
|
||||
select{min-width:150px;max-width:320px;font-family:arimo;font-size:11px;padding:3px 6px;margin:0 10px 0 0;border:none;border-radius:4px;box-shadow:0 2px 0 #E0E0E0,inset 0 -1px #FFFFFF;background:#F8F8F8;outline:none;display:inline-block;cursor:pointer;}
|
||||
select[disabled]{background-color:#F8F8F8;cursor:default;box-shadow:0 2px 0 #F0F0F0,inset 0 -1px #FFFFFF;}
|
||||
select[name=enter_view]{padding:0;float:right;}
|
||||
|
||||
@@ -42,12 +42,13 @@ $sec_afp = parse_ini_file('state/sec_afp.ini',true);
|
||||
// Merge SMART settings
|
||||
require_once 'include/CustomMerge.php';
|
||||
|
||||
// Build webGui pages first, then plugins pages
|
||||
$site = [];
|
||||
$base = 'dynamix';
|
||||
// Build the webGui pages first
|
||||
build_pages("$base/*.page");
|
||||
// Build the plugins pages
|
||||
foreach (glob('plugins/*', GLOB_ONLYDIR+GLOB_NOSORT) as $plugin) if ($plugin != $base) build_pages("$plugin/*.page");
|
||||
build_pages('webGui/*.page');
|
||||
foreach (glob('plugins/*', GLOB_ONLYDIR) as $plugin) {
|
||||
if ($plugin != 'plugins/dynamix') build_pages("$plugin/*.page");
|
||||
}
|
||||
|
||||
// Here's the page we're rendering
|
||||
$myPage = $site[basename($path)];
|
||||
$pageroot = "{$docroot}/".dirname($myPage['file']);
|
||||
|
||||
Reference in New Issue
Block a user