diff --git a/blazar_dashboard/api/client.py b/blazar_dashboard/api/client.py index c6664d7..e97c99c 100644 --- a/blazar_dashboard/api/client.py +++ b/blazar_dashboard/api/client.py @@ -45,7 +45,7 @@ class Host(base.APIDictWrapper): _attrs = ['id', 'hypervisor_hostname', 'hypervisor_type', 'hypervisor_version', 'vcpus', 'cpu_info', 'memory_mb', 'local_gb', 'status', 'created_at', 'updated_at', - 'service_name', 'trust_id'] + 'service_name', 'trust_id', 'reservable'] def __init__(self, apiresource): super(Host, self).__init__(apiresource) diff --git a/blazar_dashboard/content/hosts/tables.py b/blazar_dashboard/content/hosts/tables.py index 2760ec5..6dafcea 100644 --- a/blazar_dashboard/content/hosts/tables.py +++ b/blazar_dashboard/content/hosts/tables.py @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +from django.template import defaultfilters as filters from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy from horizon import tables @@ -68,6 +69,8 @@ class HostsTable(tables.DataTable): local_gb = tables.Column("local_gb", verbose_name=_("Local Storage"), filters=(sizeformat.diskgbformat,)) type = tables.Column("hypervisor_type", verbose_name=_("Hypervisor type")) + reservable = tables.Column("reservable", verbose_name=_("Reservable"), + filters=(filters.yesno, filters.capfirst)) class Meta(object): name = "hosts" diff --git a/blazar_dashboard/content/hosts/templates/hosts/_detail_overview.html b/blazar_dashboard/content/hosts/templates/hosts/_detail_overview.html index 14f134a..885803f 100644 --- a/blazar_dashboard/content/hosts/templates/hosts/_detail_overview.html +++ b/blazar_dashboard/content/hosts/templates/hosts/_detail_overview.html @@ -7,8 +7,11 @@
{{ host.hypervisor_hostname }}
{% trans "Id" %}
{{ host.id }}
+
{% trans "Reservable" %}
+
{{ host.reservable|yesno|capfirst }}
{% trans "Status" %}
-
{{ host.status }}
{% trans "Created at" %}
+
{{ host.status }}
+
{% trans "Created at" %}
{{ host.created_at|parse_isotime|date:"Y-m-d H:i T"|default:"-" }}
{% trans "Updated at" %}
{{ host.updated_at|parse_isotime|date:"Y-m-d H:i T"|default:"-" }}
diff --git a/blazar_dashboard/test/test_data/blazar_data.py b/blazar_dashboard/test/test_data/blazar_data.py index 989b347..173e351 100644 --- a/blazar_dashboard/test/test_data/blazar_data.py +++ b/blazar_dashboard/test/test_data/blazar_data.py @@ -149,7 +149,8 @@ host_sample1 = { "local_gb": 128, "id": "1", "trust_id": "dummy", - "ex1": "dummy" + "ex1": "dummy", + "reservable": True } host_sample2 = { @@ -166,7 +167,8 @@ host_sample2 = { "local_gb": 128, "id": "2", "trust_id": "dummy", - "ex2": "dummy" + "ex2": "dummy", + "reservable": True }