Jelajahi Sumber

fix: add top countries by visits data to chart data in reports.html

Manuel 7 bulan lalu
induk
melakukan
dd7d9d6469
1 mengubah file dengan 4 tambahan dan 0 penghapusan
  1. 4 0
      templates/reports.html

+ 4 - 0
templates/reports.html

@@ -73,6 +73,10 @@
         "labels": {{ metrics.http_response_distribution_chart.labels | tojson | safe }},
         "data":   {{ metrics.http_response_distribution_chart.data   | tojson | safe }},
         "colors": {{ metrics.http_response_distribution_chart.colors | tojson | safe }}
+      },
+      "countries": {
+        "labels": {{ metrics.top_countries_by_visits | map(attribute='country') | list | tojson | safe }},
+        "data":   {{ metrics.top_countries_by_visits | map(attribute='total_requests') | list | tojson | safe }}
       }
     }
   </script>