box-vmlist.html 4.47 KB
Newer Older
Őry Máté committed
1 2
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
Dudás Ádám committed
3 4
{% if instances %}
{% for i in instances %}
5
<li class="wm {% if id == i.id %}opened{% endif %}">
6
<div class="summary {% if id == i.id %}selected-summary{% endif %} {% if i.template.state == "NEW" %}unfinished{% endif %}">
7
        <!--<div class="id"></div>-->
Bence Dnyi committed
8
        <div class="name {% if i.state == 'ACTIVE' %}wm-on{% else %}wm-off{% endif %}">
Danyi Bence committed
9
            {{i.name|truncatechars:20}}
Bence Dnyi committed
10
        </div>
Danyi Bence committed
11 12 13
        <div class="status">
            {{i.state}}
        </div>
Bence Dnyi committed
14
        <div class="actions">
Őry Máté committed
15
            {% if i.state == 'ACTIVE' %}
16
            <a href="{{i.get_connect_uri}}" data-id="{{ i.id  }}" class="connect-vm-button" title="{% trans "Connect" %}">
Dányi Bence committed
17
                <img src="/static/icons/plug.png" alt="{% trans "Connect" %}" />
Dányi Bence committed
18
            </a>
19 20
            <a href="#"  class="stop-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Pause" %}">
                <img src="/static/icons/control-pause.png" alt="{% trans "Pause" %}" />
21 22
            </span>
            <a href="#"  class="delete-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Delete" %}">
Őry Máté committed
23
                <img src="/static/icons/minus-circle.png" alt="{% trans "Delete" %}" />
Dányi Bence committed
24
            </a>
25
            <a href="#"  class="restart-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Restart" %}">
Dányi Bence committed
26 27
                <img src="/static/icons/arrow-circle-double.png" alt="↺" />
            </a>
Őry Máté committed
28 29
            {% endif %}
            {% if i.state == 'PENDING' %}
30
            <img src="/static/load.gif" /> {% trans "starting…" %}
Őry Máté committed
31
            {% endif %}
32 33
            {% if i.state == 'STOPPED' %}
            <a href="#"  class="resume-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Resume" %}">
Őry Máté committed
34
                <img src="/static/icons/control.png" alt="{% trans "Resume" %}" />
35 36
            </span>
            <a href="#"  class="delete-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Delete" %}">
Őry Máté committed
37
                <img src="/static/icons/minus-circle.png" alt="{% trans "Delete" %}" />
Dányi Bence committed
38
            </a>
Őry Máté committed
39 40
            {% endif %}
            {% if i.state == 'FAILED' %}
41
            <a href="#"  class="delete-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Delete" %}">
Őry Máté committed
42
                <img src="/static/icons/minus-circle.png" alt="{% trans "Delete" %}" />
Dányi Bence committed
43
            </a>
Őry Máté committed
44
            {% endif %}
Bence Dnyi committed
45 46 47
        </div>
        <div class="clear"></div>
    </div>
48
    <div class="details">
49
        <div class="details-container">
Dányi Bence committed
50
            <ul>
51 52 53 54 55 56 57 58
                <li class="name">{% trans "Hostname" %}: <span class="value">{{i.name}}</span><div class="clear"></div></li>
                <li class="os-{{i.template.os_type}}">{% trans "System" %}: <span class="value">{{i.template.system}}</span><div class="clear"></div></li>
                <li class="template">{% trans "Template" %}: <span class="value">{{i.template.name}}</span><div class="clear"></div></li>
                <li class="type">{% trans "Size" %}: <span class="value">{{i.template.instance_type.name}}:
                    <span class="cpu">{{i.template.instance_type.CPU}}</span>
                    <span class="memory">{{i.template.instance_type.RAM}}</span>
                    <span class="credit">{{i.template.instance_type.credit}}</span>
                </span></li>
Őry Máté committed
59
                <li class="date">{% trans "Created at" %}: <span class="value">{{i.created_at}}</span></li>
60 61 62 63 64 65
                {% if i.time_of_suspend %}
                <li class="date">{% trans "time of suspend"|capfirst %}: <span class="value"><abbr title="{{i.time_of_suspend}}">{{i.time_of_suspend|timeuntil}}</abbr></span></li>
                {% endif %}
                {% if i.time_of_delete %}
                <li class="date">{% trans "time of delete"|capfirst %}: <span class="value"><abbr title="{{i.time_of_delete}}">{{i.time_of_delete|timeuntil}}</abbr></span></li>
                {% endif %}
Őry Máté committed
66
                <li>&nbsp;<span class="value"><a href="/vm/show/{{i.id}}/" title="{{i.name}}">{% trans "More details" %}</a></span></li>
Dányi Bence committed
67 68
            </ul>
        </div>
Bence Dnyi committed
69 70
    </div>
</li>
Dudás Ádám committed
71 72
{% endfor %}
{% else %}
Danyi Bence committed
73
<div id="new-wm-tooltip">
Bence Dnyi committed
74 75
    <div id="new-wm-tooltip-container">
        <p>
Őry Máté committed
76
            {% trans "You have not started any machines yet." %}
Bence Dnyi committed
77 78
        </p>
        <p>
Őry Máté committed
79
            {% trans "Choose a template, and you can use the system in a minute." %}
Bence Dnyi committed
80
        </p>
Dányi Bence committed
81
        <div id="new-wm-tooltip-tail"></div>
Bence Dnyi committed
82 83
    </div>
</div>
84
{% endif %}