Implement a full-featured admin backend at `/manage/` with login authentication using signed cookies and constant-time credential verification. The panel includes a dashboard showing total/active users, storage usage, monthly revenue, and pending invoices, plus user management, payment overview, and pricing configuration pages. New environment variables `ADMIN_USERNAME`, `ADMIN_PASSWORD`, `ADMIN_SESSION_SECRET`, and `ADMIN_SESSION_EXPIRE_HOURS` control access. The admin router is registered in main.py and all new templates, auth module, and router files are added.
40 lines
1.5 KiB
HTML
40 lines
1.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Admin Login - MyWebdav</title>
|
|
<link rel="stylesheet" href="/static/css/admin.css">
|
|
<link rel="icon" type="image/png" href="/static/icons/icon-192x192.png">
|
|
</head>
|
|
<body>
|
|
<div class="login-container">
|
|
<div class="login-box">
|
|
<div class="login-logo">
|
|
<span class="logo-icon">◆</span>
|
|
<span class="logo-text">My<span class="logo-accent">Webdav</span></span>
|
|
</div>
|
|
<h1 class="login-title">Admin Panel</h1>
|
|
|
|
{% if error %}
|
|
<div class="login-error">
|
|
Invalid username or password.
|
|
</div>
|
|
{% endif %}
|
|
|
|
<form method="POST" action="/manage/login" class="login-form">
|
|
<div class="form-group">
|
|
<label class="form-label" for="username">Username</label>
|
|
<input type="text" id="username" name="username" class="form-input" required autofocus>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="form-label" for="password">Password</label>
|
|
<input type="password" id="password" name="password" class="form-input" required>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary">Login</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|