Skip to content

Commit

Permalink
Fix inconsistencies between overview and index.
Browse files Browse the repository at this point in the history
However the tables are not identical, because the overview page serves a
different purpose than the instance list.

fixes bug 897094

Change-Id: Ic8de38418e3d206ed6a0f184062ef0ca9f20db65
  • Loading branch information
jakedahn committed Jan 4, 2012
1 parent 7266ee5 commit 01b5070
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
Expand Up @@ -32,6 +32,7 @@
from django.utils.translation import ugettext as _
import openstackx.api.exceptions as api_exceptions

import horizon
from horizon import api
from horizon import forms
from horizon import test
Expand Down Expand Up @@ -164,6 +165,8 @@ def usage(request, tenant_id=None):
template_name = 'nova/instances_and_volumes/instances/usage.html'
mimetype = "text/html"

dash_url = horizon.get_dashboard('nova').get_absolute_url()

return shortcuts.render(request, template_name, {
'usage': usage,
'ram_unit': ram_unit,
Expand All @@ -172,7 +175,8 @@ def usage(request, tenant_id=None):
'show_terminated': show_terminated,
'datetime_start': datetime_start,
'datetime_end': datetime_end,
'instances': instances},
'instances': instances,
'dash_url': dash_url},
content_type=mimetype)


Expand Down
Expand Up @@ -35,21 +35,24 @@ <h3>Disk</h3>
</div>

<div class='table_title wide'>
<a class="csv_download_link pull-right" href="{{ csv_link }}">{% trans "Download CSV" %} &raquo;</a>
<a class="csv_download_link pull-right" href="{{ csv_link }}">{% trans "Download CSV" %}</a>

{% if show_terminated %}
<a id="toggle_terminated" href="{{dash_url}}">{% trans "Hide Terminated" %}</a>
{% else %}
<a id="toggle_terminated" href="{{dash_url}}?show_terminated=True">{% trans "Show Terminated" %}</a>
{% endif %}

<h3>Server Usage Summary</h3>
</div>

<table class="zebra-striped">
<tr id='headings'>
<th>{% trans "ID" %}</th>
<th>{% trans "Name" %}</th>
<th>{% trans "User" %}</th>
<th>{% trans "VCPUs" %}</th>
<th>{% trans "Ram Size" %}</th>
<th>{% trans "Disk Size" %}</th>
<th>{% trans "Flavor" %}</th>
<th>{% trans "Size" %}</th>
<th>{% trans "Uptime" %}</th>
<th>{% trans "Status" %}</th>
<th>{% trans "State" %}</th>
</tr>
<tbody class='main'>
{% for instance in instances %}
Expand All @@ -58,13 +61,9 @@ <h3>Server Usage Summary</h3>
{% else %}
<tr class="{% cycle 'odd' 'even' %}">
{% endif %}
<td>{{ instance.id }}</td>
<td>{{ instance.name }}</td>
<td>{{ instance.user_id }}</td>
<td>{{ instance.vcpus }}</td>
<td>{{ instance.ram_size|mbformat }}</td>
<td>{{ instance.disk_size }}GB</td>
<td>{{ instance.flavor }}</td>
<td>{{ instance.ram_size|mbformat }} Ram | {{ instance.vcpus }} VCPU | {{ instance.disk_size }}GB Disk</td>
<td>{{ instance.uptime_at|timesince }}</td>
<td>{{ instance.state|lower|capfirst }}</td>
</tr>
Expand Down
15 changes: 11 additions & 4 deletions openstack-dashboard/dashboard/static/dashboard/css/style.css
Expand Up @@ -269,10 +269,6 @@ th {
small {
font-size: 11px;
}
.csv_download_link {
margin-top: 11px;
font-size: 11px;
}

#user_info {
position: relative;
Expand Down Expand Up @@ -814,3 +810,14 @@ td.multi_select_column {
float: left;
width: 25px;
}

.table_title a {
font-size: 11px;
float: right;
margin-left: 10px;
margin-top: 10px;
}

tr.terminated {
color: #999999;
}

0 comments on commit 01b5070

Please sign in to comment.