box-vmlist.html 5.08 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 %}">
Dányi Bence committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
    <div class="summary {% if id == i.id %}selected-summary{% endif %} {% if i.template.state == "NEW" %}unfinished{% endif %}">
        <!--<div class="id"></div>
    -->
    <div class="name {% if i.state == 'ACTIVE' %}wm-on{% else %}wm-off{% endif %}">{{i.name|truncatechars:20}}</div>
    <div class="status">{{i.state}}</div>
    <div class="actions">
        {% if i.state == 'ACTIVE' %}
        <a href="{{i.get_connect_uri}}" data-id="{{ i.id  }}" class="connect-vm-button" title="{% trans "Connect" %}">
            <img src="/static/icons/plug.png" alt="{% trans "Connect" %}" />
        </a>
        <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" %}" />
        </span>
        <a href="#"  class="delete-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Delete" %}">
            <img src="/static/icons/minus-circle.png" alt="{% trans "Delete" %}" />
        </a>
        <a href="#"  class="restart-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Restart" %}">
            <img src="/static/icons/arrow-circle-double.png" alt="↺" />
        </a>
        {% endif %}
Őry Máté committed
26
            {% if i.state == 'PENDING' %}
Dányi Bence committed
27 28
        <img src="/static/load.gif" />
        {% trans "starting…" %}
Őry Máté committed
29
            {% endif %}
30
            {% if i.state == 'STOPPED' %}
Dányi Bence committed
31 32 33 34 35 36 37
        <a href="#"  class="resume-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Resume" %}">
            <img src="/static/icons/control.png" alt="{% trans "Resume" %}" />
        </span>
        <a href="#"  class="delete-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Delete" %}">
            <img src="/static/icons/minus-circle.png" alt="{% trans "Delete" %}" />
        </a>
        {% endif %}
Őry Máté committed
38
            {% if i.state == 'FAILED' %}
Dányi Bence committed
39 40 41 42
        <a href="#"  class="delete-vm-button" data-name="{{ i.name}}" data-id="{{ i.id }}" title="{% trans "Delete" %}">
            <img src="/static/icons/minus-circle.png" alt="{% trans "Delete" %}" />
        </a>
        {% endif %}
Bence Dnyi committed
43
    </div>
Dányi Bence committed
44 45 46 47 48 49 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
    <div class="clear"></div>
</div>
<div class="details">
    <div class="details-container">
        <ul>
            <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 "Type" %}:
                <span class="value">{{i.share.type}}</span>
                <div class="clear"></div>
            </li>
            <li class="template">
                {% trans "Share" %}:
                <span class="value">{{i.share.name}}</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}}:
78 79 80
                    <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>
Dányi Bence committed
81 82 83 84 85 86 87 88 89 90 91 92 93
                </span>
            </li>
            <li class="date">
                {% trans "Created at" %}:
                <span class="value">{{i.created_at}}</span>
            </li>
            {% 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 %}
94
                {% if i.time_of_delete %}
Dányi Bence committed
95 96 97 98 99 100 101 102 103 104 105 106 107
            <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 %}
            <li>
                &nbsp;
                <span class="value">
                    <a href="/vm/show/{{i.id}}/" title="{{i.name}}">{% trans "More details" %}</a>
                </span>
            </li>
        </ul>
Bence Dnyi committed
108
    </div>
Dányi Bence committed
109
</div>
Bence Dnyi committed
110
</li>
Dudás Ádám committed
111 112
{% endfor %}
{% else %}
Danyi Bence committed
113
<div id="new-wm-tooltip">
Dányi Bence committed
114 115 116 117 118 119 120
<div id="new-wm-tooltip-container">
    <p>{% trans "You have not started any machines yet." %}</p>
    <p>
        {% trans "Choose a template, and you can use the system in a minute." %}
    </p>
    <div id="new-wm-tooltip-tail"></div>
</div>
Bence Dnyi committed
121
</div>
122
{% endif %}