Files
bookapp/templates/system_status.html
2026-02-06 11:05:46 -05:00

122 lines
5.0 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="row mb-4">
<div class="col-md-8">
<h2><i class="fas fa-server me-2"></i>System Status</h2>
<p class="text-muted">AI Model Health, Selection Reasoning, and Availability.</p>
</div>
<div class="col-md-4 text-end">
<a href="{{ url_for('index') }}" class="btn btn-outline-secondary me-2">Back to Dashboard</a>
<form action="{{ url_for('optimize_models') }}" method="POST" class="d-inline" onsubmit="return confirm('This will re-analyze all available models. Continue?');">
<button type="submit" class="btn btn-primary">
<i class="fas fa-sync me-2"></i>Refresh & Optimize
</button>
</form>
</div>
</div>
<div class="card shadow-sm mb-4">
<div class="card-header bg-light">
<h5 class="mb-0"><i class="fas fa-robot me-2"></i>AI Model Selection</h5>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-hover align-middle mb-0">
<thead class="table-light">
<tr>
<th style="width: 15%">Role</th>
<th style="width: 25%">Selected Model</th>
<th style="width: 15%">Est. Cost</th>
<th>Selection Reasoning</th>
</tr>
</thead>
<tbody>
{% if models %}
{% for role, info in models.items() %}
{% if role != 'ranking' %}
<tr>
<td class="fw-bold text-uppercase">{{ role }}</td>
<td>
<span class="badge bg-info text-dark">{{ info.model }}</span>
</td>
<td>
<span class="badge bg-light text-dark border">{{ info.estimated_cost }}</span>
</td>
<td class="small text-muted">
{{ info.reason }}
</td>
</tr>
{% endif %}
{% endfor %}
{% else %}
<tr>
<td colspan="3" class="text-center py-4 text-muted">
<i class="fas fa-exclamation-circle me-2"></i>No model configuration found.
<br>Click <strong>Refresh & Optimize</strong> to scan available Gemini models.
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
</div>
</div>
<!-- Ranked Models -->
<div class="card shadow-sm mb-4">
<div class="card-header bg-light">
<h5 class="mb-0"><i class="fas fa-list-ol me-2"></i>All Models Ranked</h5>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-hover align-middle mb-0">
<thead class="table-light">
<tr>
<th style="width: 10%">Rank</th>
<th style="width: 30%">Model Name</th>
<th style="width: 15%">Est. Cost</th>
<th>Reasoning</th>
</tr>
</thead>
<tbody>
{% if models and models.ranking %}
{% for item in models.ranking %}
<tr>
<td class="fw-bold">{{ loop.index }}</td>
<td><span class="badge bg-secondary">{{ item.model }}</span></td>
<td><small>{{ item.estimated_cost }}</small></td>
<td class="small text-muted">{{ item.reason }}</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td colspan="3" class="text-center py-4 text-muted">
No ranking data available. Refresh models to generate.
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
</div>
</div>
<!-- Cache Info -->
<div class="card shadow-sm">
<div class="card-header bg-light">
<h5 class="mb-0"><i class="fas fa-clock me-2"></i>Cache Status</h5>
</div>
<div class="card-body">
<p class="mb-0">
<strong>Last Scan:</strong>
{% if cache and cache.timestamp %}
{{ datetime.fromtimestamp(cache.timestamp).strftime('%Y-%m-%d %H:%M:%S') }}
{% else %}
Never
{% endif %}
</p>
<p class="text-muted small mb-0">Model selection is cached for 24 hours to save API calls.</p>
</div>
</div>
{% endblock %}