add objectId on watchdog
This commit is contained in:
@@ -679,6 +679,7 @@ class AdminController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/watchdog', name: 'watchdog')]
|
#[Route('/watchdog', name: 'watchdog')]
|
||||||
|
#[Route('/watchdog/view/{id}', name: 'watchdog_view')]
|
||||||
#[Route('/watchdog/{type}', name: 'watchdog_type')]
|
#[Route('/watchdog/{type}', name: 'watchdog_type')]
|
||||||
#[Route('/watchdog/{type}/{action}', name: 'watchdog_type_action')]
|
#[Route('/watchdog/{type}/{action}', name: 'watchdog_type_action')]
|
||||||
public function watchdog(
|
public function watchdog(
|
||||||
@@ -686,7 +687,8 @@ class AdminController extends AbstractController
|
|||||||
Request $Request,
|
Request $Request,
|
||||||
EntityManagerInterface $EntityManagerInterface,
|
EntityManagerInterface $EntityManagerInterface,
|
||||||
string $type = null,
|
string $type = null,
|
||||||
string $action = null
|
string $action = null,
|
||||||
|
int $id = null
|
||||||
): Response {
|
): Response {
|
||||||
/**
|
/**
|
||||||
* @var LogEntryRepository $logEntryRepository
|
* @var LogEntryRepository $logEntryRepository
|
||||||
@@ -704,6 +706,9 @@ class AdminController extends AbstractController
|
|||||||
->from('Gedmo\Loggable\Entity\LogEntry', 'l')
|
->from('Gedmo\Loggable\Entity\LogEntry', 'l')
|
||||||
->orderBy('l.loggedAt', 'DESC');
|
->orderBy('l.loggedAt', 'DESC');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (null != $type) {
|
if (null != $type) {
|
||||||
$qb->where('l.objectClass = :type');
|
$qb->where('l.objectClass = :type');
|
||||||
$qb->setParameter('type', 'App\Entity\\' . $type);
|
$qb->setParameter('type', 'App\Entity\\' . $type);
|
||||||
@@ -718,6 +723,11 @@ class AdminController extends AbstractController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(null != $id){
|
||||||
|
$qb->where('l.objectId = :id');
|
||||||
|
$qb->setParameter('id', $id);
|
||||||
|
}
|
||||||
|
|
||||||
$pagination = $paginator->paginate(
|
$pagination = $paginator->paginate(
|
||||||
$qb->getQuery()->getResult(),
|
$qb->getQuery()->getResult(),
|
||||||
$Request->query->getInt('page', 1)
|
$Request->query->getInt('page', 1)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
{% if notype is not defined %}
|
{% if notype is not defined %}
|
||||||
<p>{{ i.objectClass }} (# {{ i.objectId }})</p>
|
<p>{{ i.objectClass }} (# {{ i.objectId }}) {% if is_granted('ROLE_ADMIN') %}<a href="{{ path('admin_watchdog_view', {'id': i.objectId}) }}" class="btn btn-warning btn-sm" data-bs-toggle="tooltip" data-placement="top" title="{% trans %}tooltip_directory_history{% endtrans %} (Admin)"><i class="fas fa-clock"></i></a>{% endif %}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p>{{ ('title_data_' ~ i.action)|trans }}</p>
|
<p>{{ ('title_data_' ~ i.action)|trans }}</p>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"version": "0.2.8"
|
"version": "0.2.9"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user