Merge pull request #161 from corey-hammerton/catalog

puppetboard: Adding a more intuitive catalog view
This commit is contained in:
Spencer Krum
2015-11-04 17:18:01 -08:00
6 changed files with 221 additions and 3 deletions

View File

@@ -48,7 +48,7 @@
<th>Target</th>
</tr>
</thead>
<tbody>
<tbody class='searchable'>
{% for edge in catalog.get_edges() %}
<tr>
<td>{{edge.source}}</td>

View File

@@ -0,0 +1,90 @@
{% extends 'layout.html' %}
{% block content %}
<div class="ui fluid icon input hide" style="margin-bottom:20px">
<input autofocus="autofocus" class="filter-table" placeholder="Type here to filter...">
</div>
<table class="ui basic table">
<tbody>
<tr>
<th><h1>Comparing</h1></th>
<th><h1>Against</h1></th>
</tr>
<tr>
<td>{{compare.node}}</td>
<td>{{against.node}}</td>
</tr>
<tr>
<td>
<table class="ui basic table compact catalog">
<thead>
<tr><th>Resources</th></tr>
</thead>
<tbody class='searchable'>
{% for resource in compare.get_resources() %}
<tr>
<td>{{resource.type_}}[{{resource.name}}]</td>
</tr>
{% endfor %}
</tbody>
</table>
</td>
<td>
<table class="ui basic table compact catalog">
<thead>
<tr><th>Resources</th></tr>
</thead>
<tbody class='searchable'>
{% for resource in against.get_resources() %}
<tr>
<td>{{resource.type_}}[{{resource.name}}]</td>
</tr>
{% endfor %}
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table class="ui basic table compact catalog">
<thead>
<tr>
<th>Edges</th>
<th>-&gt;</th>
<th>Target</th>
</tr>
</thead>
<tbody class='searchable'>
{% for edge in compare.get_edges() %}
<tr>
<td>{{edge.source}}</td>
<td>{{edge.relationship}}</td>
<td>{{edge.target}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</td>
<td>
<table class="ui basic table compact catalog">
<thead>
<tr>
<th>Edge</th>
<th>-&gt;</th>
<th>Target</th>
</tr>
</thead>
<tbody class='searchable'>
{% for edge in against.get_edges() %}
<tr>
<td>{{edge.source}}</td>
<td>{{edge.relationship}}</td>
<td>{{edge.target}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
{% endblock content %}

View File

@@ -0,0 +1,40 @@
{% extends 'layout.html' %}
{% import '_macros.html' as macros %}
{% block content %}
<div class="ui fluid icon input hide" style="margin-bottom:20px">
<input autofocus="autofocus" class="filter-table" placeholder="Type here to filter...">
</div>
<table class='ui compact basic table nodes'>
<thead>
<tr>
<th></th>
<th>Hostname</th>
<th>Compile Time</th>
<th>Compare With</th>
</tr>
</thead>
<tbody class="searchable">
{% for node in nodes %}
<tr>
<td></td>
<td><a href="{{url_for('node', node_name=node.name)}}">{{node.name}}</a></td>
<td><a rel="utctimestamp" href="{{url_for('catalog_node', node_name=node.name)}}">{{node.catalog_timestamp}}</a></td>
<td>
{% if node.form %}
<div class="ui form">
<form method="POST" action="{{url_for('catalog_submit')}}">
{{node.form.csrf_token}}
<div class="field inline">
{{node.form.compare}}
{{node.form.against}}
<input type="submit" class="ui submit button" style="height:auto;" value="Compare"/>
</div>
</form>
</div>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock content %}

View File

@@ -34,6 +34,7 @@
('reports', 'Reports'),
('metrics', 'Metrics'),
('inventory', 'Inventory'),
('catalogs', 'Catalogs'),
('query', 'Query'),
] %}
<a {% if endpoint == request.endpoint %} class="active item" {% else %} class="item" {% endif %}