vm-detail.html 9.43 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
    <div class="pull-right" style="padding-top: 15px;">
10 11
      <form style="display: inline;" method="POST" action="{% url "dashboard.views.detail" pk=instance.pk %}">
        {% csrf_token %}
12
        <input type="hidden" name="sleep" />
13 14 15 16
        <button title="{% trans "Sleep" %}" class="btn btn-default btn-xs" type="submit"><i class="icon-moon"></i></button>
      </form>
      <form style="display: inline;" method="POST" action="{% url "dashboard.views.detail" pk=instance.pk %}">
        {% csrf_token %}
17
        <input type="hidden" name="deploy" />
18 19 20 21
        <button title="{% trans "Deploy" %}" class="btn btn-default btn-xs" type="submit"><i class="icon-play"></i></button>
      </form>
      <form style="display: inline;" method="POST" action="{% url "dashboard.views.detail" pk=instance.pk %}">
        {% csrf_token %}
22
        <input type="hidden" name="wake_up" />
23 24
        <button title="{% trans "Wake up" %}" class="btn btn-default btn-xs" type="submit"><i class="icon-sun"></i></button>
      </form>
25 26
      <form style="display: inline;" method="POST" action="{% url "dashboard.views.detail" pk=instance.pk %}">
        {% csrf_token %}
27
        <input type="hidden" name="shut_down" />
28
        <button title="{% trans "Shut down" %}" class="btn btn-default btn-xs" type="submit"><i class="icon-off"></i></button>
29
      </form>
30 31
      <form style="display: inline;" method="POST" action="{% url "dashboard.views.detail" pk=instance.pk %}">
        {% csrf_token %}
32
        <input type="hidden" name="reboot" />
33 34 35 36
        <button title="{% trans "Reboot (ctrl + alt + del)" %}" class="btn btn-default btn-xs" type="submit"><i class="icon-refresh"></i></button>
      </form>
      <form style="display: inline;" method="POST" action="{% url "dashboard.views.detail" pk=instance.pk %}">
        {% csrf_token %}
37
        <input type="hidden" name="reset" />
38 39
        <button title="{% trans "Reset (power cycle)" %}" class="btn btn-default btn-xs" type="submit"><i class="icon-bolt"></i></button>
      </form>
40 41 42 43 44 45 46
      <form style="display: inline;" method="POST" action="{% url "dashboard.views.detail" pk=instance.pk %}">
        {% csrf_token %}
        <input type="hidden" name="shut_off"/>
        <button title="{% trans "Shut off" %}" class="btn btn-default btn-xs" type="submit">
          <i class="icon-ban-circle"></i>
        </button>
      </form>
47 48 49
      <a title="Migrate" data-vm-pk="{{ instance.pk }}" href="{% url "dashboard.views.vm-migrate" pk=instance.pk %}" class="btn btn-default btn-xs vm-migrate">
        <i class="icon-truck"></i>
      </a>
50 51
      <form style="display: inline;" method="POST" action="{% url "dashboard.views.detail" pk=instance.pk %}">
        {% csrf_token %}
52
        <input type="hidden" name="save_as" />
53
        <button title="{% trans "Save as template" %}" class="btn btn-default btn-xs" type="submit"><i class="icon-save"></i></button>
54
      </form>
55
      <a title="{% trans "Destroy" %}" href="{% url "dashboard.views.delete-vm" pk=instance.pk %}" class="btn btn-default btn-xs vm-delete" data-vm-pk="{{ instance.pk }}"><i class="icon-remove"></i></a>
56
      <a title="{% trans "Help" %}" href="#" class="btn btn-default btn-xs vm-details-help-button"><i class="icon-question"></i></a>
57
    </div>
58 59 60 61 62 63 64 65 66 67 68
    <h1>
      <div id="vm-details-rename">
        <form action="" method="POST" id="vm-details-rename-form">
          {% csrf_token %}
          <input id="vm-details-rename-name" class="form-control" name="new_name" type="text" value="{{ instance.name }}"/> 
          <button type="submit" id="vm-details-rename-submit" class="btn">{% trans "Rename" %}</button>
        </form>
      </div>
      <div id="vm-details-h1-name">
        {{ instance.name }} 
      </div>
69 70 71 72 73 74 75 76 77 78
      <small>{{ instance.primary_host.get_fqdn }}</small>
    </h1>
    <div class="vm-details-help js-hidden">
      <ul style="list-style: none;">
        <li>
          <strong>{% trans "Sleep" %}:</strong>
          {% trans "Suspend virtual machine with memory dump." %}
        </li>
        <li>
          <strong>{% trans "Wake up" %}:</strong>
