pull/3122/head
Isaac Connor 2017-10-23 11:50:45 -07:00
parent f99e404730
commit df8fbaccea
3 changed files with 4 additions and 3 deletions

View File

@ -381,7 +381,7 @@ class Event {
public function save( ) {
$sql = 'UPDATE Events SET '.implode(' AND', array_map( function($field) {return $field.'=?';}, $fields ) ) . ' WHERE Id=?';
$values = array_map( function($field){return $this->{$field}}, $fields );
$values = array_map( function($field){return $this->{$field};}, $fields );
$values[] = $this->{'Id'};
dbQuery( $sql, NULL, $values );
}

View File

@ -113,7 +113,7 @@ class Storage {
if ( ! array_key_exists( 'disk_used_space', $this ) ) {
$used = 0;
if ( $this->{'Type'} == 's3fs' ) {
$used = dbFetchOne('SELECT SUM(DiskSpace) FROM EVents WHERE StorageId=? AND DiskSpace IS NOT NULL', 'DiskSpace', array($this-Id()) );
$used = dbFetchOne('SELECT SUM(DiskSpace) AS DiskSpace FROM Events WHERE StorageId=? AND DiskSpace IS NOT NULL', 'DiskSpace', array($this->Id()) );
foreach ( Event::find_all( array( 'StorageId'=>$this->Id(), 'DiskSpace'=>null ) ) as $Event ) {
$Event->Storage( $this ); // Prevent further db hit

View File

@ -140,13 +140,14 @@ function loadImage2Monitor( monId, url ) {
if ( url == 'no data' ) {
writeText(monId, 'No Data');
} else {
writeText(monId, 'Loading...');
//writeText(monId, 'Loading...');
monitorLoading[monId] = true;
monitorLoadStartTimems[monId] = new Date().getTime();
monitorImageObject[monId].src = url; // starts a load but doesn't refresh yet, wait until ready
}
}
}
function timerFire() {
// See if we need to reschedule
if ( currentDisplayInterval != timerInterval || currentSpeed == 0 ) {