diff options
-rw-r--r-- | apis/event.inc.php | 20 | ||||
-rw-r--r-- | modules/eventlog.inc.php | 15 | ||||
-rw-r--r-- | style/default.css | 12 | ||||
-rw-r--r-- | templates/eventlog/_page.html | 2 | ||||
-rw-r--r-- | templates/main-menu.html | 4 |
5 files changed, 48 insertions, 5 deletions
diff --git a/apis/event.inc.php b/apis/event.inc.php new file mode 100644 index 00000000..443c6935 --- /dev/null +++ b/apis/event.inc.php @@ -0,0 +1,20 @@ +<?php + +if (!isLocalExecution()) + die('Nope'); + +if ($argc < 3) + die("Not enough parameters"); + +switch ($argc[1]) { +case 'info': + EventLog::info($argc[2]); + break; +case 'warning': + EventLog::warning($argc[2]); + break; +case 'failure': + EventLog::failure($argc[2]); + break; +} + diff --git a/modules/eventlog.inc.php b/modules/eventlog.inc.php index 1a63a0a6..0105928b 100644 --- a/modules/eventlog.inc.php +++ b/modules/eventlog.inc.php @@ -30,6 +30,7 @@ class Page_EventLog extends Page } $row['date'] = $day . date(' H:i', $row['dateline']); $row['icon'] = $this->typeToIcon($row['logtypeid']); + $row['color'] = $this->typeToColor($row['logtypeid']); $lines[] = $row; } @@ -52,4 +53,18 @@ class Page_EventLog extends Page } } + private function typeToColor($type) + { + switch ($type) { + case 'info': + return 'green'; + case 'warning': + return 'orange'; + case 'error': + return 'red'; + default: + return ''; + } + } + } diff --git a/style/default.css b/style/default.css index acbddcd6..1359c4ba 100644 --- a/style/default.css +++ b/style/default.css @@ -87,7 +87,15 @@ body { } .red { - color: red; + color: #c00; +} + +.orange { + color: #c70; +} + +.green { + color: #0c0; } .slx-label { @@ -139,6 +147,6 @@ body { to { transform: scale( 1 ) rotate( 360deg ); } } -.slx-text-red { +.slx-warning-badge { color: #ff0; } diff --git a/templates/eventlog/_page.html b/templates/eventlog/_page.html index 910b2dd5..b28fe2f0 100644 --- a/templates/eventlog/_page.html +++ b/templates/eventlog/_page.html @@ -13,7 +13,7 @@ <tr> <td><span class="glyphicon glyphicon-{{icon}}" title="{{logtypeid}}"></span></td> <td class="text-right" nowrap="nowrap">{{date}}</td> - <td>{{description}}</td> + <td class="{{color}}">{{description}}</td> <td>{{#extra}} <a class="btn btn-default btn-xs pull-left" onclick="$('#details-body').html($('#extra-{{logid}}').html())" data-toggle="modal" data-target="#myModal">»</a> <div class="hidden" id="extra-{{logid}}">{{extra}}</div> diff --git a/templates/main-menu.html b/templates/main-menu.html index 401c4dc2..da00335c 100644 --- a/templates/main-menu.html +++ b/templates/main-menu.html @@ -44,10 +44,10 @@ </ul> </li> {{#dbupdate}} - <li><a href="api.php?do=update"><span class="slx-text-red badge"><span class="glyphicon glyphicon-exclamation-sign"></span> DB-Update</span></a></li> + <li><a href="api.php?do=update"><span class="slx-warning-badge badge"><span class="glyphicon glyphicon-exclamation-sign"></span> DB-Update</span></a></li> {{/dbupdate}} {{#warning}} - <li><a href="?do=EventLog"><span class="slx-text-red badge"><span class="glyphicon glyphicon-exclamation-sign"></span> {{lang_warning}}</span></a></li> + <li><a href="?do=EventLog"><span class="slx-warning-badge badge"><span class="glyphicon glyphicon-exclamation-sign"></span> {{lang_warning}}</span></a></li> {{/warning}} </ul> <ul class="nav navbar-nav navbar-right"> |