accessGate/views/admin/servers.ejs

60 lines
2.4 KiB
Plaintext

<%- include('../navbar', {active: "admin-servers"}); %>
<div class="container-fluid">
<h3 class="text-dark mb-4">Servers</h3>
<% if (locals.alert) { %>
<div class="alert alert-<%= locals.alert_type %>" role="alert">
<%= locals.alert %>
</div>
<% } %>
<div class="card shadow">
<div class="card-header py-3">
<p class="text-primary m-0 fw-bold">Server list</p>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6 text-nowrap">
<div id="dataTable_length" class="dataTables_length" aria-controls="dataTable"><a class="btn btn-primary" href="/admin/servers/new" data-toggle="modal" >New server</a></div>
</div>
<div class="col-md-6">
<div class="text-md-end dataTables_filter" id="dataTable_filter"><label class="form-label"><input type="search" class="form-control form-control-sm" aria-controls="dataTable" placeholder="Search"></label></div>
</div>
</div>
<div class="table-responsive table mt-2" id="dataTable" role="grid" aria-describedby="dataTable_info">
<table class="table my-0" id="dataTable">
<thead>
<tr>
<th>Hostname</th>
<th>IP</th>
<th>User</th>
<th>Last pull</th>
<th></th>
</tr>
</thead>
<tbody>
<% servers.forEach(function (server) { %>
<tr>
<td><%= server.hostname %></td>
<td><%= server.ip %></td>
<td><%= server.username %></td>
<td><%= server.lastPull %> <% if (!server.lastPull) { %>never<% } %></td>
<td style="text-align: right;"> <a class="btn btn-sm btn-danger" href="/admin/servers/delete/<%= server.hostname %>"><i class="far fa-trash-alt"></i></a></td>
</tr>
<% }) %>
</tbody>
<tfoot>
<tr></tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
<%- include('../footer'); %>