vm-list.html 3.77 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
        <h3 class="no-margin"><i class="icon-desktop"></i> {% trans "Virtual machines" %}</h3>
Kálmán Viktor committed
13
      </div>
14 15
      <div class="pull-right" style="max-width: 250px; margin-top: 15px; margin-right: 15px;">
        <form action="" method="GET" class="input-group">
16
          <input type="text" name="s"{% if request.GET.s %} value="{{ request.GET.s }}"{% endif %} class="form-control input-tags" placeholder="{% trans "Search..."%}" />
17 18 19 20 21
          <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>
22 23
      <div class="panel-body vm-list-group-control">
        <p>
24 25 26 27 28 29
        <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>
30 31
        </p>
      </div>
Kálmán Viktor committed
32
      <div class="panel-body">
33 34 35 36 37 38 39 40 41 42 43 44
        <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>
45
            <td class="state">{{ i.get_status_display }}</td>
46 47 48 49 50 51 52 53
            <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>
54 55 56
    </div>
  </div>
</div>
57 58
</div>

59

60
<div class="alert alert-info">
61 62
	{% 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!" %}
63 64
</div>

65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
<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;
  }
81 82 83 84 85 86 87 88

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

  .vm-list-table-admin {
    width: 130px;
  }
89 90 91 92
</style>
{% endblock %}

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