dashboard.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Dashboard - TG Admin</title>
  7. <script src="https://cdn.tailwindcss.com"></script>
  8. <script>
  9. tailwind.config = {
  10. theme: {
  11. extend: {
  12. fontFamily: { sans: ['Inter', 'system-ui', 'sans-serif'] },
  13. colors: { brand: { DEFAULT: '#000000', hover: '#1a1a1a' } }
  14. }
  15. }
  16. }
  17. </script>
  18. <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
  19. <style>
  20. body { font-family: 'Inter', system-ui, sans-serif; }
  21. .nav-item { @apply flex items-center gap-3 px-4 py-3 text-gray-400 hover:text-white hover:bg-white/5 transition-colors cursor-pointer; }
  22. .nav-item.active { @apply text-white bg-white/10; }
  23. .card { @apply bg-white border border-gray-200 p-6; }
  24. .badge { @apply inline-flex items-center px-2.5 py-0.5 text-xs font-medium; }
  25. .badge-success { @apply bg-green-100 text-green-800; }
  26. </style>
  27. </head>
  28. <body class="min-h-screen bg-gray-50">
  29. <div class="flex min-h-screen">
  30. <!-- Sidebar Overlay (Mobile) -->
  31. <div id="sidebar-overlay" class="fixed inset-0 bg-black/50 z-40 lg:hidden hidden"></div>
  32. <!-- Sidebar -->
  33. <aside id="sidebar" class="fixed lg:static inset-y-0 left-0 z-50 w-64 bg-gradient-to-b from-gray-900 via-gray-900 to-black transform -translate-x-full lg:translate-x-0 transition-transform duration-200">
  34. <div class="flex flex-col h-full">
  35. <!-- Logo -->
  36. <div class="flex items-center justify-between h-16 px-6 border-b border-white/10">
  37. <div class="flex items-center gap-3">
  38. <div class="w-8 h-8 bg-white rounded-lg flex items-center justify-center">
  39. <svg class="w-4 h-4 text-black" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  40. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
  41. </svg>
  42. </div>
  43. <span class="text-white font-semibold">TG Admin</span>
  44. </div>
  45. <!-- Close button (Mobile) -->
  46. <button id="sidebar-close" class="lg:hidden text-gray-400 hover:text-white">
  47. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  48. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
  49. </svg>
  50. </button>
  51. </div>
  52. <!-- Navigation -->
  53. <nav class="flex-1 px-4 py-6 space-y-1 overflow-y-auto">
  54. <a href="dashboard.html" class="nav-item active">
  55. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  56. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"/>
  57. </svg>
  58. <span>Dashboard</span>
  59. </a>
  60. <a href="users.html" class="nav-item">
  61. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  62. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197m13.5-9a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z"/>
  63. </svg>
  64. <span>用户管理</span>
  65. </a>
  66. <a href="settings.html" class="nav-item">
  67. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  68. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/>
  69. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
  70. </svg>
  71. <span>设置</span>
  72. </a>
  73. </nav>
  74. <!-- Footer -->
  75. <div class="px-6 py-4 border-t border-white/10">
  76. <a href="auth/login.html" class="flex items-center gap-3 text-gray-400 hover:text-white transition-colors">
  77. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  78. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"/>
  79. </svg>
  80. <span>退出登录</span>
  81. </a>
  82. </div>
  83. </div>
  84. </aside>
  85. <!-- Main Content -->
  86. <div class="flex-1 flex flex-col min-w-0">
  87. <!-- Header -->
  88. <header class="h-16 bg-white border-b border-gray-200 flex items-center justify-between px-4 lg:px-8">
  89. <!-- Mobile menu button -->
  90. <button id="sidebar-toggle" class="lg:hidden p-2 -ml-2 text-gray-600 hover:text-black">
  91. <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  92. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/>
  93. </svg>
  94. </button>
  95. <!-- Page Title -->
  96. <h1 class="text-lg font-semibold text-black hidden lg:block">Dashboard</h1>
  97. <!-- User Menu -->
  98. <div class="relative">
  99. <button data-dropdown-toggle="user-dropdown" class="flex items-center gap-3 cursor-pointer">
  100. <div class="w-8 h-8 bg-gray-900 rounded-full flex items-center justify-center">
  101. <span class="text-white text-sm font-medium">A</span>
  102. </div>
  103. <span class="hidden sm:block text-sm font-medium text-gray-700">Admin</span>
  104. <svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  105. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/>
  106. </svg>
  107. </button>
  108. <!-- Dropdown -->
  109. <div id="user-dropdown" data-dropdown class="hidden absolute right-0 mt-2 w-48 bg-white border border-gray-200 shadow-lg z-50">
  110. <a href="settings.html" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">设置</a>
  111. <a href="auth/login.html" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-50">退出登录</a>
  112. </div>
  113. </div>
  114. </header>
  115. <!-- Page Content -->
  116. <main class="flex-1 p-4 lg:p-8 overflow-auto">
  117. <!-- Page Header -->
  118. <div class="mb-8">
  119. <h2 class="text-2xl lg:text-3xl font-bold text-black">Dashboard</h2>
  120. <p class="text-gray-400 mt-1">欢迎回来,这是您的数据概览</p>
  121. </div>
  122. <!-- Stats Cards -->
  123. <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 lg:gap-6 mb-8">
  124. <!-- Card 1 -->
  125. <div class="card">
  126. <div class="flex items-center justify-between mb-4">
  127. <span class="text-gray-500 text-sm">总用户</span>
  128. <svg class="w-5 h-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  129. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"/>
  130. </svg>
  131. </div>
  132. <div class="text-3xl font-bold text-black">12,456</div>
  133. <div class="text-sm text-green-600 mt-2">+12.5% 较上月</div>
  134. </div>
  135. <!-- Card 2 -->
  136. <div class="card">
  137. <div class="flex items-center justify-between mb-4">
  138. <span class="text-gray-500 text-sm">活跃用户</span>
  139. <svg class="w-5 h-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  140. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"/>
  141. </svg>
  142. </div>
  143. <div class="text-3xl font-bold text-black">8,234</div>
  144. <div class="text-sm text-green-600 mt-2">+8.2% 较上月</div>
  145. </div>
  146. <!-- Card 3 -->
  147. <div class="card">
  148. <div class="flex items-center justify-between mb-4">
  149. <span class="text-gray-500 text-sm">直播场次</span>
  150. <svg class="w-5 h-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  151. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
  152. </svg>
  153. </div>
  154. <div class="text-3xl font-bold text-black">1,892</div>
  155. <div class="text-sm text-green-600 mt-2">+23.1% 较上月</div>
  156. </div>
  157. <!-- Card 4 -->
  158. <div class="card">
  159. <div class="flex items-center justify-between mb-4">
  160. <span class="text-gray-500 text-sm">系统稳定性</span>
  161. <svg class="w-5 h-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  162. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/>
  163. </svg>
  164. </div>
  165. <div class="text-3xl font-bold text-black">99.9%</div>
  166. <div class="text-sm text-gray-500 mt-2">正常运行</div>
  167. </div>
  168. </div>
  169. <!-- Charts Section -->
  170. <div class="grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-6 mb-8">
  171. <!-- Chart 1 -->
  172. <div class="card">
  173. <h3 class="text-lg font-semibold text-black mb-4">用户增长趋势</h3>
  174. <div class="h-64 bg-gray-50 border border-gray-100 flex items-center justify-center">
  175. <span class="text-gray-400">图表区域</span>
  176. </div>
  177. </div>
  178. <!-- Chart 2 -->
  179. <div class="card">
  180. <h3 class="text-lg font-semibold text-black mb-4">直播数据统计</h3>
  181. <div class="h-64 bg-gray-50 border border-gray-100 flex items-center justify-center">
  182. <span class="text-gray-400">图表区域</span>
  183. </div>
  184. </div>
  185. </div>
  186. <!-- Recent Activity -->
  187. <div class="card">
  188. <div class="flex items-center justify-between mb-6">
  189. <h3 class="text-lg font-semibold text-black">最近活动</h3>
  190. <a href="users.html" class="text-sm text-gray-500 hover:text-black">查看全部</a>
  191. </div>
  192. <div class="space-y-4">
  193. <div class="flex items-center gap-4 py-3 border-b border-gray-100">
  194. <div class="w-10 h-10 bg-gray-900 rounded-full flex items-center justify-center flex-shrink-0">
  195. <span class="text-white text-sm font-medium">张</span>
  196. </div>
  197. <div class="flex-1 min-w-0">
  198. <p class="text-sm font-medium text-black truncate">张明 开始了新直播</p>
  199. <p class="text-xs text-gray-400">2 分钟前</p>
  200. </div>
  201. <span class="badge badge-success">直播中</span>
  202. </div>
  203. <div class="flex items-center gap-4 py-3 border-b border-gray-100">
  204. <div class="w-10 h-10 bg-gray-900 rounded-full flex items-center justify-center flex-shrink-0">
  205. <span class="text-white text-sm font-medium">李</span>
  206. </div>
  207. <div class="flex-1 min-w-0">
  208. <p class="text-sm font-medium text-black truncate">李华 注册了新账户</p>
  209. <p class="text-xs text-gray-400">15 分钟前</p>
  210. </div>
  211. <span class="badge bg-gray-100 text-gray-800">新用户</span>
  212. </div>
  213. <div class="flex items-center gap-4 py-3">
  214. <div class="w-10 h-10 bg-gray-900 rounded-full flex items-center justify-center flex-shrink-0">
  215. <span class="text-white text-sm font-medium">王</span>
  216. </div>
  217. <div class="flex-1 min-w-0">
  218. <p class="text-sm font-medium text-black truncate">王芳 结束了直播</p>
  219. <p class="text-xs text-gray-400">1 小时前</p>
  220. </div>
  221. <span class="badge bg-gray-100 text-gray-800">已结束</span>
  222. </div>
  223. </div>
  224. </div>
  225. </main>
  226. </div>
  227. </div>
  228. <script type="module" src="../src/js/main.js"></script>
  229. </body>
  230. </html>