vm-detail.html 8.37 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 8
    <div class="pull-right" style="padding-top: 15px;">
      <a title="Rename" href="#" class="btn btn-default btn-xs vm-details-rename-button"><i class="icon-pencil"></i></a>
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
      <form style="display: inline;" method="POST" action="{% url "dashboard.views.detail" pk=instance.pk %}">
        {% csrf_token %}
        <input type="hidden" name="sleep" value="dummy"/>
        <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 %}
        <input type="hidden" name="deploy" value="dummy"/>
        <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 %}
        <input type="hidden" name="wake_up" value="dummy"/>
        <button title="{% trans "Wake up" %}" class="btn btn-default btn-xs" type="submit"><i class="icon-sun"></i></button>
      </form>
24 25 26
      <form style="display: inline;" method="POST" action="{% url "dashboard.views.detail" pk=instance.pk %}">
        {% csrf_token %}
        <input type="hidden" name="shut_down" value="dummy"/>
27
        <button title="{% trans "Shut down" %}" class="btn btn-default btn-xs" type="submit"><i class="icon-off"></i></button>
28
      </form>
29 30 31 32 33 34 35 36 37 38 39 40 41
      <form style="display: inline;" method="POST" action="{% url "dashboard.views.detail" pk=instance.pk %}">
        {% csrf_token %}
        <input type="hidden" name="reboot" value="dummy"/>
        <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 %}
        <input type="hidden" name="reset" value="dummy"/>
        <button title="{% trans "Reset (power cycle)" %}" class="btn btn-default btn-xs" type="submit"><i class="icon-bolt"></i></button>
      </form>
      <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>
42 43 44
      <form style="display: inline;" method="POST" action="{% url "dashboard.views.detail" pk=instance.pk %}">
        {% csrf_token %}
        <input type="hidden" name="save_as" value="dummy"/>
45
        <button title="{% trans "Save as template" %}" class="btn btn-default btn-xs" type="submit"><i class="icon-save"></i></button>
46
      </form>
47
      <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>
48
    </div>
49 50 51 52 53 54 55 56 57 58 59
    <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>
60
      <small>{{ instance.primary_host.get_fqdn }}</small></h1>
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">{{ instance.state }}</span>
66 67 68
        <div class="btn-group">
          <button type="button" class="btn btn-warning dropdown-toggle" data-toggle="dropdown">Action <i class="icon-caret-down"></i></button>
          <ul class="dropdown-menu" role="menu">
69 70 71 72 73
            <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>
74 75 76 77
          </ul>
        </div>
      </div>
      <h3>{% trans "Connection" %}</h3>
78
      <input type="text" value="{{ instance.get_connect_command }}" class="form-control" readonly />
79 80 81 82
      <dl class="dl-horizontal vm-details-pw">
        <dt>Password:</dt>
        <dd>
          <div class="input-group">
83
            <input type="text" id="vm-details-pw-input" class="form-control input-sm input-tags" value="{{ instance.pw }}"/>
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
            <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;">
          <a id="vm-details-pw-change" href="#">Generate new password!</a>
        </dd>
        <div id="vm-details-pw-confirm">
          <dt>
            Are you sure?
          </dt>
          <dd>
            <a href="#" class="vm-details-pw-confirm-choice label label-success" data-choice="1" data-vm="{{ instance.pk }}">Yes</a> / 
            <a href="#" class="vm-details-pw-confirm-choice label label-danger" data-choice="0">No</a>
          </dd>
        </div>
101 102
      </dl>
    </div>
103
    <div class="col-md-8" id="vm-detail-pane">
104 105 106
      <div class="panel panel-default" id="vm-detail-panel">
        <ul class="nav nav-pills panel-heading">
          <li class="active">
107
            <a href="#home" data-toggle="pill" data-target="#_home" class="text-center">
108
              <i class="icon-compass icon-2x"></i><br>
109 110
              {% trans "Home" %}</a>
          </li>
111
          <li>
112
            <a href="#resources" data-toggle="pill" data-target="#_resources" class="text-center">
113
              <i class="icon-tasks icon-2x"></i><br>
114 115
              {% trans "Resources" %}</a>
          </li>
116 117 118
          <li {% if not instance.is_console_available %}class="disabled">
            <a href="#" data-toggle="pill_" data-target="#_console" class="text-center">
              {% else %}>
119
            <a href="#console" data-toggle="pill" data-target="#_console" class="text-center">
120
              {% endif %}
121 122 123
              <i class="icon-desktop icon-2x"></i><br>
              {% trans "Console" %}</a></li>
          <li>
124
            <a href="#access" data-toggle="pill" data-target="#_access" class="text-center">
125
              <i class="icon-group icon-2x"></i><br>
126 127
              {% trans "Access" %}</a>
          </li>
128
          <li>
129
            <a href="#network" data-toggle="pill" data-target="#_network" class="text-center">
130
              <i class="icon-globe icon-2x"></i><br>
131 132
              {% trans "Network" %}</a>
          </li>
133
          <li>
134
            <a href="#activity" data-toggle="pill" data-target="#_activity" class="text-center">
135
              <i class="icon-time icon-2x"></i><br>
136 137
              {% trans "Activity" %}</a>
          </li>
138 139 140
        </ul>

        <div class="tab-content panel-body">
141 142 143 144 145 146
          <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>
147 148 149 150 151 152 153
        </div>
      </div>
    </div>
  </div>
</div>

{% endblock %}
154 155 156 157

{% block extra_js %}
  <script src="{{ STATIC_URL }}dashboard/vm-details.js"></script>
  <script src="{{ STATIC_URL }}dashboard/vm-common.js"></script>
158
  <script src="{{ STATIC_URL }}dashboard/vm-console.js"></script>
159
{% endblock %}