- Add login page with JWT authentication - Add dashboard with stats and quick actions - Add links management page (full CRUD with search) - Add collections management page - Add API key management page with copy-to-clipboard - Add admin user management page (admin only) - Fix UUID type mismatches across all endpoints - Add updated_at column to api_keys and audit_log in schema.sql - Fix DB_PASSWORD default in docker-compose.yml - Add PyJWT to requirements.txt - Fix API docs URL (/docs instead of /api/docs) - Improve JS error handling (show actual messages) - Rewrite conftest.py with proper DB lifecycle management - Add 42 new integration tests (84 total, all passing) - test_admin.py: 15 tests for admin endpoints - test_auth_extended.py: 9 tests for API key CRUD - test_tags.py: 12 tests for tag endpoints - test_sync.py: 6 tests for sync endpoints
59 lines
2.1 KiB
HTML
59 lines
2.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{% block title %}LinkSync{% endblock %}</title>
|
|
<link rel="stylesheet" href="/static/css/main.css">
|
|
{% block extra_css %}{% endblock %}
|
|
</head>
|
|
<body>
|
|
<nav class="navbar">
|
|
<div class="nav-brand">
|
|
<a href="/dashboard">LinkSync</a>
|
|
</div>
|
|
<div class="nav-links" id="nav-links">
|
|
<a href="/dashboard">Dashboard</a>
|
|
<a href="/links">Links</a>
|
|
<a href="/collections">Collections</a>
|
|
<a href="/api-keys">API Keys</a>
|
|
<a href="/admin" id="admin-nav" style="display: none;">Admin</a>
|
|
<a href="/docs" target="_blank">API</a>
|
|
</div>
|
|
<div class="nav-user">
|
|
<span id="nav-username"></span>
|
|
<button class="btn btn-sm btn-outline" id="logout-btn">Logout</button>
|
|
</div>
|
|
</nav>
|
|
<main class="container">
|
|
{% block content %}{% endblock %}
|
|
</main>
|
|
<footer class="footer">
|
|
<p>LinkSyncServer © 2026</p>
|
|
</footer>
|
|
<script src="/static/js/main.js"></script>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const token = localStorage.getItem('token');
|
|
const user = JSON.parse(localStorage.getItem('user') || 'null');
|
|
if (!token) {
|
|
window.location.href = '/login';
|
|
return;
|
|
}
|
|
if (user) {
|
|
document.getElementById('nav-username').textContent = user.username;
|
|
if (user.role === 'admin') {
|
|
document.getElementById('admin-nav').style.display = '';
|
|
}
|
|
}
|
|
document.getElementById('logout-btn').addEventListener('click', function() {
|
|
localStorage.removeItem('token');
|
|
localStorage.removeItem('user');
|
|
window.location.href = '/login';
|
|
});
|
|
});
|
|
</script>
|
|
{% block extra_js %}{% endblock %}
|
|
</body>
|
|
</html>
|