{% extends "pages/main.html" %}
{% load staticfiles %}
{% block title %} Actors {% endblock %}

{% block container %}

<h2>Actors list</h2>
    <div class="table-responsive">
    <table class="table table-striped">
        <thead>
          <tr>
            <th>Name</th>
            <th>Status</th>
            <th>IP address</th>
            <th>Status</th>
          </tr>
        </thead>
        <tbody>
         {% for a in actors %}
          <tr>
            <td><a href="{% url 'actor_details' a.name %}"> {{ a.name }} </a></td>
            <td>  </td>
            <td>{{ a.ip_addr }} : {{ a.port }}</td>
            <td>
                {% if a.status|stringformat:"s" == "ONLINE" %}
                    <span class="label label-default">
                {% elif a.status|stringformat:"s" == "OFFLINE" %}
                    <span class="label label-danger">
                {% elif a.status|stringformat:"s" == "CONNECTED" %}
                    <span class="label label-success">
                {% endif %}
                {{ a.status }}</span>
            </td>
          </tr>
         {% endfor %}
        </tbody>
    </table>
    </div>


<h2>Global KV</h2>
    <div class="table-responsive">
    <table class="table table-striped">
        <thead>
          <tr>
            <th>Formula ID</th>
            <th>Monitor</th>
            <th>Value</th>
            <th>Timestamp</th>
          </tr>
        </thead>
        <tbody>
         {% for e in KV.entries %}
          <tr>
            <td> {{ e.fid }} </td>
            <td> {{ e.agent }} </td>
            <td> {{ e.value }} </td>
            <td> {{ e.timestamp }} </td>
          </tr>
         {% endfor %}
        </tbody>
    </table>
    </div>

{% endblock %}

