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

221 lines
9.1 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/dataTables.bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-md-9">
<h1>Inventory <small>Salt minions list</small></h1>
</div>
<div class="col-md-3">
<h3><small>{{ now }}</small></h3>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-body">
<h2>Available minions</h2>
<div class="table-responsive"><table id="hostlist" class="table table-striped table-bordered">
<thead>
<tr>
<th>Name</th>
<th class="hidden-xs hidden-sm">OS</th>
<th>Roles</th>
<th>IP</th>
<th class="hidden-xs hidden-sm">RAM (MB)</th>
<th>Salt</th>
</tr>
<tr>
<td>Name</td>
<td class="hidden-xs hidden-sm">OS</td>
<td>Roles</td>
<td>IP</td>
<td class="hidden-xs hidden-sm">RAM (MB)</td>
<td>Salt</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>
<span class="glyphicon {% if data.virtual != "physical" %} glyphicon-cloud {% else %} glyphicon-hdd {% endif %}" aria-hidden="true"></span>
{{ name }}
</td>
<td class="hidden-xs hidden-sm" style="white-space: nowrap">{{ data.lsb_distrib_description }}</td>
<td>{% for role in data.roles %} {{ role }} {% endfor %}</td>
<td>{{ data.fqdn_ip }}</td>
<td class="right number hidden-xs hidden-sm">{{ data.mem_total }}</td>
<td>{{ data.saltversion }}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td style="font-weight: bold;">Total:</th>
<td class="hidden-xs hidden-sm" style="font-weight: bold;"></th>
<td style="font-weight: bold;"></th>
<td style="font-weight: bold;"></th>
<td class="hidden-xs hidden-sm" style="font-weight: bold;"></th>
<td style="font-weight: bold;"></th>
</tr>
</tfoot>
</table></div>
<div class="row">
<div class="col-md-6">
<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['down'] %}
<tr class="danger">
<td>{{ name }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="col-md-6">
<h2>Pending keys</h2>
<table id="statuslist" class="table table-striped table-bordered">
<thead>
<tr>
<th>Name</th>
</tr>
</thead>
<tbody>
{% for name in keylist['minions_pre'] %}
<tr class="warning">
<td>{{ name }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<!-- end row -->
<div class="row">
<div class="col-md-12">
<h2>Previous jobs</h2>
<div class="table-responsive"><table id="joblist" class="table table-striped table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Function</th>
<th>StartTime</th>
<th>Target</th>
</tr>
<tr>
<td>Name</td>
<td>Function</td>
<td>StartTime</td>
<td>Target</td>
</tr>
</thead>
<tbody>
{% for id, data in joblist|dictsort|reverse %}
<tr class="info">
<td>
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#{{ id.translate(None, '.') }}">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
</button>
{{ id }}
</td>
<td>{{ data.Function }}</td>
<td>{{ data.StartTime }}</td>
<td>{{ data.Target }}</td>
</tr>
{% endfor %}
</tbody>
</table></div>
</div>
</div>
</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 %}
{% for id, data in joblist.iteritems() %}
<div class="modal" id="{{ id.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">{{ id }}</h1>
</div>
<div class="modal-body">
<h2>Job information</h2>
<ul>
<li>Function: {{ data['Function'] }}</li>
<li>Target: {{ data['Target'] }}</li>
<li>User: {{ data['User'] }}</li>
<li>StartTime: {{ data['StartTime'] }}</li>
<li>Target-type: {{ data['Target-type'] }}</li>
<li>Arguments: {{ data['Arguments'] }}</li>
</ul>
</div>
</div>
</div>
</div>
{% endfor %}
<script type="text/javascript" language="javascript" src="vendor/jquery/dist/jquery.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/bootstrap/dist/js/bootstrap.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="vendor/datatables/media/js/dataTables.bootstrap.min.js"></script>
<script type="text/javascript" language="javascript" src="res/inittable.js"></script>
</body>
</html>