2023-08-02 16:56:07 +03:00
|
|
|
{extends "@layout.xml"}
|
|
|
|
|
|
|
|
{block title}
|
|
|
|
Логи
|
|
|
|
{/block}
|
|
|
|
|
|
|
|
{block heading}
|
|
|
|
Логи
|
|
|
|
{/block}
|
|
|
|
|
|
|
|
{block content}
|
|
|
|
{var $amount = sizeof($logs)}
|
|
|
|
|
|
|
|
<style>
|
|
|
|
del, ins { text-decoration: none; color: #000; }
|
|
|
|
del { background: #fdd; }
|
|
|
|
ins { background: #dfd; }
|
|
|
|
</style>
|
|
|
|
<form class="aui">
|
|
|
|
<div>
|
|
|
|
<select class="select medium-field" type="number" id="type" name="type" placeholder="Тип изменения">
|
|
|
|
<option value="any" n:attr="selected => !$type">Любое</option>
|
|
|
|
<option value="0" n:attr="selected => $type === 0">Создание</option>
|
|
|
|
<option value="1" n:attr="selected => $type === 1">Редактирование</option>
|
|
|
|
<option value="2" n:attr="selected => $type === 2">Удаление</option>
|
|
|
|
<option value="3" n:attr="selected => $type === 3">Восстановление</option>
|
|
|
|
</select>
|
|
|
|
<input class="text medium-field" type="number" id="id" name="id" placeholder="ID записи" n:attr="value => $id"/>
|
2023-08-09 23:17:14 +03:00
|
|
|
<input class="text medium-field" type="text" id="uid" name="uid" placeholder="UUID пользователя" n:attr="value => $user"/>
|
2023-08-02 16:56:07 +03:00
|
|
|
</div>
|
|
|
|
<div style="margin: 8px 0;" />
|
|
|
|
<div>
|
|
|
|
<select class="select medium-field" id="obj_type" name="obj_type" placeholder="Тип объекта">
|
|
|
|
<option value="any" n:attr="selected => !$obj_type">Любой</option>
|
|
|
|
<option n:foreach="$object_types as $type" n:attr="selected => $obj_type === $type">{$type}</option>
|
|
|
|
</select>
|
|
|
|
<input class="text medium-field" type="number" id="obj_id" name="obj_id" placeholder="ID объекта" n:attr="value => $obj_id"/>
|
|
|
|
<input type="submit" class="aui-button aui-button-primary medium-field" value="Поиск" style="width: 165px;"/>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<table class="aui aui-table-list">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>ID</th>
|
|
|
|
<th>Пользователь</th>
|
|
|
|
<th>Объект</th>
|
|
|
|
<th>Тип</th>
|
|
|
|
<th>Изменения</th>
|
|
|
|
<th>Время</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr n:foreach="$logs as $log">
|
|
|
|
<td>{$log->getId()}</td>
|
|
|
|
<td>
|
2023-08-09 23:17:14 +03:00
|
|
|
<a href="/admin/chandler/user/{$log->getUser()}" target="_blank">{$log->getUser()}</a>
|
2023-08-02 16:56:07 +03:00
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<span n:if="$log->getObjectAvatar()" class="aui-avatar aui-avatar-xsmall">
|
|
|
|
<span class="aui-avatar-inner">
|
|
|
|
<img src="{$log->getObjectAvatar()}" alt="{$log->getObjectName()}" style="object-fit: cover;" role="presentation" />
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<a href="{$log->getObjectURL()}">{$log->getObjectName()}</a>
|
|
|
|
</td>
|
|
|
|
<td>{$log->getTypeNom()}</td>
|
|
|
|
<td>
|
|
|
|
{foreach $log->getChanges() as $change}
|
|
|
|
<div>
|
|
|
|
<b>{$change["field"]}</b>:
|
|
|
|
{if array_key_exists('diff', $change)}
|
|
|
|
{$change["diff"]|noescape}
|
|
|
|
{else}
|
|
|
|
<ins>{$change["old_value"]}</ins>
|
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
{/foreach}
|
|
|
|
</td>
|
|
|
|
<td>
|
2023-08-10 00:04:57 +03:00
|
|
|
{=new openvk\Web\Util\DateTime($change["ts"])}
|
2023-08-02 16:56:07 +03:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<br/>
|
|
|
|
<div align="right">
|
|
|
|
{var $isLast = ((20 * (($_GET['p'] ?? 1) - 1)) + $amount) < $count}
|
|
|
|
|
|
|
|
<a n:if="($_GET['p'] ?? 1) > 1" class="aui-button" href="?p={($_GET['p'] ?? 1) - 1}">«</a>
|
|
|
|
<a n:if="$isLast" class="aui-button" href="?p={($_GET['p'] ?? 1) + 1}">»</a>
|
|
|
|
</div>
|
|
|
|
{/block}
|