{% extends 'base.j2' %}
{% block title %}dag{% endblock %}
{% block extra_css %}<link rel="stylesheet" href="/static/css/table.css"/>{% endblock %}
{% block content %}
<h1>dag</h1>

<table>
<thead>
    <tr>
        <th>key</th>
        <th>value</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>id</td>
        <td>{{ dag.id }}</td>
    </tr>
    <tr>
        <td>status</td>
        <td><code>{{ dag.status }}</code></td>
    </tr>
    <tr>
        <td>graph</td>
        <td><a href="/dags/{{ dag.id }}/graph.json"><code>{{ dag.graph|truncate(20) }}</code></a></td>
    </tr>
    <tr>
        <td>success_tasks</td>
        <td><code>{{ dag.success_tasks }}</code></td>
    </tr>
    <tr>
        <td>created_at</td>
        <td><code>{{ dag.created_at|format_time if dag.created_at is not none else 'NULL'}}</code></td>
    </tr>
    <tr>
        <td>updated_at</td>
        <td><code>{{ dag.updated_at|format_time if dag.updated_at is not none else 'NULL'}}</code></td>
    </tr>
    <tr>
        <td>started_at</td>
        <td><code>{{ dag.started_at|format_time if dag.started_at is not none else 'NULL'}}</code></td>
    </tr>
    <tr>
        <td>stopped_at</td>
        <td><code>{{ dag.stopped_at|format_time if dag.stopped_at is not none else 'NULL'}}</code></td>
    </tr>
    <tr>
        <td>duration</td>
        <td><code>{{ dag.duration_seconds|round(1) if dag.duration_seconds is not none else 'NULL' }}</code></td>
    </tr>
</tbody>
</table>
<h2>dag tasks</h2>
{% include 'tasks_table.j2' %}

{# {% for task_id in dag.tasks %}
    <a href="/tasks/{{ task_id }}">{{ task_id }}</a>
{% endfor %} #}
{% endblock %}
