apps.html 1.98 KB
Newer Older
Daniele Venzano's avatar
Daniele Venzano committed
1
{% extends "base_user.html" %}
2
{% block title %}User usage history{% endblock %}
Daniele Venzano's avatar
Daniele Venzano committed
3
{% block content %}
4
<h2>Usage history</h2>
Daniele Venzano's avatar
Daniele Venzano committed
5 6 7 8 9 10 11
    {% if apps|length == 0 and not has_notebook %}
        <p>You have no clusters running at this time</p>
    {% endif %}

    {% if has_notebook %}
        <p>You have a notebook running:
        <a href="{{ notebook_address }}">open</a>
Daniele Venzano's avatar
Daniele Venzano committed
12
        <a href="{{ url_for("web_inspect", user_id=user_id, cluster_id=notebook_cluster_id) }}">inspect</a>
13
        <a href="{{ url_for("web_terminate", user_id=user_id, cluster_id=notebook_cluster_id) }}">terminate</a>
Daniele Venzano's avatar
Daniele Venzano committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
        </p>
    {% endif %}

    <table id="app_list">
    <thead>
    <tr>
        <th>Name</th>
        <th>Command line</th>
        <th>Spark options</th>
        <th>Started</th>
        <th>Finished</th>
        <th>Status</th>
        <th>Logs</th>
    </tr>
    </thead>
29
    <tbody>
Daniele Venzano's avatar
Daniele Venzano committed
30
        {% for a in apps %}
31
            <tr class="{{ loop.cycle('odd', 'even') }}">
Daniele Venzano's avatar
Daniele Venzano committed
32
            <td>{{ a["execution_name"] }}</td>
33 34
            <td class="long-text">{{ a["cmd"] }}</td>
            <td class="long-text">{{ a["spark_options"] }}</td>
Daniele Venzano's avatar
Daniele Venzano committed
35 36 37 38 39
            <td>{{ a["time_started"] }}</td>
            <td>{{ a["time_finished"] }}</td>
            <td>{{ a["status"] }}</td>
            <td>
                {% if a["status"] == "finished" %}
40
                <a href="{{ url_for("api_history_log_archive", user_id=user_id, app_id=a["id"]) }}">Zip</a>
Daniele Venzano's avatar
Daniele Venzano committed
41 42
                {% endif %}
                {% if a["status"] == "running" %}
43
                <a href="{{ url_for("web_inspect", user_id=user_id, cluster_id=a["cluster_id"]) }}">Inspect</a>
Daniele Venzano's avatar
Daniele Venzano committed
44 45 46 47
                {% endif %}
            </td>
            <td>
                {% if a["status"] == "running" %}
48
                <a href="{{ url_for("web_terminate", user_id=user_id, cluster_id=a["cluster_id"]) }}">Terminate</a>
Daniele Venzano's avatar
Daniele Venzano committed
49 50 51 52 53
                {% endif %}
            </td>
            </tr>
            <!-- FIXME: add a re-run link -->
        {% endfor %}
54
    </tbody>
Daniele Venzano's avatar
Daniele Venzano committed
55 56
    </table>
{% endblock %}