summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2014-12-05 16:26:19 +0100
committerSimon Rettberg2014-12-05 16:26:19 +0100
commit03480d86be75b942b64b31178a579e6deed8a822 (patch)
treebace4f51607c48923f42afbc4df0c776d41ef12a
parentTweaks and fixes (diff)
downloadslx-admin-03480d86be75b942b64b31178a579e6deed8a822.tar.gz
slx-admin-03480d86be75b942b64b31178a579e6deed8a822.tar.xz
slx-admin-03480d86be75b942b64b31178a579e6deed8a822.zip
Use different icons for client log entries (incomplete)
-rw-r--r--modules/syslog.inc.php18
-rw-r--r--templates/page-syslog.html2
2 files changed, 19 insertions, 1 deletions
diff --git a/modules/syslog.inc.php b/modules/syslog.inc.php
index facc1557..7bd0c197 100644
--- a/modules/syslog.inc.php
+++ b/modules/syslog.inc.php
@@ -56,6 +56,7 @@ class Page_SysLog extends Page
$day = Dictionary::translate('yesterday');
}
$row['date'] = $day . date(' H:i', $row['dateline']);
+ $row['icon'] = $this->eventToIconName($row['logtypeid']);
$lines[] = $row;
}
@@ -65,5 +66,22 @@ class Page_SysLog extends Page
'list' => $lines
));
}
+
+ private function eventToIconName($event)
+ {
+ switch ($event) {
+ case 'session-open':
+ return 'glyphicon-log-in';
+ case 'session-close':
+ return 'glyphicon-log-out';
+ case 'partition-swap':
+ return 'glyphicon-info-sign';
+ case 'partition-temp':
+ case 'smartctl-realloc':
+ return 'glyphicon-exclamation-sign';
+ default:
+ return 'glyphicon-minus';
+ }
+ }
}
diff --git a/templates/page-syslog.html b/templates/page-syslog.html
index 7cedd7f3..98e94291 100644
--- a/templates/page-syslog.html
+++ b/templates/page-syslog.html
@@ -24,7 +24,7 @@
<tbody>
{{#list}}
<tr>
- <td><span class="glyphicon glyphicon-off" title="{{logtypeid}}" onclick="$('#filterstring').tagsinput('add', '{{logtypeid}}')"></span></td>
+ <td><span class="glyphicon {{icon}}" title="{{logtypeid}}" onclick="$('#filterstring').tagsinput('add', '{{logtypeid}}')"></span></td>
<td class="text-right" nowrap="nowrap">{{date}}</td>
<td>{{clientip}}</td>
<td>{{description}}</td>