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

Kálmán Viktor committed
5 6 7 8
<div class="row">
  <div class="col-md-12">
    <div class="panel panel-default">
      <div class="panel-heading">
9
        <h3 class="no-margin"><i class="icon-desktop"></i>{% trans "Virtual machines" %}</h3>
Kálmán Viktor committed
10
      </div>
11 12
      <div class="pull-right" style="max-width: 250px; margin-top: 15px; margin-right: 15px;">
        <form action="" method="GET" class="input-group">
13
          <input type="text" name="s"{% if request.GET.s %} value="{{ request.GET.s }}"{% endif %} class="form-control input-tags" placeholder="{% trans "Search..."%}" />
14 15 16 17 18
          <div class="input-group-btn">
            <button type="submit" class="form-control btn btn-primary input-tags" title="search"><i class="icon-search"></i></button>
          </div>
        </form>
      </div>
19 20
      <div class="panel-body vm-list-group-control">
        <p>
21 22 23 24 25 26
        <strong>{% trans "Group actions" %}</strong>
        <button id="vm-list-group-select-all" class="btn btn-info btn-xs">{% trans "Select all" %}</button>
        <a class="btn btn-default btn-xs" id="vm-list-group-migrate" disabled><i class="icon-truck"></i> {% trans "Migrate" %}</a>
        <a disabled href="#" class="btn btn-default btn-xs"><i class="icon-refresh"></i> {% trans "Reboot" %}</a>
        <a disabled href="#" class="btn btn-default btn-xs"><i class="icon-off"></i> {% trans "Shutdown" %}</a>
        <a id="vm-list-group-delete" disabled href="#" class="btn btn-danger btn-xs"><i class="icon-remove"></i> {% trans "Destroy" %}</a>
27 28
        </p>
      </div>
Kálmán Viktor committed
29
      <div class="panel-body">
30 31 32 33 34 35 36 37 38 39 40 41
        <table class="table table-bordered table-striped table-hover vm-list-table">
          <thead><tr>
              <th class="orderable pk sortable vm-list-table-thin"><a href="?sort=pk">{% trans "ID" %}</a></th>
              <th class="name orderable sortable"><a href="?sort=name">{% trans "Name" %}</a></th>
              <th>{% trans "State" %}</th>
              <th class="orderable sortable"><a href="?sort=owner">{% trans "Owner" %}</a></th>
              {% if user.is_superuser %}<th class="orderable sortable"><a href="?sort=node">{% trans "Node" %}</a></th>{% endif %}
          </tr></thead><tbody>
          {% for i in object_list %}
          <tr class="{% cycle 'odd' 'even' %}">
            <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>
42
            <td class="state">{{ i.get_status_display }}</td>
43 44 45 46 47 48 49 50
            <td>{{ i.owner }}</td>
            {% if user.is_superuser %}<td>{{ i.node.name|default:"-" }}</td>{% endif %}
          </tr>
          {% empty %}
          <tr><td colspan="4">{% trans "You have no virtual machines." %}</td></tr>
          {% endfor %}
        </tbody>
      </table>
51 52 53
    </div>
  </div>
</div>
54 55
</div>

56

57
<div class="alert alert-info">
58 59
	{% 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!" %}
60 61
</div>

62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
<style>
  .popover {
    max-width: 600px;
  }

  .vm-list-selected, .vm-list-selected td {
    background-color: #e8e8e8 !important;
  }

  .vm-list-selected:hover, .vm-list-selected:hover td {
    background-color: #d0d0d0 !important;
  }

  .vm-list-selected td:first-child {
    font-weight: bold;
  }
78 79 80 81 82 83 84 85

  .vm-list-table-thin {
    width: 10px;
  }

  .vm-list-table-admin {
    width: 130px;
  }
86 87 88 89
</style>
{% endblock %}

{% block extra_js %}
90 91
  <script src="{{ STATIC_URL}}dashboard/vm-list.js"></script>
  <script src="{{ STATIC_URL}}dashboard/vm-common.js"></script>
Kálmán Viktor committed
92
{% endblock %}