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

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

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

Kálmán Viktor committed
8 9 10 11
<div class="row">
  <div class="col-md-12">
    <div class="panel panel-default">
      <div class="panel-heading">
12 13
        <div class="pull-right table-sorting">
          {% trans "Sorting ... " %}
14
          <!--<i class="fa fa-refresh fa-spin fa-2x"></i>-->
15
        </div>
16
        <h3 class="no-margin"><i class="fa fa-desktop"></i> {% trans "Virtual machines" %}</h3>
Kálmán Viktor committed
17
      </div>
18 19
      <div class="pull-right" style="max-width: 250px; margin-top: 15px; margin-right: 15px;">
        <form action="" method="GET" class="input-group">
20
          <input type="text" name="s"{% if request.GET.s %} value="{{ request.GET.s }}"{% endif %} class="form-control input-tags" placeholder="{% trans "Search..."%}" />
21
          <div class="input-group-btn">
22
            <button type="submit" class="form-control btn btn-primary input-tags" title="search"><i class="fa fa-search"></i></button>
23 24 25
          </div>
        </form>
      </div>
26 27
      <div class="panel-body vm-list-group-control">
        <p>
28 29
        <strong>{% trans "Group actions" %}</strong>
        <button id="vm-list-group-select-all" class="btn btn-info btn-xs">{% trans "Select all" %}</button>
30 31 32 33
        <a class="btn btn-default btn-xs" id="vm-list-group-migrate" disabled><i class="fa fa-truck"></i> {% trans "Migrate" %}</a>
        <a disabled href="#" class="btn btn-default btn-xs"><i class="fa fa-refresh"></i> {% trans "Reboot" %}</a>
        <a disabled href="#" class="btn btn-default btn-xs"><i class="fa fa-off"></i> {% trans "Shutdown" %}</a>
        <a id="vm-list-group-delete" disabled href="#" class="btn btn-danger btn-xs"><i class="fa fa-times"></i> {% trans "Destroy" %}</a>
34 35
        </p>
      </div>
Kálmán Viktor committed
36
      <div class="panel-body">
37 38
        <table class="table table-bordered table-striped table-hover vm-list-table">
          <thead><tr>
39
              <th data-sort="int" class="orderable pk sortable vm-list-table-thin" style="min-width: 50px;">
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
                {% 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>
              {% if user.is_superuser %}<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 %}
59 60
          </tr></thead><tbody>
          {% for i in object_list %}
61
          <tr class="{% cycle 'odd' 'even' %}" data-vm-pk="{{ i.pk }}">
62 63
            <td class="pk"><div id="vm-{{i.pk}}">{{i.pk}}</div> </td>
            <td class="name"><a class="real-link" href="{% url "dashboard.views.detail" i.pk %}">{{ i.name }}</a>  </td>
64
            <td class="state">{{ i.get_status_display }}</td>
65 66 67
            <td>
              {% include "dashboard/_display-name.html" with user=i.owner show_org=True %}
            </td>
68 69 70
            {% if user.is_superuser %}
            <td data-sort-value="{{ i.node.normalized_name }}">{{ i.node.name|default:"-" }}</td>
            {% endif %}
71 72
          </tr>
          {% empty %}
73 74 75 76 77 78 79 80 81
          <tr>
            <td colspan="5">
              {% if request.GET.s %}
                <strong>{% trans "No result." %}</strong>
              {% else %}
                <strong>{% trans "You have no virtual machines." %}</strong>
              {% endif %}
            </td>
          </tr>
82 83 84
          {% endfor %}
        </tbody>
      </table>
85 86 87
    </div>
  </div>
</div>
88 89
</div>

90

91
<div class="alert alert-info">
92 93
  {% 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!" %}
94 95
</div>

96 97 98
{% endblock %}

{% block extra_js %}
99 100
  <script src="{{ STATIC_URL}}dashboard/vm-list.js"></script>
  <script src="{{ STATIC_URL}}dashboard/vm-common.js"></script>
101
  <script src="{{ STATIC_URL}}dashboard/js/stupidtable.min.js"></script>
Kálmán Viktor committed
102
{% endblock %}