2016-04-22 07:06:01 +00:00
|
|
|
{% extends "base.html" %} {% block title %}
|
|
|
|
<title>DNS Control Panel - History</title>
|
|
|
|
{% endblock %} {% block dashboard_stat %}
|
|
|
|
<!-- Content Header (Page header) -->
|
|
|
|
<section class="content-header">
|
2016-06-18 04:41:01 +00:00
|
|
|
<h1>
|
|
|
|
History <small>Recent PowerDNS-Admin events</small>
|
|
|
|
</h1>
|
|
|
|
<ol class="breadcrumb">
|
|
|
|
<li><a href="{{ url_for('dashboard') }}"><i
|
|
|
|
class="fa fa-dashboard"></i> Home</a></li>
|
|
|
|
<li class="active">History</li>
|
|
|
|
</ol>
|
2016-04-22 07:06:01 +00:00
|
|
|
</section>
|
|
|
|
{% endblock %} {% block content %}
|
|
|
|
<section class="content">
|
2016-06-18 04:41:01 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<div class="box">
|
|
|
|
<div class="box-header">
|
|
|
|
<h3 class="box-title">History Management</h3>
|
|
|
|
</div>
|
|
|
|
<div class="box-body clearfix">
|
|
|
|
<button type="button" class="btn btn-flat btn-danger pull-right" data-toggle="modal" data-target="#modal_clear_history">
|
|
|
|
Clear History <i class="fa fa-trash"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
|
|
<table id="tbl_history" class="table table-bordered table-striped">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Changed by</th>
|
|
|
|
<th>Content</th>
|
|
|
|
<th>Time</th>
|
|
|
|
<th>Detail</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for history in histories %}
|
|
|
|
<tr class="odd gradeX">
|
|
|
|
<td>{{ history.created_by }}</td>
|
|
|
|
<td>{{ history.msg }}</td>
|
|
|
|
<td>{{ history.created_on }}</td>
|
|
|
|
<td width="6%">
|
2016-08-21 14:46:23 +00:00
|
|
|
<button type="button" class="btn btn-flat btn-primary history-info-button" value='{{ history.detail }}'>Info <i class="fa fa-info"></i>
|
2016-06-18 04:41:01 +00:00
|
|
|
</button>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<!-- /.box-body -->
|
|
|
|
</div>
|
|
|
|
<!-- /.box -->
|
|
|
|
</div>
|
|
|
|
<!-- /.col -->
|
|
|
|
</div>
|
|
|
|
<!-- /.row -->
|
2016-04-22 07:06:01 +00:00
|
|
|
</section>
|
|
|
|
{% endblock %}
|
|
|
|
{% block extrascripts %}
|
|
|
|
<script>
|
2016-06-18 04:41:01 +00:00
|
|
|
// set up history data table
|
|
|
|
$("#tbl_history").DataTable({
|
|
|
|
"paging" : true,
|
|
|
|
"lengthChange" : false,
|
|
|
|
"searching" : true,
|
|
|
|
"ordering" : true,
|
|
|
|
"info" : true,
|
2018-04-17 06:30:08 +00:00
|
|
|
"autoWidth" : false,
|
2018-04-18 05:11:00 +00:00
|
|
|
"order": [[ 2, "desc" ]],
|
2018-04-17 06:30:08 +00:00
|
|
|
"columnDefs": [
|
|
|
|
{
|
2018-04-18 05:11:00 +00:00
|
|
|
"type": "time",
|
2018-04-17 06:30:08 +00:00
|
|
|
"render": function ( data, type, row ) {
|
|
|
|
return moment.utc(data).local().format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
},
|
|
|
|
"targets": 2
|
|
|
|
}
|
|
|
|
]
|
2016-06-18 04:41:01 +00:00
|
|
|
});
|
2016-07-01 22:31:14 +00:00
|
|
|
$(document.body).on('click', '.history-info-button', function() {
|
2016-06-18 04:41:01 +00:00
|
|
|
var modal = $("#modal_history_info");
|
|
|
|
var info = $(this).val();
|
2016-08-21 14:46:23 +00:00
|
|
|
$('#modal-code-content').html(json_library.prettyPrint(info));
|
2016-06-18 04:41:01 +00:00
|
|
|
modal.modal('show');
|
|
|
|
});
|
2015-12-13 09:34:12 +00:00
|
|
|
</script>
|
2016-04-22 07:06:01 +00:00
|
|
|
{% endblock %}
|
|
|
|
{% block modals %}
|
|
|
|
<!-- Clear History Confirmation Box -->
|
|
|
|
<div class="modal fade modal-warning" id="modal_clear_history">
|
2016-06-18 04:41:01 +00:00
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal"
|
|
|
|
aria-label="Close">
|
|
|
|
<span aria-hidden="true">×</span>
|
|
|
|
</button>
|
|
|
|
<h4 class="modal-title">Confirmation</h4>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<p>Are you sure you want to remove all history?</p>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-flat btn-default pull-left"
|
|
|
|
data-dismiss="modal">Close</button>
|
2018-04-12 00:11:34 +00:00
|
|
|
<button type="button" class="btn btn-flat btn-danger" onclick="applyChanges('', $SCRIPT_ROOT + '/admin/history', false, true);">Clear History</button>
|
2016-06-18 04:41:01 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- /.modal-content -->
|
|
|
|
</div>
|
|
|
|
<!-- /.modal-dialog -->
|
2016-04-22 07:06:01 +00:00
|
|
|
</div>
|
|
|
|
<div class="modal fade" id="modal_history_info">
|
2016-06-18 04:41:01 +00:00
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal"
|
|
|
|
aria-label="Close">
|
|
|
|
<span aria-hidden="true">×</span>
|
|
|
|
</button>
|
|
|
|
<h4 class="modal-title">History Details</h4>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2016-08-21 14:46:23 +00:00
|
|
|
<pre><code id="modal-code-content"></code></pre>
|
2016-06-18 04:41:01 +00:00
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-flat btn-default pull-right"
|
|
|
|
data-dismiss="modal">Close</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- /.modal-content -->
|
|
|
|
</div>
|
|
|
|
<!-- /.modal-dialog -->
|
2016-04-22 07:06:01 +00:00
|
|
|
</div>
|
|
|
|
<!-- /.modal -->
|
2015-12-13 09:34:12 +00:00
|
|
|
{% endblock %}
|