{% 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>

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


<h5>Worker usage</h5>
<div class="container" style="height: 500px;">
{{ worker_efficiency|safe }}
</div>

<h5>CPU usage</h5>
<div class="container" style="height: 500px;">
{{ cpu_efficiency|safe }}
</div>

<h5>CPU Usage</h5>
<div class="container">
  <div class="row">
    <div class="col-6" style="height: 300px;">
{{ user_time_distribution_max_plot|safe }}
    </div>
  </div>
</div>

<h5>Memory usage</h5>
<div class="container" style="height: 500px;">
{{ memory_efficiency|safe }}
</div>

<h5>Memory Usage</h5>
<div class="container">
  <div class="row">
    <div class="col-6" style="height: 300px;">
{{ memory_usage_distribution_avg_plot|safe }}
    </div>
    <div class="col-6" style="height: 300px;">
{{ memory_usage_distribution_max_plot|safe }}
    </div>
  </div>
</div>

{% endblock %}
