91 lines
3.0 KiB
Twig
91 lines
3.0 KiB
Twig
{% extends 'admin/base.html.twig' %}
|
|
|
|
{% block title %}Admin Dashboard{% endblock %}
|
|
|
|
{% block body %}
|
|
<h1 class="h4 mb-3">Dashboard</h1>
|
|
|
|
{# ============================= #}
|
|
{# USER + RESET CARD #}
|
|
{# ============================= #}
|
|
<div class="card bg-black text-info border-secondary mb-4">
|
|
<div class="card-body">
|
|
<div class="mb-2">
|
|
<strong>User:</strong> {{ app.user.userIdentifier }}
|
|
</div>
|
|
<div class="mb-2">
|
|
<strong>Rollen:</strong> {{ app.user.roles|join(', ') }}
|
|
</div>
|
|
|
|
<hr class="border-secondary">
|
|
|
|
<div class="text-light">
|
|
<p class="fw-bold">Reset des Systems</p>
|
|
<p>Unwiderruflicher Reset des gesamten Systems</p>
|
|
|
|
{% for label, messages in app.flashes %}
|
|
{% for message in messages %}
|
|
<div class="alert alert-{{ label }} fade show" role="alert">
|
|
{{ message }}
|
|
</div>
|
|
{% endfor %}
|
|
{% endfor %}
|
|
|
|
<form method="post" action="/admin/documents/reset" onsubmit="return resetSystem()">
|
|
<button type="submit" class="btn btn-outline-danger">
|
|
Reset System
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{# ============================= #}
|
|
{# KNOWLEDGE INDEX STATUS CARD #}
|
|
{# ============================= #}
|
|
{% set percent = chunkLimit > 0 ? (chunkCount / chunkLimit * 100)|round(1) : 0 %}
|
|
|
|
<div class="card bg-black text-light border-secondary">
|
|
<div class="card-body">
|
|
|
|
<h5 class="text-info mb-3">Knowledge Index</h5>
|
|
|
|
<div class="mb-2">
|
|
<strong>Chunks:</strong>
|
|
{{ chunkCount|number_format(0, ',', '.') }}
|
|
/
|
|
{{ chunkLimit|number_format(0, ',', '.') }}
|
|
</div>
|
|
|
|
<div class="progress bg-dark" style="height: 18px;">
|
|
<div
|
|
class="progress-bar
|
|
{% if chunkCount > 115000 %}
|
|
bg-danger
|
|
{% elseif chunkCount > 100000 %}
|
|
bg-warning text-dark
|
|
{% else %}
|
|
bg-success
|
|
{% endif %}
|
|
"
|
|
role="progressbar"
|
|
style="width: {{ percent }}%;"
|
|
>
|
|
{{ percent }}%
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-2 small text-light">
|
|
System ist für maximal 120.000 Chunks optimiert.
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function resetSystem() {
|
|
return confirm('Sind Sie sicher, dass Sie das gesamte System zurücksetzen möchten?');
|
|
}
|
|
</script>
|
|
{% endblock %}
|