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

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

6
{% block content %}
7 8 9 10

{% if instance.is_base %}
<div class="alert alert-info alert-new-template">
  <strong>{% trans "This is the master vm of your new template" %}</strong>
11 12 13 14 15
  <div id="vm-details-template-tour-button" class="pull-right">
    <a href="#" class="btn btn-default btn-lg pull-right vm-details-start-template-tour">
      <i class="icon-play"></i> {% trans "Start template tutorial" %}
    </a>
  </div>
16
  <ol>
17
    <li>{% trans "Modify the virtual machine to suit your needs <strong>(optional)</strong>" %}
18
      <ul>
19 20 21 22
        <li>{% trans "Change the name and description" %}</li>
        <li>{% trans "Change the resources (CPU and RAM)" %}</li>
        <li>{% trans "Attach or detach disks" %}</li>
        <li>{% trans "Add or remove network interfaces" %}</li>
23 24
      </ul>
    </li>
25
    <li>{% trans "Deploy the virtual machine" %}</li>
26 27 28
    <li>{% trans "Connect to the machine" %}</li>
    <li>{% trans "Do all the needed installations/customizations" %}</li>
    <li>{% trans "Log off from the machine" %}</li>
29
    <li>
30
      {% trans "Press the Save as template button" %}
31
    </li>
32 33 34
    <li>
      {% trans "Delete this virtual machine <strong>(optional)</strong>" %}
    </li>
35 36 37
  </ol>
</div>
{% endif %}
38 39
<div class="body-content">
  <div class="page-header">
40
    <div class="pull-right" id="ops">
41
      {% include "dashboard/vm-detail/_operations.html" %}
42
    </div>
43
    <h1>
44
      <div id="vm-details-rename" class="vm-details-home-rename-form-div">
45 46
        <form action="" method="POST" id="vm-details-rename-form">
          {% csrf_token %}
47 48 49 50 51 52
          <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>
53 54
        </form>
      </div>
55
      <div id="vm-details-h1-name" class="vm-details-home-edit-name">
56 57
        {{ instance.name }} 
      </div>
58 59 60
      <small>{{ instance.primary_host.get_fqdn }}</small>
    </h1>
    <div style="clear: both;"></div>
61 62
  </div>
  <div class="row">
63
    <div class="col-md-4" id="vm-info-pane">
64
      <div class="big">
65 66 67 68
        <span id="vm-details-state" class="label label-success">
          <i class="{{ instance.get_status_icon }}"></i> 
          <span>{{ instance.get_status_display|upper }}</span>
        </span>
69 70
      </div>
      <h3>{% trans "Connection" %}</h3>
71
      <input type="text" value="{{ instance.get_connect_command }}" class="form-control" readonly />
72
      <dl class="dl-horizontal vm-details-pw">
73
        <dt>{% trans "Password" %}:</dt>
74 75
        <dd>
          <div class="input-group">
76
            <input type="text" id="vm-details-pw-input" class="form-control input-sm input-tags" value="{{ instance.pw }}"/>
77 78 79 80 81 82
            <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;">
83
          <a id="vm-details-pw-change" href="#">{% trans "Generate new password!" %}</a>
84
        </dd>
85
        <div id="vm-details-pw-confirm"> {% comment %} TODO Couldn't this use a modal? {% endcomment%}
86
          <dt>
87
            {% trans "Are you sure?" %}
88 89
          </dt>
          <dd>
90 91
            <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>
92 93
          </dd>
        </div>
94 95
      </dl>
    </div>
96
    <div class="col-md-8" id="vm-detail-pane">
97 98 99
      <div class="panel panel-default" id="vm-detail-panel">
        <ul class="nav nav-pills panel-heading">
          <li class="active">
100
            <a href="#home" data-toggle="pill" data-target="#_home" class="text-center">
101
              <i class="icon-compass icon-2x"></i><br>
102 103
              {% trans "Home" %}</a>
          </li>
104
          <li>
105
            <a href="#resources" data-toggle="pill" data-target="#_resources" class="text-center">
106
              <i class="icon-tasks icon-2x"></i><br>
107 108
              {% trans "Resources" %}</a>
          </li>
109
          <li{% if not instance.is_console_available %} class="disabled"{% endif %}>
110
            <a href="#console" data-toggle="pill" data-target="#_console" class="text-center">
111 112 113
              <i class="icon-desktop icon-2x"></i><br>
              {% trans "Console" %}</a></li>
          <li>
114
            <a href="#access" data-toggle="pill" data-target="#_access" class="text-center">
115
              <i class="icon-group icon-2x"></i><br>
116 117
              {% trans "Access" %}</a>
          </li>
118
          <li>
119
            <a href="#network" data-toggle="pill" data-target="#_network" class="text-center">
120
              <i class="icon-globe icon-2x"></i><br>
121 122
              {% trans "Network" %}</a>
          </li>
123
          <li>
124
            <a href="#activity" data-toggle="pill" data-target="#_activity" class="text-center">
125
              <i class="icon-time icon-2x"></i><br>
126 127
              {% trans "Activity" %}</a>
          </li>
128 129 130
        </ul>

        <div class="tab-content panel-body">
131 132 133 134 135 136
          <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>
137 138 139 140 141 142 143
        </div>
      </div>
    </div>
  </div>
</div>

{% endblock %}
144 145

{% block extra_js %}
146
  <script src="{{ STATIC_URL }}dashboard/bootstrap-tour.min.js"></script>
147 148
  <script src="{{ STATIC_URL }}dashboard/vm-details.js"></script>
  <script src="{{ STATIC_URL }}dashboard/vm-common.js"></script>
149
  <script src="{{ STATIC_URL }}dashboard/vm-console.js"></script>
150
  <script src="{{ STATIC_URL }}dashboard/disk-list.js"></script>
151
  <script src="{{ STATIC_URL }}dashboard/vm-tour.js"></script>
152
{% endblock %}