vm-detail.html 10 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

{% if instance.is_base %}
9
<div class="alert alert-info alert-new-template" id="alert-new-template" style="position: relative;">
10 11 12
  <form action="{% url "dashboard.views.vm-toggle-tutorial" pk=instance.pk %}"
    method="POST">
    {% csrf_token %}
13
    <input name="hidden" type="hidden"
14
     value="{{ hide_tutorial|yesno:"false,true" }}"/>
15
    <button type="submit"
16
      id="dashboard-tutorial-toggle" class="btn btn-sm pull-right btn-success">
17
      <i class="fa fa-caret-{% if hide_tutorial %}down{% else %}up{% endif %}"></i>
18 19 20
      {% trans "Toggle tutorial panel" %}
    </button>

21
    <a href="#" class="btn btn-default btn-sm pull-right"
22
      id="vm-details-start-template-tour">
23
      <i class="fa fa-play"></i> {% trans "Start template tutorial" %}
24
    </a>
25 26 27
  </form>
  <strong>{% trans "This is the master vm of your new template" %}</strong>
  <ol {% if hide_tutorial %}style="display: none;"{% endif %}>
28
    <li>{% trans "Modify the virtual machine to suit your needs <strong>(optional)</strong>" %}
29
      <ul>
30 31
        <li>{% trans "Change the description" %}</li>
        <li>{% trans "Change resources (CPU and RAM)" %}</li>
32 33
        <li>{% trans "Attach or detach disks" %}</li>
        <li>{% trans "Add or remove network interfaces" %}</li>
34 35
      </ul>
    </li>
36
    <li>{% trans "Deploy the virtual machine" %}</li>
37 38 39
    <li>{% trans "Connect to the machine" %}</li>
    <li>{% trans "Do all the needed installations/customizations" %}</li>
    <li>{% trans "Log off from the machine" %}</li>
40
    <li>
41
      {% trans "Press the Save as template button" %}
42
    </li>
43 44 45
    <li>
      {% trans "Delete this virtual machine <strong>(optional)</strong>" %}
    </li>
46 47 48
  </ol>
</div>
{% endif %}
49 50
<div class="body-content">
  <div class="page-header">
51
    <div class="pull-right" id="ops">
52
      {% include "dashboard/vm-detail/_operations.html" %}
53
    </div>
54
    <h1>
55
      <div id="vm-details-rename" class="vm-details-home-rename-form-div">
56 57
        <form action="" method="POST" id="vm-details-rename-form">
          {% csrf_token %}
58
          <div class="input-group vm-details-home-name">
59
            <input id="vm-details-rename-name" class="form-control input-sm" name="new_name" type="text" value="{{ instance.name }}"/>
60
            <span class="input-group-btn">
61 62 63 64
              <button type="submit" class="btn btn-sm vm-details-rename-submit
                {% if not is_operator %}disabled{% endif %}">
                {% trans "Rename" %}
              </button>
65 66
            </span>
          </div>
67 68
        </form>
      </div>
69
      <div id="vm-details-h1-name" class="vm-details-home-edit-name">
70
        {{ instance.name }}
71
      </div>
72 73 74
      <small>{{ instance.primary_host.get_fqdn }}</small>
    </h1>
    <div style="clear: both;"></div>
75 76
  </div>
  <div class="row">
77
    <div class="col-md-4" id="vm-info-pane">
78
      <div class="big">
79
        <span id="vm-details-state" class="label label-success" data-status="{{ instance.status }}">
80 81 82 83 84
          <i class="fa
            {% if is_new_state %}
            fa-spinner fa-spin
            {% else %}
            {{ instance.get_status_icon }}{% endif %}"></i>
85 86
          <span>{{ instance.get_status_display|upper }}</span>
        </span>
87
      </div>
88 89 90 91
      <h3>{% trans "Connection details" %}</h3>
      <dl class="dl-horizontal vm-details-connection">
        <dt>{% trans "Protocol" %}</dt>
        <dd>{{ instance.access_method|upper }}</dd>
92 93 94 95
          <dt>{% trans "Host" %}</dt>
          <dd>
            {% if instance.get_connect_port %}
              {{ instance.get_connect_host }}:<strong>{{ instance.get_connect_port }}</strong>
96 97
            {% elif instance.interface_set.count < 1%}
              <strong>{% trans "The VM doesn't have any network interface." %}</strong>
98
            {% else %}
99
              <strong>{% trans "The required port for this protocol is not forwarded." %}</strong>
100 101 102
            {% endif %}
          </dd>

103
        {% if instance.ipv6 and instance.get_connect_port %}
104
          <dt>{% trans "Host (IPv6)" %}</dt>
105
          <dd>{{ ipv6_host }}:<strong>{{ ipv6_port }}</strong></dd>
106 107
        {% endif %}

108 109 110
        <dt>{% trans "Username" %}</dt>
        <dd>cloud</dd>
        <dt>{% trans "Password" %}</dt>
111 112
        <dd>
          <div class="input-group">
113
            <input type="text" id="vm-details-pw-input" class="form-control input-sm input-tags"
114
            value="{{ instance.pw }}" spellcheck="false"/>
115 116 117
            <span class="input-group-addon input-tags" id="vm-details-pw-show"
              title="{% trans "Show password" %}" data-container="body">
              <i class="fa fa-eye" id="vm-details-pw-eye"></i>
