{% extends "layout.html" %}

{% block content %}

<br />
<h2>{{ workflow_details['workflow_name'] }}</h2>

<hr>

<ul>
    <li><b>Started:</b>  {{ workflow_details['time_began'] | timeformat }}</li>
    <li><b>Completed:</b>  {{ workflow_details['time_completed'] | timeformat }}</li>
    <li><b>Workflow duration:</b>  {{ (workflow_details['time_began'], workflow_details['time_completed']) | durationformat }}</li>
    <li><b>Owner:</b>  {{ workflow_details['user'] }}</li>
    <li><b>Host:</b>  {{ workflow_details['host'] }}</li>
    <li><b>Run directory:</b>  {{ workflow_details['rundir'] }}</li>
    <li><b>Number of completed tasks:</b>  {{ workflow_details['tasks_completed_count'] }}</li>
    <li><b>Number of failed tasks:</b>  {{ workflow_details['tasks_failed_count'] }}</li>
</ul>

{% if not group_by_apps %}
    <a href="dag_group_by_apps">View workflow DAG -- colored by apps</a>
{% else %}
    <a href="dag_group_by_states">View workflow DAG -- colored by task states</a>
{% endif%}
<br><a href="/workflow/{{ workflow_details['run_id'] }}/">View workflow task summary</a>

<div class="container">
    <div class="col-12" style='height: 600px'>
       {{ workflow_dag_plot | safe }}
    </div>
</div>

{% endblock %}
