<commit_before>{% extends "admin/object_history.html" %}
{% load url from future %}
{% load admin_urls %}

{% block title %}Logtail {{ block.super }}{% endblock %}

{% block extrahead %}
{{ block.super }}
<style type="text/css">
  pre#log-tail {
    height: auto;
    overflow-x: scroll;
  }
  #content-main {
    margin-top: 20px;
  }
</style>
{% if include_jquery %}
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
{% endif %}
{% endblock %}

{% block breadcrumbs %}
<div class="breadcrumbs">
  <a href="{% url 'admin:index' %}">Home</a>
  &rsaquo; <a href="{% url 'log_list' %}">Logtail</a>
</div>
{% endblock %}

{% block content %}
  <div id="content-main">
    <ul class="object-tools">
      <li><a href="history/" class="historylink">Auto-Scroll</a></li>
    </ul>
    <div class="module">
      <table id="change-history">
        <thead>
          <tr>
            <th scope="col">Log</th>
            <th scope="col">Path</th>
          </tr>
        </thead>
        <tbody>
          {% for log, path in object_list %}
            <tr>
              <th scope="row"><a href="#" class="logfile_change">{{ log }}</a></th>
              <td>{{ path }}</td>
            </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
    <div>
<pre id="log-tail">
</pre>
    </div>
  </div>
  <script type="text/javascript">
    // Django logtail script

    var BASE_URL = "{% url "log_list" %}";
    var TIMEOUT = 1000 * 60 * 8;
    var new_start = "0";
    var can_poll = true;
    var timed_out = false;
    var interval;

    // Timeout the polling after eight minutes
    window.setTimeout(function() {
      alert("The polling timed out. Refresh to tail again.");
      timed_out = true;
    }, TIMEOUT);

    var tail = function(url) {
      if (timed_out == true) {
        return
      }

      // Theoretically avoid checking multiple times at once
      if (can_poll == false) {
        return
      }
      can_poll = false

      var full_url = url + "/" + new_start + "/";

      $.getJSON(full_url, function(data) {
        $("#log-tail").append(data["data"]);
        new_start = data["ends"];
      });

      can_poll = true
    };

    $(".logfile_change").live("click", function() {

      var log = $(this).text();
      var url = (BASE_URL + log);

      if (new_start != "0") {
        window.clearInterval(interval);
        $("#log-tail").empty();
        new_start = "0";
      }

      tail(url, new_start);
      interval = window.setInterval(tail, 2000, url);
    });
  </script>
{% endblock %}
<commit_msg>Lower the update interval<commit_after>{% extends "admin/object_history.html" %}
{% load url from future %}
{% load admin_urls %}

{% block title %}Logtail {{ block.super }}{% endblock %}

{% block extrahead %}
{{ block.super }}
<style type="text/css">
  pre#log-tail {
    height: auto;
    overflow-x: scroll;
  }
  #content-main {
    margin-top: 20px;
  }
</style>
{% if include_jquery %}
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
{% endif %}
{% endblock %}

{% block breadcrumbs %}
<div class="breadcrumbs">
  <a href="{% url 'admin:index' %}">Home</a>
  &rsaquo; <a href="{% url 'log_list' %}">Logtail</a>
</div>
{% endblock %}

{% block content %}
  <div id="content-main">
    <ul class="object-tools">
      <li><a href="history/" class="historylink">Auto-Scroll</a></li>
    </ul>
    <div class="module">
      <table id="change-history">
        <thead>
          <tr>
            <th scope="col">Log</th>
            <th scope="col">Path</th>
          </tr>
        </thead>
        <tbody>
          {% for log, path in object_list %}
            <tr>
              <th scope="row"><a href="#" class="logfile_change">{{ log }}</a></th>
              <td>{{ path }}</td>
            </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
    <div>
<pre id="log-tail">
</pre>
    </div>
  </div>
  <script type="text/javascript">
    // Django logtail script

    var BASE_URL = "{% url "log_list" %}";
    var TIMEOUT = 1000 * 60 * 8;
    var new_start = "0";
    var can_poll = true;
    var timed_out = false;
    var interval;

    // Timeout the polling after eight minutes
    window.setTimeout(function() {
      alert("The polling timed out. Refresh to tail again.");
      timed_out = true;
    }, TIMEOUT);

    var tail = function(url) {
      if (timed_out == true) {
        return
      }

      // Theoretically avoid checking multiple times at once
      if (can_poll == false) {
        return
      }
      can_poll = false

      var full_url = url + "/" + new_start + "/";

      $.getJSON(full_url, function(data) {
        $("#log-tail").append(data["data"]);
        new_start = data["ends"];
      });

      can_poll = true
    };

    $(".logfile_change").live("click", function() {

      var log = $(this).text();
      var url = (BASE_URL + log);

      if (new_start != "0") {
        window.clearInterval(interval);
        $("#log-tail").empty();
        new_start = "0";
      }

      tail(url, new_start);
      interval = window.setInterval(tail, 1000, url);
    });
  </script>
{% endblock %}

{'fraction_non_alphanumeric': 0.18716372021521907, 'fraction_numerical': 0.007302075326671791, 'mean_word_length': 2.2169344870210135, 'pattern_counts': {'":': 0, '<': 95, '<?xml version=': 0, '>': 95, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2135145', 'n_tokens_mistral': 1844, 'n_tokens_neox': 1719, 'n_words': 401}