{% extends 'layouts/base.html' %}

{% set active_menu = 'workers' %}
{% set page_title = 'Workers' %}

{% block body_header %}
<h1 class="title mb-4">Spark Workers</h1>
{% endblock %}

{% block body %}

<div class="columns is-mobile">
    <div class="column is-8">

    {% for worker in workers %}
    <nav class="panel">
    <p class="panel-heading">
        <i class="fa fa-server" aria-hidden="true"></i> {{worker.name}}
    </p>
    <div class="panel-block">
        <p>
            <b>ID:</b> {{worker.uuid}}<br/>
            <b>Owner:</b> {{worker.owner}}<br/>
            <b>Last Ping:</b> {{humanized_timediff(worker.last_ping)}}<br/>
            <b>First Seen:</b> {{humanized_timediff(worker.time_created)}}<br/>
            <b>Architectures:</b> {{', '.join(prefix_list_entries(worker.architectures, '⚙'))}}<br/>
            <b>Accepted Tasks:</b> {{', '.join(worker.accepts)}}<br/>
        </p>
    </div>
    </nav>
    {% endfor %}

    </div>
</div>

{% endblock %}
