mirror of
https://github.com/unraid/webgui.git
synced 2026-05-05 11:50:41 -05:00
Add last parity log to Dashboard (align with Main page)
This commit is contained in:
@@ -176,6 +176,13 @@ function read_parity_log($epoch, $busy=false) {
|
||||
}
|
||||
return $line ?: $last ?: '0|0|0|0|0';
|
||||
}
|
||||
function last_parity_log() {
|
||||
$log = '/boot/config/parity-checks.log';
|
||||
if (!file_exists($log)) return [0,0,0,0,0];
|
||||
list($date,$duration,$speed,$status,$error) = explode('|',exec("tail -1 $log"));
|
||||
list($y,$m,$d,$t) = preg_split('/ +/',$date);
|
||||
return [strtotime("$d-$m-$y $t"), $duration, $speed, $status, $error];
|
||||
}
|
||||
function urlencode_path($path) {
|
||||
return str_replace("%2F", "/", urlencode($path));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user