Spaces:
Running
Running
Создай админ-панель для Telegram-бота на основе HTML, CSS и JavaScript (с возможностью подключения к бэкенду). Цель панели: Управление ботом, который рассылает сообщения пользователям, ведёт статистику и работает с базой данных. Требования к функционалу: Вход в панель (логин и пароль, защита доступа). Статистика: Общее количество пользователей Активные/неактивные пользователи График роста подписчиков (по дням) Рассылка сообщений: Поле ввода текста (поддержка Markdown/HTML) Выбор аудитории: всем, по тегам, по активности Кнопка "Отправить" и подтверждение История рассылок (дата, текст, кол-во получателей) Управление пользователями: Таблица с ID, именем, username, датой регистрации, статусом Поиск и фильтрация Настройки бота: Включение/выключение автозапуска Настройка времени рассылки API-токен Telegram (скрытый, с возможностью смены) Логи: Отображение последних действий (ошибки, успешные рассылки и т.п.) Дизайн: Современный, адаптивный интерфейс (под ПК и мобильные) Тёмная и светлая тема Использование иконок (например, Font Awesome) Технологии: Фронтенд: HTML, CSS, JavaScript (желательно с Bootstrap или Tailwind) Бэкенд: можно оставить заготовку на Node.js/Express или Python/Flask (с комментариями, как подключить) Хранение данных: пример с JSON или подключение к SQLite/PostgreSQL - Initial Deployment
Browse files- README.md +7 -5
- index.html +1143 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: nbnb
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: pink
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en" class="h-full">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Telegram Bot Admin Panel</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
| 10 |
+
<style>
|
| 11 |
+
/* Custom scrollbar */
|
| 12 |
+
::-webkit-scrollbar {
|
| 13 |
+
width: 8px;
|
| 14 |
+
height: 8px;
|
| 15 |
+
}
|
| 16 |
+
::-webkit-scrollbar-track {
|
| 17 |
+
background: #f1f1f1;
|
| 18 |
+
}
|
| 19 |
+
::-webkit-scrollbar-thumb {
|
| 20 |
+
background: #888;
|
| 21 |
+
border-radius: 4px;
|
| 22 |
+
}
|
| 23 |
+
::-webkit-scrollbar-thumb:hover {
|
| 24 |
+
background: #555;
|
| 25 |
+
}
|
| 26 |
+
.dark ::-webkit-scrollbar-track {
|
| 27 |
+
background: #374151;
|
| 28 |
+
}
|
| 29 |
+
.dark ::-webkit-scrollbar-thumb {
|
| 30 |
+
background: #6b7280;
|
| 31 |
+
}
|
| 32 |
+
.dark ::-webkit-scrollbar-thumb:hover {
|
| 33 |
+
background: #9ca3af;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
/* Markdown preview styles */
|
| 37 |
+
#messagePreview {
|
| 38 |
+
border: 1px solid #e5e7eb;
|
| 39 |
+
border-radius: 0.375rem;
|
| 40 |
+
padding: 1rem;
|
| 41 |
+
min-height: 100px;
|
| 42 |
+
}
|
| 43 |
+
.dark #messagePreview {
|
| 44 |
+
border-color: #4b5563;
|
| 45 |
+
background-color: #1f2937;
|
| 46 |
+
}
|
| 47 |
+
#messagePreview h1, #messagePreview h2, #messagePreview h3 {
|
| 48 |
+
margin-top: 0.5em;
|
| 49 |
+
margin-bottom: 0.5em;
|
| 50 |
+
font-weight: bold;
|
| 51 |
+
}
|
| 52 |
+
#messagePreview h1 { font-size: 1.5em; }
|
| 53 |
+
#messagePreview h2 { font-size: 1.3em; }
|
| 54 |
+
#messagePreview h3 { font-size: 1.1em; }
|
| 55 |
+
#messagePreview p { margin-bottom: 1em; }
|
| 56 |
+
#messagePreview ul, #messagePreview ol {
|
| 57 |
+
margin-bottom: 1em;
|
| 58 |
+
padding-left: 2em;
|
| 59 |
+
}
|
| 60 |
+
#messagePreview ul { list-style-type: disc; }
|
| 61 |
+
#messagePreview ol { list-style-type: decimal; }
|
| 62 |
+
#messagePreview blockquote {
|
| 63 |
+
border-left: 4px solid #ddd;
|
| 64 |
+
padding-left: 1em;
|
| 65 |
+
margin-left: 0;
|
| 66 |
+
margin-bottom: 1em;
|
| 67 |
+
color: #777;
|
| 68 |
+
}
|
| 69 |
+
.dark #messagePreview blockquote {
|
| 70 |
+
border-left-color: #555;
|
| 71 |
+
color: #aaa;
|
| 72 |
+
}
|
| 73 |
+
#messagePreview pre {
|
| 74 |
+
background-color: #f5f5f5;
|
| 75 |
+
padding: 1em;
|
| 76 |
+
border-radius: 0.375rem;
|
| 77 |
+
overflow-x: auto;
|
| 78 |
+
margin-bottom: 1em;
|
| 79 |
+
}
|
| 80 |
+
.dark #messagePreview pre {
|
| 81 |
+
background-color: #2d3748;
|
| 82 |
+
}
|
| 83 |
+
#messagePreview code {
|
| 84 |
+
font-family: monospace;
|
| 85 |
+
background-color: #f5f5f5;
|
| 86 |
+
padding: 0.2em 0.4em;
|
| 87 |
+
border-radius: 0.2em;
|
| 88 |
+
}
|
| 89 |
+
.dark #messagePreview code {
|
| 90 |
+
background-color: #2d3748;
|
| 91 |
+
}
|
| 92 |
+
#messagePreview a {
|
| 93 |
+
color: #3b82f6;
|
| 94 |
+
text-decoration: underline;
|
| 95 |
+
}
|
| 96 |
+
#messagePreview img {
|
| 97 |
+
max-width: 100%;
|
| 98 |
+
height: auto;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
/* Animation for notifications */
|
| 102 |
+
@keyframes slideIn {
|
| 103 |
+
from { transform: translateX(100%); }
|
| 104 |
+
to { transform: translateX(0); }
|
| 105 |
+
}
|
| 106 |
+
@keyframes fadeOut {
|
| 107 |
+
from { opacity: 1; }
|
| 108 |
+
to { opacity: 0; }
|
| 109 |
+
}
|
| 110 |
+
.notification {
|
| 111 |
+
animation: slideIn 0.3s ease-out;
|
| 112 |
+
}
|
| 113 |
+
.notification.hide {
|
| 114 |
+
animation: fadeOut 0.5s ease-out forwards;
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
/* Transition for theme toggle */
|
| 118 |
+
.theme-transition * {
|
| 119 |
+
transition: background-color 0.3s ease, border-color 0.3s ease;
|
| 120 |
+
}
|
| 121 |
+
</style>
|
| 122 |
+
</head>
|
| 123 |
+
<body class="theme-transition bg-gray-100 dark:bg-gray-900 h-full">
|
| 124 |
+
<!-- Login Screen -->
|
| 125 |
+
<div id="loginScreen" class="flex items-center justify-center min-h-screen p-4">
|
| 126 |
+
<div class="w-full max-w-md bg-white dark:bg-gray-800 rounded-lg shadow-lg overflow-hidden">
|
| 127 |
+
<div class="bg-blue-600 dark:bg-blue-800 py-4 px-6">
|
| 128 |
+
<h1 class="text-2xl font-bold text-white">Telegram Bot Admin</h1>
|
| 129 |
+
<p class="text-blue-100 dark:text-blue-200">Please sign in to continue</p>
|
| 130 |
+
</div>
|
| 131 |
+
<div class="p-6">
|
| 132 |
+
<div class="mb-4">
|
| 133 |
+
<label for="username" class="block text-gray-700 dark:text-gray-300 text-sm font-bold mb-2">Username</label>
|
| 134 |
+
<input type="text" id="username" class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:text-white" placeholder="Enter your username">
|
| 135 |
+
</div>
|
| 136 |
+
<div class="mb-6">
|
| 137 |
+
<label for="password" class="block text-gray-700 dark:text-gray-300 text-sm font-bold mb-2">Password</label>
|
| 138 |
+
<input type="password" id="password" class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:text-white" placeholder="Enter your password">
|
| 139 |
+
</div>
|
| 140 |
+
<div class="flex items-center justify-between">
|
| 141 |
+
<button id="loginBtn" class="bg-blue-600 hover:bg-blue-700 dark:bg-blue-700 dark:hover:bg-blue-800 text-white font-bold py-2 px-4 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50 transition-colors">
|
| 142 |
+
Sign In
|
| 143 |
+
</button>
|
| 144 |
+
<div class="flex items-center">
|
| 145 |
+
<span class="text-gray-600 dark:text-gray-400 text-sm mr-2">Dark Mode</span>
|
| 146 |
+
<label class="relative inline-flex items-center cursor-pointer">
|
| 147 |
+
<input type="checkbox" id="themeToggle" class="sr-only peer">
|
| 148 |
+
<div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"></div>
|
| 149 |
+
</label>
|
| 150 |
+
</div>
|
| 151 |
+
</div>
|
| 152 |
+
</div>
|
| 153 |
+
</div>
|
| 154 |
+
</div>
|
| 155 |
+
|
| 156 |
+
<!-- Main Admin Panel (Hidden by default) -->
|
| 157 |
+
<div id="adminPanel" class="hidden h-full">
|
| 158 |
+
<!-- Sidebar -->
|
| 159 |
+
<div class="fixed inset-y-0 left-0 w-64 bg-white dark:bg-gray-800 shadow-lg z-10">
|
| 160 |
+
<div class="flex items-center justify-center h-16 px-4 bg-blue-600 dark:bg-blue-800">
|
| 161 |
+
<h1 class="text-xl font-bold text-white">Telegram Bot Admin</h1>
|
| 162 |
+
</div>
|
| 163 |
+
<div class="flex flex-col h-full">
|
| 164 |
+
<nav class="flex-1 px-2 py-4 space-y-1 overflow-y-auto">
|
| 165 |
+
<a href="#" id="dashboardLink" class="flex items-center px-4 py-2 text-sm font-medium rounded-md bg-blue-100 dark:bg-gray-700 text-blue-700 dark:text-white">
|
| 166 |
+
<i class="fas fa-tachometer-alt mr-3"></i>
|
| 167 |
+
Dashboard
|
| 168 |
+
</a>
|
| 169 |
+
<a href="#" id="broadcastLink" class="flex items-center px-4 py-2 text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700">
|
| 170 |
+
<i class="fas fa-bullhorn mr-3"></i>
|
| 171 |
+
Broadcast Messages
|
| 172 |
+
</a>
|
| 173 |
+
<a href="#" id="usersLink" class="flex items-center px-4 py-2 text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700">
|
| 174 |
+
<i class="fas fa-users mr-3"></i>
|
| 175 |
+
User Management
|
| 176 |
+
</a>
|
| 177 |
+
<a href="#" id="settingsLink" class="flex items-center px-4 py-2 text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700">
|
| 178 |
+
<i class="fas fa-cog mr-3"></i>
|
| 179 |
+
Bot Settings
|
| 180 |
+
</a>
|
| 181 |
+
<a href="#" id="logsLink" class="flex items-center px-4 py-2 text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700">
|
| 182 |
+
<i class="fas fa-clipboard-list mr-3"></i>
|
| 183 |
+
System Logs
|
| 184 |
+
</a>
|
| 185 |
+
</nav>
|
| 186 |
+
<div class="px-4 py-4 border-t border-gray-200 dark:border-gray-700">
|
| 187 |
+
<div class="flex items-center">
|
| 188 |
+
<div class="flex-shrink-0">
|
| 189 |
+
<img class="h-10 w-10 rounded-full" src="https://ui-avatars.com/api/?name=Admin&background=3b82f6&color=fff" alt="Admin">
|
| 190 |
+
</div>
|
| 191 |
+
<div class="ml-3">
|
| 192 |
+
<p class="text-sm font-medium text-gray-700 dark:text-gray-300">Admin</p>
|
| 193 |
+
<button id="logoutBtn" class="text-xs font-medium text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300">Sign out</button>
|
| 194 |
+
</div>
|
| 195 |
+
</div>
|
| 196 |
+
</div>
|
| 197 |
+
</div>
|
| 198 |
+
</div>
|
| 199 |
+
|
| 200 |
+
<!-- Main Content -->
|
| 201 |
+
<div class="ml-64 flex flex-col h-full">
|
| 202 |
+
<!-- Top Navigation -->
|
| 203 |
+
<header class="flex items-center justify-between h-16 px-6 bg-white dark:bg-gray-800 shadow-sm z-10">
|
| 204 |
+
<div class="flex items-center">
|
| 205 |
+
<button id="sidebarToggle" class="text-gray-500 dark:text-gray-400 focus:outline-none lg:hidden">
|
| 206 |
+
<i class="fas fa-bars"></i>
|
| 207 |
+
</button>
|
| 208 |
+
<h2 id="pageTitle" class="ml-4 text-xl font-semibold text-gray-800 dark:text-white">Dashboard</h2>
|
| 209 |
+
</div>
|
| 210 |
+
<div class="flex items-center space-x-4">
|
| 211 |
+
<div class="relative">
|
| 212 |
+
<button id="notificationsBtn" class="text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 focus:outline-none">
|
| 213 |
+
<i class="fas fa-bell"></i>
|
| 214 |
+
<span id="notificationBadge" class="absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full h-4 w-4 flex items-center justify-center hidden">3</span>
|
| 215 |
+
</button>
|
| 216 |
+
</div>
|
| 217 |
+
<div class="relative">
|
| 218 |
+
<button id="themeToggleBtn" class="text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 focus:outline-none">
|
| 219 |
+
<i id="themeIcon" class="fas fa-moon"></i>
|
| 220 |
+
</button>
|
| 221 |
+
</div>
|
| 222 |
+
</div>
|
| 223 |
+
</header>
|
| 224 |
+
|
| 225 |
+
<!-- Content Area -->
|
| 226 |
+
<main class="flex-1 overflow-y-auto p-6 bg-gray-50 dark:bg-gray-900">
|
| 227 |
+
<!-- Dashboard Content -->
|
| 228 |
+
<div id="dashboardContent">
|
| 229 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
|
| 230 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
|
| 231 |
+
<div class="flex items-center">
|
| 232 |
+
<div class="p-3 rounded-full bg-blue-100 dark:bg-blue-900 text-blue-600 dark:text-blue-300">
|
| 233 |
+
<i class="fas fa-users text-xl"></i>
|
| 234 |
+
</div>
|
| 235 |
+
<div class="ml-4">
|
| 236 |
+
<p class="text-sm font-medium text-gray-500 dark:text-gray-400">Total Users</p>
|
| 237 |
+
<p id="totalUsers" class="text-2xl font-semibold text-gray-800 dark:text-white">1,254</p>
|
| 238 |
+
</div>
|
| 239 |
+
</div>
|
| 240 |
+
</div>
|
| 241 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
|
| 242 |
+
<div class="flex items-center">
|
| 243 |
+
<div class="p-3 rounded-full bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-300">
|
| 244 |
+
<i class="fas fa-user-check text-xl"></i>
|
| 245 |
+
</div>
|
| 246 |
+
<div class="ml-4">
|
| 247 |
+
<p class="text-sm font-medium text-gray-500 dark:text-gray-400">Active Users</p>
|
| 248 |
+
<p id="activeUsers" class="text-2xl font-semibold text-gray-800 dark:text-white">892</p>
|
| 249 |
+
</div>
|
| 250 |
+
</div>
|
| 251 |
+
</div>
|
| 252 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
|
| 253 |
+
<div class="flex items-center">
|
| 254 |
+
<div class="p-3 rounded-full bg-yellow-100 dark:bg-yellow-900 text-yellow-600 dark:text-yellow-300">
|
| 255 |
+
<i class="fas fa-user-clock text-xl"></i>
|
| 256 |
+
</div>
|
| 257 |
+
<div class="ml-4">
|
| 258 |
+
<p class="text-sm font-medium text-gray-500 dark:text-gray-400">Inactive Users</p>
|
| 259 |
+
<p id="inactiveUsers" class="text-2xl font-semibold text-gray-800 dark:text-white">362</p>
|
| 260 |
+
</div>
|
| 261 |
+
</div>
|
| 262 |
+
</div>
|
| 263 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
|
| 264 |
+
<div class="flex items-center">
|
| 265 |
+
<div class="p-3 rounded-full bg-purple-100 dark:bg-purple-900 text-purple-600 dark:text-purple-300">
|
| 266 |
+
<i class="fas fa-paper-plane text-xl"></i>
|
| 267 |
+
</div>
|
| 268 |
+
<div class="ml-4">
|
| 269 |
+
<p class="text-sm font-medium text-gray-500 dark:text-gray-400">Broadcasts Sent</p>
|
| 270 |
+
<p id="broadcastsSent" class="text-2xl font-semibold text-gray-800 dark:text-white">47</p>
|
| 271 |
+
</div>
|
| 272 |
+
</div>
|
| 273 |
+
</div>
|
| 274 |
+
</div>
|
| 275 |
+
|
| 276 |
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
|
| 277 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
|
| 278 |
+
<h3 class="text-lg font-semibold text-gray-800 dark:text-white mb-4">User Growth</h3>
|
| 279 |
+
<canvas id="userGrowthChart" height="300"></canvas>
|
| 280 |
+
</div>
|
| 281 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
|
| 282 |
+
<h3 class="text-lg font-semibold text-gray-800 dark:text-white mb-4">Recent Activity</h3>
|
| 283 |
+
<div class="space-y-4">
|
| 284 |
+
<div class="flex items-start">
|
| 285 |
+
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-blue-100 dark:bg-blue-900 flex items-center justify-center text-blue-600 dark:text-blue-300">
|
| 286 |
+
<i class="fas fa-bullhorn"></i>
|
| 287 |
+
</div>
|
| 288 |
+
<div class="ml-4">
|
| 289 |
+
<p class="text-sm font-medium text-gray-800 dark:text-white">New broadcast sent</p>
|
| 290 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">"Weekly update" sent to 892 users</p>
|
| 291 |
+
<p class="text-xs text-gray-400 dark:text-gray-500">2 hours ago</p>
|
| 292 |
+
</div>
|
| 293 |
+
</div>
|
| 294 |
+
<div class="flex items-start">
|
| 295 |
+
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-green-100 dark:bg-green-900 flex items-center justify-center text-green-600 dark:text-green-300">
|
| 296 |
+
<i class="fas fa-user-plus"></i>
|
| 297 |
+
</div>
|
| 298 |
+
<div class="ml-4">
|
| 299 |
+
<p class="text-sm font-medium text-gray-800 dark:text-white">New user registered</p>
|
| 300 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">@newuser joined the bot</p>
|
| 301 |
+
<p class="text-xs text-gray-400 dark:text-gray-500">5 hours ago</p>
|
| 302 |
+
</div>
|
| 303 |
+
</div>
|
| 304 |
+
<div class="flex items-start">
|
| 305 |
+
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-yellow-100 dark:bg-yellow-900 flex items-center justify-center text-yellow-600 dark:text-yellow-300">
|
| 306 |
+
<i class="fas fa-cog"></i>
|
| 307 |
+
</div>
|
| 308 |
+
<div class="ml-4">
|
| 309 |
+
<p class="text-sm font-medium text-gray-800 dark:text-white">Settings updated</p>
|
| 310 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">Broadcast schedule changed</p>
|
| 311 |
+
<p class="text-xs text-gray-400 dark:text-gray-500">Yesterday</p>
|
| 312 |
+
</div>
|
| 313 |
+
</div>
|
| 314 |
+
</div>
|
| 315 |
+
</div>
|
| 316 |
+
</div>
|
| 317 |
+
</div>
|
| 318 |
+
|
| 319 |
+
<!-- Broadcast Content -->
|
| 320 |
+
<div id="broadcastContent" class="hidden">
|
| 321 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow mb-6">
|
| 322 |
+
<div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700">
|
| 323 |
+
<h3 class="text-lg font-semibold text-gray-800 dark:text-white">Create New Broadcast</h3>
|
| 324 |
+
</div>
|
| 325 |
+
<div class="p-6">
|
| 326 |
+
<div class="mb-6">
|
| 327 |
+
<label for="broadcastMessage" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Message Content (Markdown/HTML supported)</label>
|
| 328 |
+
<textarea id="broadcastMessage" rows="6" class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:text-white" placeholder="Enter your message here..."></textarea>
|
| 329 |
+
<div class="mt-2 flex space-x-2">
|
| 330 |
+
<button id="previewBtn" class="px-3 py-1 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-md text-sm hover:bg-gray-300 dark:hover:bg-gray-600">
|
| 331 |
+
<i class="fas fa-eye mr-1"></i> Preview
|
| 332 |
+
</button>
|
| 333 |
+
<button id="clearBtn" class="px-3 py-1 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-md text-sm hover:bg-gray-300 dark:hover:bg-gray-600">
|
| 334 |
+
<i class="fas fa-trash-alt mr-1"></i> Clear
|
| 335 |
+
</button>
|
| 336 |
+
</div>
|
| 337 |
+
</div>
|
| 338 |
+
|
| 339 |
+
<div id="previewContainer" class="mb-6 hidden">
|
| 340 |
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Message Preview</label>
|
| 341 |
+
<div id="messagePreview" class="prose dark:prose-invert max-w-none"></div>
|
| 342 |
+
</div>
|
| 343 |
+
|
| 344 |
+
<div class="mb-6">
|
| 345 |
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Target Audience</label>
|
| 346 |
+
<div class="space-y-4">
|
| 347 |
+
<div class="flex items-center">
|
| 348 |
+
<input id="allUsers" name="audience" type="radio" checked class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600 dark:bg-gray-700">
|
| 349 |
+
<label for="allUsers" class="ml-2 block text-sm text-gray-700 dark:text-gray-300">All users</label>
|
| 350 |
+
</div>
|
| 351 |
+
<div class="flex items-center">
|
| 352 |
+
<input id="activeUsersOnly" name="audience" type="radio" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600 dark:bg-gray-700">
|
| 353 |
+
<label for="activeUsersOnly" class="ml-2 block text-sm text-gray-700 dark:text-gray-300">Active users only (interacted in last 30 days)</label>
|
| 354 |
+
</div>
|
| 355 |
+
<div class="flex items-center">
|
| 356 |
+
<input id="inactiveUsersOnly" name="audience" type="radio" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600 dark:bg-gray-700">
|
| 357 |
+
<label for="inactiveUsersOnly" class="ml-2 block text-sm text-gray-700 dark:text-gray-300">Inactive users only (no interaction in last 30 days)</label>
|
| 358 |
+
</div>
|
| 359 |
+
<div class="flex items-start">
|
| 360 |
+
<input id="customFilter" name="audience" type="radio" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600 dark:bg-gray-700 mt-1">
|
| 361 |
+
<div class="ml-2">
|
| 362 |
+
<label for="customFilter" class="block text-sm text-gray-700 dark:text-gray-300">Custom filter</label>
|
| 363 |
+
<div class="mt-1 flex flex-wrap gap-2">
|
| 364 |
+
<select id="filterField" class="px-3 py-1 border border-gray-300 dark:border-gray-600 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:text-white">
|
| 365 |
+
<option value="tags">Tags</option>
|
| 366 |
+
<option value="language">Language</option>
|
| 367 |
+
<option value="country">Country</option>
|
| 368 |
+
</select>
|
| 369 |
+
<select id="filterOperator" class="px-3 py-1 border border-gray-300 dark:border-gray-600 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:text-white">
|
| 370 |
+
<option value="equals">equals</option>
|
| 371 |
+
<option value="contains">contains</option>
|
| 372 |
+
<option value="startsWith">starts with</option>
|
| 373 |
+
<option value="endsWith">ends with</option>
|
| 374 |
+
</select>
|
| 375 |
+
<input id="filterValue" type="text" class="px-3 py-1 border border-gray-300 dark:border-gray-600 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:text-white" placeholder="Value">
|
| 376 |
+
<button id="addFilterBtn" class="px-3 py-1 bg-blue-600 text-white rounded-md text-sm hover:bg-blue-700">
|
| 377 |
+
<i class="fas fa-plus mr-1"></i> Add
|
| 378 |
+
</button>
|
| 379 |
+
</div>
|
| 380 |
+
<div id="activeFilters" class="mt-2 space-y-1"></div>
|
| 381 |
+
</div>
|
| 382 |
+
</div>
|
| 383 |
+
</div>
|
| 384 |
+
</div>
|
| 385 |
+
|
| 386 |
+
<div class="flex justify-end">
|
| 387 |
+
<button id="sendBroadcastBtn" class="px-4 py-2 bg-blue-600 text-white rounded-md text-sm font-medium hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500">
|
| 388 |
+
<i class="fas fa-paper-plane mr-2"></i> Send Broadcast
|
| 389 |
+
</button>
|
| 390 |
+
</div>
|
| 391 |
+
</div>
|
| 392 |
+
</div>
|
| 393 |
+
|
| 394 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow">
|
| 395 |
+
<div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700">
|
| 396 |
+
<h3 class="text-lg font-semibold text-gray-800 dark:text-white">Broadcast History</h3>
|
| 397 |
+
</div>
|
| 398 |
+
<div class="overflow-x-auto">
|
| 399 |
+
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
| 400 |
+
<thead class="bg-gray-50 dark:bg-gray-700">
|
| 401 |
+
<tr>
|
| 402 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Date</th>
|
| 403 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Message Preview</th>
|
| 404 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Recipients</th>
|
| 405 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Status</th>
|
| 406 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Actions</th>
|
| 407 |
+
</tr>
|
| 408 |
+
</thead>
|
| 409 |
+
<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
|
| 410 |
+
<tr>
|
| 411 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">2023-06-15 14:30</td>
|
| 412 |
+
<td class="px-6 py-4 text-sm text-gray-800 dark:text-gray-300 max-w-xs truncate">📢 Weekly Update: New features added to our bot...</td>
|
| 413 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">892</td>
|
| 414 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
| 415 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200">Completed</span>
|
| 416 |
+
</td>
|
| 417 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">
|
| 418 |
+
<button class="text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300 mr-3">
|
| 419 |
+
<i class="fas fa-eye"></i>
|
| 420 |
+
</button>
|
| 421 |
+
<button class="text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300">
|
| 422 |
+
<i class="fas fa-trash-alt"></i>
|
| 423 |
+
</button>
|
| 424 |
+
</td>
|
| 425 |
+
</tr>
|
| 426 |
+
<tr>
|
| 427 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">2023-06-10 09:15</td>
|
| 428 |
+
<td class="px-6 py-4 text-sm text-gray-800 dark:text-gray-300 max-w-xs truncate">🚀 Important Announcement: Scheduled maintenance...</td>
|
| 429 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">1,254</td>
|
| 430 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
| 431 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200">Completed</span>
|
| 432 |
+
</td>
|
| 433 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">
|
| 434 |
+
<button class="text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300 mr-3">
|
| 435 |
+
<i class="fas fa-eye"></i>
|
| 436 |
+
</button>
|
| 437 |
+
<button class="text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300">
|
| 438 |
+
<i class="fas fa-trash-alt"></i>
|
| 439 |
+
</button>
|
| 440 |
+
</td>
|
| 441 |
+
</tr>
|
| 442 |
+
<tr>
|
| 443 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">2023-06-05 16:45</td>
|
| 444 |
+
<td class="px-6 py-4 text-sm text-gray-800 dark:text-gray-300 max-w-xs truncate">🎉 Special Offer: Limited time discount for premium...</td>
|
| 445 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">362</td>
|
| 446 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
| 447 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200">Completed</span>
|
| 448 |
+
</td>
|
| 449 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">
|
| 450 |
+
<button class="text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300 mr-3">
|
| 451 |
+
<i class="fas fa-eye"></i>
|
| 452 |
+
</button>
|
| 453 |
+
<button class="text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300">
|
| 454 |
+
<i class="fas fa-trash-alt"></i>
|
| 455 |
+
</button>
|
| 456 |
+
</td>
|
| 457 |
+
</tr>
|
| 458 |
+
</tbody>
|
| 459 |
+
</table>
|
| 460 |
+
</div>
|
| 461 |
+
</div>
|
| 462 |
+
</div>
|
| 463 |
+
|
| 464 |
+
<!-- Users Content -->
|
| 465 |
+
<div id="usersContent" class="hidden">
|
| 466 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow mb-6">
|
| 467 |
+
<div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700 flex justify-between items-center">
|
| 468 |
+
<h3 class="text-lg font-semibold text-gray-800 dark:text-white">User Management</h3>
|
| 469 |
+
<div class="flex space-x-2">
|
| 470 |
+
<div class="relative">
|
| 471 |
+
<input type="text" id="userSearch" class="pl-8 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:text-white" placeholder="Search users...">
|
| 472 |
+
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 473 |
+
<i class="fas fa-search text-gray-400"></i>
|
| 474 |
+
</div>
|
| 475 |
+
</div>
|
| 476 |
+
<button id="exportUsersBtn" class="px-3 py-2 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-md text-sm hover:bg-gray-300 dark:hover:bg-gray-600">
|
| 477 |
+
<i class="fas fa-download mr-1"></i> Export
|
| 478 |
+
</button>
|
| 479 |
+
</div>
|
| 480 |
+
</div>
|
| 481 |
+
<div class="p-6">
|
| 482 |
+
<div class="overflow-x-auto">
|
| 483 |
+
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
| 484 |
+
<thead class="bg-gray-50 dark:bg-gray-700">
|
| 485 |
+
<tr>
|
| 486 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">ID</th>
|
| 487 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Name</th>
|
| 488 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Username</th>
|
| 489 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Registration</th>
|
| 490 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Last Activity</th>
|
| 491 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Status</th>
|
| 492 |
+
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Actions</th>
|
| 493 |
+
</tr>
|
| 494 |
+
</thead>
|
| 495 |
+
<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
|
| 496 |
+
<tr>
|
| 497 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">12345</td>
|
| 498 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-300">John Doe</td>
|
| 499 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-300">@johndoe</td>
|
| 500 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">2023-05-10</td>
|
| 501 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">2023-06-14</td>
|
| 502 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
| 503 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200">Active</span>
|
| 504 |
+
</td>
|
| 505 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">
|
| 506 |
+
<button class="text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300 mr-3">
|
| 507 |
+
<i class="fas fa-edit"></i>
|
| 508 |
+
</button>
|
| 509 |
+
<button class="text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300">
|
| 510 |
+
<i class="fas fa-trash-alt"></i>
|
| 511 |
+
</button>
|
| 512 |
+
</td>
|
| 513 |
+
</tr>
|
| 514 |
+
<tr>
|
| 515 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">12346</td>
|
| 516 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-300">Jane Smith</td>
|
| 517 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-300">@janesmith</td>
|
| 518 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">2023-05-15</td>
|
| 519 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">2023-06-15</td>
|
| 520 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
| 521 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200">Active</span>
|
| 522 |
+
</td>
|
| 523 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">
|
| 524 |
+
<button class="text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300 mr-3">
|
| 525 |
+
<i class="fas fa-edit"></i>
|
| 526 |
+
</button>
|
| 527 |
+
<button class="text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300">
|
| 528 |
+
<i class="fas fa-trash-alt"></i>
|
| 529 |
+
</button>
|
| 530 |
+
</td>
|
| 531 |
+
</tr>
|
| 532 |
+
<tr>
|
| 533 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">12347</td>
|
| 534 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-300">Robert Johnson</td>
|
| 535 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-300">@robertj</td>
|
| 536 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">2023-04-22</td>
|
| 537 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">2023-05-28</td>
|
| 538 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
| 539 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200">Inactive</span>
|
| 540 |
+
</td>
|
| 541 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">
|
| 542 |
+
<button class="text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300 mr-3">
|
| 543 |
+
<i class="fas fa-edit"></i>
|
| 544 |
+
</button>
|
| 545 |
+
<button class="text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300">
|
| 546 |
+
<i class="fas fa-trash-alt"></i>
|
| 547 |
+
</button>
|
| 548 |
+
</td>
|
| 549 |
+
</tr>
|
| 550 |
+
<tr>
|
| 551 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">12348</td>
|
| 552 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-300">Emily Davis</td>
|
| 553 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-300">@emilyd</td>
|
| 554 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">2023-03-18</td>
|
| 555 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">2023-06-12</td>
|
| 556 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
| 557 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200">Active</span>
|
| 558 |
+
</td>
|
| 559 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">
|
| 560 |
+
<button class="text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300 mr-3">
|
| 561 |
+
<i class="fas fa-edit"></i>
|
| 562 |
+
</button>
|
| 563 |
+
<button class="text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300">
|
| 564 |
+
<i class="fas fa-trash-alt"></i>
|
| 565 |
+
</button>
|
| 566 |
+
</td>
|
| 567 |
+
</tr>
|
| 568 |
+
<tr>
|
| 569 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">12349</td>
|
| 570 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-300">Michael Wilson</td>
|
| 571 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-300">@michaelw</td>
|
| 572 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">2023-02-05</td>
|
| 573 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">2023-04-15</td>
|
| 574 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
| 575 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200">Inactive</span>
|
| 576 |
+
</td>
|
| 577 |
+
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300">
|
| 578 |
+
<button class="text-blue-600 hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300 mr-3">
|
| 579 |
+
<i class="fas fa-edit"></i>
|
| 580 |
+
</button>
|
| 581 |
+
<button class="text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300">
|
| 582 |
+
<i class="fas fa-trash-alt"></i>
|
| 583 |
+
</button>
|
| 584 |
+
</td>
|
| 585 |
+
</tr>
|
| 586 |
+
</tbody>
|
| 587 |
+
</table>
|
| 588 |
+
</div>
|
| 589 |
+
<div class="mt-4 flex items-center justify-between">
|
| 590 |
+
<div class="text-sm text-gray-500 dark:text-gray-400">
|
| 591 |
+
Showing <span class="font-medium">1</span> to <span class="font-medium">5</span> of <span class="font-medium">1,254</span> users
|
| 592 |
+
</div>
|
| 593 |
+
<div class="flex space-x-2">
|
| 594 |
+
<button class="px-3 py-1 border border-gray-300 dark:border-gray-600 rounded-md text-sm text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
|
| 595 |
+
Previous
|
| 596 |
+
</button>
|
| 597 |
+
<button class="px-3 py-1 border border-gray-300 dark:border-gray-600 rounded-md text-sm text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
|
| 598 |
+
Next
|
| 599 |
+
</button>
|
| 600 |
+
</div>
|
| 601 |
+
</div>
|
| 602 |
+
</div>
|
| 603 |
+
</div>
|
| 604 |
+
</div>
|
| 605 |
+
|
| 606 |
+
<!-- Settings Content -->
|
| 607 |
+
<div id="settingsContent" class="hidden">
|
| 608 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow mb-6">
|
| 609 |
+
<div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700">
|
| 610 |
+
<h3 class="text-lg font-semibold text-gray-800 dark:text-white">Bot Settings</h3>
|
| 611 |
+
</div>
|
| 612 |
+
<div class="p-6">
|
| 613 |
+
<div class="mb-6">
|
| 614 |
+
<div class="flex items-center justify-between mb-4">
|
| 615 |
+
<div>
|
| 616 |
+
<h4 class="text-base font-medium text-gray-800 dark:text-white">Bot Status</h4>
|
| 617 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">Enable or disable the bot</p>
|
| 618 |
+
</div>
|
| 619 |
+
<label class="relative inline-flex items-center cursor-pointer">
|
| 620 |
+
<input type="checkbox" id="botStatusToggle" class="sr-only peer" checked>
|
| 621 |
+
<div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"></div>
|
| 622 |
+
</label>
|
| 623 |
+
</div>
|
| 624 |
+
|
| 625 |
+
<div class="mb-6">
|
| 626 |
+
<h4 class="text-base font-medium text-gray-800 dark:text-white mb-2">Telegram API Token</h4>
|
| 627 |
+
<div class="flex">
|
| 628 |
+
<input type="password" id="apiToken" class="flex-1 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-l-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:text-white" value="123456789:ABC-DEF1234ghIkl-zyx57W2v1u123ew11">
|
| 629 |
+
<button id="showTokenBtn" class="px-3 py-2 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 border-t border-r border-b border-gray-300 dark:border-gray-600 rounded-r-md hover:bg-gray-300 dark:hover:bg-gray-600">
|
| 630 |
+
<i class="fas fa-eye"></i>
|
| 631 |
+
</button>
|
| 632 |
+
</div>
|
| 633 |
+
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">Keep this token secure. Don't share it with anyone.</p>
|
| 634 |
+
</div>
|
| 635 |
+
|
| 636 |
+
<div class="mb-6">
|
| 637 |
+
<h4 class="text-base font-medium text-gray-800 dark:text-white mb-2">Automatic Broadcast Schedule</h4>
|
| 638 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
| 639 |
+
<div>
|
| 640 |
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Enable Auto Broadcast</label>
|
| 641 |
+
<label class="relative inline-flex items-center cursor-pointer">
|
| 642 |
+
<input type="checkbox" id="autoBroadcastToggle" class="sr-only peer">
|
| 643 |
+
<div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"></div>
|
| 644 |
+
</label>
|
| 645 |
+
</div>
|
| 646 |
+
<div>
|
| 647 |
+
<label for="broadcastTime" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Broadcast Time</label>
|
| 648 |
+
<select id="broadcastTime" class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:text-white">
|
| 649 |
+
<option value="09:00">09:00 AM</option>
|
| 650 |
+
<option value="12:00" selected>12:00 PM</option>
|
| 651 |
+
<option value="15:00">03:00 PM</option>
|
| 652 |
+
<option value="18:00">06:00 PM</option>
|
| 653 |
+
<option value="21:00">09:00 PM</option>
|
| 654 |
+
</select>
|
| 655 |
+
</div>
|
| 656 |
+
<div>
|
| 657 |
+
<label for="broadcastFrequency" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Frequency</label>
|
| 658 |
+
<select id="broadcastFrequency" class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:text-white">
|
| 659 |
+
<option value="daily">Daily</option>
|
| 660 |
+
<option value="weekly" selected>Weekly</option>
|
| 661 |
+
<option value="monthly">Monthly</option>
|
| 662 |
+
</select>
|
| 663 |
+
</div>
|
| 664 |
+
</div>
|
| 665 |
+
</div>
|
| 666 |
+
|
| 667 |
+
<div class="mb-6">
|
| 668 |
+
<h4 class="text-base font-medium text-gray-800 dark:text-white mb-2">Welcome Message</h4>
|
| 669 |
+
<textarea id="welcomeMessage" rows="4" class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:text-white">Welcome to our bot! 🎉 Use /help to see available commands.</textarea>
|
| 670 |
+
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">This message will be sent to new users when they start the bot.</p>
|
| 671 |
+
</div>
|
| 672 |
+
|
| 673 |
+
<div class="flex justify-end">
|
| 674 |
+
<button id="saveSettingsBtn" class="px-4 py-2 bg-blue-600 text-white rounded-md text-sm font-medium hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500">
|
| 675 |
+
<i class="fas fa-save mr-2"></i> Save Settings
|
| 676 |
+
</button>
|
| 677 |
+
</div>
|
| 678 |
+
</div>
|
| 679 |
+
</div>
|
| 680 |
+
</div>
|
| 681 |
+
</div>
|
| 682 |
+
|
| 683 |
+
<!-- Logs Content -->
|
| 684 |
+
<div id="logsContent" class="hidden">
|
| 685 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow">
|
| 686 |
+
<div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700 flex justify-between items-center">
|
| 687 |
+
<h3 class="text-lg font-semibold text-gray-800 dark:text-white">System Logs</h3>
|
| 688 |
+
<div class="flex space-x-2">
|
| 689 |
+
<button id="refreshLogsBtn" class="px-3 py-2 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-md text-sm hover:bg-gray-300 dark:hover:bg-gray-600">
|
| 690 |
+
<i class="fas fa-sync-alt mr-1"></i> Refresh
|
| 691 |
+
</button>
|
| 692 |
+
<button id="clearLogsBtn" class="px-3 py-2 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-md text-sm hover:bg-gray-300 dark:hover:bg-gray-600">
|
| 693 |
+
<i class="fas fa-trash-alt mr-1"></i> Clear
|
| 694 |
+
</button>
|
| 695 |
+
</div>
|
| 696 |
+
</div>
|
| 697 |
+
<div class="p-6">
|
| 698 |
+
<div class="overflow-y-auto max-h-96">
|
| 699 |
+
<div class="space-y-4">
|
| 700 |
+
<div class="flex items-start">
|
| 701 |
+
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-blue-100 dark:bg-blue-900 flex items-center justify-center text-blue-600 dark:text-blue-300">
|
| 702 |
+
<i class="fas fa-info-circle"></i>
|
| 703 |
+
</div>
|
| 704 |
+
<div class="ml-4">
|
| 705 |
+
<p class="text-sm font-medium text-gray-800 dark:text-white">Broadcast sent successfully</p>
|
| 706 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">Message "Weekly update" delivered to 892 users</p>
|
| 707 |
+
<p class="text-xs text-gray-400 dark:text-gray-500">2023-06-15 14:30:22</p>
|
| 708 |
+
</div>
|
| 709 |
+
</div>
|
| 710 |
+
<div class="flex items-start">
|
| 711 |
+
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-green-100 dark:bg-green-900 flex items-center justify-center text-green-600 dark:text-green-300">
|
| 712 |
+
<i class="fas fa-check-circle"></i>
|
| 713 |
+
</div>
|
| 714 |
+
<div class="ml-4">
|
| 715 |
+
<p class="text-sm font-medium text-gray-800 dark:text-white">New user registered</p>
|
| 716 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">User @newuser (ID: 12350) joined the bot</p>
|
| 717 |
+
<p class="text-xs text-gray-400 dark:text-gray-500">2023-06-15 12:15:08</p>
|
| 718 |
+
</div>
|
| 719 |
+
</div>
|
| 720 |
+
<div class="flex items-start">
|
| 721 |
+
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-yellow-100 dark:bg-yellow-900 flex items-center justify-center text-yellow-600 dark:text-yellow-300">
|
| 722 |
+
<i class="fas fa-exclamation-triangle"></i>
|
| 723 |
+
</div>
|
| 724 |
+
<div class="ml-4">
|
| 725 |
+
<p class="text-sm font-medium text-gray-800 dark:text-white">Failed to send message to user</p>
|
| 726 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">User @problemuser (ID: 12345) blocked the bot</p>
|
| 727 |
+
<p class="text-xs text-gray-400 dark:text-gray-500">2023-06-15 10:42:36</p>
|
| 728 |
+
</div>
|
| 729 |
+
</div>
|
| 730 |
+
<div class="flex items-start">
|
| 731 |
+
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-red-100 dark:bg-red-900 flex items-center justify-center text-red-600 dark:text-red-300">
|
| 732 |
+
<i class="fas fa-times-circle"></i>
|
| 733 |
+
</div>
|
| 734 |
+
<div class="ml-4">
|
| 735 |
+
<p class="text-sm font-medium text-gray-800 dark:text-white">Error connecting to database</p>
|
| 736 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">Connection timeout after 5000ms</p>
|
| 737 |
+
<p class="text-xs text-gray-400 dark:text-gray-500">2023-06-15 09:30:15</p>
|
| 738 |
+
</div>
|
| 739 |
+
</div>
|
| 740 |
+
<div class="flex items-start">
|
| 741 |
+
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-blue-100 dark:bg-blue-900 flex items-center justify-center text-blue-600 dark:text-blue-300">
|
| 742 |
+
<i class="fas fa-info-circle"></i>
|
| 743 |
+
</div>
|
| 744 |
+
<div class="ml-4">
|
| 745 |
+
<p class="text-sm font-medium text-gray-800 dark:text-white">Bot settings updated</p>
|
| 746 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">Changed welcome message and broadcast schedule</p>
|
| 747 |
+
<p class="text-xs text-gray-400 dark:text-gray-500">2023-06-14 18:22:45</p>
|
| 748 |
+
</div>
|
| 749 |
+
</div>
|
| 750 |
+
<div class="flex items-start">
|
| 751 |
+
<div class="flex-shrink-0 h-10 w-10 rounded-full bg-green-100 dark:bg-green-900 flex items-center justify-center text-green-600 dark:text-green-300">
|
| 752 |
+
<i class="fas fa-check-circle"></i>
|
| 753 |
+
</div>
|
| 754 |
+
<div class="ml-4">
|
| 755 |
+
<p class="text-sm font-medium text-gray-800 dark:text-white">Database backup completed</p>
|
| 756 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">Backup file created: backup_20230614_120000.sql</p>
|
| 757 |
+
<p class="text-xs text-gray-400 dark:text-gray-500">2023-06-14 12:00:00</p>
|
| 758 |
+
</div>
|
| 759 |
+
</div>
|
| 760 |
+
</div>
|
| 761 |
+
</div>
|
| 762 |
+
</div>
|
| 763 |
+
</div>
|
| 764 |
+
</div>
|
| 765 |
+
</main>
|
| 766 |
+
</div>
|
| 767 |
+
</div>
|
| 768 |
+
|
| 769 |
+
<!-- Modals -->
|
| 770 |
+
<!-- Broadcast Confirmation Modal -->
|
| 771 |
+
<div id="broadcastConfirmModal" class="fixed inset-0 z-50 hidden overflow-y-auto">
|
| 772 |
+
<div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
| 773 |
+
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
|
| 774 |
+
<div class="absolute inset-0 bg-gray-500 dark:bg-gray-900 opacity-75"></div>
|
| 775 |
+
</div>
|
| 776 |
+
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
| 777 |
+
<div class="inline-block align-bottom bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full">
|
| 778 |
+
<div class="bg-white dark:bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
|
| 779 |
+
<div class="sm:flex sm:items-start">
|
| 780 |
+
<div class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-100 dark:bg-blue-900 sm:mx-0 sm:h-10 sm:w-10">
|
| 781 |
+
<i class="fas fa-exclamation-triangle text-blue-600 dark:text-blue-300"></i>
|
| 782 |
+
</div>
|
| 783 |
+
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
|
| 784 |
+
<h3 class="text-lg leading-6 font-medium text-gray-900 dark:text-white" id="modalTitle">Confirm Broadcast</h3>
|
| 785 |
+
<div class="mt-2">
|
| 786 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">Are you sure you want to send this broadcast to <span id="recipientCount" class="font-semibold">892</span> users?</p>
|
| 787 |
+
<div class="mt-4 bg-gray-100 dark:bg-gray-700 p-3 rounded-md">
|
| 788 |
+
<p class="text-sm font-medium text-gray-800 dark:text-white">Message Preview:</p>
|
| 789 |
+
<div id="confirmPreview" class="prose dark:prose-invert max-w-none mt-1 text-sm"></div>
|
| 790 |
+
</div>
|
| 791 |
+
</div>
|
| 792 |
+
</div>
|
| 793 |
+
</div>
|
| 794 |
+
</div>
|
| 795 |
+
<div class="bg-gray-50 dark:bg-gray-700 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
| 796 |
+
<button id="confirmSendBtn" type="button" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm">
|
| 797 |
+
<i class="fas fa-paper-plane mr-2"></i> Send Now
|
| 798 |
+
</button>
|
| 799 |
+
<button id="cancelSendBtn" type="button" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 dark:border-gray-600 shadow-sm px-4 py-2 bg-white dark:bg-gray-600 text-base font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
|
| 800 |
+
Cancel
|
| 801 |
+
</button>
|
| 802 |
+
</div>
|
| 803 |
+
</div>
|
| 804 |
+
</div>
|
| 805 |
+
</div>
|
| 806 |
+
|
| 807 |
+
<!-- Notification Toast -->
|
| 808 |
+
<div id="notificationToast" class="fixed bottom-4 right-4 z-50 space-y-2 hidden"></div>
|
| 809 |
+
|
| 810 |
+
<!-- Backend Connection Example (commented out) -->
|
| 811 |
+
<!--
|
| 812 |
+
<script>
|
| 813 |
+
// Example backend connection using fetch API
|
| 814 |
+
// Replace with your actual backend endpoint
|
| 815 |
+
|
| 816 |
+
const API_BASE_URL = 'https://your-api-endpoint.com';
|
| 817 |
+
|
| 818 |
+
async function login(username, password) {
|
| 819 |
+
try {
|
| 820 |
+
const response = await fetch(`${API_BASE_URL}/login`, {
|
| 821 |
+
method: 'POST',
|
| 822 |
+
headers: {
|
| 823 |
+
'Content-Type': 'application/json'
|
| 824 |
+
},
|
| 825 |
+
body: JSON.stringify({ username, password })
|
| 826 |
+
});
|
| 827 |
+
|
| 828 |
+
if (!response.ok) {
|
| 829 |
+
throw new Error('Login failed');
|
| 830 |
+
}
|
| 831 |
+
|
| 832 |
+
const data = await response.json();
|
| 833 |
+
return data.token; // Assuming the API returns a JWT token
|
| 834 |
+
} catch (error) {
|
| 835 |
+
console.error('Login error:', error);
|
| 836 |
+
showNotification('Login failed. Please try again.', 'error');
|
| 837 |
+
return null;
|
| 838 |
+
}
|
| 839 |
+
}
|
| 840 |
+
|
| 841 |
+
async function getStats() {
|
| 842 |
+
try {
|
| 843 |
+
const token = localStorage.getItem('authToken');
|
| 844 |
+
const response = await fetch(`${API_BASE_URL}/stats`, {
|
| 845 |
+
headers: {
|
| 846 |
+
'Authorization': `Bearer ${token}`
|
| 847 |
+
}
|
| 848 |
+
});
|
| 849 |
+
|
| 850 |
+
if (!response.ok) {
|
| 851 |
+
throw new Error('Failed to fetch stats');
|
| 852 |
+
}
|
| 853 |
+
|
| 854 |
+
return await response.json();
|
| 855 |
+
} catch (error) {
|
| 856 |
+
console.error('Stats fetch error:', error);
|
| 857 |
+
showNotification('Failed to load statistics', 'error');
|
| 858 |
+
return null;
|
| 859 |
+
}
|
| 860 |
+
}
|
| 861 |
+
|
| 862 |
+
// Add more API functions as needed...
|
| 863 |
+
</script>
|
| 864 |
+
-->
|
| 865 |
+
|
| 866 |
+
<script>
|
| 867 |
+
// DOM Elements
|
| 868 |
+
const loginScreen = document.getElementById('loginScreen');
|
| 869 |
+
const adminPanel = document.getElementById('adminPanel');
|
| 870 |
+
const usernameInput = document.getElementById('username');
|
| 871 |
+
const passwordInput = document.getElementById('password');
|
| 872 |
+
const loginBtn = document.getElementById('loginBtn');
|
| 873 |
+
const logoutBtn = document.getElementById('logoutBtn');
|
| 874 |
+
const themeToggle = document.getElementById('themeToggle');
|
| 875 |
+
const themeToggleBtn = document.getElementById('themeToggleBtn');
|
| 876 |
+
const themeIcon = document.getElementById('themeIcon');
|
| 877 |
+
const sidebarToggle = document.getElementById('sidebarToggle');
|
| 878 |
+
const pageTitle = document.getElementById('pageTitle');
|
| 879 |
+
|
| 880 |
+
// Content sections
|
| 881 |
+
const dashboardContent = document.getElementById('dashboardContent');
|
| 882 |
+
const broadcastContent = document.getElementById('broadcastContent');
|
| 883 |
+
const usersContent = document.getElementById('usersContent');
|
| 884 |
+
const settingsContent = document.getElementById('settingsContent');
|
| 885 |
+
const logsContent = document.getElementById('logsContent');
|
| 886 |
+
|
| 887 |
+
// Navigation links
|
| 888 |
+
const dashboardLink = document.getElementById('dashboardLink');
|
| 889 |
+
const broadcastLink = document.getElementById('broadcastLink');
|
| 890 |
+
const usersLink = document.getElementById('usersLink');
|
| 891 |
+
const settingsLink = document.getElementById('settingsLink');
|
| 892 |
+
const logsLink = document.getElementById('logsLink');
|
| 893 |
+
|
| 894 |
+
// Broadcast elements
|
| 895 |
+
const broadcastMessage = document.getElementById('broadcastMessage');
|
| 896 |
+
const previewBtn = document.getElementById('previewBtn');
|
| 897 |
+
const clearBtn = document.getElementById('clearBtn');
|
| 898 |
+
const previewContainer = document.getElementById('previewContainer');
|
| 899 |
+
const messagePreview = document.getElementById('messagePreview');
|
| 900 |
+
const sendBroadcastBtn = document.getElementById('sendBroadcastBtn');
|
| 901 |
+
const broadcastConfirmModal = document.getElementById('broadcastConfirmModal');
|
| 902 |
+
const confirmSendBtn = document.getElementById('confirmSendBtn');
|
| 903 |
+
const cancelSendBtn = document.getElementById('cancelSendBtn');
|
| 904 |
+
const confirmPreview = document.getElementById('confirmPreview');
|
| 905 |
+
const recipientCount = document.getElementById('recipientCount');
|
| 906 |
+
|
| 907 |
+
// User management elements
|
| 908 |
+
const userSearch = document.getElementById('userSearch');
|
| 909 |
+
const exportUsersBtn = document.getElementById('exportUsersBtn');
|
| 910 |
+
|
| 911 |
+
// Settings elements
|
| 912 |
+
const botStatusToggle = document.getElementById('botStatusToggle');
|
| 913 |
+
const apiToken = document.getElementById('apiToken');
|
| 914 |
+
const showTokenBtn = document.getElementById('showTokenBtn');
|
| 915 |
+
const autoBroadcastToggle = document.getElementById('autoBroadcastToggle');
|
| 916 |
+
const broadcastTime = document.getElementById('broadcastTime');
|
| 917 |
+
const broadcastFrequency = document.getElementById('broadcastFrequency');
|
| 918 |
+
const welcomeMessage = document.getElementById('welcomeMessage');
|
| 919 |
+
const saveSettingsBtn = document.getElementById('saveSettingsBtn');
|
| 920 |
+
|
| 921 |
+
// Logs elements
|
| 922 |
+
const refreshLogsBtn = document.getElementById('refreshLogsBtn');
|
| 923 |
+
const clearLogsBtn = document.getElementById('clearLogsBtn');
|
| 924 |
+
|
| 925 |
+
// Notification elements
|
| 926 |
+
const notificationToast = document.getElementById('notificationToast');
|
| 927 |
+
const notificationsBtn = document.getElementById('notificationsBtn');
|
| 928 |
+
const notificationBadge = document.getElementById('notificationBadge');
|
| 929 |
+
|
| 930 |
+
// Chart
|
| 931 |
+
let userGrowthChart;
|
| 932 |
+
|
| 933 |
+
// Initialize the page
|
| 934 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 935 |
+
// Check for saved theme preference
|
| 936 |
+
if (localStorage.getItem('darkMode') === 'true') {
|
| 937 |
+
document.documentElement.classList.add('dark');
|
| 938 |
+
themeToggle.checked = true;
|
| 939 |
+
themeIcon.className = 'fas fa-sun';
|
| 940 |
+
}
|
| 941 |
+
|
| 942 |
+
// Initialize chart
|
| 943 |
+
initUserGrowthChart();
|
| 944 |
+
|
| 945 |
+
// Set up event listeners
|
| 946 |
+
setupEventListeners();
|
| 947 |
+
});
|
| 948 |
+
|
| 949 |
+
function setupEventListeners() {
|
| 950 |
+
// Login
|
| 951 |
+
loginBtn.addEventListener('click', handleLogin);
|
| 952 |
+
passwordInput.addEventListener('keypress', function(e) {
|
| 953 |
+
if (e.key === 'Enter') handleLogin();
|
| 954 |
+
});
|
| 955 |
+
|
| 956 |
+
// Logout
|
| 957 |
+
logoutBtn.addEventListener('click', handleLogout);
|
| 958 |
+
|
| 959 |
+
// Theme toggle
|
| 960 |
+
themeToggle.addEventListener('change', toggleDarkMode);
|
| 961 |
+
themeToggleBtn.addEventListener('click', toggleDarkMode);
|
| 962 |
+
|
| 963 |
+
// Sidebar toggle for mobile
|
| 964 |
+
sidebarToggle.addEventListener('click', function() {
|
| 965 |
+
document.querySelector('.fixed.inset-y-0.left-0').classList.toggle('-translate-x-full');
|
| 966 |
+
});
|
| 967 |
+
|
| 968 |
+
// Navigation links
|
| 969 |
+
dashboardLink.addEventListener('click', function(e) {
|
| 970 |
+
e.preventDefault();
|
| 971 |
+
showSection('dashboard');
|
| 972 |
+
});
|
| 973 |
+
broadcastLink.addEventListener('click', function(e) {
|
| 974 |
+
e.preventDefault();
|
| 975 |
+
showSection('broadcast');
|
| 976 |
+
});
|
| 977 |
+
usersLink.addEventListener('click', function(e) {
|
| 978 |
+
e.preventDefault();
|
| 979 |
+
showSection('users');
|
| 980 |
+
});
|
| 981 |
+
settingsLink.addEventListener('click', function(e) {
|
| 982 |
+
e.preventDefault();
|
| 983 |
+
showSection('settings');
|
| 984 |
+
});
|
| 985 |
+
logsLink.addEventListener('click', function(e) {
|
| 986 |
+
e.preventDefault();
|
| 987 |
+
showSection('logs');
|
| 988 |
+
});
|
| 989 |
+
|
| 990 |
+
// Broadcast functionality
|
| 991 |
+
previewBtn.addEventListener('click', previewMessage);
|
| 992 |
+
clearBtn.addEventListener('click', clearMessage);
|
| 993 |
+
sendBroadcastBtn.addEventListener('click', confirmBroadcast);
|
| 994 |
+
confirmSendBtn.addEventListener('click', sendBroadcast);
|
| 995 |
+
cancelSendBtn.addEventListener('click', function() {
|
| 996 |
+
broadcastConfirmModal.classList.add('hidden');
|
| 997 |
+
});
|
| 998 |
+
|
| 999 |
+
// User management
|
| 1000 |
+
exportUsersBtn.addEventListener('click', exportUsers);
|
| 1001 |
+
|
| 1002 |
+
// Settings
|
| 1003 |
+
showTokenBtn.addEventListener('click', toggleTokenVisibility);
|
| 1004 |
+
saveSettingsBtn.addEventListener('click', saveSettings);
|
| 1005 |
+
|
| 1006 |
+
// Logs
|
| 1007 |
+
refreshLogsBtn.addEventListener('click', refreshLogs);
|
| 1008 |
+
clearLogsBtn.addEventListener('click', clearLogs);
|
| 1009 |
+
|
| 1010 |
+
// Notifications
|
| 1011 |
+
notificationsBtn.addEventListener('click', showNotifications);
|
| 1012 |
+
}
|
| 1013 |
+
|
| 1014 |
+
function handleLogin() {
|
| 1015 |
+
const username = usernameInput.value.trim();
|
| 1016 |
+
const password = passwordInput.value.trim();
|
| 1017 |
+
|
| 1018 |
+
if (!username || !password) {
|
| 1019 |
+
showNotification('Please enter both username and password', 'error');
|
| 1020 |
+
return;
|
| 1021 |
+
}
|
| 1022 |
+
|
| 1023 |
+
// In a real app, you would call your backend API here
|
| 1024 |
+
// For demo purposes, we'll just check for non-empty credentials
|
| 1025 |
+
showNotification('Login successful!', 'success');
|
| 1026 |
+
|
| 1027 |
+
// Hide login screen and show admin panel
|
| 1028 |
+
loginScreen.classList.add('hidden');
|
| 1029 |
+
adminPanel.classList.remove('hidden');
|
| 1030 |
+
|
| 1031 |
+
// For demo, set some fake stats
|
| 1032 |
+
document.getElementById('totalUsers').textContent = '1,254';
|
| 1033 |
+
document.getElementById('activeUsers').textContent = '892';
|
| 1034 |
+
document.getElementById('inactiveUsers').textContent = '362';
|
| 1035 |
+
document.getElementById('broadcastsSent').textContent = '47';
|
| 1036 |
+
|
| 1037 |
+
// Update chart with fake data
|
| 1038 |
+
updateChartWithRandomData();
|
| 1039 |
+
|
| 1040 |
+
// Show notifications badge
|
| 1041 |
+
notificationBadge.classList.remove('hidden');
|
| 1042 |
+
notificationBadge.textContent = '3';
|
| 1043 |
+
}
|
| 1044 |
+
|
| 1045 |
+
function handleLogout() {
|
| 1046 |
+
// In a real app, you would call your backend API here
|
| 1047 |
+
// For demo, just show login screen again
|
| 1048 |
+
adminPanel.classList.add('hidden');
|
| 1049 |
+
loginScreen.classList.remove('hidden');
|
| 1050 |
+
|
| 1051 |
+
// Clear inputs
|
| 1052 |
+
usernameInput.value = '';
|
| 1053 |
+
passwordInput.value = '';
|
| 1054 |
+
|
| 1055 |
+
showNotification('You have been logged out', 'info');
|
| 1056 |
+
}
|
| 1057 |
+
|
| 1058 |
+
function toggleDarkMode() {
|
| 1059 |
+
const isDarkMode = document.documentElement.classList.toggle('dark');
|
| 1060 |
+
localStorage.setItem('darkMode', isDarkMode.toString());
|
| 1061 |
+
|
| 1062 |
+
if (isDarkMode) {
|
| 1063 |
+
themeIcon.className = 'fas fa-sun';
|
| 1064 |
+
themeToggle.checked = true;
|
| 1065 |
+
} else {
|
| 1066 |
+
themeIcon.className = 'fas fa-moon';
|
| 1067 |
+
themeToggle.checked = false;
|
| 1068 |
+
}
|
| 1069 |
+
}
|
| 1070 |
+
|
| 1071 |
+
function showSection(section) {
|
| 1072 |
+
// Hide all sections
|
| 1073 |
+
dashboardContent.classList.add('hidden');
|
| 1074 |
+
broadcastContent.classList.add('hidden');
|
| 1075 |
+
usersContent.classList.add('hidden');
|
| 1076 |
+
settingsContent.classList.add('hidden');
|
| 1077 |
+
logsContent.classList.add('hidden');
|
| 1078 |
+
|
| 1079 |
+
// Remove active class from all nav links
|
| 1080 |
+
document.querySelectorAll('nav a').forEach(link => {
|
| 1081 |
+
link.classList.remove('bg-blue-100', 'dark:bg-gray-700', 'text-blue-700', 'dark:text-white');
|
| 1082 |
+
link.classList.add('text-gray-700', 'dark:text-gray-300', 'hover:bg-gray-100', 'dark:hover:bg-gray-700');
|
| 1083 |
+
});
|
| 1084 |
+
|
| 1085 |
+
// Show selected section and update active nav link
|
| 1086 |
+
switch(section) {
|
| 1087 |
+
case 'dashboard':
|
| 1088 |
+
dashboardContent.classList.remove('hidden');
|
| 1089 |
+
dashboardLink.classList.remove('text-gray-700', 'dark:text-gray-300', 'hover:bg-gray-100', 'dark:hover:bg-gray-700');
|
| 1090 |
+
dashboardLink.classList.add('bg-blue-100', 'dark:bg-gray-700', 'text-blue-700', 'dark:text-white');
|
| 1091 |
+
pageTitle.textContent = 'Dashboard';
|
| 1092 |
+
break;
|
| 1093 |
+
case 'broadcast':
|
| 1094 |
+
broadcastContent.classList.remove('hidden');
|
| 1095 |
+
broadcastLink.classList.remove('text-gray-700', 'dark:text-gray-300', 'hover:bg-gray-100', 'dark:hover:bg-gray-700');
|
| 1096 |
+
broadcastLink.classList.add('bg-blue-100', 'dark:bg-gray-700', 'text-blue-700', 'dark:text-white');
|
| 1097 |
+
pageTitle.textContent = 'Broadcast Messages';
|
| 1098 |
+
break;
|
| 1099 |
+
case 'users':
|
| 1100 |
+
usersContent.classList.remove('hidden');
|
| 1101 |
+
usersLink.classList.remove('text-gray-700', 'dark:text-gray-300', 'hover:bg-gray-100', 'dark:hover:bg-gray-700');
|
| 1102 |
+
usersLink.classList.add('bg-blue-100', 'dark:bg-gray-700', 'text-blue-700', 'dark:text-white');
|
| 1103 |
+
pageTitle.textContent = 'User Management';
|
| 1104 |
+
break;
|
| 1105 |
+
case 'settings':
|
| 1106 |
+
settingsContent.classList.remove('hidden');
|
| 1107 |
+
settingsLink.classList.remove('text-gray-700', 'dark:text-gray-300', 'hover:bg-gray-100', 'dark:hover:bg-gray-700');
|
| 1108 |
+
settingsLink.classList.add('bg-blue-100', 'dark:bg-gray-700', 'text-blue-700', 'dark:text-white');
|
| 1109 |
+
pageTitle.textContent = 'Bot Settings';
|
| 1110 |
+
break;
|
| 1111 |
+
case 'logs':
|
| 1112 |
+
logsContent.classList.remove('hidden');
|
| 1113 |
+
logsLink.classList.remove('text-gray-700', 'dark:text-gray-300', 'hover:bg-gray-100', 'dark:hover:bg-gray-700');
|
| 1114 |
+
logsLink.classList.add('bg-blue-100', 'dark:bg-gray-700', 'text-blue-700', 'dark:text-white');
|
| 1115 |
+
pageTitle.textContent = 'System Logs';
|
| 1116 |
+
break;
|
| 1117 |
+
}
|
| 1118 |
+
}
|
| 1119 |
+
|
| 1120 |
+
function initUserGrowthChart() {
|
| 1121 |
+
const ctx = document.getElementById('userGrowthChart').getContext('2d');
|
| 1122 |
+
|
| 1123 |
+
userGrowthChart = new Chart(ctx, {
|
| 1124 |
+
type: 'line',
|
| 1125 |
+
data: {
|
| 1126 |
+
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
|
| 1127 |
+
datasets: [{
|
| 1128 |
+
label: 'Total Users',
|
| 1129 |
+
data: [320, 450, 600, 750, 900, 1254],
|
| 1130 |
+
borderColor: 'rgb(59, 130, 246)',
|
| 1131 |
+
backgroundColor: 'rgba(59, 130, 246, 0.1)',
|
| 1132 |
+
tension: 0.3,
|
| 1133 |
+
fill: true
|
| 1134 |
+
}]
|
| 1135 |
+
},
|
| 1136 |
+
options: {
|
| 1137 |
+
responsive: true,
|
| 1138 |
+
plugins: {
|
| 1139 |
+
legend: {
|
| 1140 |
+
position: 'top',
|
| 1141 |
+
labels
|
| 1142 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=billivilli/nbnb" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 1143 |
+
</html>
|