This repository has been archived on 2025-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
salt-inventory/templates/hostlist_template.html

137 lines
5.4 KiB
HTML

<html>
<head>
<title>Host list</title>
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../vendor/datatables/media/css/jquery.dataTables.css">
<script type="text/javascript" language="javascript" src="vendor/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" language="javascript" src="vendor/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" language="javascript" src="vendor/jquery-number/jquery.number.min.js"></script>
<script type="text/javascript" language="javascript" src="vendor/datatables/media/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="res/inittable.js"></script>
</head>
<body>
<div class="container">
<div class="jumbotron">
<h1>Inventory <small>Salt minions list</small></h1>
</div>
</div>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-body">
<h2>Available minions</h2>
<table id="hostlist" class="table table-striped table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Machine type</th>
<th>OS</th>
<th>Roles</th>
<th>IP</th>
<th>RAM (MB)</th>
<th># CPUs</th>
</tr>
<tr>
<td>Name</td>
<td>Machine type</td>
<td>OS</td>
<td>Roles</td>
<td>IP</td>
<td>RAM (MB)</td>
<td># CPUs</td>
</tr>
</thead>
<tbody>
{% for name, data in hostlist.iteritems() %}
<tr>
<td>
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#{{ name.translate(None, '.') }}">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
</button>
{{ name }}
</td>
<td>{% if data.virtual != "physical" %} Virtual ({{ data.virtual }}) {% else %} Physical {% endif %}</td>
<td>{{ data.lsb_distrib_description }}</td>
<td>{% for role in data.roles %} {{ role }} {% endfor %}</td>
<td>{{ data.fqdn_ip }}</td>
<td class="right number">{{ data.mem_total }}</td>
<td class="right">{{ data.num_cpus }}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td style="font-weight: bold;">Total:</th>
<td style="font-weight: bold;"></th>
<td style="font-weight: bold;"></th>
<td style="font-weight: bold;"></th>
<td style="font-weight: bold;"></th>
<td style="font-weight: bold;"></th>
<td style="font-weight: bold;"></th>
</tr>
</tfoot>
</table>
<h2>Disconnected minions</h2>
<table id="statuslist" class="table table-striped table-bordered">
<thead>
<tr>
<th>Name</th>
</tr>
</thead>
<tbody>
{% for name in statlist %}
<tr class="danger">
<td>{{ name }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% for name, data in hostlist.iteritems() %}
<div class="modal" id="{{ name.translate(None, '.') }}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h1 class="modal-title" id="myModalLabel">{{ name }}</h1>
</div>
<div class="modal-body">
<h2>System information</h2>
<h3>Generic</h3>
<ul>
<li>Operating System: {{ data.kernel }} ({{ data.kernelrelease }})</li>
<li>Distribution: {{ data.lsb_distrib_description }}</li>
<li>Machine type: {% if data.virtual != "physical" %} Virtual ({{ data.virtual }}) {% else %} Physical {% endif %}</li>
<li>Architecture: {{ data.osarch }}</li>
<li>Salt version: {{ data.saltversion }}</li>
</ul>
<h3>CPU</h3>
<ul>
<li>Numer of CPUs: {{ data.num_cpus }}</li>
<li>CPU architecture: {{ data.cpuarch }}</li>
<li>CPU model: {{ data.cpu_model }}</li>
</ul>
<h3>Memory</h3>
<ul>
<li>Total memory: {{ data.mem_total }}</li>
</ul>
<h3>Roles</h3>
<ul>
{% for role in data.roles %}
<li>{{ role }}</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
{% endfor %}
</body>
</html>