summaryrefslogtreecommitdiffstats
path: root/modules-available/syslog
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-01 23:07:06 +0100
committerSimon Rettberg2017-12-01 23:07:06 +0100
commitcfd181a3ee8025ac39886a8ba422fefd8545fb2c (patch)
tree5429814a5afddca3fdfd6c85884ae801199d62f8 /modules-available/syslog
parent[inc/Util] Add helper to pretty-print timestamp (diff)
downloadslx-admin-cfd181a3ee8025ac39886a8ba422fefd8545fb2c.tar.gz
slx-admin-cfd181a3ee8025ac39886a8ba422fefd8545fb2c.tar.xz
slx-admin-cfd181a3ee8025ac39886a8ba422fefd8545fb2c.zip
[syslog, statistics] Pretty print time, shorten CPU model in list
Diffstat (limited to 'modules-available/syslog')
-rw-r--r--modules-available/syslog/page.inc.php10
1 files changed, 1 insertions, 9 deletions
diff --git a/modules-available/syslog/page.inc.php b/modules-available/syslog/page.inc.php
index 927a3adf..c679877a 100644
--- a/modules-available/syslog/page.inc.php
+++ b/modules-available/syslog/page.inc.php
@@ -57,19 +57,11 @@ class Page_SysLog extends Page
$whereClause .= "machineuuid='" . preg_replace('/[^0-9a-zA-Z\-]/', '', Request::get('machineuuid', '', 'string')) . "'";
}
- $today = date('d.m.Y');
- $yesterday = date('d.m.Y', time() - 86400);
$lines = array();
$paginate = new Paginate("SELECT logid, dateline, logtypeid, clientip, description, extra FROM clientlog $whereClause ORDER BY logid DESC", 50);
$res = $paginate->exec();
while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
- $day = date('d.m.Y', $row['dateline']);
- if ($day === $today) {
- $day = Dictionary::translate('lang_today');
- } elseif ($day === $yesterday) {
- $day = Dictionary::translate('lang_yesterday');
- }
- $row['date'] = $day . date(' H:i', $row['dateline']);
+ $row['date'] = Util::prettyTime($row['dateline']);
$row['icon'] = $this->eventToIconName($row['logtypeid']);
$lines[] = $row;
}