Merge "Display flavorless nodes, hide the node counts"

This commit is contained in:
Jenkins 2015-02-25 11:42:14 +00:00 committed by Gerrit Code Review
commit d75c48e52c
2 changed files with 43 additions and 46 deletions

View File

@ -149,8 +149,13 @@ class IndexView(views.IndexView):
field.initial = 0 field.initial = 0
free_roles.append(role) free_roles.append(role)
data['free_roles'] = free_roles data['free_roles'] = free_roles
data['flavors'] = list( flavor_data = list(
_flavor_data(self.request, flavors, flavor_roles)) _flavor_data(self.request, flavors, flavor_roles))
data['flavors'] = flavor_data
data['no_flavor_nodes'] = [
node for node in nodes
if not any(node in d['nodes'] for d in flavor_data)
]
else: else:
distribution = collections.Counter() distribution = collections.Counter()

View File

@ -12,57 +12,49 @@
{% endspaceless %}{% endfor %} {% endspaceless %}{% endfor %}
</div> </div>
<h4>{% trans "Available Flavors" %}</h4> <h4>{% trans "Hardware" %}</h4>
{% for flavor in flavors %} {% for flavor in flavors %}
<div class="boxes-flavor" data-flavor="{{ flavor.name }}"> <div class="boxes-flavor panel panel-default" data-flavor="{{ flavor.name }}">
<div class="row"> <div class="panel-heading">
<div class="col-md-9"> <strong>{% trans "Flavor:" %}</strong>
<strong>{% trans "Flavor:" %}</strong> <i>{{ flavor.name }}</i>
<i>{{ flavor.name }}</i> {{ flavor.cpu_arch }},
{{ flavor.cpu_arch }}, {{ flavor.vcpus }} CPU,
{{ flavor.vcpus }} CPU, {{ flavor.ram }}MB RAM,
{{ flavor.ram }}MB RAM, {{ flavor.disk }}GB Disk
{{ flavor.disk }}GB Disk
</div>
<div class="col-md-3">
<span class="pull-right">
{% trans "Free Nodes:" %}
<span class="free-nodes"></span> / {{ flavor.nodes|length }}
</span>
</div>
</div> </div>
<div class="row"> <div class="panel-body"><div class="row">
<div class="col-md-12"> <div class="col-xs-5">
<div class="separator-line"></div> <div class="boxes-drop-roles">
</div> {% for role in flavor.roles %}{% spaceless %}
</div> {% include "tuskar_boxes/overview/_role_info.html" with role=role %}
<div class="row"> {% endspaceless %}{% endfor %}
<div class="col-xs-5"> </div>
<div class="boxes-drop-roles"> <div class="btn-group boxes-drop-group">
{% for role in flavor.roles %}{% spaceless %} <div class="boxes-drop" data-toggle="dropdown">
{% include "tuskar_boxes/overview/_role_info.html" with role=role %} <div><i class="fa fa-plus"></i><br>
{% endspaceless %}{% endfor %} {% trans "enroll a deployment role" %}</div>
</div>
<div class="btn-group boxes-drop-group">
<div class="boxes-drop" data-toggle="dropdown">
<div><i class="fa fa-plus"></i><br>
{% trans "enroll a deployment role" %}</div>
</div>
<ul class="boxes-roles-menu dropdown-menu" role="menu">
{% for role in roles %}
<li>
<a href="#" data-role="{{ role.name }}"
>{{ role.name|title }}</a>
</li>
{% endfor %}
</ul>
</div>
</div> </div>
{% include "tuskar_boxes/overview/_node_info.html" with nodes=flavor.nodes classes="col-xs-7" %} <ul class="boxes-roles-menu dropdown-menu" role="menu">
{% for role in roles %}
<li>
<a href="#" data-role="{{ role.name }}"
>{{ role.name|title }}</a>
</li>
{% endfor %}
</ul>
</div>
</div> </div>
{% include "tuskar_boxes/overview/_node_info.html" with nodes=flavor.nodes classes="col-xs-7" %}
</div></div>
</div> </div>
{% endfor %} {% endfor %}
<div class="boxes-flavor panel panel-default">
<div class="panel-heading"><strong>{% trans "No flavor" %}</strong></div>
<div class="panel-body">
{% include "tuskar_boxes/overview/_node_info.html" with nodes=no_flavor_nodes %}
</div>
</div>
<hr> <hr>
<button type="submit" class="btn btn-default"> <button type="submit" class="btn btn-default">