feat: add web UI with login, CRUD, admin, and API key management
- 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
This commit is contained in:
70
LinkSyncServer/templates/apikeys.html
Normal file
70
LinkSyncServer/templates/apikeys.html
Normal file
@@ -0,0 +1,70 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}API Keys - LinkSync{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<h1>API Keys</h1>
|
||||
<button class="btn btn-primary" id="new-key-btn">+ New API Key</button>
|
||||
</div>
|
||||
|
||||
<div id="api-keys-list" class="api-keys-table">
|
||||
<div class="loading">Loading API keys...</div>
|
||||
</div>
|
||||
|
||||
<div id="key-modal" class="modal" style="display: none;">
|
||||
<div class="modal-overlay"></div>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h2>Create API Key</h2>
|
||||
<button class="modal-close" id="key-modal-close">×</button>
|
||||
</div>
|
||||
<form id="key-form">
|
||||
<div class="form-group">
|
||||
<label for="key-name">Key Name *</label>
|
||||
<input type="text" id="key-name" placeholder="e.g., Firefox Extension" required>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button type="button" class="btn btn-secondary" id="key-cancel-btn">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary" id="key-save-btn">Create</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="key-result-modal" class="modal" style="display: none;">
|
||||
<div class="modal-overlay"></div>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h2>API Key Created</h2>
|
||||
<button class="modal-close" id="key-result-close">×</button>
|
||||
</div>
|
||||
<div class="key-result">
|
||||
<p><strong>Copy this key now. You will not be able to see it again.</strong></p>
|
||||
<div class="key-display">
|
||||
<code id="new-key-value"></code>
|
||||
<button class="btn btn-sm" id="copy-key-btn">Copy</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button class="btn btn-primary" id="key-done-btn">Done</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="delete-key-modal" class="modal" style="display: none;">
|
||||
<div class="modal-overlay"></div>
|
||||
<div class="modal-content modal-sm">
|
||||
<h2>Delete API Key</h2>
|
||||
<p>Are you sure you want to delete this API key? Any connections using this key will stop working.</p>
|
||||
<div class="form-actions">
|
||||
<button class="btn btn-secondary" id="delete-key-cancel-btn">Cancel</button>
|
||||
<button class="btn btn-danger" id="confirm-delete-key-btn">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_js %}
|
||||
<script src="/static/js/apikeys-page.js"></script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user