mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 21:51:14 -07:00
130 lines
5.9 KiB
HTML
130 lines
5.9 KiB
HTML
<%inherit file="base.html"/>
|
|
|
|
<%def name="headIncludes()">
|
|
<link rel="stylesheet" href="interfaces/default/css/dataTables.bootstrap.css">
|
|
<link rel="stylesheet" href="interfaces/default/css/dataTables.colVis.css">
|
|
<link rel="stylesheet" href="interfaces/default/css/plexpy-dataTables.css">
|
|
</%def>
|
|
|
|
<%def name="body()">
|
|
|
|
<div class='container-fluid'>
|
|
<div class='table-card-header'>
|
|
<div class="header-bar">
|
|
<span><i class="fa fa-history"></i> History</span>
|
|
</div>
|
|
<div class="button-bar">
|
|
<div class="colvis-button-bar hidden-xs"></div>
|
|
<button class="btn btn-danger btn-edit" data-toggle="button" aria-pressed="false" autocomplete="off" id="row-edit-mode">
|
|
<i class="fa fa-trash-o"></i> Delete mode
|
|
</button>
|
|
<div class="alert alert-danger alert-edit" role="alert" id="row-edit-mode-alert"><i class="fa fa-exclamation-triangle"></i> Select rows to delete. Data is deleted upon exiting delete mode.</div>
|
|
</div>
|
|
</div>
|
|
<div class='table-card-back'>
|
|
<table class="display" id="history_table" width="100%">
|
|
<thead>
|
|
<tr>
|
|
<th align='left' id="delete_row">Delete</th>
|
|
<th align='left' id="time">Time</th>
|
|
<th align='left' id="friendly_name">User</th>
|
|
<th align='left' id="ip_address">IP Address</th>
|
|
<th align='left' id="platform">Platform</th>
|
|
<th align='left' id="title">Title</th>
|
|
<th align='left' id="started">Started</th>
|
|
<th align='left' id="paused_counter">Paused</th>
|
|
<th align='left' id="stopped">Stopped</th>
|
|
<th align='left' id="duration">Duration</th>
|
|
<th align='left' id="percent_complete"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
</tbody>
|
|
</table>
|
|
<div class="modal fade" id="info-modal" tabindex="-1" role="dialog" aria-labelledby="info-modal">
|
|
</div>
|
|
<div class="modal fade" id="ip-info-modal" tabindex="-1" role="dialog" aria-labelledby="ip-info-modal">
|
|
</div>
|
|
<div class="modal fade" id="confirm-modal" tabindex="-1" role="dialog" aria-labelledby="confirm-modal">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-remove"></i></button>
|
|
<h4 class="modal-title" id="myModalLabel">Confirm Delete</h4>
|
|
</div>
|
|
<div class="modal-body" style="text-align: center;">
|
|
<p>Are you REALLY sure you want to delete <strong><span id="deleteCount"></span></strong> history item(s)?</p>
|
|
<p>This is permanent and cannot be undone!</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-dark" data-dismiss="modal">Cancel</button>
|
|
<button type="button" class="btn btn-danger btn-ok" data-dismiss="modal" id="confirm-delete">Delete</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</%def>
|
|
|
|
<%def name="javascriptIncludes()">
|
|
<script src="interfaces/default/js/jquery.dataTables.min.js"></script>
|
|
<script src="interfaces/default/js/dataTables.colVis.js"></script>
|
|
<script src="interfaces/default/js/dataTables.bootstrap.min.js"></script>
|
|
<script src="interfaces/default/js/dataTables.bootstrap.pagination.js"></script>
|
|
<script src="interfaces/default/js/moment-with-locale.js"></script>
|
|
<script src="interfaces/default/js/tables/history_table.js"></script>
|
|
<script>
|
|
$(document).ready(function() {
|
|
history_table_options.ajax = {
|
|
"url": "get_history",
|
|
type: "post",
|
|
data: function ( d ) {
|
|
return { 'json_data': JSON.stringify( d ) };
|
|
}
|
|
}
|
|
history_table = $('#history_table').DataTable(history_table_options);
|
|
var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark', exclude: [0, 10] });
|
|
$(colvis.button()).appendTo('div.colvis-button-bar');
|
|
|
|
clearSearchButton('history_table', history_table);
|
|
|
|
$('#row-edit-mode').on('click', function() {
|
|
$('#row-edit-mode-alert').fadeIn(200);
|
|
|
|
if ($(this).hasClass('active')) {
|
|
if (history_to_delete.length > 0) {
|
|
$('#deleteCount').text(history_to_delete.length);
|
|
$('#confirm-modal').modal();
|
|
$('#confirm-modal').one('click', '#confirm-delete', function () {
|
|
for (var i = 0; i < history_to_delete.length; i++) {
|
|
$.ajax({
|
|
url: 'delete_history_rows',
|
|
data: { row_id: history_to_delete[i] },
|
|
async: true,
|
|
success: function (data) {
|
|
var msg = "User history purged";
|
|
showMsg(msg, false, true, 2000);
|
|
}
|
|
});
|
|
}
|
|
history_table.draw();
|
|
});
|
|
}
|
|
|
|
$('.delete-control').each(function () {
|
|
$(this).find('button.btn-danger').toggleClass('btn-warning').toggleClass('btn-danger');
|
|
$(this).addClass('hidden');
|
|
$('#row-edit-mode-alert').fadeOut(200);
|
|
});
|
|
|
|
} else {
|
|
history_to_delete = [];
|
|
$('.delete-control').each(function() {
|
|
$(this).removeClass('hidden');
|
|
});
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</%def>
|