mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-31 00:04:40 +02:00
Added better formatted extra section for certain log types
This commit is contained in:
parent
4107535b19
commit
69fc28d5d6
10 changed files with 1388 additions and 1304 deletions
|
@ -0,0 +1,23 @@
|
|||
{# @var entry \App\Entity\LogSystem\DatabaseUpdatedLogEntry #}
|
||||
|
||||
{% if entry.successful %}
|
||||
<h5><span class="badge bg-success badge-success">
|
||||
<i class="fa-solid fa-check"></i>
|
||||
{% trans %}log.database_updated.success{% endtrans %}
|
||||
</span></h5>
|
||||
{% else %}
|
||||
<h5><span class="badge bg-danger badge-danger">
|
||||
<i class="fa-solid fa-xmark"></i>
|
||||
{% trans %}log.database_updated.failed{% endtrans %}</span>
|
||||
</h5>
|
||||
{% endif %}
|
||||
|
||||
<span class="badge bg-secondary badge-secondary badge-pill" title="{% trans %}log.database_updated.old_version{% endtrans %}">
|
||||
<i class="fa-solid fa-database"></i>
|
||||
{{ entry.oldVersion }}
|
||||
</span>
|
||||
<i class="fa-solid fa-arrow-right-long"></i>
|
||||
<span class="badge bg-primary badge-primary badge-pill" title="{% trans %}log.database_updated.new_version{% endtrans %}">
|
||||
<i class="fa-solid fa-database"></i>
|
||||
{{ entry.newVersion }}
|
||||
</span>
|
|
@ -0,0 +1,9 @@
|
|||
{# @var entry \App\Entity\LogSystem\UserLoginLogEntry #}
|
||||
|
||||
IP:
|
||||
<span class="badge bg-primary badge-primary">
|
||||
<i class="fa-solid fa-network-wired"></i>
|
||||
{{ entry.iPAddress }}
|
||||
</span>
|
||||
|
||||
<p class="text-muted">{% trans %}log.user_login.ip_anonymize_hint{% endtrans %}</p>
|
9
templates/log_system/details/_extra_user_login.html.twig
Normal file
9
templates/log_system/details/_extra_user_login.html.twig
Normal file
|
@ -0,0 +1,9 @@
|
|||
{# @var entry \App\Entity\LogSystem\UserLoginLogEntry #}
|
||||
|
||||
{% trans %}log.user_login.login_from_ip{% endtrans %}:
|
||||
<span class="badge bg-primary badge-primary">
|
||||
<i class="fa-solid fa-network-wired"></i>
|
||||
{{ entry.iPAddress }}
|
||||
</span>
|
||||
|
||||
<p class="text-muted">{% trans %}log.user_login.ip_anonymize_hint{% endtrans %}</p>
|
|
@ -0,0 +1,4 @@
|
|||
{# @var entry \App\Entity\LogSystem\UserNotAllowedLogEntry #}
|
||||
|
||||
{% trans %}log.user_not_allowed.unauthorized_access_attempt_to{% endtrans %}: <code>{{ entry.path }}</code>
|
||||
<p class="text-muted">{% trans %}log.user_not_allowed.hint{% endtrans %}</p>
|
|
@ -58,6 +58,19 @@
|
|||
</table>
|
||||
|
||||
<div class="card-body">
|
||||
{{ extra_html | raw }}
|
||||
{# This assignment is to improve autocomplete on the subpages, as PHPstorm ignores typehints for log_entry #}
|
||||
{% set entry = log_entry %}
|
||||
{% if log_entry is instanceof('App\\Entity\\LogSystem\\DatabaseUpdatedLogEntry') %}
|
||||
{% include "log_system/details/_extra_database_updated.html.twig" %}
|
||||
{% elseif log_entry is instanceof('App\\Entity\\LogSystem\\UserLoginLogEntry')
|
||||
or log_entry is instanceof('App\\Entity\\LogSystem\\UserLogoutLogEntry') %}
|
||||
{% include "log_system/details/_extra_user_login.html.twig" %}
|
||||
{% elseif log_entry is instanceof('App\\Entity\\LogSystem\\UserNotAllowedLogEntry') %}
|
||||
{% include "log_system/details/_extra_user_not_allowed.html.twig" %}
|
||||
{% elseif log_entry is instanceof('App\\Entity\\LogSystem\\SecurityEventLogEntry') %}
|
||||
{% include "log_system/details/_extra_security_event.html.twig" %}
|
||||
{% else %}
|
||||
{{ extra_html | raw }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue