vm-detail.html 7.48 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 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
          <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
          <i class="fa {{ instance.get_status_icon }}"></i>
67 68
          <span>{{ instance.get_status_display|upper }}</span>
        </span>
69
      </div>
70 71 72 73
      <h3>{% trans "Connection details" %}</h3>
      <dl class="dl-horizontal vm-details-connection">
        <dt>{% trans "Protocol" %}</dt>
        <dd>{{ instance.access_method|upper }}</dd>
74 75 76 77 78
          <dt>{% trans "Host" %}</dt>
          <dd>
            {% if instance.get_connect_port %}
              {{ instance.get_connect_host }}:<strong>{{ instance.get_connect_port }}</strong>
            {% else %}
79
              <strong>{% trans "The required port for this protocol is not forwarded." %}</strong>
80 81 82
            {% endif %}
          </dd>

83
        {% if instance.ipv6 and instance.get_connect_port %}
84
          <dt>{% trans "Host (IPv6)" %}</dt>
85
          <dd>{{ ipv6_host }}:<strong>{{ ipv6_port }}</strong></dd>
86 87
        {% endif %}

88 89 90
        <dt>{% trans "Username" %}</dt>
        <dd>cloud</dd>
        <dt>{% trans "Password" %}</dt>
91 92
        <dd>
          <div class="input-group">
93
            <input type="text" id="vm-details-pw-input" class="form-control input-sm input-tags"
94
            value="{{ instance.pw }}" spellcheck="false"/>
95
            <span class="input-group-addon input-tags" id="vm-details-pw-show">
96
              <i class="fa fa-eye" id="vm-details-pw-eye" title="Show password"></i>
97 98 99 100
            </span>
          </div>
        </dd>
        <dd style="font-size: 10px; text-align: right; padding-top: 8px;">
101 102 103 104 105
          <div id="vm-details-pw-reset">
          {% with op=op.password_reset %}{% if op %}
            <a href="{{op.get_url}}" class="operation btn btn-default btn-xs" {% if op.disabled %}disabled{% endif %}>{% trans "Generate new password!" %}</a>
          {% endif %}{% endwith %}
          </div>
106
        </dd>
107
      </dl>
108

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

        <div class="tab-content panel-body">
155 156 157 158 159 160
          <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>
161 162 163 164 165 166 167
        </div>
      </div>
    </div>
  </div>
</div>

{% endblock %}
168 169

{% block extra_js %}
170
  <script src="{{ STATIC_URL }}dashboard/bootstrap-tour.min.js"></script>
171 172
  <script src="{{ STATIC_URL }}dashboard/vm-details.js"></script>
  <script src="{{ STATIC_URL }}dashboard/vm-common.js"></script>
173
  <script src="{{ STATIC_URL }}dashboard/vm-console.js"></script>
174
  <script src="{{ STATIC_URL }}dashboard/disk-list.js"></script>
175
  <script src="{{ STATIC_URL }}dashboard/vm-tour.js"></script>
176
{% endblock %}