detail.html 3.5 KB
Newer Older
1 2 3 4 5 6
{% extends "dashboard/base.html" %}
{% load staticfiles %}
{% load i18n %}
{% load render_table from django_tables2 %}
{% load crispy_forms_tags %}

7
{% block title-page %}{% trans "Storage" %}{% endblock %}
8 9 10 11 12 13 14

{% block content %}

<div class="row">
  <div class="col-md-5">
    <div class="panel panel-default">
      <div class="panel-heading">
15
        <h3 class="no-margin"><i class="fa fa-database"></i> {% trans "Datastore" %}</h3>
16 17 18 19 20 21 22 23 24
      </div>
      <div class="panel-body">
        {% crispy form %}
      </div><!-- .panel-body -->
    </div>
  </div>
  <div class="col-md-7">
    <div class="panel panel-default">
      <div class="panel-heading">
25
        <h3 class="no-margin"><i class="fa fa-bar-chart"></i> {% trans "Statistics" %}</h3>
26 27 28 29 30 31 32 33 34
      </div>
      <div class="panel-body">
        <div class="progress">
          <div class="progress-bar progress-bar-success progress-bar-stripped"
            role="progressbar" style="min-width: 30px; width: {{ stats.used_percent }}%">
            {{ stats.used_percent }}%
          </div>
        </div>
        <div class="text-muted text-center">
35
          {{ stats.used_space}}/{{ stats.total_space }}
36 37
        </div>

38 39 40 41
        <h3>
          {% trans "Missing disks" %}
          <small>{% trans "disk objects without images files" %}</small>
        </h3>
42 43 44 45 46
        {% for m in missing_disks %}
          <p>
          {{ m }} - {{ m.filename }}
          </p>
          {% empty %}
47
          {% trans "None" %}
48 49
        {% endfor %}

50 51 52 53
        <h3>
          {% trans "Orphan disks" %}
          <small>{% trans "image files without disk object in the database" %}</small>
        </h3>
54
        {% for o in orphan_disks %}
55 56 57
          <p>
            {{ o }}
          </p>
58
          {% empty %}
59
          {% trans "None" %}
60 61 62 63 64 65 66 67 68 69
        {% endfor %}
      </div><!-- .panel-body -->
    </div>
  </div>
</div>

<div class="row">
  <div class="col-md-12">
    <div class="panel panel-default">
      <div class="panel-heading">
70
        <h3 class="no-margin"><i class="fa fa-file"></i> {% trans "Disks" %}</h3>
71 72
      </div>
      <div class="panel-body">
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
        <div class="row">
          <div class="col-md-9">
            <ul class="nav nav-pills" style="margin: 5px 0 20px 0;">
              <li class="disabled"><a href="#">{% trans "Filter by type" %}</a></li>
              <li {% if not request.GET.filter %} class="active"{% endif %}>
              <a href="{{ request.path }}?s={{ request.GET.s }}">{% trans "ALL" %}</a>
              </li>
              {% for f in filter_names %}
                <li{% if request.GET.filter == f.0 %} class="active"{% endif %}>
                <a href="?filter={{ f.0 }}&s={{ request.GET.s }}">{{ f.1|capfirst }}</a>
                </li>
              {% endfor %}
            </ul>
          </div>
          <div class="col-md-3">
            <form action="" method="GET" id="network-host-list-form">
              <div class="input-group">
90
                <input type="text" name="s" class="form-control"
91 92 93 94 95 96 97 98 99
                value="{{ request.GET.s }}" placeholder="{% trans "Search..." %}"/>
                <span class="input-group-btn">
                  <button class="btn btn-primary"><i class="fa fa-search"></i></button>
                </span>
                <input type="hidden" name="filter" value="{{ request.GET.filter }}"/>
              </div>
            </form>
          </div>
        </div><!-- .row -->
100 101 102 103 104 105 106 107 108
        <div class="table-responsive">
          {% render_table disk_table %}
        </div>
      </div><!-- .panel-body -->
    </div>
  </div>
</div>

{% endblock %}