{% extends "BaseNavbar.html" %}
{% block main %}
<div class="row justify-content-lg-center m-4">
<div class="col-lg-10 p-3 m-3 rounded iplm">
<h2>Global Settings</h2><br>
<h4>User Management</h4><hr>
<form action="/settings" method="POST" role="form" id="AnswerForm">
<div class="form-group">
<label for="NewUser" >Add New User</label>
<input onfocus="this.placeholder=''" type="text" name="UserName" class="form-control" id="implantCmd" placeholder="Username">
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" name="is_admin" id="defaultCheck1">
<label class="form-check-label" for="defaultCheck1">Admin account</label>
</div>
<button type="submit" class="btn btn-default" id="AddUserBtn">Submit</button>
</form>
<br>
<h5 class="text-danger">Disable User</h5><hr>
<p>TODO: Generate a list of with enable/disabled check boxes for any admin users. Ensure "self-disabling" cannot happen.</p>
<br>
<h5>Logs</h5><hr>
<div class="row">
<div class="col-md-6 ">Number of records:<span class="counter pull-right">0 items</span></div>
<div class="col-md-6">
<label>
<input type="search" class="form form-control form-control-sm search" placeholder="Search logs" aria-controls="dtBasicExample">
</label>
</div>
</div>
<table class="table table-striped table-bordered table-sm results table-hover" id="dtBasicExample" cellspacing="0" width="100%">
<thead>
<tr>
<th scope="col">Time</th>
<th scope="col">Type</th>
<th scope="col">Record</th>
</tr>
</thead>
<tbody>
{% for x in logs %}
<tr>
<td >{{x.time}}</td>
<td>{{ x.type }}</td>
<td>{{ x.data }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!-- Modal -->
<div class="modal fade" id="FormSubmissionModal" tabindex="-1" role="dialog" aria-labelledby="FormSubmissionModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="FormModalTitle"></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div id="modal-result"></div>
<div id="modal-reason"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
{% endblock %}