79
          {% trans "Wake up suspended machine." %}
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
        </li>
        <li>
          <strong>{% trans "Shutdown" %}:</strong>
          {% trans "Shutdown virtual machine with ACPI signal." %}
        </li>
        <li>
          <strong>{% trans "Reboot (ctrl + alt + del)" %}:</strong>
          {% trans "Reboot virtual machine with Ctrl+Alt+Del signal." %}
        </li>
        <li>
          <strong>{% trans "Reset (power cycle)" %}:</strong>
          {% trans "Reset virtual machine (reset button)" %}
        </li>
        <li>
          <strong>{% trans "Shut off" %}:</strong>
          {% trans "Shut off VM. (plug-out)" %}
        </li>
        <li>
          <strong>{% trans "Migrate" %}:</strong>
          {% trans "Live migrate running vm to another node." %}
        </li>
        <li>
          <strong>{% trans "Save as template" %}:</strong>
103
          {% trans "Shut down the virtual machine, and save it as a new template." %}
104 105 106 107 108 109 110 111
        </li>
        <li>
          <strong>{% trans "Destroy" %}:</strong>
          {% trans "Remove virtual machine and its networks." %}
        </li>
      </ul>
    </div>
    <div style="clear: both;"></div>
112 113
  </div>
  <div class="row">
114
    <div class="col-md-4" id="vm-info-pane">
115
      <div class="big">
116 117 118 119
        <span id="vm-details-state" class="label label-success">
          <i class="{{ instance.get_status_icon }}"></i> 
          <span>{{ instance.get_status_display|upper }}</span>
        </span>
120 121
      </div>
      <h3>{% trans "Connection" %}</h3>
122
      <input type="text" value="{{ instance.get_connect_command }}" class="form-control" readonly />
123
      <dl class="dl-horizontal vm-details-pw">
124
        <dt>{% trans "Password" %}:</dt>
125 126
        <dd>
          <div class="input-group">
127
            <input type="text" id="vm-details-pw-input" class="form-control input-sm input-tags" value="{{ instance.pw }}"/>
128 129 130 131 132 133
            <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;">
134
          <a id="vm-details-pw-change" href="#">{% trans "Generate new password!" %}</a>
135
        </dd>
136
        <div id="vm-details-pw-confirm"> {% comment %} TODO Couldn't this use a modal? {% endcomment%}
137
          <dt>
138
            {% trans "Are you sure?" %}
139 140
          </dt>
          <dd>
141 142
            <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>
143 144
          </dd>
        </div>
145 146
      </dl>
    </div>
147
    <div class="col-md-8" id="vm-detail-pane">
148 149 150
      <div class="panel panel-default" id="vm-detail-panel">
        <ul class="nav nav-pills panel-heading">
          <li class="active">
151
            <a href="#home" data-toggle="pill" data-target="#_home" class="text-center">
152
              <i class="icon-compass icon-2x"></i><br>
153 154
              {% trans "Home" %}</a>
          </li>
155
          <li>
156
            <a href="#resources" data-toggle="pill" data-target="#_resources" class="text-center">
157
              <i class="icon-tasks icon-2x"></i><br>
158 159
              {% trans "Resources" %}</a>
          </li>
160
          <li{% if not instance.is_console_available %} class="disabled"{% endif %}>
161
            <a href="#console" data-toggle="pill" data-target="#_console" class="text-center">
162 163 164
              <i class="icon-desktop icon-2x"></i><br>
              {% trans "Console" %}</a></li>
          <li>
165
            <a href="#access" data-toggle="pill" data-target="#_access" class="text-center">
166
              <i class="icon-group icon-2x"></i><br>
167 168
              {% trans "Access" %}</a>
          </li>
169
          <li>
170
            <a href="#network" data-toggle="pill" data-target="#_network" class="text-center">
171
              <i class="icon-globe icon-2x"></i><br>
172 173
              {% trans "Network" %}</a>
          </li>
174
          <li>
175
            <a href="#activity" data-toggle="pill" data-target="#_activity" class="text-center">
176
              <i class="icon-time icon-2x"></i><br>
177 178
              {% trans "Activity" %}</a>
          </li>
179 180 181
        </ul>

        <div class="tab-content panel-body">
182 183 184 185 186 187
          <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>
188 189 190 191 192 193 194
        </div>
      </div>
    </div>
  </div>
</div>

{% endblock %}
195 196 197 198

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