{% extends "main.html" %}
{% load filters %}


{% block title %}Job{% endblock %}


{% block breadcrumbs %}
<div class="breadcrumbs">
    <a href='{% url "index" %}'>Home</a>&nbsp;›
    <a href="{% url 'kg_usage' %}">Usage</a>&nbsp;›
    <a href="{% url 'kg_usage_job_list' %}">Jobs</a>&nbsp;›
    {{ job }}
</div>
{% endblock %}


{% block content %}
<div id="content-main">
    <div class="module">
        <h2>Job Details</h2>
        <h3>{{ job.jobid }}</h3>
        <div class="table-container">
            <table class="keyvalue">
                <tr><th>Job ID:</th><td>{{ job.jobid }}</td></tr>
                {% if user.is_authenticated %}
                <tr><th>User:</th><td><a href="{{ job.account.person.get_absolute_url }}">{{ job.account.person }}</a></td></tr>
                {% endif %}
                <tr><th>Project:</th><td><a href="{{ job.project.get_absolute_url }}">{{ job.project.pid }}</a></td></tr>
                <tr><th>Machine:</th><td><a href="{{ job.machine.get_absolute_url }}">{{ job.machine }}</a></td></tr>
                <tr><th>Job start time:</th><td>{{ job.start }}</td></tr>
                <tr><th>Date finished:</th><td>{{ job.date }}</td></tr>
                <tr><th>Queue:</th><td>{{ job.queue }}</td></tr>
                <tr><th>CPU Usage:</th><td>{{ job.cpu_usage }}</td></tr>
                <tr><th>Memory Used:</th><td>{{ job.mem|fileformat }}</td></tr>
                <tr><th>Virtual Memory Used:</th><td>{{ job.vmem|fileformat }}</td></tr>
                <tr><th>Estimated Wall time:</th><td>{{ job.est_wall_time }}s (~{{ job.est_wall_time|timeformat }})</td></tr>
                <tr><th>Actual Wall time:</th><td>{{ job.act_wall_time }}s (~{{ job.act_wall_time|timeformat }})</td></tr>
                <tr><th>Cores:</th><td>{{ job.cores }}</td></tr>
                <tr><th>Exit Status:</th><td>{{ job.exit_status }}</td></tr>
                <tr><th>Software Used:</th><td>{% for s in job.software.all %}<a href="{{ s.get_absolute_url }}">{{ s }}, </a>{% endfor %}</td></tr>
            </table>
        </div>
    </div>
</div>
{% endblock %}