118 119 120 121
            </span>
          </div>
        </dd>
        <dd style="font-size: 10px; text-align: right; padding-top: 8px;">
122 123
          <div id="vm-details-pw-reset">
          {% with op=op.password_reset %}{% if op %}
124 125 126 127 128 129 130 131
          <a href="{% if op.disabled %}#{% else %}{{op.get_url}}{% endif %}"
            class="operation operation-{{op.op}}"
            {% if op.disabled %}
            data-disabled="true"
            title="{% if instance.has_agent %}{% trans "Start the VM to change the password." %}{% else %}{% trans "This machine has no agent installed." %}{% endif %}"
            {% endif %}>
            {% trans "Generate new password!" %}
          </a>
132 133
          {% endif %}{% endwith %}
          </div>
134
        </dd>
135
      </dl>
136
      {% for c in connect_commands %}
137
      <div class="input-group dashboard-vm-details-connect-command">
138
        <span class="input-group-addon input-tags">{% trans "Command" %}</span>
139
        <input type="text" spellcheck="false"
140 141
        value="{{ c }}"
        id="vm-details-connection-string" class="form-control input-tags" />
142 143 144
        <span class="input-group-addon input-tags vm-details-connection-string-copy"
          title="{% trans "Select all" %}" data-container="body">
          <i class="fa fa-copy"></i>
145 146 147 148
        </span>
      </div>

      {% empty %}
149
      <div class="input-group dashboard-vm-details-connect-command">
150 151
        <span class="input-group-addon input-tags">{% trans "Command" %}</span>
        <input type="text" spellcheck="false" value="{% trans "Connection is not possible." %}"
152
        id="vm-details-connection-string" class="form-control input-tags" />
153
        <span class="input-group-addon input-tags" id="vm-details-connection-string-copy">
154
          <i class="fa fa-copy" title="{% trans "Select all" %}"></i>
155 156
        </span>
      </div>
157
      {% endfor %}
158
      {% if instance.get_connect_uri %}
159
      <div id="dashboard-vm-details-connect" class="operation-wrapper">
160 161
        {% if client_download %}
        <a id="dashboard-vm-details-connect-button" class="btn btn-xs btn-default operation " href="{{ instance.get_connect_uri}}" title="{% trans "Connect via the CIRCLE Client" %}">
162
                <i class="fa fa-external-link"></i> {% trans "Connect" %}
163
        </a>
164 165 166 167 168 169
        <a href="{% url "dashboard.views.client-check" %}?vm={{ instance.pk }}">{% trans "Download client" %}</a>
        {% else %}
        <a id="dashboard-vm-details-connect-download-button" class="btn btn-xs btn-default operation " href="{% url "dashboard.views.client-check" %}?vm={{ instance.pk }}" title="{% trans "Download the CIRCLE Client" %}">
                <i class="fa fa-external-link"></i> {% trans "Connect (download client)" %}
        </a>
        {% endif %}
170
      </div>
171
      {% endif %}
172
    </div>
173
    <div class="col-md-8" id="vm-detail-pane">
174 175 176
      <div class="panel panel-default" id="vm-detail-panel">
        <ul class="nav nav-pills panel-heading">
          <li class="active">
177
            <a href="#home" data-toggle="pill" data-target="#_home" class="text-center">
178
              <i class="fa fa-compass fa-2x"></i><br>
179 180
              {% trans "Home" %}</a>
          </li>
181
          <li>
182
            <a href="#resources" data-toggle="pill" data-target="#_resources" class="text-center">
183
              <i class="fa fa-tasks fa-2x"></i><br>
184 185
              {% trans "Resources" %}</a>
          </li>
186
          <li{% if not instance.is_console_available %} class="disabled"{% endif %}>
187
            <a href="#console" data-toggle="pill" data-target="#_console" class="text-center">
188
              <i class="fa fa-desktop fa-2x"></i><br>
189 190
              {% trans "Console" %}</a></li>
          <li>
191
            <a href="#access" data-toggle="pill" data-target="#_access" class="text-center">
192
              <i class="fa fa-group fa-2x"></i><br>
193 194
              {% trans "Access" %}</a>
          </li>
195
          <li>
196
            <a href="#network" data-toggle="pill" data-target="#_network" class="text-center">
197
              <i class="fa fa-globe fa-2x"></i><br>
198 199
              {% trans "Network" %}</a>
          </li>
200
          <li>
201
            <a href="#activity" data-toggle="pill" data-target="#_activity" class="text-center">
202
              <i class="fa fa-clock-o fa-2x"></i><br>
203 204
              {% trans "Activity" %}</a>
          </li>
205 206 207
        </ul>

        <div class="tab-content panel-body">
208 209 210 211 212 213
          <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>
214 215 216 217 218 219 220
        </div>
      </div>
    </div>
  </div>
</div>

{% endblock %}
221 222

{% block extra_js %}
223
  <script src="{{ STATIC_URL }}dashboard/introjs/intro.min.js"></script>
224 225
  <script src="{{ STATIC_URL }}dashboard/vm-details.js"></script>
  <script src="{{ STATIC_URL }}dashboard/vm-common.js"></script>
226
  <script src="{{ STATIC_URL }}dashboard/vm-console.js"></script>
227
  <script src="{{ STATIC_URL }}dashboard/disk-list.js"></script>
228
  <script src="{{ STATIC_URL }}dashboard/vm-tour.js"></script>
229
{% endblock %}