execution_inspect.html 2.85 KB
Newer Older
Sabino Papagna's avatar
Sabino Papagna committed
1 2
{% extends "base_user.html" %}
{% block title %}Inspect execution {{ e.name }}{% endblock %}
3 4 5 6 7

{% block custom_head %}
    <script src="/static/moment.min.js" type="application/javascript"></script>
    <script src="/static/moment-timezone.min.js" type="application/javascript"></script>
    <script>
8 9 10
    var locale = window.navigator.userLanguage || window.navigator.language;
    moment.locale(locale);

11 12 13
    function format_timestamp(ts) {
        var m = moment.utc(ts);
        m.local();
14
        document.write(m.format("L, LTS"));
15 16 17 18
    }
    </script>
{% endblock %}

Sabino Papagna's avatar
Sabino Papagna committed
19
{% block content %}
20
<h2>Detailed information for execution {{ e.name }} ({{ e.id }})</h2>
Sabino Papagna's avatar
Sabino Papagna committed
21 22 23
<div id="contents">
<ul>
    <li>Application name: {{ e.description['name'] }}</li>
24
    {% if role == "admin" %}
Sabino Papagna's avatar
Sabino Papagna committed
25
    <li>Owner: {{ e.user_id }}</li>
26
    {% endif %}
Sabino Papagna's avatar
Sabino Papagna committed
27 28 29 30 31 32 33 34 35 36 37
    <li>Time submitted: <script>format_timestamp("{{ e.time_submit }}")</script></li>
    {% if e.time_start == None %}
    <li>Time started: not yet</li>
    {% else %}
    <li>Time started: <script>format_timestamp("{{ e.time_start }}")</script></li>
    {% endif %}
    {% if e.time_end == None %}
    <li>Time finished: not yet</li>
    {% else %}
    <li>Time finished: <script>format_timestamp("{{ e.time_end }}")</script></li>
    {%  endif %}
38 39 40 41 42 43 44 45
    <li>Status: <span style="font-weight: bold;">{{ e.status }}</span></li>
    <li>Actions:
        {% if e.is_active %}
            <a href="/executions/terminate/{{ e.id }}">Terminate</a>
        {% else %}
            <a href="/executions/restart/{{ e.id }}">Restart</a>
        {% endif %}
    </li>
Sabino Papagna's avatar
Sabino Papagna committed
46 47 48 49 50
</ul>
{% if e.status == 'error' %}
<p>Error message: <code>{{ e.error_message }}</code></p>
{% endif %}

51 52 53 54
<div id="endpoints">
<h3>Endpoints</h3>
{% if endpoints|length > 0 %}
<ul>
55
{% for endp in endpoints|sort %}
56
    <li><a href="{{ endp[1] }}" target="_blank">{{ endp[0] }}</a></li>
57 58 59 60 61 62 63
{% endfor %}
</ul>
{% else %}
<p>This execution does not have any active endpoint</p>
{% endif %}
</div>

Sabino Papagna's avatar
Sabino Papagna committed
64 65 66 67
<div id="container_list">
{% if services_info|length > 0 %}
<h3>Services:</h3>
{% endif %}
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
<table class="service-list">
    <thead>
    <tr>
        <th>ID</th>
        <th>Name</th>
        <th>Zoe status</th>
        <th>Backend status</th>
        <th>Host</th>
        <th>Output logs</th>
        <th>Errors</th>
    </tr>
    </thead>
    <tbody>
    {% for s in services_info %}
        <tr>
            <td>{{ s['id'] }}</td>
            <td>{{ s['name'] }}</td>
            <td>{{ s['status'] }}</td>
            <td>{{ s['backend_status'] }}</td>
            <td>{{ s['backend_host'] }}</td>
            <td><a href="{{ reverse_url("service_logs", s['id']) }}">available</a></td>
            <td>{{ s['error_message'] }}</td>
        </tr>
    {% endfor %}

    </tbody>
</table>
Sabino Papagna's avatar
Sabino Papagna committed
95 96 97
</div>

</div>
98 99 100 101 102 103
<script>
    function refresh_page() {
        document.location.reload();
    }
    setInterval(refresh_page, 15000);
</script>
Sabino Papagna's avatar
Sabino Papagna committed
104
{% endblock %}