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

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

        <div class="tab-content panel-body">
187 188 189 190 191 192
          <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>
193 194 195 196 197 198 199
        </div>
      </div>
    </div>
  </div>
</div>

{% endblock %}
200 201 202 203

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