
Tables should look better on mobile now. Don't show table column selector on mobile sizes. Show more important columns on mobile.
153 lines
5.5 KiB
HTML
153 lines
5.5 KiB
HTML
<%inherit file="base.html"/>
|
|
<%!
|
|
from plexpy import helpers
|
|
%>
|
|
|
|
<%def name="headIncludes()">
|
|
<link rel="stylesheet" href="interfaces/default/css/plexwatch-tables.css">
|
|
<link rel="stylesheet" href="interfaces/default/css/dataTables.responsive.css">
|
|
<style>
|
|
td {word-break: break-all;}
|
|
</style>
|
|
</%def>
|
|
|
|
<%def name="headerIncludes()">
|
|
</%def>
|
|
|
|
<%def name="body()">
|
|
<div class='container-fluid'>
|
|
<div class='row-fluid'>
|
|
<div class='span12'>
|
|
<div class='table-card-back'>
|
|
<div class="header-bar">
|
|
<h2><i class="fa fa-book"></i> Logs</h2>
|
|
</div>
|
|
<div class="button-bar">
|
|
<button class="rounded" id="clear-logs"><i class="fa fa-trash-o"></i> Clear log</button>
|
|
</div>
|
|
</div>
|
|
<div class='table-card-back'>
|
|
<div role="tabpanel">
|
|
<ul class="nav nav-pills" role="tablist">
|
|
<li role="presentation" class="active"><a id="plexpy-logs-btn" href="#tabs-1" aria-controls="tabs-1" role="tab" data-toggle="tab">PlexPy Logs</a></li>
|
|
<li role="presentation"><a id="plex-logs-btn" href="#tabs-2" aria-controls="tabs-2" role="tab" data-toggle="tab">Plex Media Server Logs</a></li>
|
|
</ul>
|
|
|
|
<div class="tab-content">
|
|
<div role="tabpanel" class="tab-pane active" id="tabs-1">
|
|
<table class="display" id="log_table" width="100%">
|
|
<thead>
|
|
<tr>
|
|
<th class="min-tablet" align='left' id="timestamp">Timestamp</th>
|
|
<th class="desktop" align='left' id="level">Level</th>
|
|
<th class="all" align='left' id="message">Message</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div role="tabpanel" class="tab-pane" id="tabs-2">
|
|
<table class="display" id="plex_log_table" width="100%">
|
|
<thead>
|
|
<tr>
|
|
<th class="min-tablet" align='left' id="plex_timestamp">Timestamp</th>
|
|
<th class="desktop" align='left' id="plex_level">Level</th>
|
|
<th class="all" align='left' id="plex_message">Message</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<br>
|
|
<div align="center">Refresh rate:
|
|
<select id="refreshrate" onchange="setRefresh()">
|
|
<option value="0" selected="selected">No Refresh</option>
|
|
<option value="5">5 Seconds</option>
|
|
<option value="15">15 Seconds</option>
|
|
<option value="30">30 Seconds</option>
|
|
<option value="60">60 Seconds</option>
|
|
<option value="300">5 Minutes</option>
|
|
<option value="600">10 Minutes</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</%def>
|
|
|
|
<%def name="javascriptIncludes()">
|
|
<script src="interfaces/default/js/jquery.dataTables.min.js"></script>
|
|
<script src="interfaces/default/js/dataTables.responsive.js"></script>
|
|
<script src="interfaces/default/js/jquery.dataTables.bootstrap.pagination.integration.js"></script>
|
|
<script src="interfaces/default/js/tables/logs.js"></script>
|
|
<script src="interfaces/default/js/tables/plex_logs.js"></script>
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
LoadPlexPyLogs();
|
|
});
|
|
|
|
function LoadPlexPyLogs() {
|
|
log_table_options.ajax = {
|
|
"url": "getLog"
|
|
}
|
|
log_table = $('#log_table').DataTable(log_table_options);
|
|
}
|
|
|
|
function LoadPlexLogs() {
|
|
plex_log_table_options.ajax = {
|
|
"url": "get_plex_log"
|
|
}
|
|
plex_log_table = $('#plex_log_table').DataTable(plex_log_table_options);
|
|
}
|
|
|
|
$("#plexpy-logs-btn").click(function() {
|
|
$("#clear-logs").show();
|
|
LoadPlexPyLogs();
|
|
});
|
|
|
|
$("#plex-logs-btn").click(function() {
|
|
$("#clear-logs").hide();
|
|
LoadPlexLogs();
|
|
});
|
|
|
|
$("#clear-logs").click(function() {
|
|
var r = confirm("Are you sure you want to clear the PlexPy log?");
|
|
if (r == true) {
|
|
window.location.href = "clearLogs";
|
|
}
|
|
});
|
|
|
|
var timer;
|
|
function setRefresh()
|
|
{
|
|
refreshrate = document.getElementById('refreshrate');
|
|
if(refreshrate != null)
|
|
{
|
|
if(timer)
|
|
{
|
|
clearInterval(timer);
|
|
}
|
|
if(refreshrate.value != 0)
|
|
{
|
|
timer = setInterval(function() {
|
|
if ($("#tabs-1").hasClass("active")) {
|
|
log_table.ajax.reload();
|
|
} else {
|
|
plex_log_table.ajax.reload();
|
|
}
|
|
}, 1000*refreshrate.value);
|
|
}
|
|
}
|
|
}
|
|
|
|
</script>
|
|
</%def>
|