graph_reports.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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 de Peticiones") }}</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 + country charts -->
  55. <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
  56. <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
  57. <h2 class="text-xl font-bold mb-4 text-gray-800">
  58. {{ _("Distribución de Códigos HTTP") }}
  59. </h2>
  60. <div class="h-96">
  61. <canvas id="httpCodesChart"></canvas>
  62. </div>
  63. </div>
  64. <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
  65. <div class="flex items-center justify-between mb-4">
  66. <h2 class="text-xl font-bold text-gray-800">
  67. {{ _("Países más visitados") }}
  68. </h2>
  69. <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-semibold bg-yellow-100 text-yellow-800">
  70. {{ _("Beta") }}
  71. </span>
  72. </div>
  73. <div class="h-96">
  74. <canvas id="countriesChart"></canvas>
  75. </div>
  76. </div>
  77. </div>
  78. <!-- Most visited pages table -->
  79. <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
  80. <h2 class="text-xl font-bold mb-4 text-gray-800">
  81. {{ _("Top 20 Páginas Más Visitadas") }}
  82. </h2>
  83. <div class="overflow-x-auto">
  84. <table class="min-w-full divide-y divide-gray-200">
  85. <thead class="bg-gray-50">
  86. <tr>
  87. <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  88. {{ _("URL") }}
  89. </th>
  90. <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  91. {{ _("Total de Peticiones") }}
  92. </th>
  93. <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  94. {{ _("Visitas Únicas") }}
  95. </th>
  96. <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  97. {{ _("Datos Transmitidos") }}
  98. </th>
  99. </tr>
  100. </thead>
  101. <tbody class="bg-white divide-y divide-gray-200">
  102. {% for page in metrics.top_pages %}
  103. <tr class="hover:bg-gray-50">
  104. <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 truncate max-w-xs">
  105. {{ page.url }}
  106. </td>
  107. <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
  108. {{ page.total_requests }}
  109. </td>
  110. <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
  111. {{ page.unique_visits }}
  112. </td>
  113. <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
  114. {{ "%.2f"|format(page.total_data_bytes / (1024**2)) }} {{ _("MB") }}
  115. </td>
  116. </tr>
  117. {% endfor %}
  118. </tbody>
  119. </table>
  120. </div>
  121. </div>
  122. <!-- Shared IPs table -->
  123. <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-200">
  124. <h2 class="text-xl font-bold mb-4 text-gray-800">
  125. {{ _("IPs Compartidas por Múltiples Usuarios") }}
  126. </h2>
  127. <div class="overflow-x-auto">
  128. <table class="min-w-full divide-y divide-gray-200">
  129. <thead class="bg-gray-50">
  130. <tr>
  131. <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  132. {{ _("IP") }}
  133. </th>
  134. <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  135. {{ _("Número de Usuarios") }}
  136. </th>
  137. <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
  138. {{ _("Usuarios") }}
  139. </th>
  140. </tr>
  141. </thead>
  142. <tbody class="bg-white divide-y divide-gray-200">
  143. {% for ip in metrics.users_per_ip %}
  144. <tr class="hover:bg-gray-50">
  145. <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">
  146. {{ ip.ip }}
  147. </td>
  148. <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
  149. {{ ip.user_count }}
  150. </td>
  151. <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
  152. {{ ip.usernames }}
  153. </td>
  154. </tr>
  155. {% endfor %}
  156. </tbody>
  157. </table>
  158. </div>
  159. </div>
  160. </div>