diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-07-29 14:42:00 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-07-29 14:42:00 +0000 |
commit | a840479787a95dc5260bb96eb1e076e8bbd0b866 (patch) | |
tree | 054e3d03a8cfa3004d20c9988446b37e1d5eb208 | |
parent | 6859eaaf593f01a7e90b361ebfa4be58470fe14c (diff) | |
parent | a12d4391c483f9de720ce742db67527ba65fbfab (diff) | |
download | tuskar-ui-a840479787a95dc5260bb96eb1e076e8bbd0b866.tar.gz |
Merge "Add column "Uptime" to instances overview"
4 files changed, 15 insertions, 1 deletions
diff --git a/openstack_dashboard/api/nova.py b/openstack_dashboard/api/nova.py index f03f2a88..5acd6ab7 100644 --- a/openstack_dashboard/api/nova.py +++ b/openstack_dashboard/api/nova.py @@ -75,7 +75,7 @@ class Server(APIResourceWrapper): 'image_name', 'VirtualInterfaces', 'flavor', 'key_name', 'tenant_id', 'user_id', 'OS-EXT-STS:power_state', 'OS-EXT-STS:task_state', 'OS-EXT-SRV-ATTR:instance_name', - 'OS-EXT-SRV-ATTR:host'] + 'OS-EXT-SRV-ATTR:host', 'created'] def __init__(self, apiresource, request): super(Server, self).__init__(apiresource) diff --git a/openstack_dashboard/dashboards/admin/instances/tables.py b/openstack_dashboard/dashboards/admin/instances/tables.py index 08b84ff1..265a9529 100644 --- a/openstack_dashboard/dashboards/admin/instances/tables.py +++ b/openstack_dashboard/dashboards/admin/instances/tables.py @@ -17,10 +17,12 @@ import logging +from django.template.defaultfilters import timesince from django.template.defaultfilters import title from django.utils.translation import ugettext_lazy as _ from horizon import tables +from horizon.utils.filters import parse_isotime from horizon.utils.filters import replace_underscores from openstack_dashboard import api @@ -152,6 +154,9 @@ class AdminInstancesTable(tables.DataTable): state = tables.Column(get_power_state, filters=(title, replace_underscores), verbose_name=_("Power State")) + created = tables.Column("created", + verbose_name=_("Uptime"), + filters=(parse_isotime, timesince)) class Meta: name = "instances" diff --git a/openstack_dashboard/dashboards/project/instances/tables.py b/openstack_dashboard/dashboards/project/instances/tables.py index e30a62a7..a9533474 100644 --- a/openstack_dashboard/dashboards/project/instances/tables.py +++ b/openstack_dashboard/dashboards/project/instances/tables.py @@ -18,6 +18,7 @@ from django.core import urlresolvers from django import shortcuts from django import template +from django.template.defaultfilters import timesince from django.template.defaultfilters import title from django.utils.http import urlencode from django.utils.translation import string_concat @@ -28,6 +29,7 @@ from horizon import exceptions from horizon import messages from horizon import tables from horizon.templatetags import sizeformat +from horizon.utils.filters import parse_isotime from horizon.utils.filters import replace_underscores import logging @@ -548,6 +550,9 @@ class InstancesTable(tables.DataTable): state = tables.Column(get_power_state, filters=(title, replace_underscores), verbose_name=_("Power State")) + created = tables.Column("created", + verbose_name=_("Uptime"), + filters=(parse_isotime, timesince)) class Meta: name = "instances" diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html index 8d5fc284..1b1006ff 100644 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html +++ b/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html @@ -13,6 +13,10 @@ <dd>{{ instance.id }}</dd> <dt>{% trans "Status" %}</dt> <dd>{{ instance.status|title }}</dd> + <dt>{% trans "Created" %}</dt> + <dd>{{ instance.created|parse_isotime }}</dd> + <dt>{% trans "Uptime" %}</dt> + <dd>{{ instance.created|parse_isotime|timesince }}</dd> </dl> </div> |