[GITLAB] - UPGRADE TO v12 on Wednesday the 18th of December at 11.30AM

home_user.jinja2 3.57 KB
Newer Older
Daniele Venzano's avatar
Daniele Venzano committed
1
{% extends "base_user.jinja2" %}
2
{% block title %}Home{% endblock %}
3 4

{% block custom_head %}
5 6 7
    <script src="{{ static_url("sorttable.js") }}" type="application/javascript"></script>
    <script src="{{ static_url("moment.min.js") }}" type="application/javascript"></script>
    <script src="{{ static_url("moment-timezone.min.js") }}" type="application/javascript"></script>
8 9
    <script>
    function format_timestamp(ts) {
10 11 12
        var m = moment.utc(ts);
        m.local();
        document.write(m.calendar());
13 14 15 16
    }
    </script>
{% endblock %}

17
{% block content %}
18 19 20 21 22 23 24 25 26 27 28
    <h2>Welcome to Zoe Analytics</h2>

    <p>You have {{ running_executions|length }} execution{{ "s" if running_executions|length != 1 }} running{% if running_executions|length > 0 %}
    with a total reservation of <script>format_bytes({{ total_memory }}, 2);</script> of memory and {{ total_cores }} cores.
        {% else %}.{% endif %}
    </p>

    {% if running_executions|length > 0 %}
    <div class="execution_table">
    <h3>Running executions</h3>
    <table id="exec_list" class="app_list">
29 30 31 32 33 34 35 36 37 38 39
    <thead>
    <tr>
        <th>ID</th>
        <th>Execution name</th>
        <th>Status</th>
        <th>Started</th>
        <th>Finished</th>
        <th>Actions</th>
    </tr>
    </thead>
    <tbody>
40 41
        {% for e in running_executions %}
            <tr>
42 43
                <td>{{ e.id }}</td>
                <td><a href="/executions/inspect/{{ e.id }}">{{ e.name }}</a></td>
44 45 46 47 48
                <td>{{ e.status }}</td>
                {% if e.time_start == None %}
                <td>not yet</td>
                {% else %}
                <td><script>format_timestamp("{{ e.time_start }}")</script></td>
49
                {% endif %}
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
                {% if e.time_end == None %}
                <td>not yet</td>
                {% else %}
                <td><script>format_timestamp("{{ e.time_end }}")</script></td>
                {% endif %}
                {% if e.is_active %}
                    <td><a href="/executions/terminate/{{ e.id }}">Terminate</a></td>
                {% else %}
                    <td><a href="/executions/restart/{{ e.id }}">Restart</a></td>
                {% endif %}
            </tr>
        {% endfor %}
    </tbody>
    </table>
    </div>
    {% endif %}

    {% if last_executions|length > 0 %}
    <div class="execution_table">
    <h3>Most recent executions</h3>
    <table id="exec_list" class="app_list">
    <thead>
    <tr>
        <th>ID</th>
        <th>Execution name</th>
        <th>Status</th>
        <th>Started</th>
        <th>Finished</th>
        <th>Actions</th>
    </tr>
    </thead>
    <tbody>
        {% for e in last_executions %}
            <tr>
                <td>{{ e.id }}</td>
                <td><a href="/executions/inspect/{{ e.id }}">{{ e.name }}</a></td>
86 87 88 89 90 91 92 93 94 95 96
                <td>{{ e.status }}</td>
                {% if e.time_start == None %}
                <td>not yet</td>
                {% else %}
                <td><script>format_timestamp("{{ e.time_start }}")</script></td>
                {% endif %}
                {% if e.time_end == None %}
                <td>not yet</td>
                {% else %}
                <td><script>format_timestamp("{{ e.time_end }}")</script></td>
                {% endif %}
97
                {% if e.is_active %}
98 99
                    <td><a href="/executions/terminate/{{ e.id }}">Terminate</a></td>
                {% else %}
100
                    <td><a href="/executions/restart/{{ e.id }}">Restart</a></td>
101 102 103 104 105 106
                {% endif %}
            </tr>
        {% endfor %}
    </tbody>
    </table>
    </div>
107
    {% endif %}
108 109

{% endblock %}