{% block content %}
<h3 class="mb-2">suvi with {{ processes|length }} running processes <a href="{{url_for('app_ps_json')}}"><img src="/static/img/code.png" title="json" /></a></h3>
<i>Auto-reloads every seconds.</i>
<table class="table mt-5">
    <thead>
        <tr>
            <th style="width: 150px">Actions</th>
            <th style="width: 150px">PID</th>
            <th style="width: 20%">Config name</th>
            <th>Args</th>
        </tr>
    </thead>
    <tbody>
        {% for taskName, proc in processes.items()|sort(attribute='0') %}
        <tr>
            <td>
                <a href="{{url_for('app_task_info', task_name=taskName)}}"><img src="/static/img/info.png" title="task information"></a>
                <a class="pointer" hx-get="{{url_for('app_stop_task', task_name=taskName)}}" hx-target="#config-name-{{taskName}}"><img src="/static/img/stop.png" title="stop instance"></a>
                <a class="pointer" hx-get="{{url_for('app_remove', task_name=taskName)}}"hx-target="#config-name-{{taskName}}"><img src="/static/img/remove.png" title="remove from keepalive"></a>
                <a href="{{url_for('app_task_log', task_name=taskName)}}"><img src="/static/img/log.png" title="task log"></a>
            </td>
            <th> {{ proc.pid }} </th>
            <td id="config-name-{{taskName}}"> {{ taskName }}</td>
            <td>
                <code>
                        {% for arg in proc.args %}
                        {{ arg }} 
                        {% endfor %}
                </code>
            </td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% endblock %}