execution_inspect.jinja2 3.93 KB
Newer Older
Daniele Venzano's avatar
Daniele Venzano committed
1
{% extends "base_user.jinja2" %}
2
{% block title %}Inspect execution {{ e.name }}{% endblock %}
3 4

{% block custom_head %}
5 6
    <script src="{{ static_url("moment.min.js") }}" type="application/javascript"></script>
    <script src="{{ static_url("moment-timezone.min.js") }}" type="application/javascript"></script>
7
    <script>
Daniele Venzano's avatar
Daniele Venzano committed
8
    let locale = window.navigator.userLanguage || window.navigator.language;
9 10
    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 %}

19
{% block content %}
20
<h2>Detailed information for execution {{ e.name }} ({{ e.id }})</h2>
21 22
<div id="contents">
<ul>
23
    <li>Application name: {{ e.app_name }}</li>
Daniele Venzano's avatar
Daniele Venzano committed
24
    {% if user.role.can_operate_others %}
25
    <li>Owner: {{ e.owner.username }}</li>
26
    {% endif %}
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
    <li>Status: <span style="font-weight: bold;">{{ e.status }}</span></li>
39
    {% if e.is_running %}
40
    <li>Will be killed at: <script>format_timestamp("{{ killed_at }}")</script></li>
41
    <li>Actions:
42
        <a href="{{ reverse_url("execution_terminate", e.id) }}">Terminate</a>
43
    </li>
44
    {% endif %}
45 46 47 48 49
    {% if grafana_url is defined %}
    <li>
        <a href="{{ grafana_url }}">Resource usage plots</a>
    </li>
    {% endif %}
50 51 52 53
</ul>
{% if e.status == 'error' %}
<p>Error message: <code>{{ e.error_message }}</code></p>
{% endif %}
54 55 56
{% if e.status == 'terminated' %}
<p>Termination reason: <code>{{ e.error_message }}</code></p>
{% endif %}
57

58 59 60 61
<div id="endpoints">
<h3>Endpoints</h3>
{% if endpoints|length > 0 %}
<ul>
62
{% for endp in endpoints|sort %}
63
    {% if endp[2] != None %}
64
        <li><a href="{{ endp[2] }}" target="_blank">{{ endp[0] }}</a> (<a href="{{ endp[1] }}" target="_blank" title="Direct connection without proxy, works only in Eurecom">internal link</a>)</li>
65
    {% else %}
66
    <li><a href="{{ endp[1] }}" target="_blank">{{ endp[0] }}</a> ({{ endp[1] }})</li>
67
    {% endif %}
68 69 70
{% endfor %}
</ul>
{% else %}
71 72
    {% if e.status == "running" %}
        <p>This execution does not have any active endpoint</p>
73
    {% elif e.status == "submitted" or e.status == "starting" or e.status == "queued" %}
74 75 76 77
        <p>Please wait, the execution is starting up. This page will refresh automatically.</p>
    {% else %}
        <p>No endpoints are available</p>
    {% endif %}
78 79 80
{% endif %}
</div>

81 82 83 84
<div id="container_list">
{% if services_info|length > 0 %}
<h3>Services:</h3>
{% endif %}
85 86 87 88 89 90 91 92
<table class="service-list">
    <thead>
    <tr>
        <th>ID</th>
        <th>Name</th>
        <th>Zoe status</th>
        <th>Backend status</th>
        <th>Host</th>
93
        <th>Labels</th>
94 95 96 97 98 99 100 101 102 103 104 105
        <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>
106
            <td>{% for l in s['labels'] %}{{ l }} {% endfor %}</td>
107 108 109 110 111
            {% if s['status'] != 'created' %}
            <td><a href="{{ reverse_url("service_logs", s['id']) }}">open</a></td>
            {% else %}
            <td></td>
            {% endif %}
112 113 114 115 116 117
            <td>{{ s['error_message'] }}</td>
        </tr>
    {% endfor %}

    </tbody>
</table>
118 119 120
</div>

</div>
121
{% if e.status != 'terminated' %}
122 123 124 125 126 127
<script>
    function refresh_page() {
        document.location.reload();
    }
    setInterval(refresh_page, 15000);
</script>
128
{% endif %}
129
{% endblock %}