{% extends 'admin/adminbase.html' %}
{% block title %}Admin - Worker Stats{% endblock %}

{% block head %}
    {{ super() }}
    <script src="{{ url_for('static', filename='vendor/js/jquery.dataTables.min.js') }}"></script>
    <script src="{{ url_for('static', filename='vendor/js/dataTables.bootstrap.min.js') }}"></script>
    <link href="{{ url_for('static', filename='vendor/css/dataTables.bootstrap.min.css') }}" rel="stylesheet" />
{% endblock %}
{% block header %}Worker Stats{% endblock %}

{% block admincontent %}
  <div class="worker_stats">
    <table id="workers" class="table table-striped table-bordered table-compact" cellspacing="0" width="100%">
      <thead>
        <tr>
          <th><div title="Name of Worker">Name</div></th>
          <th><div title="Number of processes available">Processes</div></th>
          <th><div title="Number of currently running checks">Running Checks</div></th>
          <th><div title="Number of completed checks">Completed Checks</div></th>
          <th><div title="Queues registered to for running service checks">Queue Names</div></th>
          <th><div title="Services that the worker is registered to run">Enabled Services</div></th>
        </tr>
      </thead>
      <tbody>
      </tbody>
    </table>
  </div>
  <script>
    $(document).ready(function() {
      // Disable datatables error reporting
      $.fn.dataTable.ext.errMode = 'none';

      var table = $('#workers')
        .on('error.dt', function (e, settings, techNote, message) {
          console.log('An error has been reported by DataTables: ', message);
        })
        .DataTable({
          'paging': false,
          'bFilter': false,
          'bInfo': false,
          "ajax": "/api/admin/get_worker_stats",
          "columns": [
            { "data": "worker_name" },
            { "data": "num_threads" },
            { "data": "running_tasks" },
            { "data": "completed_tasks" },
            { "data": "worker_queues" },
            { "data": "services_running" },
          ],
        });
      setInterval( function () {
        table.ajax.reload();
      }, 10000 );
    } );
  </script>

{% endblock %}

Fix reload time for worker stats admin page
Fix reload time for worker stats admin page
