208 lines
7.4 KiB
Twig
208 lines
7.4 KiB
Twig
{% extends 'admin/base.html.twig' %}
|
|
|
|
{% block title %}System Dashboard{% endblock %}
|
|
|
|
{% block body %}
|
|
|
|
<div class="container-fluid">
|
|
|
|
{# ===================================================== #}
|
|
{# HEADER #}
|
|
{# ===================================================== #}
|
|
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h1 class="h3 mb-0">System Overview</h1>
|
|
<span class="badge bg-secondary">RAG Enterprise</span>
|
|
</div>
|
|
|
|
{# ===================================================== #}
|
|
{# GOVERNANCE BLOCK #}
|
|
{# ===================================================== #}
|
|
|
|
<div class="card bg-black border-secondary text-light mb-4">
|
|
<div class="card-body">
|
|
|
|
<h5 class="text-info mb-3">System Governance</h5>
|
|
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<strong>Current User:</strong><br>
|
|
{{ app.user.userIdentifier }}
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
<strong>Roles:</strong><br>
|
|
{{ app.user.roles|join(', ') }}
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
{# ===================================================== #}
|
|
{# VECTOR INFRASTRUCTURE #}
|
|
{# ===================================================== #}
|
|
|
|
{% if vectorHealth is defined %}
|
|
|
|
{% set status = vectorHealth.status %}
|
|
|
|
{% set badgeClass =
|
|
status starts with 'OK'
|
|
? 'bg-success'
|
|
: (status == 'INCONSISTENT_MISSING_VECTOR'
|
|
? 'bg-warning text-dark'
|
|
: 'bg-danger')
|
|
%}
|
|
|
|
<div class="card bg-black border-secondary text-light mb-4">
|
|
<div class="card-body">
|
|
|
|
<h5 class="text-info mb-3">Vector Infrastructure</h5>
|
|
|
|
<div class="row mb-3">
|
|
|
|
<div class="col-md-4">
|
|
<strong>Status</strong><br>
|
|
<span class="badge {{ badgeClass }}">
|
|
{{ status }}
|
|
</span>
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
|
<strong>NDJSON Chunks</strong><br>
|
|
{{ vectorHealth.ndjson_chunk_count|number_format(0, ',', '.') }}
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
|
<strong>Vector Index Chunks</strong><br>
|
|
{{ vectorHealth.vector_chunk_count|number_format(0, ',', '.') }}
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% if status starts with 'OK' %}
|
|
<div class="small text-success">
|
|
Infrastructure is consistent.
|
|
</div>
|
|
{% elseif status == 'INCONSISTENT_MISSING_VECTOR' %}
|
|
<div class="small text-warning">
|
|
Vector index missing. Rebuild recommended.
|
|
</div>
|
|
{% else %}
|
|
<div class="small text-danger">
|
|
Index inconsistency detected. Immediate review required.
|
|
</div>
|
|
{% endif %}
|
|
|
|
</div>
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
{# ===================================================== #}
|
|
{# KNOWLEDGE CAPACITY #}
|
|
{# ===================================================== #}
|
|
|
|
{% set percent = chunkLimit > 0 ? (chunkCount / chunkLimit * 100)|round(1) : 0 %}
|
|
|
|
<div class="card bg-black border-secondary text-light mb-4">
|
|
<div class="card-body">
|
|
|
|
<h5 class="text-info mb-3">Knowledge Capacity</h5>
|
|
|
|
<div class="mb-2">
|
|
<strong>Chunks:</strong>
|
|
{{ chunkCount|number_format(0, ',', '.') }}
|
|
/
|
|
{{ chunkLimit|number_format(0, ',', '.') }}
|
|
</div>
|
|
|
|
<div class="progress bg-dark" style="height: 20px;">
|
|
<div
|
|
class="progress-bar
|
|
{% if percent >= 95 %}
|
|
bg-danger
|
|
{% elseif percent >= 85 %}
|
|
bg-warning text-dark
|
|
{% else %}
|
|
bg-success
|
|
{% endif %}"
|
|
role="progressbar"
|
|
style="width: {{ percent }}%;"
|
|
aria-valuenow="{{ percent }}"
|
|
aria-valuemin="0"
|
|
aria-valuemax="100"
|
|
>
|
|
{{ percent }}%
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-3 small text-secondary">
|
|
System optimized for maximum
|
|
{{ chunkLimit|number_format(0, ',', '.') }} chunks.
|
|
{% if percent >= 95 %}
|
|
<br><strong class="text-danger">Capacity limit nearly reached.</strong>
|
|
{% endif %}
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
{# ===================================================== #}
|
|
{# CRITICAL OPERATIONS (SUPER ADMIN ONLY) #}
|
|
{# ===================================================== #}
|
|
|
|
{% if is_granted('ROLE_SUPER_ADMIN') %}
|
|
|
|
<div class="card bg-black border-danger text-light">
|
|
<div class="card-body">
|
|
|
|
<h5 class="text-danger mb-3">Critical Operations</h5>
|
|
|
|
<div class="small mb-3">
|
|
Full system reset removes:
|
|
<ul>
|
|
<li>All documents & versions</li>
|
|
<li>NDJSON index</li>
|
|
<li>FAISS vector index</li>
|
|
<li>All ingest jobs</li>
|
|
</ul>
|
|
<strong>This action is irreversible.</strong>
|
|
</div>
|
|
|
|
{% for label, messages in app.flashes %}
|
|
{% for message in messages %}
|
|
<div class="alert alert-{{ label }}">
|
|
{{ message }}
|
|
</div>
|
|
{% endfor %}
|
|
{% endfor %}
|
|
|
|
<form method="post"
|
|
action="{{ path('admin_document_reset') }}"
|
|
onsubmit="return confirm('Confirm full system reset? This cannot be undone.');">
|
|
|
|
<input type="hidden"
|
|
name="_token"
|
|
value="{{ csrf_token('system_reset') }}">
|
|
|
|
<button type="submit"
|
|
class="btn btn-outline-danger">
|
|
Execute Full System Reset
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|