{% extends "data_explorer/table_entries_base.html" %}
{% block table_headers %}
    {% table_header "id" "Worker ID" min_width=100 %}
    {% table_header "status" min_width=150 %}
    {% table_header "owner__username" "Owner" min_width=125 %}
    {% table_header "nitems_completed" "Items Completed" min_width=100 %}
    {% table_header "computer_system" min_width=150 %}
    {% table_header "ncores" "Cores" min_width=75 %}
    {% table_header "ram" "RAM (GB)" min_width=75 %}
    {% table_header "updated_at" "Last Heartbeat" min_width=150 %}
{% endblock %}
{% block table_rows %}
    <td>{% foreign_key_link entry "id" %}</td>
    <td>
        {% if entry.status == "Running" %}
            {% status_bar "Running" "success" %}
        {% elif entry.status == "Idle" %}
            {% status_bar "Idle" "primary" %}
        {% elif entry.status == "Stopped" %}
            {% status_bar "Stopped" "secondary" %}
        {% elif entry.status == "Crashed" %}
            {% status_bar "Crashed" "danger" %}
        {% elif entry.status == "Stale Heartbeat" %}
            {% status_bar "Stale" "warning" %}
        {% else %}
            {% status_bar entry.status|default:"Unknown" "dark" %}
        {% endif %}
    </td>
    <td>
        {% if entry.owner %}
            {{ entry.owner.username }}
        {% else %}
            -
        {% endif %}
    </td>
    <td>{{ entry.nitems_completed|default:0 }} / {{ entry.nitems_max|default:"∞" }}</td>
    <td>{{ entry.computer_system|default:"-" }}</td>
    <td>{{ entry.ncores|default:"-" }}</td>
    <td>{{ entry.ram|default:"-" }}</td>
    <td>{{ entry.updated_at|date:"Y-m-d H:i" }}</td>
{% endblock %}
