Spaces:
Sleeping
Sleeping
Upload admin.html
Browse files- templates/admin.html +107 -68
templates/admin.html
CHANGED
|
@@ -1,73 +1,112 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
<
|
| 31 |
-
<
|
| 32 |
-
<!-- Admin Login Modal removed: admin panel is always accessible -->
|
| 33 |
-
|
| 34 |
-
<!-- Admin Interface -->
|
| 35 |
-
<div id="adminInterface">
|
| 36 |
-
<!-- Header -->
|
| 37 |
-
<header class="bg-white shadow-md">
|
| 38 |
-
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 39 |
-
<div class="flex justify-between items-center py-4">
|
| 40 |
-
<div class="flex items-center">
|
| 41 |
-
<h1 class="text-2xl font-bold text-gray-900">π English Helper Admin</h1>
|
| 42 |
-
</div>
|
| 43 |
-
<!-- Admin user info and logout removed -->
|
| 44 |
</div>
|
| 45 |
</div>
|
| 46 |
-
</
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
async function loadUsers() {
|
| 73 |
try {
|
|
|
|
| 1 |
+
{% extends "base.html" %}
|
| 2 |
+
{% block title %}Admin - English Helper{% endblock %}
|
| 3 |
+
{% block content %}
|
| 4 |
+
<style>
|
| 5 |
+
.spinner {
|
| 6 |
+
border: 3px solid #f3f3f3;
|
| 7 |
+
border-top: 3px solid #3498db;
|
| 8 |
+
border-radius: 50%;
|
| 9 |
+
width: 20px;
|
| 10 |
+
height: 20px;
|
| 11 |
+
animation: spin 1s linear infinite;
|
| 12 |
+
display: inline-block;
|
| 13 |
+
margin-right: 10px;
|
| 14 |
+
}
|
| 15 |
+
@keyframes spin {
|
| 16 |
+
0% { transform: rotate(0deg); }
|
| 17 |
+
100% { transform: rotate(360deg); }
|
| 18 |
+
}
|
| 19 |
+
.table-container {
|
| 20 |
+
max-height: 600px;
|
| 21 |
+
overflow-y: auto;
|
| 22 |
+
}
|
| 23 |
+
</style>
|
| 24 |
+
|
| 25 |
+
<div id="adminInterface">
|
| 26 |
+
<!-- Header -->
|
| 27 |
+
<header class="bg-white shadow-md">
|
| 28 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 29 |
+
<div class="flex justify-between items-center py-4">
|
| 30 |
+
<div class="flex items-center">
|
| 31 |
+
<h1 class="text-2xl font-bold text-gray-900">π English Helper Admin</h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
</div>
|
| 33 |
</div>
|
| 34 |
+
</div>
|
| 35 |
+
</header>
|
| 36 |
+
|
| 37 |
+
<!-- Navigation Tabs -->
|
| 38 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mt-6">
|
| 39 |
+
<div class="border-b border-gray-200">
|
| 40 |
+
<nav class="-mb-px flex space-x-8">
|
| 41 |
+
<button onclick="showTab('dashboard')" class="admin-tab active" data-tab="dashboard">
|
| 42 |
+
π Dashboard
|
| 43 |
+
</button>
|
| 44 |
+
<button onclick="showTab('users')" class="admin-tab" data-tab="users">
|
| 45 |
+
π₯ Users
|
| 46 |
+
</button>
|
| 47 |
+
<button onclick="showTab('database')" class="admin-tab" data-tab="database">
|
| 48 |
+
ποΈ Database
|
| 49 |
+
</button>
|
| 50 |
+
<button onclick="showTab('tokens')" class="admin-tab" data-tab="tokens">
|
| 51 |
+
π³ Token Usage
|
| 52 |
+
</button>
|
| 53 |
+
<button onclick="showTab('system')" class="admin-tab" data-tab="system">
|
| 54 |
+
π©Ί System Health
|
| 55 |
+
</button>
|
| 56 |
+
</nav>
|
| 57 |
+
</div>
|
| 58 |
+
</div>
|
| 59 |
+
|
| 60 |
+
<!-- Tab Content -->
|
| 61 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6">
|
| 62 |
+
<!-- Dashboard Tab -->
|
| 63 |
+
<div id="dashboardTab" class="tab-content">
|
| 64 |
+
<!-- ...existing dashboard content... -->
|
| 65 |
+
</div>
|
| 66 |
+
|
| 67 |
+
<!-- Users Tab -->
|
| 68 |
+
<div id="usersTab" class="tab-content hidden">
|
| 69 |
+
<!-- ...existing users content... -->
|
| 70 |
+
</div>
|
| 71 |
+
|
| 72 |
+
<!-- Database Tab -->
|
| 73 |
+
<div id="databaseTab" class="tab-content hidden">
|
| 74 |
+
<!-- ...existing database content... -->
|
| 75 |
+
</div>
|
| 76 |
+
|
| 77 |
+
<!-- Token Usage Tab -->
|
| 78 |
+
<div id="tokensTab" class="tab-content hidden">
|
| 79 |
+
<!-- ...existing token usage content... -->
|
| 80 |
+
</div>
|
| 81 |
+
|
| 82 |
+
<!-- System Health Tab -->
|
| 83 |
+
<div id="systemTab" class="tab-content hidden">
|
| 84 |
+
<!-- ...existing system health content... -->
|
| 85 |
+
</div>
|
| 86 |
+
</div>
|
| 87 |
+
</div>
|
| 88 |
+
|
| 89 |
+
<!-- User Detail Modal -->
|
| 90 |
+
<div id="userDetailModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
|
| 91 |
+
<div class="bg-white rounded-lg p-6 max-w-4xl w-full mx-4 max-h-screen overflow-y-auto">
|
| 92 |
+
<div class="flex justify-between items-center mb-4">
|
| 93 |
+
<!-- ...existing modal header... -->
|
| 94 |
+
</div>
|
| 95 |
+
<div id="userDetailContent">
|
| 96 |
+
<!-- ...existing modal content... -->
|
| 97 |
+
</div>
|
| 98 |
+
</div>
|
| 99 |
+
</div>
|
| 100 |
+
|
| 101 |
+
<!-- Toast Notifications -->
|
| 102 |
+
<div id="toastContainer" class="fixed top-4 right-4 z-50"></div>
|
| 103 |
+
|
| 104 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 105 |
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
| 106 |
+
<script>
|
| 107 |
+
// ...existing admin JS code...
|
| 108 |
+
</script>
|
| 109 |
+
{% endblock %}
|
| 110 |
|
| 111 |
async function loadUsers() {
|
| 112 |
try {
|