Skip to content
Snippets Groups Projects
Commit 64c83de1 authored by Pablo Armingol's avatar Pablo Armingol
Browse files

code cleanup

parent ccbf8139
No related branches found
No related tags found
2 merge requests!235Release TeraFlowSDN 3.0,!161Resolve "(TID) Visual inventory management"
...@@ -158,9 +158,7 @@ def inventory(device_uuid: str): ...@@ -158,9 +158,7 @@ def inventory(device_uuid: str):
flash('Device({:s}) not found'.format(str(device_uuid)), 'danger') flash('Device({:s}) not found'.format(str(device_uuid)), 'danger')
device_obj = Device() device_obj = Device()
context_client.close() context_client.close()
return render_template('device/inventory.html', device=device_obj)
return render_template(
'device/inventory.html', device=device_obj, dde=DeviceDriverEnum, dose=DeviceOperationalStatusEnum)
@device.get('<path:device_uuid>/delete') @device.get('<path:device_uuid>/delete')
def delete(device_uuid): def delete(device_uuid):
......
...@@ -78,21 +78,21 @@ ...@@ -78,21 +78,21 @@
<div class="row mb-3"> <div class="row mb-3">
<div class="col-sm-3"> <div class="col-sm-3">
<ul id="myUL"> <ul id="myUL">
<li><span class="caret"></span>>Components</span> <li><span class="caret"></span>Components</span>
<ul class="nested"> <ul class="nested">
{% for item in (device.components|sort(true, attribute='name'))%} {% for item in (device.components|sort(true, attribute='name')) %}
{%if item.parent |length < 1 or item.type=='CHASSIS' %} {% if item.parent |length < 1 or item.type=='CHASSIS' %}
<li><span class="caret"></span>{{item.name}}</span> <li><span class="caret"></span>{{item.name}}</span>
<ul class="nested"> <ul class="nested">
{%for comp in (device.components|sort(true, attribute='name'))%} {% for comp in (device.components|sort(true, attribute='name')) %}
{%if item.name == comp.parent%} {% if item.name == comp.parent %}
<li>{{comp.name}}</li> <li>{{comp.name}}</li>
{%endif%} {% endif %}
{%endfor%} {% endfor %}
</ul> </ul>
</li> </li>
{%endif%} {% endif %}
{%endfor%} {% endfor %}
</ul> </ul>
</li> </li>
</ul> </ul>
...@@ -148,6 +148,4 @@ ...@@ -148,6 +148,4 @@
{% endif %} {% endif %}
</div> </div>
{% endblock %}
{% endblock %}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment