<commit_before>{% extends "admin/skeleton.html" %}
{% block title %}Dashboard{% endblock %}
{% block head %}
  <script type="text/javascript" src="https://www.google.com/jsapi"></script>
{% endblock %}
{% block content %}
  <h1>Active Empires</h1>
  <div id="graph" style="width: 100%; margin: 0 auto;"></div>
  <script type="text/javascript">
    // keep the width/height ratio of the graph nice
    var ratio = 0.4;
    $("#graph").css("height", $("#graph").width() * ratio);

    google.load("visualization", "1", {packages:["corechart"]});
    google.setOnLoadCallback(drawChart);

    function drawChart() {
      var dataTable = new google.visualization.DataTable();
      dataTable.addColumn("date", "Date");
      dataTable.addColumn("number", "1-day actives");
      dataTable.addColumn("number", "7-day actives");
      dataTable.addColumn("number", "New Signups");
      dataTable.addRows([
      {% for entry in graph_data %}
        [new Date({{entry.year}}, {{entry.month|add:'1'}}, {{entry.day}}), {{entry.oneda|default:'0'}}, {{entry.sevenda|default:'0'}}, {{entry.signups|default:'0'}}],
      {% endfor %}
      ]);

      var dataView = new google.visualization.DataView(dataTable);

      var width = $("#graph").width();
      var height = $("#graph").height();
      var options = {
        "chartArea": {left: 50, top: 10, width: width - 100, height: height - 80},
        "backgroundColor": {fill: "transparent"},
        "series": {
          0: { "type": "line", "targetAxisIndex": 0 },
          1: { "type": "line", "targetAxisIndex": 0 },
          2: { "type": "line", "targetAxisIndex": 1 },
        }
      };

      var chart = new google.visualization.LineChart(document.getElementById("graph"));
      chart.draw(dataView, options);
    }
  </script>

  <p id="oldest-star">...</p>
  <script>
    function refreshOldestStar() {
      $.ajax({
        "url": "/realms/{{realm}}/admin",
        "type": "POST",
        "success": function(data) {
          $("p#oldest-star span").html("<b>" + data["oldest_star_name"] + "</b> (" +
            data["oldest_star_id"] + "): " + data["oldest_star_time"]);
        }
      });
    }
    $("p#oldest-star").on("click", "a", refreshOldestStar);
    refreshOldestStar();
  </script>
{% endblock %}<commit_msg>Fixed the display of the last simulated star.<commit_after>{% extends "admin/skeleton.html" %}
{% block title %}Dashboard{% endblock %}
{% block head %}
  <script type="text/javascript" src="https://www.google.com/jsapi"></script>
{% endblock %}
{% block content %}
  <h1>Active Empires</h1>
  <div id="graph" style="width: 100%; margin: 0 auto;"></div>
  <script type="text/javascript">
    // keep the width/height ratio of the graph nice
    var ratio = 0.4;
    $("#graph").css("height", $("#graph").width() * ratio);

    google.load("visualization", "1", {packages:["corechart"]});
    google.setOnLoadCallback(drawChart);

    function drawChart() {
      var dataTable = new google.visualization.DataTable();
      dataTable.addColumn("date", "Date");
      dataTable.addColumn("number", "1-day actives");
      dataTable.addColumn("number", "7-day actives");
      dataTable.addColumn("number", "New Signups");
      dataTable.addRows([
      {% for entry in graph_data %}
        [new Date({{entry.year}}, {{entry.month|add:'1'}}, {{entry.day}}), {{entry.oneda|default:'0'}}, {{entry.sevenda|default:'0'}}, {{entry.signups|default:'0'}}],
      {% endfor %}
      ]);

      var dataView = new google.visualization.DataView(dataTable);

      var width = $("#graph").width();
      var height = $("#graph").height();
      var options = {
        "chartArea": {left: 50, top: 10, width: width - 100, height: height - 80},
        "backgroundColor": {fill: "transparent"},
        "series": {
          0: { "type": "line", "targetAxisIndex": 0 },
          1: { "type": "line", "targetAxisIndex": 0 },
          2: { "type": "line", "targetAxisIndex": 1 },
        }
      };

      var chart = new google.visualization.LineChart(document.getElementById("graph"));
      chart.draw(dataView, options);
    }
  </script>

  <p id="oldest-star"><span>...</span></p>
  <script>
    function refreshOldestStar() {
      $.ajax({
        "url": "/realms/{{realm}}/admin",
        "type": "POST",
        "success": function(data) {
          $("p#oldest-star span").html("<b>" + data["oldest_star_name"] + "</b> (" +
            data["oldest_star_id"] + "): " + data["oldest_star_time"]);
        }
      });
    }
    $("p#oldest-star").on("click", "a", refreshOldestStar);
    refreshOldestStar();
  </script>
{% endblock %}
{'fraction_non_alphanumeric': 0.21052631578947367, 'fraction_numerical': 0.01299545159194282, 'mean_word_length': 3.108540925266904, 'pattern_counts': {'":': 24, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3725723', 'n_tokens_mistral': 1545, 'n_tokens_neox': 1457, 'n_words': 301}