execution_inspect.jinja2 3.63 KB
Newer Older
Daniele Venzano's avatar
Daniele Venzano committed
1
{% extends "base_user.jinja2" %}
Sabino Papagna's avatar
Sabino Papagna committed
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 %}

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>
Daniele Venzano's avatar
Daniele Venzano committed
24
    {% if user.role.can_operate_others %}
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
    <li>Status: <span style="font-weight: bold;">{{ e.status }}</span></li>
39
    {% if e.is_running %}
40
    <li>Actions:
41
        <a href="{{ reverse_url("execution_terminate", e.id) }}">Terminate</a>
42
    </li>
43
44
    {% elif e.status == "terminated" %}
    <li>Actions:
45
        <a href="{{ reverse_url("execution_restart", e.id) }}">Restart</a>
46
47
    </li>
    {% endif %}
48
49
50
51
52
    {% if grafana_url is defined %}
    <li>
        <a href="{{ grafana_url }}">Resource usage plots</a>
    </li>
    {% endif %}
Sabino Papagna's avatar
Sabino Papagna committed
53
54
55
56
57
</ul>
{% if e.status == 'error' %}
<p>Error message: <code>{{ e.error_message }}</code></p>
{% endif %}

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

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

    </tbody>
</table>
Sabino Papagna's avatar
Sabino Papagna committed
114
115
116
</div>

</div>
117
{% if e.status != 'terminated' %}
118
119
120
121
122
123
<script>
    function refresh_page() {
        document.location.reload();
    }
    setInterval(refresh_page, 15000);
</script>
124
{% endif %}
Sabino Papagna's avatar
Sabino Papagna committed
125
{% endblock %}