Spaces:
Running
Running
File size: 47,405 Bytes
b1355f8 | 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 33 34 35 36 37 38 39 40 41 42 43 44 45 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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Telegram Bot Manager & Server Monitor</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#4361ee',
secondary: '#3f37c9',
accent: '#4cc9f0',
dark: '#1d3557',
success: '#2ec4b6',
warning: '#ff9f1c',
danger: '#e71d36',
light: '#f8f9fa'
}
}
}
}
</script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
body {
font-family: 'Inter', sans-serif;
background-color: #f5f7fb;
}
.sidebar {
transition: all 0.3s ease;
}
.sidebar.collapsed {
width: 80px;
}
.sidebar.collapsed .sidebar-text {
display: none;
}
.sidebar.collapsed .sidebar-icon {
margin: 0 auto;
}
.card {
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
border-radius: 12px;
transition: all 0.3s ease;
}
.card:hover {
transform: translateY(-3px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.status-indicator {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 50%;
margin-right: 8px;
}
.status-up {
background-color: #10b981;
}
.status-down {
background-color: #ef4444;
}
.status-warning {
background-color: #f59e0b;
}
.pulse {
animation: pulse 2s infinite;
}
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
}
70% {
box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
}
}
.log-entry {
border-left: 3px solid #4361ee;
padding-left: 12px;
margin-bottom: 12px;
}
.log-entry.warning {
border-left-color: #f59e0b;
}
.log-entry.error {
border-left-color: #ef4444;
}
.service-card {
transition: all 0.2s ease;
}
.service-card:hover {
transform: translateY(-2px);
}
.role-badge {
padding: 2px 8px;
border-radius: 20px;
font-size: 0.75rem;
font-weight: 500;
}
.admin-badge {
background-color: #fee2e2;
color: #dc2626;
}
.user-badge {
background-color: #dbeafe;
color: #2563eb;
}
.guest-badge {
background-color: #fef3c7;
color: #d97706;
}
.chart-container {
height: 200px;
}
.activity-indicator {
position: relative;
}
.activity-indicator::after {
content: "";
position: absolute;
top: 0;
right: 0;
width: 10px;
height: 10px;
background-color: #10b981;
border-radius: 50%;
animation: pulse 1.5s infinite;
}
</style>
</head>
<body class="bg-gray-50">
<!-- Login Page -->
<div id="login-page" class="min-h-screen flex items-center justify-center bg-gradient-to-br from-primary to-secondary p-4">
<div class="bg-white rounded-2xl shadow-xl w-full max-w-md overflow-hidden">
<div class="p-8">
<div class="text-center mb-8">
<div class="mx-auto bg-gray-200 border-2 border-dashed rounded-xl w-16 h-16 flex items-center justify-center mb-4">
<i class="fas fa-robot text-2xl text-primary"></i>
</div>
<h1 class="text-3xl font-bold text-gray-800">Bot Manager</h1>
<p class="text-gray-600 mt-2">Sign in to your dashboard</p>
</div>
<form id="login-form" class="space-y-6">
<div>
<label for="username" class="block text-sm font-medium text-gray-700 mb-1">Username</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-user text-gray-400"></i>
</div>
<input type="text" id="username" class="block w-full pl-10 pr-3 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-primary" placeholder="Enter your username">
</div>
</div>
<div>
<label for="password" class="block text-sm font-medium text-gray-700 mb-1">Password</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-lock text-gray-400"></i>
</div>
<input type="password" id="password" class="block w-full pl-10 pr-3 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-primary" placeholder="Enter your password">
</div>
</div>
<div class="flex items-center justify-between">
<div class="flex items-center">
<input id="remember-me" name="remember-me" type="checkbox" class="h-4 w-4 text-primary focus:ring-primary border-gray-300 rounded">
<label for="remember-me" class="ml-2 block text-sm text-gray-700">Remember me</label>
</div>
<div class="text-sm">
<a href="#" class="font-medium text-primary hover:text-secondary">Forgot password?</a>
</div>
</div>
<div>
<button type="submit" class="w-full flex justify-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-primary hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary transition duration-300">
Sign in
</button>
</div>
</form>
<div class="mt-6">
<div class="relative">
<div class="absolute inset-0 flex items-center">
<div class="w-full border-t border-gray-300"></div>
</div>
<div class="relative flex justify-center text-sm">
<span class="px-2 bg-white text-gray-500">Or continue with</span>
</div>
</div>
<div class="mt-6 grid grid-cols-2 gap-3">
<button class="w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-lg shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
<i class="fab fa-google text-red-500 mr-2"></i>
Google
</button>
<button class="w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-lg shadow-sm bg-white text-sm font-medium text-gray-500 hover:bg-gray-50">
<i class="fab fa-github text-gray-800 mr-2"></i>
GitHub
</button>
</div>
</div>
</div>
<div class="bg-gray-50 px-8 py-4 text-center">
<p class="text-xs text-gray-600">
© 2023 Bot Manager Dashboard. All rights reserved.
</p>
</div>
</div>
</div>
<!-- Main Dashboard -->
<div id="dashboard" class="hidden min-h-screen flex flex-col">
<!-- Header -->
<header class="bg-white shadow-sm z-10">
<div class="flex items-center justify-between px-6 py-4">
<div class="flex items-center">
<button id="sidebar-toggle" class="mr-4 text-gray-500 hover:text-gray-700 focus:outline-none">
<i class="fas fa-bars text-xl"></i>
</button>
<h1 class="text-xl font-bold text-gray-800">Telegram Bot Manager</h1>
</div>
<div class="flex items-center space-x-4">
<div class="relative">
<button class="text-gray-500 hover:text-gray-700 relative">
<i class="fas fa-bell text-xl"></i>
<span class="absolute top-0 right-0 inline-flex items-center justify-center px-2 py-1 text-xs font-bold leading-none text-white transform translate-x-1/2 -translate-y-1/2 bg-red-500 rounded-full">3</span>
</button>
</div>
<div class="flex items-center">
<div class="mr-3 text-right">
<p class="text-sm font-medium text-gray-800" id="user-display-name">John Doe</p>
<p class="text-xs text-gray-500" id="user-role">Administrator</p>
</div>
<div class="relative">
<img class="h-10 w-10 rounded-full" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="User profile">
</div>
</div>
</div>
</div>
</header>
<div class="flex flex-1 overflow-hidden">
<!-- Sidebar -->
<aside id="sidebar" class="sidebar w-64 bg-white shadow-md flex flex-col">
<nav class="flex-1 px-4 py-6">
<ul class="space-y-2">
<li>
<a href="#" class="flex items-center p-3 text-gray-700 rounded-lg hover:bg-gray-100 active">
<i class="fas fa-home sidebar-icon text-primary text-lg mr-3"></i>
<span class="sidebar-text font-medium">Dashboard</span>
</a>
</li>
<li>
<a href="#" class="flex items-center p-3 text-gray-700 rounded-lg hover:bg-gray-100">
<i class="fas fa-robot sidebar-icon text-primary text-lg mr-3"></i>
<span class="sidebar-text font-medium">Bot Management</span>
</a>
</li>
<li>
<a href="#" class="flex items-center p-3 text-gray-700 rounded-lg hover:bg-gray-100">
<i class="fas fa-server sidebar-icon text-primary text-lg mr-3"></i>
<span class="sidebar-text font-medium">Server Status</span>
</a>
</li>
<li>
<a href="#" class="flex items-center p-3 text-gray-700 rounded-lg hover:bg-gray-100">
<i class="fas fa-cogs sidebar-icon text-primary text-lg mr-3"></i>
<span class="sidebar-text font-medium">Services</span>
</a>
</li>
<li>
<a href="#" class="flex items-center p-3 text-gray-700 rounded-lg hover:bg-gray-100">
<i class="fas fa-chart-line sidebar-icon text-primary text-lg mr-3"></i>
<span class="sidebar-text font-medium">Reports</span>
</a>
</li>
<li>
<a href="#" class="flex items-center p-3 text-gray-700 rounded-lg hover:bg-gray-100">
<i class="fas fa-users sidebar-icon text-primary text-lg mr-3"></i>
<span class="sidebar-text font-medium">Users</span>
</a>
</li>
<li>
<a href="#" class="flex items-center p-3 text-gray-700 rounded-lg hover:bg-gray-100">
<i class="fas fa-cog sidebar-icon text-primary text-lg mr-3"></i>
<span class="sidebar-text font-medium">Settings</span>
</a>
</li>
</ul>
</nav>
<div class="p-4 border-t border-gray-200">
<button id="logout-btn" class="w-full flex items-center p-3 text-gray-700 rounded-lg hover:bg-gray-100">
<i class="fas fa-sign-out-alt sidebar-icon text-danger text-lg mr-3"></i>
<span class="sidebar-text font-medium">Logout</span>
</button>
</div>
</aside>
<!-- Main Content -->
<main class="flex-1 overflow-y-auto p-6 bg-gray-50">
<div class="mb-6">
<h2 class="text-2xl font-bold text-gray-800">Dashboard Overview</h2>
<p class="text-gray-600">Welcome back! Here's what's happening with your bot and servers.</p>
</div>
<!-- Stats Cards -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
<div class="card bg-white p-6">
<div class="flex items-center">
<div class="p-3 rounded-lg bg-blue-100 text-primary mr-4">
<i class="fas fa-robot text-xl"></i>
</div>
<div>
<p class="text-gray-500 text-sm">Bot Status</p>
<div class="flex items-center mt-1">
<span class="status-indicator status-up pulse"></span>
<span class="text-lg font-semibold">Running</span>
</div>
</div>
</div>
</div>
<div class="card bg-white p-6">
<div class="flex items-center">
<div class="p-3 rounded-lg bg-green-100 text-success mr-4">
<i class="fas fa-server text-xl"></i>
</div>
<div>
<p class="text-gray-500 text-sm">Servers</p>
<p class="text-2xl font-bold">4</p>
</div>
</div>
</div>
<div class="card bg-white p-6">
<div class="flex items-center">
<div class="p-3 rounded-lg bg-yellow-100 text-warning mr-4">
<i class="fas fa-exclamation-circle text-xl"></i>
</div>
<div>
<p class="text-gray-500 text-sm">Alerts</p>
<p class="text-2xl font-bold">2</p>
</div>
</div>
</div>
<div class="card bg-white p-6">
<div class="flex items-center">
<div class="p-3 rounded-lg bg-purple-100 text-accent mr-4">
<i class="fas fa-users text-xl"></i>
</div>
<div>
<p class="text-gray-500 text-sm">Active Users</p>
<p class="text-2xl font-bold">18</p>
</div>
</div>
</div>
</div>
<!-- Server Status and Bot Activity -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
<!-- Server Status -->
<div class="card bg-white p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-semibold text-gray-800">Server Status</h3>
<button class="text-sm text-primary hover:text-secondary">
<i class="fas fa-sync-alt mr-1"></i> Refresh
</button>
</div>
<div class="space-y-4">
<div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
<div class="flex items-center">
<div class="status-indicator status-up mr-3"></div>
<span class="font-medium">Nginx</span>
</div>
<span class="text-sm text-gray-500">Running</span>
</div>
<div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
<div class="flex items-center">
<div class="status-indicator status-up mr-3"></div>
<span class="font-medium">Docker</span>
</div>
<span class="text-sm text-gray-500">Running</span>
</div>
<div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
<div class="flex items-center">
<div class="status-indicator status-warning mr-3"></div>
<span class="font-medium">Database</span>
</div>
<span class="text-sm text-gray-500">Degraded</span>
</div>
<div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
<div class="flex items-center">
<div class="status-indicator status-up mr-3"></div>
<span class="font-medium">Redis</span>
</div>
<span class="text-sm text-gray-500">Running</span>
</div>
</div>
</div>
<!-- Bot Activity -->
<div class="card bg-white p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-semibold text-gray-800">Bot Activity</h3>
<button class="text-sm text-primary hover:text-secondary">
View All
</button>
</div>
<div class="space-y-4 max-h-80 overflow-y-auto">
<div class="log-entry">
<p class="text-sm text-gray-800">User <span class="font-medium">Alex Johnson</span> sent command <span class="font-mono bg-gray-100 px-1 rounded">/status</span></p>
<p class="text-xs text-gray-500 mt-1">2 minutes ago</p>
</div>
<div class="log-entry warning">
<p class="text-sm text-gray-800">Warning: High CPU usage detected on server <span class="font-medium">prod-01</span></p>
<p class="text-xs text-gray-500 mt-1">5 minutes ago</p>
</div>
<div class="log-entry">
<p class="text-sm text-gray-800">Bot response sent to <span class="font-medium">@travelbot</span> channel</p>
<p class="text-xs text-gray-500 mt-1">8 minutes ago</p>
</div>
<div class="log-entry error">
<p class="text-sm text-gray-800">Error: Failed to connect to database</p>
<p class="text-xs text-gray-500 mt-1">12 minutes ago</p>
</div>
<div class="log-entry">
<p class="text-sm text-gray-800">User <span class="font-medium">Sarah Miller</span> sent command <span class="font-mono bg-gray-100 px-1 rounded">/help</span></p>
<p class="text-xs text-gray-500 mt-1">15 minutes ago</p>
</div>
<div class="log-entry">
<p class="text-sm text-gray-800">Scheduled report generated and sent</p>
<p class="text-xs text-gray-500 mt-1">22 minutes ago</p>
</div>
</div>
</div>
</div>
<!-- Services and Send Command -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
<!-- Services Control -->
<div class="card bg-white p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-semibold text-gray-800">Server Services</h3>
<button class="text-sm text-primary hover:text-secondary">
Manage All
</button>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="service-card bg-gray-50 p-4 rounded-lg border border-gray-200">
<div class="flex justify-between items-start">
<div>
<h4 class="font-medium">Nginx</h4>
<p class="text-sm text-gray-500">Web Server</p>
</div>
<span class="status-indicator status-up"></span>
</div>
<div class="flex space-x-2 mt-3">
<button class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 py-1 px-2 rounded">Restart</button>
<button class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 py-1 px-2 rounded">Stop</button>
</div>
</div>
<div class="service-card bg-gray-50 p-4 rounded-lg border border-gray-200">
<div class="flex justify-between items-start">
<div>
<h4 class="font-medium">Docker</h4>
<p class="text-sm text-gray-500">Container Engine</p>
</div>
<span class="status-indicator status-up"></span>
</div>
<div class="flex space-x-2 mt-3">
<button class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 py-1 px-2 rounded">Restart</button>
<button class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 py-1 px-2 rounded">Stop</button>
</div>
</div>
<div class="service-card bg-gray-50 p-4 rounded-lg border border-gray-200">
<div class="flex justify-between items-start">
<div>
<h4 class="font-medium">PostgreSQL</h4>
<p class="text-sm text-gray-500">Database</p>
</div>
<span class="status-indicator status-warning"></span>
</div>
<div class="flex space-x-2 mt-3">
<button class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 py-1 px-2 rounded">Restart</button>
<button class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 py-1 px-2 rounded">Stop</button>
</div>
</div>
<div class="service-card bg-gray-50 p-4 rounded-lg border border-gray-200">
<div class="flex justify-between items-start">
<div>
<h4 class="font-medium">Redis</h4>
<p class="text-sm text-gray-500">Cache</p>
</div>
<span class="status-indicator status-up"></span>
</div>
<div class="flex space-x-2 mt-3">
<button class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 py-1 px-2 rounded">Restart</button>
<button class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 py-1 px-2 rounded">Stop</button>
</div>
</div>
</div>
</div>
<!-- Send Command -->
<div class="card bg-white p-6">
<h3 class="text-lg font-semibold text-gray-800 mb-4">Send Command to Bot</h3>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Command</label>
<div class="flex">
<input type="text" class="block w-full px-4 py-2 border border-gray-300 rounded-l-lg focus:ring-primary focus:border-primary" placeholder="/command [arguments]">
<button class="bg-primary hover:bg-secondary text-white px-4 py-2 rounded-r-lg transition duration-300">
Send
</button>
</div>
<p class="mt-1 text-xs text-gray-500">Example: /broadcast Hello everyone!</p>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Target</label>
<select class="block w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-primary focus:border-primary">
<option>All Users</option>
<option>Active Users</option>
<option>Specific Group</option>
<option>Channel</option>
</select>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Message</label>
<textarea class="block w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-primary focus:border-primary" rows="3" placeholder="Enter your message here..."></textarea>
</div>
<button class="w-full bg-primary hover:bg-secondary text-white py-2 px-4 rounded-lg transition duration-300">
Send Command
</button>
</div>
</div>
<!-- Users and Reports -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
<!-- Authorized Users -->
<div class="card bg-white p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-semibold text-gray-800">Authorized Users</h3>
<button class="text-sm bg-primary hover:bg-secondary text-white py-1 px-3 rounded-lg transition duration-300">
Add User
</button>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">User</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Role</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<img class="h-10 w-10 rounded-full" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="">
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">John Doe</div>
<div class="text-sm text-gray-500">john@example.com</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="role-badge admin-badge">Admin</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">
Active
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-primary hover:text-secondary mr-3">
<i class="fas fa-edit"></i>
</button>
<button class="text-danger hover:text-red-700">
<i class="fas fa-trash"></i>
</button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<img class="h-10 w-10 rounded-full" src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="">
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">Jane Smith</div>
<div class="text-sm text-gray-500">jane@example.com</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="role-badge user-badge">User</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">
Active
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-primary hover:text-secondary mr-3">
<i class="fas fa-edit"></i>
</button>
<button class="text-danger hover:text-red-700">
<i class="fas fa-trash"></i>
</button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<img class="h-10 w-10 rounded-full" src="https://images.unsplash.com/photo-1500648767791-00dcc994a43e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt="">
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">Robert Johnson</div>
<div class="text-sm text-gray-500">robert@example.com</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="role-badge guest-badge">Guest</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">
Pending
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-primary hover:text-secondary mr-3">
<i class="fas fa-edit"></i>
</button>
<button class="text-danger hover:text-red-700">
<i class="fas fa-trash"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Reports -->
<div class="card bg-white p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-semibold text-gray-800">Scheduled Reports</h3>
<button class="text-sm bg-primary hover:bg-secondary text-white py-1 px-3 rounded-lg transition duration-300">
Schedule Report
</button>
</div>
<div class="space-y-4">
<div class="p-4 border border-gray-200 rounded-lg">
<div class="flex justify-between items-start">
<div>
<h4 class="font-medium">Daily Server Status</h4>
<p class="text-sm text-gray-500">Every day at 9:00 AM</p>
</div>
<span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded">Active</span>
</div>
<div class="flex space-x-2 mt-3">
<button class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 py-1 px-2 rounded">Edit</button>
<button class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 py-1 px-2 rounded">Pause</button>
</div>
</div>
<div class="p-4 border border-gray-200 rounded-lg">
<div class="flex justify-between items-start">
<div>
<h4 class="font-medium">Weekly Bot Analytics</h4>
<p class="text-sm text-gray-500">Every Monday at 10:00 AM</p>
</div>
<span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded">Active</span>
</div>
<div class="flex space-x-2 mt-3">
<button class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 py-1 px-2 rounded">Edit</button>
<button class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 py-1 px-2 rounded">Pause</button>
</div>
</div>
<div class="p-4 border border-gray-200 rounded-lg">
<div class="flex justify-between items-start">
<div>
<h4 class="font-medium">Monthly Usage Report</h4>
<p class="text-sm text-gray-500">First day of every month</p>
</div>
<span class="text-xs bg-yellow-100 text-yellow-800 px-2 py-1 rounded">Paused</span>
</div>
<div class="flex space-x-2 mt-3">
<button class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 py-1 px-2 rounded">Edit</button>
<button class="text-xs bg-gray-200 hover:bg-gray-300 text-gray-800 py-1 px-2 rounded">Resume</button>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
</div>
<script>
// Mock user data
const users = {
admin: {
username: "admin",
password: "admin123", // In real app, this would be hashed
role: "Administrator",
name: "Admin User"
},
user: {
username: "user",
password: "user123",
role: "User",
name: "Regular User"
},
guest: {
username: "guest",
password: "guest123",
role: "Guest",
name: "Guest User"
}
};
// DOM Elements
const loginPage = document.getElementById('login-page');
const dashboard = document.getElementById('dashboard');
const loginForm = document.getElementById('login-form');
const logoutBtn = document.getElementById('logout-btn');
const sidebarToggle = document.getElementById('sidebar-toggle');
const sidebar = document.getElementById('sidebar');
const userDisplayName = document.getElementById('user-display-name');
const userRole = document.getElementById('user-role');
// Login functionality
loginForm.addEventListener('submit', function(e) {
e.preventDefault();
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
// Simple authentication (in real app, this would be server-side)
if (users[username] && users[username].password === password) {
// Set user session
localStorage.setItem('currentUser', JSON.stringify(users[username]));
// Update UI with user info
userDisplayName.textContent = users[username].name;
userRole.textContent = users[username].role;
// Show dashboard and hide login
loginPage.classList.add('hidden');
dashboard.classList.remove('hidden');
} else {
alert('Invalid username or password');
}
});
// Logout functionality
logoutBtn.addEventListener('click', function() {
localStorage.removeItem('currentUser');
dashboard.classList.add('hidden');
loginPage.classList.remove('hidden');
});
// Sidebar toggle
sidebarToggle.addEventListener('click', function() {
sidebar.classList.toggle('collapsed');
});
// Check if user is already logged in
window.addEventListener('load', function() {
const currentUser = localStorage.getItem('currentUser');
if (currentUser) {
const user = JSON.parse(currentUser);
userDisplayName.textContent = user.name;
userRole.textContent = user.role;
loginPage.classList.add('hidden');
dashboard.classList.remove('hidden');
}
});
// Simulate real-time updates
setInterval(() => {
// In a real app, this would fetch data from an API
// For demo purposes, we'll just simulate status changes
const serverStatuses = document.querySelectorAll('.status-indicator');
serverStatuses.forEach(indicator => {
// Randomly change status for demo
if (Math.random() > 0.7) {
indicator.classList.toggle('status-up');
indicator.classList.toggle('status-warning');
}
});
}, 5000);
</script>
<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=fsalmansour/bot" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |