put back disk space in header, more debug in caching storagea

This commit is contained in:
Isaac Connor 2017-10-10 14:06:21 -04:00
parent 9cbcc43e3d
commit ffc1ac43f5
2 changed files with 3 additions and 1 deletions

View File

@ -9,6 +9,7 @@ class Storage {
if ( is_integer( $IdOrRow ) or is_numeric( $IdOrRow ) ) {
if ( isset( $storage_cache[$IdOrRow] ) ) {
Logger::Debug("Using cached Storage object for $IdOrRow");
return $storage_cache[$IdOrRow];
} else {
$row = dbFetchOne( 'SELECT * FROM Storage WHERE Id=?', NULL, array( $IdOrRow ) );
@ -68,6 +69,7 @@ class Storage {
$results = $result->fetchALL(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, 'Storage' );
foreach ( $results as $row => $obj ) {
$storage_areas[] = $obj;
$storage_cache[$obj->Id()] = $obj;
}
return $storage_areas;
}

View File

@ -257,7 +257,7 @@ ZoneMinder requires Javascript. Please enable Javascript in your browser for thi
array_push( $storage_areas, new Storage() );
}
$func = function($S){ return '<span title="'.human_filesize($S->disk_used_space()) . ' of ' . human_filesize($S->disk_total_space()).'">'.$S->Name() . ': ' . $S->disk_usage_percent().'%' . '</span>'; };
$func = function($S){ return '<span title="">'.$S->Name() . ': ' . $S->disk_usage_percent().'%' . '</span>'; };
#$func = function($S){ return '<span title="">'.$S->Name() . ': ' . $S->disk_usage_percent().'%' . '</span>'; };
echo implode( ', ', array_map ( $func, $storage_areas ) );
echo ' ' . ZM_PATH_MAP .': '. getDiskPercent(ZM_PATH_MAP).'%';
?></li>