graph_reports.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <div class="w-full space-y-6">
  2. <!-- Main metrics cards -->
  3. <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
  4. <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-200">
  5. <h3 class="text-lg font-semibold text-gray-700">
  6. Usuarios Totales
  7. </h3>
  8. <p class="text-2xl font-bold text-blue-600">
  9. {{ metrics.total_stats.total_users }}
  10. </p>
  11. </div>
  12. <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-200">
  13. <h3 class="text-lg font-semibold text-gray-700">
  14. Registros de Log
  15. </h3>
  16. <p class="text-2xl font-bold text-green-600">
  17. {{ metrics.total_stats.total_log_entries }}
  18. </p>
  19. </div>
  20. <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-200">
  21. <h3 class="text-lg font-semibold text-gray-700">
  22. Datos Transmitidos
  23. </h3>
  24. <p class="text-2xl font-bold text-purple-600">
  25. {{ "%.2f"|format(metrics.total_stats.total_data_transmitted / (1024**3)) }} GB
  26. </p>
  27. </div>
  28. <div class="bg-white p-4 rounded-lg shadow-sm border border-gray-200">
  29. <h3 class="text-lg font-semibold text-gray-700">Total Requests</h3>
  30. <p class="text-2xl font-bold text-orange-600">
  31. {{ metrics.total_stats.total_requests }}
  32. </p>
  33. </div>
  34. </div>
  35. <!-- Main charts -->
  36. <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
  37. <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
  38. <h2 class="text-xl font-bold mb-4 text-gray-800">
  39. Top 20 Usuarios por Actividad
  40. </h2>
  41. <div class="h-80">
  42. <canvas id="usersActivityChart"></canvas>
  43. </div>
  44. </div>
  45. <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
  46. <h2 class="text-xl font-bold mb-4 text-gray-800">
  47. Top 20 Usuarios por Datos Transmitidos
  48. </h2>
  49. <div class="h-80">
  50. <canvas id="usersDataChart"></canvas>
  51. </div>
  52. </div>
  53. </div>
  54. <!-- HTTP codes chart -->
  55. <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
  56. <h2 class="text-xl font-bold mb-4 text-gray-800">
  57. Distribución de Códigos HTTP
  58. </h2>
  59. <div class="h-96">
  60. <canvas id="httpCodesChart"></canvas>
  61. </div>
  62. </div>
  63. <!-- Most visited pages table -->
  64. <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
  65. <h2 class="text-xl font-bold mb-4 text-gray-800">
  66. Top 20 Páginas Más Visitadas
  67. </h2>
  68. <div class="overflow-x-auto">
  69. <table class="min-w-full divide-y divide-gray-200">
  70. <thead class="bg-gray-50">
  71. <tr>
  72. <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  73. URL
  74. </th>
  75. <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  76. Total Requests
  77. </th>
  78. <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  79. Visitas Únicas
  80. </th>
  81. <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  82. Datos Transmitidos
  83. </th>
  84. </tr>
  85. </thead>
  86. <tbody class="bg-white divide-y divide-gray-200">
  87. {% for page in metrics.top_pages %}
  88. <tr class="hover:bg-gray-50">
  89. <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 truncate max-w-xs">
  90. {{ page.url }}
  91. </td>
  92. <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
  93. {{ page.total_requests }}
  94. </td>
  95. <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
  96. {{ page.unique_visits }}
  97. </td>
  98. <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
  99. {{ "%.2f"|format(page.total_data_bytes / (1024**2)) }} MB
  100. </td>
  101. </tr>
  102. {% endfor %}
  103. </tbody>
  104. </table>
  105. </div>
  106. </div>
  107. <!-- Shared IPs table -->
  108. <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
  109. <h2 class="text-xl font-bold mb-4 text-gray-800">
  110. IPs Compartidas por Múltiples Usuarios
  111. </h2>
  112. <div class="overflow-x-auto">
  113. <table class="min-w-full divide-y divide-gray-200">
  114. <thead class="bg-gray-50">
  115. <tr>
  116. <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  117. IP
  118. </th>
  119. <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  120. Número de Usuarios
  121. </th>
  122. <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  123. Usuarios
  124. </th>
  125. </tr>
  126. </thead>
  127. <tbody class="bg-white divide-y divide-gray-200">
  128. {% for ip in metrics.users_per_ip %}
  129. <tr class="hover:bg-gray-50">
  130. <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">
  131. {{ ip.ip }}
  132. </td>
  133. <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
  134. {{ ip.user_count }}
  135. </td>
  136. <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
  137. {{ ip.usernames }}
  138. </td>
  139. </tr>
  140. {% endfor %}
  141. </tbody>
  142. </table>
  143. </div>
  144. </div>
  145. </div>