vm-list.html 6.77 KB
Newer Older
Kálmán Viktor committed
1
{% extends "dashboard/base.html" %}
2
{% load staticfiles %}
Kálmán Viktor committed
3
{% load i18n %}
4 5 6

{% block title-page %}{% trans "Virtual machines" %}{% endblock %}

Kálmán Viktor committed
7
{% block content %}
8

Kálmán Viktor committed
9 10 11 12
<div class="row">
  <div class="col-md-12">
    <div class="panel panel-default">
      <div class="panel-heading">
13 14
        <div class="pull-right table-sorting">
          {% trans "Sorting ... " %}
15
          <!--<i class="fa fa-refresh fa-spin fa-2x"></i>-->
16
        </div>
17
        <h3 class="no-margin"><i class="fa fa-desktop"></i> {% trans "Virtual machines" %}</h3>
Kálmán Viktor committed
18
      </div>
19 20 21 22 23 24
      <div class="panel-body">
        <div class="row">
          <div class="col-md-8 vm-list-group-control" id="vm-mass-ops">
            <strong>{% trans "Group actions" %}</strong>
            <button id="vm-list-group-select-all" class="btn btn-info btn-xs">{% trans "Select all" %}</button>
            {% for o in ops %}
25
              <a href="{{ o.get_url }}" class="btn btn-xs btn-{{ o.effect }} mass-operation"
26 27 28 29 30 31 32 33 34 35 36
               title="{{ o.name|capfirst }}" disabled>
                <i class="fa fa-{{ o.icon }}"></i>
              </a>
            {% endfor %}
          </div><!-- .vm-list-group-control -->
          <div class="col-md-4" id="vm-list-search">
            <form action="" method="GET">
              <div class="input-group">
                {{ search_form.s }}
                <div class="input-group-btn">
                  {{ search_form.stype }}
37
                </div>
38
                <label class="input-group-addon input-tags" title="{% trans "Include deleted VMs" %}"
39 40
                  id="vm-list-search-checkbox-span" data-container="body">
                  {{ search_form.include_deleted }}
41
                </label>
42
                <div class="input-group-btn">
43
                  <button type="submit" class="btn btn-primary input-tags">
44 45 46 47 48 49 50 51
                    <i class="fa fa-search"></i>
                  </button>
                </div>
              </div><!-- .input-group -->
            </form>
          </div><!-- .col-md-4 #vm-list-search -->
        </div><!-- .row -->
      </div><!-- .panel-body -->
Kálmán Viktor committed
52
      <div class="panel-body">
53
        <div class="table-responsive">
54 55
        <table class="table table-bordered table-striped table-hover vm-list-table"
         id="vm-list-table">
56
          <thead><tr>
57
              <th data-sort="int" class="orderable pk sortable vm-list-table-thin" style="min-width: 50px;">
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
                {% trans "ID" as t %}
                {% include "dashboard/vm-list/header-link.html" with name=t sort="pk" %}
              </th>
              <th data-sort="string" class="name orderable sortable">
                {% trans "Name" as t %}
                {% include "dashboard/vm-list/header-link.html" with name=t sort="name" %}
              </th>
              <th data-sort="string">
                {% trans "State" as t %}
                {% include "dashboard/vm-list/header-link.html" with name=t sort="status" %}
              </th>
              <th data-sort="string" class="orderable sortable">
                {% trans "Owner" as t %}
                {% include "dashboard/vm-list/header-link.html" with name=t sort="owner" %}
              </th>
73 74 75 76
              <th data-sort="string" class="orderable sortable">
                {% trans "Lease" as t %}
                {% include "dashboard/vm-list/header-link.html" with name=t sort="lease" %}
              </th>
77 78 79 80
              <th data-sort="string" class="orderable sortable">
                {% trans "Memory" as t %}
                {% include "dashboard/vm-list/header-link.html" with name=t sort="ram_size" %}
              </th>
81 82 83 84 85 86 87 88 89 90
              {% if user.is_superuser %}
                <th data-sort="string" class="orderable sortable">
                  {% trans "IP address" as t %}
                  {% include "dashboard/vm-list/header-link.html" with name=t sort="ip_addr" %}
                </th>
                <th data-sort="string" class="orderable sortable">
                  {% trans "Node" as t %}
                  {% include "dashboard/vm-list/header-link.html" with name=t sort="node" %}
                </th>
              {% endif %}
91 92
          </tr></thead><tbody>
          {% for i in object_list %}
93
          <tr class="{% cycle 'odd' 'even' %}" data-vm-pk="{{ i.pk }}">
94
            <td class="pk"><div id="vm-{{i.pk}}">{{i.pk}}</div> </td>
95 96 97
            <td class="name"><a class="real-link" href="{% url "dashboard.views.detail" i.pk %}">
                {{ i.name }}</a>
            </td>
98
            <td class="state">
99
              <i class="fa fa-fw
100
                {% if show_acts_in_progress and i.is_in_status_change %}
101 102 103 104 105
                  fa-spin fa-spinner
                {% else %}
                {{ i.get_status_icon }}{% endif %}"></i>
              <span>{{ i.get_status_display }}</span>
            </td>
106
            <td>
107 108 109 110 111 112
              {% if i.owner.profile %}
                {{ i.owner.profile.get_display_name }}
              {% else %}
                {{ i.owner.username }}
              {% endif %}
              {# include "dashboard/_display-name.html" with user=i.owner show_org=True #}
113
            </td>
114
            <td class="lease "data-sort-value="{{ i.lease.name }}">
115 116 117 118 119 120
              <span title="{{ i.time_of_suspend|timeuntil }} | {{ i.time_of_delete|timeuntil }}">
                {{ i.lease.name }}
              </span>
            </td>
            <td class="memory "data-sort-value="{{ i.ram_size }}">
              {{ i.ram_size }} MiB
121
            </td>
122
            {% if user.is_superuser %}
123 124 125
            <td class="ip_addr "data-sort-value="{{ i.ipv4 }}">
              {{ i.ipv4|default:"-" }}
            </td>
126 127 128
            <td class="node "data-sort-value="{{ i.node.normalized_name }}">
              {{ i.node.name|default:"-" }}
            </td>
129
            {% endif %}
130 131
          </tr>
          {% empty %}
132
          <tr>
133
            <td colspan="7">
134 135 136 137 138 139 140
              {% if request.GET.s %}
                <strong>{% trans "No result." %}</strong>
              {% else %}
                <strong>{% trans "You have no virtual machines." %}</strong>
              {% endif %}
            </td>
          </tr>
141 142 143
          {% endfor %}
        </tbody>
      </table>
144
      </div><!-- .table-responsive -->
145 146 147
    </div>
  </div>
</div>
148 149
</div>

150
<div class="alert alert-info">
151 152 153 154 155
  {% blocktrans %}
  You can filter the list by certain attributes (owner, name, status, tags)
  in the following way: "owner:John Doe name:my little server !name:test".
  If you don't specify any attribute names the filtering will be done by name.
  {% endblocktrans %}
156
</div>
157

158
<div class="alert alert-info">
159 160
  {% trans "You can select multiple vm instances while holding down the <strong>CTRL</strong> key." %}
  {% trans "If you want to select multiple instances by one click select an instance then hold down <strong>SHIFT</strong> key and select another one!" %}
161 162
</div>

163
{% endblock %}