vm-list.html 4.86 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 28 29 30 31 32
      <p>
      {% for o in ops %}
        <a href="{{ o.get_url }}" class="btn btn-xs btn-{{ o.effect }}" title="{{ o.name }}">
          <i class="fa fa-{{ o.icon }}"></i>
        </a>
      {% endfor %}
      </p>
33 34
      <div class="panel-body vm-list-group-control">
        <p>
35 36
        <strong>{% trans "Group actions" %}</strong>
        <button id="vm-list-group-select-all" class="btn btn-info btn-xs">{% trans "Select all" %}</button>
37 38 39 40
        <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>
41 42
        </p>
      </div>
Kálmán Viktor committed
43
      <div class="panel-body">
44 45
        <table class="table table-bordered table-striped table-hover vm-list-table">
          <thead><tr>
46
              <th data-sort="int" class="orderable pk sortable vm-list-table-thin" style="min-width: 50px;">
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
                {% 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 %}
66 67
          </tr></thead><tbody>
          {% for i in object_list %}
68
          <tr class="{% cycle 'odd' 'even' %}" data-vm-pk="{{ i.pk }}">
69 70
            <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>
71
            <td class="state">{{ i.get_status_display }}</td>
72 73 74
            <td>
              {% include "dashboard/_display-name.html" with user=i.owner show_org=True %}
            </td>
75 76 77
            {% if user.is_superuser %}
            <td data-sort-value="{{ i.node.normalized_name }}">{{ i.node.name|default:"-" }}</td>
            {% endif %}
78 79
          </tr>
          {% empty %}
80 81 82 83 84 85 86 87 88
          <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>
89 90 91
          {% endfor %}
        </tbody>
      </table>
92 93 94
    </div>
  </div>
</div>
95 96
</div>

97

98
<div class="alert alert-info">
99 100
  {% 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!" %}
101 102
</div>

103 104 105
{% endblock %}

{% block extra_js %}
106 107
  <script src="{{ STATIC_URL}}dashboard/vm-list.js"></script>
  <script src="{{ STATIC_URL}}dashboard/vm-common.js"></script>
108
  <script src="{{ STATIC_URL}}dashboard/js/stupidtable.min.js"></script>
Kálmán Viktor committed
109
{% endblock %}