Added inventory page along with a navbar link.
Added inventory page showing a table similar to the "Nodes" one, but containing any customizable set of facts. A setting INVENTORY_FACTS has been added. It controls the list of facts to be displayed along with a description for the header of the table.
This commit is contained in:
37
puppetboard/templates/inventory.html
Normal file
37
puppetboard/templates/inventory.html
Normal file
@@ -0,0 +1,37 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% block content %}
|
||||
<div class="alert alert-info">
|
||||
PuppetDB currently only returns active nodes.
|
||||
</div>
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="alert alert-{{category}}">
|
||||
{{message}}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
<div class="hide" style="margin-bottom:20px">
|
||||
<input autofocus="autofocus" style="width:100%" type="text" class="filter-table input-medium search-query" placeholder="Type here to filter">
|
||||
</div>
|
||||
<table class='inventory table table-striped table-condensed'>
|
||||
<thead>
|
||||
<tr>
|
||||
{% for description in fact_desc %}
|
||||
<th>{{description}}</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="searchable">
|
||||
{% for nodename in nodedata %}
|
||||
<tr>
|
||||
|
||||
{% for item in nodedata[nodename] %}
|
||||
<td>{{item}}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock content %}
|
||||
@@ -33,6 +33,7 @@
|
||||
('facts', 'Facts'),
|
||||
('reports', 'Reports'),
|
||||
('metrics', 'Metrics'),
|
||||
('inventory', 'Inventory'),
|
||||
('query', 'Query'),
|
||||
] %}
|
||||
<a {% if endpoint == request.endpoint %} class="active item" {% else %} class="item" {% endif %}
|
||||
|
||||
Reference in New Issue
Block a user