Adding backend/LogController::index()
This commit is contained in:
parent
778c7127b3
commit
5fb9880a1b
3 changed files with 58 additions and 0 deletions
|
|
@ -64,3 +64,6 @@ router:
|
|||
backend-user-list:
|
||||
pattern: '/admin/user/list/{page:([0-9]+)}'
|
||||
path: backend::user::index
|
||||
backend-log:
|
||||
pattern: '/admin/log{page:/?([0-9]+)?}'
|
||||
path: backend::log::index
|
||||
|
|
|
|||
21
app/controllers/backend/LogController.php
Normal file
21
app/controllers/backend/LogController.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller\Backend;
|
||||
|
||||
use App\Model\Data\ActivityLog;
|
||||
|
||||
class LogController extends \Phalcon\Mvc\Controller
|
||||
{
|
||||
public function onConstruct()
|
||||
{
|
||||
$this->view->setLayout('side-menu');
|
||||
}
|
||||
|
||||
public function indexAction($page = 1)
|
||||
{
|
||||
$paginator = ActivityLog::getAllPaginationList($page);
|
||||
|
||||
$this->view->page = $paginator->getPaginate();
|
||||
$this->view->pagination_url = '/admin/log/';
|
||||
}
|
||||
}
|
||||
34
app/views/backend/log/index.volt
Normal file
34
app/views/backend/log/index.volt
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
|
||||
<h1>Activity Log</h1>
|
||||
|
||||
<table class="table table-condensed table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Ip</th>
|
||||
<th>User</th>
|
||||
<th>Message</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for item in page.items %}
|
||||
<tr>
|
||||
<td>{{ item.getTimestamp() }}</td>
|
||||
<td>{{ item.getIp() }}</td>
|
||||
<td>
|
||||
{% if item.getUser() %}
|
||||
{{ item.getUser().getId() }}:{{ item.getUser().getUsername() }}
|
||||
{% else %}
|
||||
-
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ item.getMessage() }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<nav class="text-center" aria-label="Page navigation">
|
||||
{{ partial('pagination') }}
|
||||
</nav>
|
||||
Reference in a new issue