fixing formatting

This commit is contained in:
Levi 2017-05-11 00:38:53 -05:00
parent 22798e29bf
commit 1a6e1a44d8
3 changed files with 11 additions and 16 deletions

View file

@ -174,9 +174,6 @@ class OpenNebulaManager:
def get_vm_templates(self): def get_vm_templates(self):
template_pool = oca.VmTemplatePool(self.oneadmin_client) template_pool = oca.VmTemplatePool(self.oneadmin_client)
template_pool.info() template_pool.info()
a = template_pool[0]
import pdb
pdb.set_trace()
return template_pool return template_pool
def get_vm(self, email, vm_id): def get_vm(self, email, vm_id):
@ -206,9 +203,6 @@ class OpenNebulaManager:
return vm_pool return vm_pool
class HostingManageVMAdmin(admin.ModelAdmin): class HostingManageVMAdmin(admin.ModelAdmin):
client = None client = None
oneadmin_client = None oneadmin_client = None

View file

@ -85,7 +85,7 @@
<div class="col-md-3"> <div class="col-md-3">
<div class="well text-center"> <div class="well text-center">
<i class="fa fa-hdd-o" aria-hidden="true"></i> {% trans "Disk"%} <br/> <i class="fa fa-hdd-o" aria-hidden="true"></i> {% trans "Disk"%} <br/>
<span class="label label-success">{{virtual_machine.disk_size}} GiB</span> <span class="label label-success">{{virtual_machine.disk_size|floatformat:2}} GiB</span>
</div> </div>
</div> </div>
</div><!--/row--> </div><!--/row-->
@ -150,13 +150,14 @@
<div class="row "> <div class="row ">
<div class="col-md-12 inline-headers"> <div class="col-md-12 inline-headers">
<h3>{% trans "Current status"%}</h3> <h3>{% trans "Current status"%}</h3>
<div class="pull-right space-above"> <div class="pull-right space-above">
{% if virtual_machine.status == 'pending' %} {% if virtual_machine.state == 'ACTIVE' %}
<span class="label label-warning"><strong>{{virtual_machine.get_status_display}}</strong></span> <span class="h3 label label-success"><strong> {{virtual_machine.state}}</strong></span>
{% elif virtual_machine.status == 'online' %} {% elif virtual_machine.state == 'POWEROFF' %}
<span class="label label-success"><strong>{{virtual_machine.get_status_display}}</strong></span> <span class="h3 label label-danger"><strong>{{virtual_machine.state}}</strong></span>
{% elif virtual_machine.status == 'canceled'%} {% else %}
<span class="label label-danger"><strong>{{virtual_machine.get_status_display}}</strong></span> <span class="h3 label label-warning"><strong>{{virtual_machine.state}}</strong></span>
{% endif %} {% endif %}
</div> </div>
</div> </div>

View file

@ -22,8 +22,8 @@
<tbody> <tbody>
{% for vm in vms_opennebula %} {% for vm in vms_opennebula %}
<tr> <tr>
<td scope="row">{{vm.deploy_id}}</td> <td scope="row">{{vm.name}}</td>
<td>{{vm.price}} CHF</td> <td>{{vm.price|floatformat:2}} CHF</td>
<td> <td>
{% if vm.state == 'ACTIVE' %} {% if vm.state == 'ACTIVE' %}