vm-detail.html 5.22 KB
Newer Older
1 2 3
{% extends "dashboard/base.html" %}
{% load i18n %}

4 5
{% block title-page %}{{ instance.name }} | vm{% endblock %}

6 7 8
{% block content %}
<div class="body-content">
  <div class="page-header">
9 10
    <div class="pull-right" style="padding-top: 15px;" id="ops">
      {% include "dashboard/vm-detail/_operations.html" %}
11
    </div>
12
    <h1>
13
      <div id="vm-details-rename" class="vm-details-home-rename-form-div">
14 15
        <form action="" method="POST" id="vm-details-rename-form">
          {% csrf_token %}
16 17 18 19 20 21
          <div class="input-group vm-details-home-name">
            <input id="vm-details-rename-name" class="form-control input-sm" name="new_name" type="text" value="{{ instance.name }}"/> 
            <span class="input-group-btn">
              <button type="submit" class="btn btn-sm vm-details-rename-submit">{% trans "Rename" %}</button>
            </span>
          </div>
22 23
        </form>
      </div>
24
      <div id="vm-details-h1-name" class="vm-details-home-edit-name">
25 26
        {{ instance.name }} 
      </div>
27 28 29
      <small>{{ instance.primary_host.get_fqdn }}</small>
    </h1>
    <div style="clear: both;"></div>
30 31
  </div>
  <div class="row">
32
    <div class="col-md-4" id="vm-info-pane">
33
      <div class="big">
34 35 36 37
        <span id="vm-details-state" class="label label-success">
          <i class="{{ instance.get_status_icon }}"></i> 
          <span>{{ instance.get_status_display|upper }}</span>
        </span>
38 39
      </div>
      <h3>{% trans "Connection" %}</h3>
40
      <input type="text" value="{{ instance.get_connect_command }}" class="form-control" readonly />
41
      <dl class="dl-horizontal vm-details-pw">
42
        <dt>{% trans "Password" %}:</dt>
43 44
        <dd>
          <div class="input-group">
45
            <input type="text" id="vm-details-pw-input" class="form-control input-sm input-tags" value="{{ instance.pw }}"/>
46 47 48 49 50 51
            <span class="input-group-addon input-tags" id="vm-details-pw-show">
              <i class="icon-eye-open" id="vm-details-pw-eye" title="Show password"></i>
            </span>
          </div>
        </dd>
        <dd style="font-size: 10px; text-align: right; padding-top: 8px;">
52
          <a id="vm-details-pw-change" href="#">{% trans "Generate new password!" %}</a>
53
        </dd>
54
        <div id="vm-details-pw-confirm"> {% comment %} TODO Couldn't this use a modal? {% endcomment%}
55
          <dt>
56
            {% trans "Are you sure?" %}
57 58
          </dt>
          <dd>
59 60
            <a href="#" class="vm-details-pw-confirm-choice label label-success" data-choice="1" data-vm="{{ instance.pk }}">{% trans "Yes" %}</a> / 
            <a href="#" class="vm-details-pw-confirm-choice label label-danger" data-choice="0">{% trans "No" %}</a>
61 62
          </dd>
        </div>
63 64
      </dl>
    </div>
65
    <div class="col-md-8" id="vm-detail-pane">
66 67 68
      <div class="panel panel-default" id="vm-detail-panel">
        <ul class="nav nav-pills panel-heading">
          <li class="active">
69
            <a href="#home" data-toggle="pill" data-target="#_home" class="text-center">
70
              <i class="icon-compass icon-2x"></i><br>
71 72
              {% trans "Home" %}</a>
          </li>
73
          <li>
74
            <a href="#resources" data-toggle="pill" data-target="#_resources" class="text-center">
75
              <i class="icon-tasks icon-2x"></i><br>
76 77
              {% trans "Resources" %}</a>
          </li>
78
          <li{% if not instance.is_console_available %} class="disabled"{% endif %}>
79
            <a href="#console" data-toggle="pill" data-target="#_console" class="text-center">
80 81 82
              <i class="icon-desktop icon-2x"></i><br>
              {% trans "Console" %}</a></li>
          <li>
83
            <a href="#access" data-toggle="pill" data-target="#_access" class="text-center">
84
              <i class="icon-group icon-2x"></i><br>
85 86
              {% trans "Access" %}</a>
          </li>
87
          <li>
88
            <a href="#network" data-toggle="pill" data-target="#_network" class="text-center">
89
              <i class="icon-globe icon-2x"></i><br>
90 91
              {% trans "Network" %}</a>
          </li>
92
          <li>
93
            <a href="#activity" data-toggle="pill" data-target="#_activity" class="text-center">
94
              <i class="icon-time icon-2x"></i><br>
95 96
              {% trans "Activity" %}</a>
          </li>
97 98 99
        </ul>

        <div class="tab-content panel-body">
100 101 102 103 104 105
          <div class="tab-pane active" id="_home">{% include "dashboard/vm-detail/home.html" %}</div>
          <div class="tab-pane" id="_resources">{% include "dashboard/vm-detail/resources.html" %}</div>
          <div class="tab-pane" id="_console">{% include "dashboard/vm-detail/console.html" %}</div>
          <div class="tab-pane" id="_access">{% include "dashboard/vm-detail/access.html" %} </div>
          <div class="tab-pane" id="_network">{% include "dashboard/vm-detail/network.html" %}</div>
          <div class="tab-pane" id="_activity">{% include "dashboard/vm-detail/activity.html" %}</div>
106 107 108 109 110 111 112
        </div>
      </div>
    </div>
  </div>
</div>

{% endblock %}
113 114 115 116

{% block extra_js %}
  <script src="{{ STATIC_URL }}dashboard/vm-details.js"></script>
  <script src="{{ STATIC_URL }}dashboard/vm-common.js"></script>
117
  <script src="{{ STATIC_URL }}dashboard/vm-console.js"></script>
118
  <script src="{{ STATIC_URL }}dashboard/disk-list.js"></script>
119
{% endblock %}