From 760e20bc0f7504e5539b0c07963d74ea6dce12d9 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 24 Oct 2020 08:50:59 -0400 Subject: [PATCH] Populate Monitor name and use event class DiskSpace to get DiskSpace when it hasn't been populated in the db yet --- web/ajax/events.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/ajax/events.php b/web/ajax/events.php index e420e2460..d224b8742 100644 --- a/web/ajax/events.php +++ b/web/ajax/events.php @@ -212,14 +212,14 @@ function queryRequest($filter, $search, $advsearch, $sort, $offset, $order, $lim $row['Name'] = validHtmlStr($row['Name']); $row['Archived'] = $row['Archived'] ? translate('Yes') : translate('No'); $row['Emailed'] = $row['Emailed'] ? translate('Yes') : translate('No'); - //$row['Monitor'] = ( $row['MonitorId'] and isset($MonitorById[$row['MonitorId']]) ) ? $MonitorById[$row['MonitorId']]->Name() : ''; + $row['Monitor'] = ( $row['MonitorId'] and isset($MonitorById[$row['MonitorId']]) ) ? $MonitorById[$row['MonitorId']]->Name() : ''; $row['Cause'] = validHtmlStr($row['Cause']); $row['StartTime'] = strftime(STRF_FMT_DATETIME_SHORTER, strtotime($row['StartTime'])); $row['EndTime'] = strftime(STRF_FMT_DATETIME_SHORTER, strtotime($row['StartTime'])); $row['Length'] = gmdate('H:i:s', $row['Length'] ); $row['Storage'] = ( $row['StorageId'] and isset($StorageById[$row['StorageId']]) ) ? $StorageById[$row['StorageId']]->Name() : 'Default'; $row['Notes'] = htmlspecialchars($row['Notes']); - $row['DiskSpace'] = human_filesize($row['DiskSpace']); + $row['DiskSpace'] = human_filesize($event->DiskSpace()); $rows[] = $row; } $data['rows'] = $rows;