Migrate to PostgreSQL and add Config Status page

This commit is contained in:
2026-01-12 16:37:03 -08:00
parent 9fa3380730
commit 6972c9b8f9
8 changed files with 432 additions and 4 deletions

View File

@@ -0,0 +1,73 @@
{% extends "admin/index.html" %}
{% block admin_content %}
<div class="card">
<div class="card-header">
<h5 class="mb-0">System Configuration Status</h5>
</div>
<div class="card-body">
<p class="text-muted">Current system environment and database connection details.</p>
<table class="table table-striped table-bordered">
<thead class="table-light">
<tr>
<th style="width: 30%">Setting</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Database Type</strong></td>
<td>
{% if 'sqlite' in config.database_url %}
<span class="badge bg-secondary">SQLite</span>
{% elif 'postgresql' in config.database_url %}
<span class="badge bg-primary">PostgreSQL</span>
{% else %}
<span class="badge bg-warning text-dark">{{ config.database_type }}</span>
{% endif %}
</td>
</tr>
<tr>
<td><strong>Connection URL</strong></td>
<td><code>{{ config.database_url_masked }}</code></td>
</tr>
<tr>
<td><strong>Database Host/Path</strong></td>
<td>{{ config.database_host }}</td>
</tr>
<tr>
<td><strong>Environment</strong></td>
<td>
{% if config.debug %}
<span class="badge bg-warning text-dark">Debug Mode</span>
{% else %}
<span class="badge bg-success">Production</span>
{% endif %}
</td>
</tr>
</tbody>
</table>
<div class="alert alert-info mt-3">
<i class="bi bi-info-circle"></i>
{% if 'sqlite' in config.database_url %}
Running in portable SQLite mode. To switch to PostgreSQL, please refer to the migration guide.
{% else %}
Running in PostgreSQL mode. Database is hosted at <strong>{{ config.database_host }}</strong>.
{% endif %}
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
// Activate the correct tab
const tabLink = document.getElementById('config-status-tab');
if (tabLink) {
tabLink.classList.add('active');
tabLink.setAttribute('aria-selected', 'true');
}
});
</script>
{% endblock %}

View File

@@ -16,6 +16,9 @@
<li class="nav-item" role="presentation">
<a class="nav-link" id="fitbit-tab" href="/admin/fitbit">Fitbit</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="config-status-tab" href="/admin/config-status">Config Status</a>
</li>
</ul>
<div class="tab-content mt-3">