Sha256: f664706c38e27a1a9750acf123427834d2da4feb0b746c7c60c8cf1474230d7d

Contents?: true

Size: 709 Bytes

Versions: 3

Compression:

Stored size: 709 Bytes

Contents

<div id="logs">
  <h3><%= @logfile %></h3>
  <div class="data"></div>
</div>

<script type="text/javascript">
  function loadLogs(force) {
    $("#logs .data").load("logs/data", function() {
      var elem = $(this)[0]
      // track the bottom of the logs, unless we've scrolled away
      if(force || (elem.scrollHeight - elem.scrollTop - elem.clientHeight < 100)) {
        $('body').animate({scrollTop: elem.scrollHeight}, 500);
      }

      // use timeout instead of an interval so that in case of network error
      // we don't end up with a queue of requests stacked up.
      setTimeout(function(){loadLogs}, 5000);
    });
  }

  $(document).ready(function() {
    loadLogs(true);
  });
</script>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
puppetfactory-0.6.5 views/logs.erb
puppetfactory-0.6.4 views/logs.erb
puppetfactory-0.6.3 views/logs.erb