Spaces:
Sleeping
Sleeping
| {% extends "base.html" %} | |
| {% block title %}Dashboard - SQLite Admin{% endblock %} | |
| {% block content %} | |
| <div class="dashboard"> | |
| <h1>๐ Dashboard</h1> | |
| <!-- Health Status --> | |
| <div class="card"> | |
| <h2>Database Health</h2> | |
| <div class="health-grid"> | |
| <div class="health-item"> | |
| <span class="label">Integrity</span> | |
| <span class="value {% if health.integrity == 'ok' %}success{% else %}error{% endif %}"> | |
| {{ health.integrity }} | |
| </span> | |
| </div> | |
| <div class="health-item"> | |
| <span class="label">Journal Mode</span> | |
| <span class="value">{{ health.journal_mode }}</span> | |
| </div> | |
| <div class="health-item"> | |
| <span class="label">Size</span> | |
| <span class="value">{{ health.db_size_mb }} MB</span> | |
| </div> | |
| <div class="health-item"> | |
| <span class="label">Pages</span> | |
| <span class="value">{{ health.page_count }}</span> | |
| </div> | |
| <div class="health-item"> | |
| <span class="label">WAL Pages</span> | |
| <span class="value">{{ health.wal_pages }}</span> | |
| </div> | |
| <div class="health-item"> | |
| <span class="label">DB Path</span> | |
| <span class="value code">{{ db_path }}</span> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Tables --> | |
| <div class="card"> | |
| <h2>๐ Tables</h2> | |
| {% if tables %} | |
| <table class="data-table"> | |
| <thead> | |
| <tr> | |
| <th>Table Name</th> | |
| <th>Row Count</th> | |
| <th>Actions</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| {% for table in tables %} | |
| <tr> | |
| <td class="code">{{ table.name }}</td> | |
| <td>{{ table.row_count }}</td> | |
| <td> | |
| <a href="/admin/table/{{ table.name }}" class="btn-small">View</a> | |
| </td> | |
| </tr> | |
| {% endfor %} | |
| </tbody> | |
| </table> | |
| {% else %} | |
| <p class="empty-state">No tables found</p> | |
| {% endif %} | |
| </div> | |
| <!-- Recent Backups --> | |
| <div class="card"> | |
| <h2>๐พ Recent Backups</h2> | |
| {% if backups %} | |
| <table class="data-table"> | |
| <thead> | |
| <tr> | |
| <th>Type</th> | |
| <th>File</th> | |
| <th>Size</th> | |
| <th>Status</th> | |
| <th>Time</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| {% for backup in backups %} | |
| <tr> | |
| <td>{{ backup.backup_type }}</td> | |
| <td class="code">{{ backup.file_path|truncate(40) if backup.file_path else '-' }}</td> | |
| <td>{{ backup.file_size|default(0) }} bytes</td> | |
| <td class="status-{{ backup.status }}">{{ backup.status }}</td> | |
| <td>{{ backup.created_at }}</td> | |
| </tr> | |
| {% endfor %} | |
| </tbody> | |
| </table> | |
| {% else %} | |
| <p class="empty-state">No backups yet</p> | |
| {% endif %} | |
| <div class="card-actions"> | |
| <a href="/admin/backups" class="btn-secondary">Manage Backups</a> | |
| </div> | |
| </div> | |
| </div> | |
| {% endblock %} | |