index-vm.html 3.78 KB
Newer Older
1 2 3 4 5
{% load i18n %}
<div class="panel panel-default">
  <div class="panel-heading">
    <div class="pull-right toolbar">
      <div class="btn-group">
6 7
        <a href="#index-graph-view" data-index-box="vm" class="btn btn-default btn-xs"><i class="icon-dashboard"></i></a>
        <a href="#index-list-view" data-index-box="vm" class="btn btn-default btn-xs disabled"><i class="icon-list"></i></a>
8
      </div>
Kálmán Viktor committed
9
      <span class="btn btn-default btn-xs infobtn" title="{% trans "Help" %}"><i class="icon-info-sign"></i></span>
10 11
    </div>
    <h3 class="no-margin">
12
      <i class="icon-desktop"></i> {% trans "Virtual machines" %}
13 14 15
    </h3>
  </div>
  <div class="list-group" id="vm-list-view">
16 17 18
    <div id="dashboard-vm-list">
      {% for i in instances %}
      <a href="{{ i.get_absolute_url }}" class="list-group-item">
19 20 21 22 23
        <span class="index-vm-list-name">
          <i class="{{ i.get_status_icon }}" title="{{ i.get_status_display }}"></i>
          {{ i.name }}
        </span>
        <small class="text-muted"> {{ i.primary_host.hostname }}</small>
24 25
        <div class="pull-right dashboard-vm-favourite" data-vm="{{ i.pk }}">
          {% if i.fav %}
26
            <i class="icon-star text-primary title-favourite" title="{% trans "Unfavourite" %}"></i>
27
          {% else %}
28
            <i class="icon-star-empty text-primary title-favourite" title="{% trans "Mark as favorite" %}"></i>
29 30
          {% endif %}
        </div>
31
      <div style="clear: both;"></div>
32
      </a>
33 34
      {% endfor %}
    </div>
35 36
    <div href="#" class="list-group-item list-group-footer">
      <div class="row">
37
        <div class="col-sm-6 col-xs-6 input-group input-group-sm">
Kálmán Viktor committed
38
          <input id="dashboard-vm-search-input" type="text" class="form-control" placeholder="{% trans "Search..." %}" />
39 40 41 42 43
          <div class="input-group-btn">
            <button type="submit" class="form-control btn btn-primary" title="search"><i class="icon-search"></i></button>
          </div>
        </div>
        <div class="col-sm-6 text-right">
44 45
          {% if more_instances > 0 %}
          <a class="btn btn-primary btn-xs" href="{% url "dashboard.views.vm-list" %}">
46
            <i class="icon-chevron-sign-right"></i> {% blocktrans with count=more_instances %}<strong>{{ count }}</strong>  more{% endblocktrans %}
47 48
          </a>
          {% endif %}
Kálmán Viktor committed
49
          <a class="btn btn-success btn-xs vm-create" href="{% url "dashboard.views.vm-create" %}"><i class="icon-plus-sign"></i> {% trans "new" %}</a>
50 51 52 53 54
        </div>
      </div>
    </div>
  </div>
  <div class="panel-body" id="vm-graph-view" style="display: none">
55
    <p class="pull-right">  <input class="knob" data-fgColor="chartreuse" data-thickness=".4" data-max="{{ request.user.profile.instance_limit }}" data-width="100" data-height="100" data-readOnly="true" value="{{ instances|length|add:more_instances }}"></p>
56
    <p><span class="bigbig">{% blocktrans with count=running_vm_num %}<big>{{ count }}</big> running{% endblocktrans %}</span>
57
      <ul class="list-inline" style="max-height: 95px; overflow: hidden;">
58
        {% for vm in running_vms %}
59 60 61 62 63
        <li style="display: inline-block; padding: 2px;">
          <a href="{{vm.get_absolute_url}}" title="{{vm.primary_host.get_fqdn}}"  class="label label-success">
            <i class="{{vm.get_status_icon}}"></i> {{vm.name}}
          </a>
        </li>
64
        {% endfor %}
65 66 67 68
      </ul>
    </p>

    <div class="clearfix"></div>
69 70 71 72 73 74
    <div>
      <a style="float: right; margin-top: 17px;" href="{% url "dashboard.views.vm-list" %}" class="btn btn-primary btn-xs">
        <i class="icon-chevron-sign-right"></i> 
        <strong>{{ instances|length|add:more_instances }}</strong>  machines  total
      </a> 
      <p class="big text-warning">{% blocktrans with count=stopped_vm_num %}<big>{{ count }}</big> stopped{% endblocktrans %}</p>
75 76 77
    </div>
  </div>
</div>