Merge pull request #851 from bergware/master

Bug fixes
This commit is contained in:
tom mortensen
2021-05-15 23:36:51 -07:00
committed by GitHub
6 changed files with 9 additions and 8 deletions

View File

@@ -89,6 +89,7 @@ function loadlist(id,check) {
case 'return' : updateInfo(data); break;
case 'install': list.find(tr).remove(); list.append(warning(data)); break;
}
$('#change_branch').prop('disabled',true);
} else {
<?if (!$reboot):?>
updateInfo(data);

View File

@@ -663,7 +663,7 @@ function smartMenu(table) {
opts.push({text:"_(Identity)_",icon:'fa-home',action:function(e){e.preventDefault();identity(page,disk);}});
if (view.search('green-text') == -1) {
opts.push({divider:true});
opts.push({text:"_(Acknowledge)_",icon:'fa-check-square-o',action:function(e){e.preventDefault();acknowledge(disk);}});
opts.push({text:"_(Acknowledge)_",icon:'fa-check-square-o',action:function(e){e.preventDefault();acknowledge(id,disk);}});
}
$(id).bind('click',function(){update2.stop();}).bind('mouseout',function(){setTimeout(function(){update2.start();},15000);});
context.attach(id,opts);
@@ -703,8 +703,8 @@ function identity(page,disk) {
$.cookie('one',tab,{path:'/'});
location.replace('/Dashboard/'+page+'?name='+disk);
}
function acknowledge(disk) {
$.post('/webGui/include/Acknowledge.php',{disk:disk});
function acknowledge(id,disk) {
$.post('/webGui/include/Acknowledge.php',{disk:disk},function(){$(id).removeClass('fa-thumbs-o-down orange-text').addClass('fa-thumbs-o-up green-text');$(id.replace('smart','text')).text("<?=_('healthy')?>");});
}
function dropdown(menu) {
var select = 'select[name="'+menu+'"]';

View File

@@ -462,6 +462,6 @@ while (true) {
}
publish('devices', implode("\0",$echo));
sleep(1);
usleep(250000);
}
?>

View File

@@ -4,7 +4,7 @@ init=0
declare -a reads writes
# t = poll interval in seconds
t=3
t=2
while :; do
stats=($(awk '/(sd[a-z]*|nvme[0-9]n1|vd[a-z]) /{print $3,$6,$10,$4,$8}' /proc/diskstats))
c=0; s=${#stats[@]}

View File

@@ -182,7 +182,7 @@ function device_smart(&$disk, &$fail, &$smart) {
$color = 'green';
$file = "state/smart/$name";
if (file_exists("$file") && exec("grep -Pom1 '^SMART.*: \K[A-Z]+' ".escapeshellarg($file)." |tr -d '\n' 2>/dev/null", $ssa) && in_array("$ssa",$failed)) {
$title = "S.M.A.R.T health-check failed\n"; $thumb = 'thumbs-o-down'; $color = 'red'; $text = 'fail'; $fail++;
$title = _('SMART health-check failed')."\n"; $thumb = 'thumbs-o-down'; $color = 'red'; $text = 'fail'; $fail++;
} else {
if (empty($saved["smart"]["$name.ack"])) {
exec("awk 'NR>7{print $1,$2,$4,$6,$9,$10}' ".escapeshellarg($file)." 2>/dev/null", $codes);
@@ -197,7 +197,7 @@ function device_smart(&$disk, &$fail, &$smart) {
}
}
$title .= _('Click for context menu');
return "<span id='smart-$name' name=Device class='fa fa-$thumb $color-text' style='margin-right:8px' onmouseover='this.style.cursor=\"pointer\"' title='$title'></span>$text";
return "<span id='smart-$name' name=Device class='fa fa-$thumb $color-text' style='margin-right:8px' onmouseover='this.style.cursor=\"pointer\"' title='$title'></span><span id='text-$name'>$text</span>";
}
function device_usage(&$disk, &$full, &$high) {
global $display;

View File

@@ -84,6 +84,6 @@ while (true) {
$stat = implode("\0",$stat);
publish('update3',"$echo\1$mode\1$rxtx\1$stat");
sleep(3);
sleep(2);
$time = microtime(true);
}