712c556032
- Updated `refresh_models_cache` to include output modalities in the models cache. - Added `get_model_output_modalities` function to retrieve output modalities for a specific model. - Modified tests to cover new functionality for output modalities. - Updated OpenRouter video generation functions to support audio generation and improved error handling. - Enhanced dashboard to display generated images and videos. - Refactored frontend templates to accommodate new data structures for generated content. - Adjusted tests to validate changes in model handling and dashboard rendering. Co-authored-by: Copilot <copilot@github.com>
81 lines
2.4 KiB
HTML
81 lines
2.4 KiB
HTML
{% extends "base.html" %} {% block title %}Dashboard — All You Can GET AI{%
|
|
endblock %} {% block content %}
|
|
<div class="card">
|
|
<h1>Welcome{% if user.get('email') %}, {{ user.email }}{% endif %}</h1>
|
|
<p>Role: <strong>{{ user.get('role', 'user') }}</strong></p>
|
|
<a href="{{ url_for('generate') }}" class="btn">Start generating</a>
|
|
</div>
|
|
|
|
{% if generated_images %}
|
|
<div class="card mt-2">
|
|
<h2>Generated images</h2>
|
|
<div class="image-grid">
|
|
{% for img in generated_images %}
|
|
<div class="image-grid-item">
|
|
<img
|
|
src="{{ img.image_data }}"
|
|
alt="{{ img.prompt }}"
|
|
class="generated-image"
|
|
loading="lazy"
|
|
/>
|
|
<p class="text-muted" style="font-size: 0.75rem; margin-top: 0.25rem">
|
|
<strong>{{ img.model_id }}</strong><br />{{ img.prompt[:80] }}{% if
|
|
img.prompt|length > 80 %}…{% endif %}
|
|
</p>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %} {% if generated_videos %}
|
|
<div class="card mt-2">
|
|
<h2>Generated videos</h2>
|
|
<div class="image-grid">
|
|
{% for vid in generated_videos %}
|
|
<div class="image-grid-item">
|
|
{% if vid.video_url %}
|
|
<video controls style="max-width: 100%; border-radius: 6px">
|
|
<source src="{{ vid.video_url }}" />
|
|
Your browser does not support the video tag.
|
|
</video>
|
|
{% else %}
|
|
<div
|
|
style="
|
|
background: #1a1a1a;
|
|
border-radius: 6px;
|
|
padding: 2rem;
|
|
text-align: center;
|
|
"
|
|
>
|
|
<span class="text-muted">{{ vid.status | capitalize }} …</span>
|
|
</div>
|
|
{% endif %}
|
|
<p class="text-muted" style="font-size: 0.75rem; margin-top: 0.25rem">
|
|
<strong>{{ vid.model_id }}</strong><br />{{ vid.prompt[:80] }}{% if
|
|
vid.prompt|length > 80 %}…{% endif %}<br />
|
|
<em>{{ vid.status }}</em>
|
|
</p>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %} {% if images %}
|
|
<div class="card mt-2">
|
|
<h2>Uploaded reference images</h2>
|
|
<div class="image-grid">
|
|
{% for img in images %}
|
|
<div class="image-grid-item">
|
|
<img
|
|
src="{{ url_for('serve_uploaded_image', image_id=img.id) }}"
|
|
alt="{{ img.filename }}"
|
|
class="generated-image"
|
|
loading="lazy"
|
|
/>
|
|
<p class="text-muted" style="font-size: 0.75rem; margin-top: 0.25rem">
|
|
{{ img.filename }} — {{ (img.size_bytes / 1024) | round(1) }} KB
|
|
</p>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %} {% endblock %}
|