2014-03-10 01:18:05 -04:00
|
|
|
#import sickbeard
|
|
|
|
#from sickbeard import classes
|
|
|
|
#from sickbeard.common import *
|
|
|
|
#from sickbeard.logger import reverseNames
|
|
|
|
#set global $header="Log File"
|
|
|
|
#set global $title="Logs"
|
|
|
|
|
|
|
|
#set global $sbPath = ".."
|
|
|
|
|
|
|
|
#set global $topmenu="errorlogs"#
|
|
|
|
#import os.path
|
|
|
|
#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_top.tmpl")
|
|
|
|
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
|
|
|
<!--
|
2015-02-18 18:03:09 -05:00
|
|
|
\$(document).ready(
|
|
|
|
|
|
|
|
function(){
|
|
|
|
\$('#minLevel,#logFilter,#logSearch').change(function(){
|
|
|
|
if ( \$('#logSearch').val().length > 0 ) {
|
|
|
|
\$('#logSearch').prop('disabled', true);
|
|
|
|
\$('#logFilter option[value=<NONE>]').prop('selected', true);
|
|
|
|
\$('#minLevel option[value=INFO]').prop('selected', true);
|
|
|
|
}
|
|
|
|
\$('#minLevel').prop('disabled', true);
|
|
|
|
\$('#logFilter').prop('disabled', true);
|
|
|
|
\$('#logSearch').prop('disabled', true);
|
|
|
|
document.body.style.cursor='wait'
|
|
|
|
url = '$sbRoot/errorlogs/viewlog/?minLevel='+\$('select[name=minLevel]').val()+'&logFilter='+\$('select[name=logFilter]').val()+'&logSearch='+\$('#logSearch').val()
|
2014-03-10 01:18:05 -04:00
|
|
|
window.location.href = url
|
2015-02-18 18:03:09 -05:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
\$(window).load(function(){
|
|
|
|
|
|
|
|
if ( \$('#logSearch').val().length == 0 ) {
|
|
|
|
\$('#minLevel').prop('disabled', false);
|
|
|
|
\$('#logFilter').prop('disabled', false);
|
|
|
|
\$('#logSearch').prop('disabled', false);
|
|
|
|
} else {
|
|
|
|
\$('#minLevel').prop('disabled', true);
|
|
|
|
\$('#logFilter').prop('disabled', true);
|
|
|
|
\$('#logSearch').prop('disabled', false);
|
|
|
|
}
|
|
|
|
|
|
|
|
document.body.style.cursor='default';
|
|
|
|
});
|
|
|
|
|
|
|
|
\$('#logSearch').keyup(function() {
|
|
|
|
if ( \$('#logSearch').val().length == 0 ) {
|
|
|
|
\$('#logFilter option[value=<NONE>]').prop('selected', true);
|
|
|
|
\$('#minLevel option[value=INFO]').prop('selected', true);
|
|
|
|
\$('#minLevel').prop('disabled', false);
|
|
|
|
\$('#logFilter').prop('disabled', false);
|
|
|
|
url = '$sbRoot/errorlogs/viewlog/?minLevel='+\$('select[name=minLevel]').val()+'&logFilter='+\$('select[name=logFilter]').val()+'&logSearch='+\$('#logSearch').val()
|
|
|
|
window.location.href = url
|
|
|
|
} else {
|
|
|
|
\$('#minLevel').prop('disabled', true);
|
|
|
|
\$('#logFilter').prop('disabled', true);
|
|
|
|
}
|
2014-03-10 01:18:05 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
//-->
|
|
|
|
</script>
|
2014-10-21 15:09:01 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
#if $varExists('header')
|
|
|
|
<h1 class="header">$header</h1>
|
|
|
|
#else
|
|
|
|
<h1 class="title">$title</h1>
|
|
|
|
#end if
|
2014-10-21 15:09:01 -04:00
|
|
|
|
|
|
|
<div class="h2footer pull-right">Minimum logging level to display: <select name="minLevel" id="minLevel" class="form-control form-control-inline input-sm">
|
2014-03-10 01:18:05 -04:00
|
|
|
#set $levels = $reverseNames.keys()
|
|
|
|
$levels.sort(lambda x,y: cmp($reverseNames[$x], $reverseNames[$y]))
|
|
|
|
#for $level in $levels:
|
|
|
|
<option value="$reverseNames[$level]" #if $minLevel == $reverseNames[$level] then "selected=\"selected\"" else ""#>$level.title()</option>
|
|
|
|
#end for
|
|
|
|
</select>
|
2015-02-18 18:03:09 -05:00
|
|
|
|
|
|
|
Filter log by: <select name="logFilter" id="logFilter" class="form-control form-control-inline input-sm">
|
|
|
|
#for $logNameFilter in sorted($logNameFilters)
|
|
|
|
<option value="$logNameFilter" #if $logFilter == $logNameFilter then "selected=\"selected\"" else ""#>$logNameFilters[$logNameFilter]</option>
|
|
|
|
#end for
|
|
|
|
</select>
|
|
|
|
Search log by:
|
|
|
|
<input type="text" name="logSearch" id="logSearch" value="#if $logSearch then $logSearch else ""#" class="form-control form-control-inline input-sm" />
|
2014-03-10 01:18:05 -04:00
|
|
|
</div>
|
2014-10-21 15:09:01 -04:00
|
|
|
<br />
|
|
|
|
<div class="align-left"><pre>
|
2014-03-10 01:18:05 -04:00
|
|
|
$logLines
|
|
|
|
</pre>
|
|
|
|
</div>
|
2014-10-21 15:09:01 -04:00
|
|
|
<br />
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
|
|
|
<!--
|
|
|
|
window.setInterval( "location.reload(true)", 600000); // Refresh every 10 minutes
|
|
|
|
//-->
|
|
|
|
</script>
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2015-02-18 18:03:09 -05:00
|
|
|
#include $os.path.join($sickbeard.PROG_DIR,"gui/slick/interfaces/default/inc_bottom.tmpl")
|