home.html 4.08 KB
Newer Older
Kálmán Viktor committed
1
{% load i18n %}
2 3 4
<div class="row">
  <div class="col-md-4">
    <dl>
5
      <dt>{% trans "System" %}:</dt>
6
      <dd><i class="icon-{{ os_type_icon }}"></i> {{ instance.system }}</dd>
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
      <dt style="margin-top: 5px;">
        {% trans "Name" %}:
        <a href="#" class="vm-details-home-edit-name-click"><i class="icon-pencil"></i></a>
      </dt>
      <dd>
        <div class="vm-details-home-edit-name-click">
          <small class="vm-details-home-edit-name">{{ instance.name }}</small>
        </div>
        <div class="js-hidden vm-details-home-rename-form-div" id="vm-details-home-rename">
          <form method="POST">
            {% csrf_token %}
            <div class="input-group">
              <input type="text" name="new_name" value="{{ instance.name }}" class="form-control input-sm"/>
              <span class="input-group-btn">
                <button type="submit" class="btn btn-success btn-sm vm-details-rename-submit">
                  <i class="icon-pencil"></i> {% trans "Rename" %}
                </button>
              </span>
            </div>
          </form>
        </div>
      </dd>
      <dt style="margin-top: 5px;">
        {% trans "Description" %}: 
        <a href="#" class="vm-details-home-edit-description-click"><i class="icon-pencil"></i></a>
      </dt>
      <dd>
        {% csrf_token %}
        <div class="vm-details-home-edit-description-click">
          <small class="vm-details-home-edit-description">{{ instance.description|linebreaks }}</small>
        </div>
        <div id="vm-details-home-description" class="js-hidden">
          <form method="POST">
            <textarea name="new_description" class="form-control">{{ instance.description }}</textarea>
            <button type="submit" class="btn btn-xs btn-success vm-details-description-submit">
              <i class="icon-pencil"></i> {% trans "Update" %}
            </button>
          </form>
        </div>
      </dd>
47
    </dl>
Kálmán Viktor committed
48

49
    <h4>{% trans "Expiration" %} {% if instance.is_expiring %}<i class="icon-warning-sign text-danger"></i>{% endif %}
50 51 52 53 54 55
        {% with op=op.renew %}
          <a href="{{op.get_url}}" class="btn btn-success btn-xs
                  operation operation-{{op.op}} btn btn-default">
            <i class="icon-{{op.icon}}"></i>
                  {{op.name}} </a>
        {% endwith %}
56 57 58 59 60 61 62 63
    </h4>
    <dl>
      <dt>{% trans "Suspended at:" %}</dt>
      <dd><i class="icon-moon"></i> {{ instance.time_of_suspend|timeuntil }}</dd>
      <dt>{% trans "Destroyed at:" %}</dt>
      <dd><i class="icon-remove"></i> {{ instance.time_of_delete|timeuntil }}</dd>
    </dl>

Kálmán Viktor committed
64 65 66 67 68 69 70 71 72 73 74
    <div style="font-weight: bold;">{% trans "Tags" %}</div>
    <div id="vm-details-tags" style="margin-bottom: 20px;">
      <div id="vm-details-tags-list">
        {% if instance.tags.all %}
          {% for t in instance.tags.all %}
            <div class="label label-primary label-tag" style="display: inline-block">
              {{ t }}
              <a href="#" class="vm-details-remove-tag"><i class="icon-remove"></i></a>
            </div>
          {% endfor %}
        {% else %}
75
          <small>{% trans "No tag added!" %}</small>
Kálmán Viktor committed
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
        {% endif %}
      </div>
      <form action="" method="POST">
        {% csrf_token %}
        <div class="input-group" id="vm-details-tags-form">
          <input type="text" class="form-control input-sm input-tags" name="new_tag" id="vm-details-tags-input"/>
          <!--<div class="input-group-addon">
            <i class="icon-question"></i>
          </div>-->
          <div class="input-group-btn">
            <input type="submit" class="btn btn-default btn-sm input-tags" value="{% trans "Add tag" %}"/>
          </div>
        </div>
      </form>
    </div><!-- id:vm-details-tags -->
91 92
  </div>
  <div class="col-md-8">
93
    {% if graphite_enabled %}
94 95 96
    <img src="{% url "dashboard.views.vm-graph" instance.pk "cpu" "6h" %}" style="width:100%"/>
    <img src="{% url "dashboard.views.vm-graph" instance.pk "memory" "6h" %}" style="width:100%"/>
    <img src="{% url "dashboard.views.vm-graph" instance.pk "network" "6h" %}" style="width:100%"/>
97
    {% endif %}
98 99
  </div>
</div>