Merge "Fix filtering on the node overview page"

This commit is contained in:
Jenkins 2014-10-09 09:20:46 +00:00 committed by Gerrit Code Review
commit 1d0507205b
2 changed files with 13 additions and 5 deletions

View File

@ -91,8 +91,16 @@ class RegisteredTab(tabs.TableTab):
def get_nodes_table_data(self):
redirect = urlresolvers.reverse('horizon:infrastructure:nodes:index')
nodes = api.node.Node.list(self.request, maintenance=False,
_error_redirect=redirect)
if 'provisioned' in self.request.GET:
associated = True
elif 'free' in self.request.GET:
associated = False
else:
associated = None
nodes = api.node.Node.list(self.request, associated=associated,
maintenance=False, _error_redirect=redirect)
if nodes:
all_resources = api.heat.Resource.list_all_resources(self.request)

View File

@ -26,13 +26,13 @@
<h3>{% trans 'Free Nodes' %}</h3>
<div class="d3_pie_chart_distribution" data-used="Provisioned={{ nodes_provisioned_count }}|Free={{ nodes_free_count }}"></div>
<div class="widget-info">
<a href="{% url 'horizon:infrastructure:nodes:index' %}?tab=nodes__registered">
<a href="{% url 'horizon:infrastructure:nodes:index' %}?tab=nodes__registered&free">
<span class="info">{{ nodes_free_count }}</span>
{% trans 'Free Nodes' %}
</a>
</div>
<div class="widget-info">
<a href="{% url 'horizon:infrastructure:nodes:index' %}?tab=nodes__registered">
<a href="{% url 'horizon:infrastructure:nodes:index' %}?tab=nodes__registered&provisioned">
<span class="info">{{ nodes_provisioned_count }}</span>
{% trans 'Provisioned Nodes' %}
</a>
@ -128,7 +128,7 @@
<div id="node-charts" class="nodes row">
<div class="col-lg-1">
<div class="widget-info">
<a href="{% url 'horizon:infrastructure:nodes:index' %}?tab=nodes__registered">
<a href="{% url 'horizon:infrastructure:nodes:index' %}?tab=nodes__registered&provisioned">
<span class="info">{{ nodes_provisioned_count }}</span><br>
{% trans 'Provisioned' %}<br>
{% trans 'Nodes' %}<br>