vm-detail.html 7.8 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
  <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">
13
      <i class="fa fa-play"></i> {% trans "Start template tutorial" %}
14 15
    </a>
  </div>
16
  <ol>
17
    <li>{% trans "Modify the virtual machine to suit your needs <strong>(optional)</strong>" %}
18
      <ul>
19 20
        <li>{% trans "Change the description" %}</li>
        <li>{% trans "Change resources (CPU and RAM)" %}</li>
21 22
        <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
          <div class="input-group vm-details-home-name">
48
            <input id="vm-details-rename-name" class="form-control input-sm" name="new_name" type="text" value="{{ instance.name }}"/>
49 50 51 52
            <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
        {{ instance.name }}
57
      </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
        <span id="vm-details-state" class="label label-success">
66 67 68 69 70
          <i class="fa
            {% if is_new_state %}
            fa-spinner fa-spin
            {% else %}
            {{ instance.get_status_icon }}{% endif %}"></i>
71 72
          <span>{{ instance.get_status_display|upper }}</span>
        </span>
73
      </div>
74 75 76 77
      <h3>{% trans "Connection details" %}</h3>
      <dl class="dl-horizontal vm-details-connection">
        <dt>{% trans "Protocol" %}</dt>
        <dd>{{ instance.access_method|upper }}</dd>
78 79 80 81
          <dt>{% trans "Host" %}</dt>
          <dd>
            {% if instance.get_connect_port %}
              {{ instance.get_connect_host }}:<strong>{{ instance.get_connect_port }}</strong>
82 83
            {% elif instance.interface_set.count < 1%}
              <strong>{% trans "The VM doesn't have any network interface." %}</strong>
84
            {% else %}
85
              <strong>{% trans "The required port for this protocol is not forwarded." %}</strong>
86 87 88
            {% endif %}
          </dd>

89
        {% if instance.ipv6 and instance.get_connect_port %}
90
          <dt>{% trans "Host (IPv6)" %}</dt>
91
          <dd>{{ ipv6_host }}:<strong>{{ ipv6_port }}</strong></dd>
92 93
        {% endif %}

94 95 96
        <dt>{% trans "Username" %}</dt>
        <dd>cloud</dd>
        <dt>{% trans "Password" %}</dt>
97 98
        <dd>
          <div class="input-group">
99
            <input type="text" id="vm-details-pw-input" class="form-control input-sm input-tags"
100
            value="{{ instance.pw }}" spellcheck="false"/>
101
            <span class="input-group-addon input-tags" id="vm-details-pw-show">
102
              <i class="fa fa-eye" id="vm-details-pw-eye" title="Show password"></i>
103 104 105 106
            </span>
          </div>
        </dd>
        <dd style="font-size: 10px; text-align: right; padding-top: 8px;">
107 108
          <div id="vm-details-pw-reset">
          {% with op=op.password_reset %}{% if op %}
109
          <a href="{% if op.disabled %}#{% else %}{{op.get_url}}{% endif %}" class="operation operation-{{op.op}}" data-disabled="{% if op.disabled %}true" title="{% trans "Start the VM to change the password." %}"{% else %}false" {% endif %}>{% trans "Generate new password!" %}</a>
110 111
          {% endif %}{% endwith %}
          </div>
112
        </dd>
113
      </dl>
114

115
      <div class="input-group" id="dashboard-vm-details-connect-command">
116
        <span class="input-group-addon input-tags">{% trans "Command" %}</span>
117
        <input type="text" spellcheck="false"
Guba Sándor committed
118
        value="{% if connect_command %}{{ connect_command }}{% else %}{% trans "Connection is not possible." %}{% endif %}"
119
        id="vm-details-connection-string" class="form-control input-tags" />
120
        <span class="input-group-addon input-tags" id="vm-details-connection-string-copy">
121
          <i class="fa fa-copy" title="{% trans "Select all" %}"></i>
122 123
        </span>
      </div>
124
    </div>
125
    <div class="col-md-8" id="vm-detail-pane">
126 127 128
      <div class="panel panel-default" id="vm-detail-panel">
        <ul class="nav nav-pills panel-heading">
          <li class="active">
129
            <a href="#home" data-toggle="pill" data-target="#_home" class="text-center">
130
              <i class="fa fa-compass fa-2x"></i><br>
131 132
              {% trans "Home" %}</a>
          </li>
133
          <li>
134
            <a href="#resources" data-toggle="pill" data-target="#_resources" class="text-center">
135
              <i class="fa fa-tasks fa-2x"></i><br>
136 137
              {% trans "Resources" %}</a>
          </li>
138
          <li{% if not instance.is_console_available %} class="disabled"{% endif %}>
139
            <a href="#console" data-toggle="pill" data-target="#_console" class="text-center">
140
              <i class="fa fa-desktop fa-2x"></i><br>
141 142
              {% trans "Console" %}</a></li>
          <li>
143
            <a href="#access" data-toggle="pill" data-target="#_access" class="text-center">
144
              <i class="fa fa-group fa-2x"></i><br>
145 146
              {% trans "Access" %}</a>
          </li>
147
          <li>
148
            <a href="#network" data-toggle="pill" data-target="#_network" class="text-center">
149
              <i class="fa fa-globe fa-2x"></i><br>
150 151
              {% trans "Network" %}</a>
          </li>
152
          <li>
153
            <a href="#activity" data-toggle="pill" data-target="#_activity" class="text-center">
154
              <i class="fa fa-clock-o fa-2x"></i><br>
155 156
              {% trans "Activity" %}</a>
          </li>
157 158 159
        </ul>

        <div class="tab-content panel-body">
160 161 162 163 164 165
          <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>
166 167 168 169 170 171 172
        </div>
      </div>
    </div>
  </div>
</div>

{% endblock %}
173 174

{% block extra_js %}
175
  <script src="{{ STATIC_URL }}dashboard/bootstrap-tour.min.js"></script>
176 177
  <script src="{{ STATIC_URL }}dashboard/vm-details.js"></script>
  <script src="{{ STATIC_URL }}dashboard/vm-common.js"></script>
178
  <script src="{{ STATIC_URL }}dashboard/vm-console.js"></script>
179
  <script src="{{ STATIC_URL }}dashboard/disk-list.js"></script>
180
  <script src="{{ STATIC_URL }}dashboard/vm-tour.js"></script>
181
{% endblock %}