2016-05-04 05:16:41 +00:00
|
|
|
{% extends "hosting/base_short.html" %}
|
|
|
|
{% load staticfiles bootstrap3 %}
|
2016-07-19 02:24:44 +00:00
|
|
|
{% load i18n %}
|
|
|
|
|
2016-05-04 05:16:41 +00:00
|
|
|
{% block content %}
|
|
|
|
<div>
|
|
|
|
<div class="container virtual-machine-container dashboard-container ">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-9 col-md-offset-2">
|
|
|
|
<div class="col-sm-12">
|
|
|
|
<h3><i class="fa fa-cloud" aria-hidden="true"></i> {{virtual_machine.name}}</h3>
|
|
|
|
<hr/>
|
|
|
|
<div class="col-md-3"> <!-- required for floating -->
|
|
|
|
<!-- Nav tabs -->
|
|
|
|
<ul class="nav nav-tabs tabs-left sideways">
|
|
|
|
<li class="active">
|
|
|
|
<a href="#settings-v" data-toggle="tab">
|
|
|
|
<i class="fa fa-cogs" aria-hidden="true"></i>
|
2016-07-19 02:24:44 +00:00
|
|
|
{% trans "Settings"%}
|
2016-05-04 05:16:41 +00:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#billing-v" data-toggle="tab">
|
|
|
|
<i class="fa fa-money" aria-hidden="true"></i>
|
2016-07-19 02:24:44 +00:00
|
|
|
{% trans "Billing"%}
|
2016-05-04 05:16:41 +00:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#orders-v" data-toggle="tab">
|
|
|
|
<i class="fa fa-credit-card"></i>
|
2016-07-19 02:24:44 +00:00
|
|
|
{% trans "Orders"%}
|
2016-05-04 05:16:41 +00:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#status-v" data-toggle="tab">
|
2016-07-19 02:24:44 +00:00
|
|
|
<i class="fa fa-signal" aria-hidden="true"></i> {% trans "Status"%}
|
2016-05-04 05:16:41 +00:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-9">
|
|
|
|
<!-- Tab panes -->
|
|
|
|
<div class="tab-content">
|
|
|
|
<div class="tab-pane active" id="settings-v">
|
|
|
|
<div class="row">
|
2016-06-07 05:29:22 +00:00
|
|
|
<div class="col-md-12 inline-headers">
|
2016-05-04 05:16:41 +00:00
|
|
|
<h3>{{virtual_machine.hosting_company_name}}</h3>
|
2016-06-07 05:29:22 +00:00
|
|
|
|
|
|
|
{% if virtual_machine.ip %}
|
|
|
|
<div class="pull-right right-place">
|
|
|
|
<button type="link" data-clipboard-text="{{virtual_machine.ip}}" id="copy_vm_id" class="to_copy btn btn-link"
|
|
|
|
data-toggle="tooltip" data-placement="bottom" title="Copied" data-trigger="click">
|
|
|
|
Ip: {{virtual_machine.ip}} <i class="fa fa-files-o" aria-hidden="true"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
|
|
|
|
<div class="pull-right right-place">
|
2016-07-19 02:24:44 +00:00
|
|
|
<span class="label label-warning"><strong>{% trans "Ip not assigned yet"%}</strong></span>
|
2016-06-07 05:29:22 +00:00
|
|
|
<i data-toggle="tooltip" title="Your ip will be assigned soon" class="fa fa-info-circle" aria-hidden="true"></i>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
2016-05-04 05:16:41 +00:00
|
|
|
<hr>
|
2016-06-07 05:29:22 +00:00
|
|
|
|
2016-05-04 05:16:41 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-3">
|
|
|
|
<div class="well text-center">
|
2016-07-19 02:24:44 +00:00
|
|
|
<i class="fa fa-cubes" aria-hidden="true"></i>{% trans "Cores"%} <br/>
|
2016-05-04 05:16:41 +00:00
|
|
|
<span class="label label-success">{{virtual_machine.cores}}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
|
|
<div class="well text-center">
|
2016-07-19 02:24:44 +00:00
|
|
|
<i class="fa fa-tachometer" aria-hidden="true"></i> {% trans "Memory"%} <br/>
|
2016-05-04 05:16:41 +00:00
|
|
|
<span class="label label-success">{{virtual_machine.memory}} GiB</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
|
|
<div class="well text-center">
|
2016-07-19 02:24:44 +00:00
|
|
|
<i class="fa fa-hdd-o" aria-hidden="true"></i> {% trans "Disk"%} <br/>
|
2016-05-04 05:16:41 +00:00
|
|
|
<span class="label label-success">{{virtual_machine.disk_size}} GiB</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div><!--/row-->
|
|
|
|
</div><!--/col-12-->
|
|
|
|
</div><!--/row-->
|
2016-06-30 06:23:14 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
2016-07-19 02:24:44 +00:00
|
|
|
{% trans "Configuration"%}: {{virtual_machine.get_configuration_display}}
|
2016-06-30 06:23:14 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-05-04 05:16:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="tab-pane" id="billing-v">
|
|
|
|
|
|
|
|
<div class="row ">
|
|
|
|
<div class="col-md-12 inline-headers">
|
2016-07-19 02:24:44 +00:00
|
|
|
<h3>{% trans "Current pricing"%}</h3>
|
2016-05-04 05:16:41 +00:00
|
|
|
<span class="h3 pull-right"><strong>{{virtual_machine.price|floatformat}} CHF</strong>/mo</span>
|
|
|
|
<hr>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="tab-pane" id="orders-v">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<table class="table borderless table-hover">
|
|
|
|
<h3>Orders</h3>
|
|
|
|
<br/>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>#</th>
|
2016-07-19 02:24:44 +00:00
|
|
|
<th>{% trans "Date"%}</th>
|
|
|
|
<th>{% trans "Amount"%}</th>
|
|
|
|
<th>{% trans "Status"%}</th>
|
2016-05-04 05:16:41 +00:00
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2016-05-05 06:03:35 +00:00
|
|
|
{% for order in virtual_machine.hosting_orders.all %}
|
2016-05-04 05:16:41 +00:00
|
|
|
<tr>
|
|
|
|
<td scope="row">{{order.id}}</td>
|
|
|
|
<td>{{order.created_at}}</td>
|
2016-05-12 06:57:34 +00:00
|
|
|
<td>{{order.vm_plan.price}} CHF</td>
|
2016-05-04 05:16:41 +00:00
|
|
|
<td>{% if order.approved %}
|
2016-07-19 02:24:44 +00:00
|
|
|
<span class="text-success strong">{% trans "Approved"%}</span>
|
2016-05-04 05:16:41 +00:00
|
|
|
{% else%}
|
2016-07-19 02:24:44 +00:00
|
|
|
<span class="text-danger strong">{% trans "Declined"%}</span>
|
2016-05-04 05:16:41 +00:00
|
|
|
{% endif%}
|
|
|
|
</td>
|
|
|
|
<td>
|
2016-07-19 02:24:44 +00:00
|
|
|
<button type="button" class="btn btn-default"><a href="{% url 'hosting:orders' order.id %}">{% trans "View Detail"%}</a></button>
|
2016-05-04 05:16:41 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div><!--/col-12-->
|
|
|
|
</div><!--/row-->
|
|
|
|
</div>
|
|
|
|
<div class="tab-pane" id="status-v">
|
|
|
|
<div class="row ">
|
|
|
|
<div class="col-md-12 inline-headers">
|
2016-07-19 02:24:44 +00:00
|
|
|
<h3>{% trans "Current status"%}</h3>
|
2016-06-10 04:50:49 +00:00
|
|
|
<div class="pull-right space-above">
|
|
|
|
{% if virtual_machine.status == 'pending' %}
|
|
|
|
<span class="label label-warning"><strong>{{virtual_machine.get_status_display}}</strong></span>
|
|
|
|
{% elif virtual_machine.status == 'online' %}
|
|
|
|
<span class="label label-success"><strong>{{virtual_machine.get_status_display}}</strong></span>
|
|
|
|
{% elif virtual_machine.status == 'canceled'%}
|
|
|
|
<span class="label label-danger"><strong>{{virtual_machine.get_status_display}}</strong></span>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% if not virtual_machine.status == 'canceled' %}
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12 space-above-big">
|
|
|
|
<div class="pull-right">
|
|
|
|
<form method="POST" id="virtual_machine_cancel_form" class="cancel-form" action="{% url 'hosting:virtual_machines' virtual_machine.id %}">
|
|
|
|
{% csrf_token %}
|
|
|
|
</form>
|
|
|
|
|
2016-07-19 02:24:44 +00:00
|
|
|
<button type="text" data-href="{% url 'hosting:virtual_machines' virtual_machine.id %}" data-toggle="modal" data-target="#confirm-cancel" class="btn btn-danger">{% trans "Cancel Virtual Machine"%}</button>
|
2016-06-10 04:50:49 +00:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Cancel Modal -->
|
|
|
|
<div class="modal fade" id="confirm-cancel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
2016-07-19 02:24:44 +00:00
|
|
|
{% trans "Cancel your Virtual Machine"%}
|
2016-06-10 04:50:49 +00:00
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2016-07-19 02:24:44 +00:00
|
|
|
{% trans "Are you sure do you want to cancel your Virtual Machine "%} {{vm.virtual_machine}} {% trans "plan?"%}
|
2016-06-10 04:50:49 +00:00
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
2016-07-19 02:24:44 +00:00
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Cancel"%}</button>
|
2016-06-10 04:59:05 +00:00
|
|
|
<a class="btn btn-danger btn-ok">OK</a>
|
2016-06-10 04:50:49 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-05-04 05:16:41 +00:00
|
|
|
</div>
|
2016-06-10 04:50:49 +00:00
|
|
|
<!-- / Cancel Modal -->
|
2016-05-04 05:16:41 +00:00
|
|
|
</div>
|
2016-06-10 04:50:49 +00:00
|
|
|
{% endif %}
|
2016-05-04 05:16:41 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{%endblock%}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|