mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-02-01 10:01:07 -05:00
The log functionality is similar to that of the classic skin, though with fewer options. Initial filtering support is for only component type. Also displays a fixed last 100 log events, sorted by TimeKey ascending.
31 lines
650 B
PHP
31 lines
650 B
PHP
<?php
|
|
class LogsController extends AppController {
|
|
public function index() {
|
|
$conditions = array();
|
|
$named = $this->extractNamedParams(
|
|
array('Component')
|
|
);
|
|
|
|
if ($named) {
|
|
foreach ($named as $key => $value) {
|
|
switch ($key) {
|
|
case "Component":
|
|
$Component = array($key => $value);
|
|
array_push($conditions, $Component);
|
|
break;
|
|
}
|
|
}
|
|
};
|
|
|
|
$this->set('loglines', $this->Log->find('all', array(
|
|
'limit' => 100,
|
|
'order' => array('TimeKey' => 'asc'),
|
|
'conditions' => $conditions
|
|
)));
|
|
$this->set('components', $this->Log->find('all', array(
|
|
'fields' => array('DISTINCT Component')
|
|
)));
|
|
}
|
|
}
|
|
?>
|