<!--
Copyright (C) 2026 Stefy Lanza <stefy@nexlab.net>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.
-->
{% extends "base.html" %}

{% block title %}Overview - AISBF Dashboard{% endblock %}

{% block content %}
<h2 style="margin-bottom: 30px;">Dashboard Overview</h2>

<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px;">
    <div style="background: #3498db; color: white; padding: 20px; border-radius: 8px;">
        <h3 style="font-size: 16px; margin-bottom: 10px;">Providers</h3>
        <p style="font-size: 32px; font-weight: bold;">{{ providers_count }}</p>
    </div>
    <div style="background: #2ecc71; color: white; padding: 20px; border-radius: 8px;">
        <h3 style="font-size: 16px; margin-bottom: 10px;">Rotations</h3>
        <p style="font-size: 32px; font-weight: bold;">{{ rotations_count }}</p>
    </div>
    <div style="background: #e74c3c; color: white; padding: 20px; border-radius: 8px;">
        <h3 style="font-size: 16px; margin-bottom: 10px;">Autoselect</h3>
        <p style="font-size: 32px; font-weight: bold;">{{ autoselect_count }}</p>
    </div>
</div>

<h3 style="margin-bottom: 15px;">Server Information</h3>
<table>
    <tr>
        <th>Setting</th>
        <th>Value</th>
    </tr>
    <tr>
        <td>Host</td>
        <td>{{ server_config.host }}</td>
    </tr>
    <tr>
        <td>Port</td>
        <td>{{ server_config.port }}</td>
    </tr>
    <tr>
        <td>Protocol</td>
        <td>{{ server_config.protocol }}</td>
    </tr>
    <tr>
        <td>Authentication</td>
        <td>{{ 'Enabled' if server_config.auth_enabled else 'Disabled' }}</td>
    </tr>
</table>

<h3 style="margin-top: 30px; margin-bottom: 15px;">Quick Actions</h3>
<div style="display: flex; gap: 10px; flex-wrap: wrap;">
    <a href="/dashboard/providers" class="btn">Manage Providers</a>
    <a href="/dashboard/rotations" class="btn">Manage Rotations</a>
    <a href="/dashboard/autoselect" class="btn">Manage Autoselect</a>
    <a href="/dashboard/prompts" class="btn">Manage Prompts</a>
    <a href="/dashboard/rate-limits" class="btn">Rate Limits</a>
    <a href="/dashboard/response-cache/stats" class="btn">Response Cache</a>
    <a href="/dashboard/settings" class="btn btn-secondary">Server Settings</a>
</div>
{% endblock %}
