summaryrefslogtreecommitdiff
path: root/openstack_dashboard
diff options
context:
space:
mode:
authorAndrew Bramley <andrew@tesora.com>2014-07-11 15:00:53 -0400
committerAndrew Bramley <andrew@tesora.com>2014-07-11 15:00:53 -0400
commit232f329a0784dc9486117abe8fb55cc2e6252cad (patch)
treeee4feb84184904d2932b60ee738851c457e31456 /openstack_dashboard
parent322004f8480e40af5e77ed843ff803005d5af27c (diff)
downloadhorizon-232f329a0784dc9486117abe8fb55cc2e6252cad.tar.gz
Display volume size for trove instances
Add volume size (in GB) to the trove databases table and the database details page Change-Id: Ia37e99c78cdb95a61772f2fa42c1b7f59a86aad8 Closes-bug: #1340900
Diffstat (limited to 'openstack_dashboard')
-rw-r--r--openstack_dashboard/dashboards/project/databases/tables.py9
-rw-r--r--openstack_dashboard/dashboards/project/databases/templates/databases/_detail_overview.html4
2 files changed, 13 insertions, 0 deletions
diff --git a/openstack_dashboard/dashboards/project/databases/tables.py b/openstack_dashboard/dashboards/project/databases/tables.py
index 69e7f8401..389df0e3b 100644
--- a/openstack_dashboard/dashboards/project/databases/tables.py
+++ b/openstack_dashboard/dashboards/project/databases/tables.py
@@ -133,6 +133,12 @@ def get_size(instance):
return _("Not available")
+def get_volume_size(instance):
+ if hasattr(instance, "volume"):
+ return sizeformat.diskgbformat(instance.volume.get("size"))
+ return _("Not available")
+
+
def get_databases(user):
if hasattr(user, "access"):
databases = [db.name for db in user.access]
@@ -156,6 +162,9 @@ class InstancesTable(tables.DataTable):
size = tables.Column(get_size,
verbose_name=_("Size"),
attrs={'data-type': 'size'})
+ volume = tables.Column(get_volume_size,
+ verbose_name=_("Volume Size"),
+ attrs={'data-type': 'size'})
status = tables.Column("status",
filters=(title, filters.replace_underscores),
verbose_name=_("Status"),
diff --git a/openstack_dashboard/dashboards/project/databases/templates/databases/_detail_overview.html b/openstack_dashboard/dashboards/project/databases/templates/databases/_detail_overview.html
index 217121a61..719e55be6 100644
--- a/openstack_dashboard/dashboards/project/databases/templates/databases/_detail_overview.html
+++ b/openstack_dashboard/dashboards/project/databases/templates/databases/_detail_overview.html
@@ -14,6 +14,10 @@
<dd>{{ instance.status|title }}</dd>
<dt>{% trans "RAM" %}</dt>
<dd>{{ instance.full_flavor.ram|mbformat }}</dd>
+ {% if instance.volume %}
+ <dt>{% trans "Volume Size" %}</dt>
+ <dd>{{ instance.volume.size|diskgbformat }}</dd>
+ {% endif %}
</dl>
</div>