From 01b507001df2f457c938c5fc2a7099e623beae3a Mon Sep 17 00:00:00 2001 From: jakedahn Date: Tue, 3 Jan 2012 10:31:25 -0800 Subject: [PATCH] Fix inconsistencies between overview and index. However the tables are not identical, because the overview page serves a different purpose than the instance list. fixes bug 897094 Change-Id: Ic8de38418e3d206ed6a0f184062ef0ca9f20db65 --- .../instances_and_volumes/instances/views.py | 6 ++++- .../instances/usage.html | 23 +++++++++---------- .../dashboard/static/dashboard/css/style.css | 15 ++++++++---- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/horizon/horizon/dashboards/nova/instances_and_volumes/instances/views.py b/horizon/horizon/dashboards/nova/instances_and_volumes/instances/views.py index 5a02b389469..d1afaf3e0f8 100644 --- a/horizon/horizon/dashboards/nova/instances_and_volumes/instances/views.py +++ b/horizon/horizon/dashboards/nova/instances_and_volumes/instances/views.py @@ -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 @@ -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, @@ -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) diff --git a/horizon/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/usage.html b/horizon/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/usage.html index 53d632a62dd..01031ae63b7 100644 --- a/horizon/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/usage.html +++ b/horizon/horizon/dashboards/nova/templates/nova/instances_and_volumes/instances/usage.html @@ -35,21 +35,24 @@

Disk

- {% trans "Download CSV" %} » + {% trans "Download CSV" %} + + {% if show_terminated %} + {% trans "Hide Terminated" %} + {% else %} + {% trans "Show Terminated" %} + {% endif %} +

Server Usage Summary

- - - - - + - + {% for instance in instances %} @@ -58,13 +61,9 @@

Server Usage Summary

{% else %} {% endif %} - - - - - + diff --git a/openstack-dashboard/dashboard/static/dashboard/css/style.css b/openstack-dashboard/dashboard/static/dashboard/css/style.css index 4aed2eb432b..41fc168b268 100644 --- a/openstack-dashboard/dashboard/static/dashboard/css/style.css +++ b/openstack-dashboard/dashboard/static/dashboard/css/style.css @@ -269,10 +269,6 @@ th { small { font-size: 11px; } -.csv_download_link { - margin-top: 11px; - font-size: 11px; -} #user_info { position: relative; @@ -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; +}
{% trans "ID" %} {% trans "Name" %} {% trans "User" %}{% trans "VCPUs" %}{% trans "Ram Size" %}{% trans "Disk Size" %}{% trans "Flavor" %}{% trans "Size" %} {% trans "Uptime" %}{% trans "Status" %}{% trans "State" %}
{{ instance.id }} {{ instance.name }} {{ instance.user_id }}{{ instance.vcpus }}{{ instance.ram_size|mbformat }}{{ instance.disk_size }}GB{{ instance.flavor }}{{ instance.ram_size|mbformat }} Ram | {{ instance.vcpus }} VCPU | {{ instance.disk_size }}GB Disk {{ instance.uptime_at|timesince }} {{ instance.state|lower|capfirst }}