You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bazarr/views/logs.tpl

120 lines
2.5 KiB

<html lang="en">
<head>
<!DOCTYPE html>
<script src="{{base_url}}static/jquery/jquery-latest.min.js"></script>
<script src="{{base_url}}static/semantic/semantic.min.js"></script>
<script src="{{base_url}}static/jquery/tablesort.js"></script>
<link rel="stylesheet" href="{{base_url}}static/semantic/semantic.min.css">
<style>
body {
background-color: #272727;
}
</style>
</head>
<body>
7 years ago
<div id='logs_loader' class="ui page dimmer">
<div id="loader_text" class="ui indeterminate text loader">Loading...</div>
7 years ago
</div>
<div class="content">
<table class="ui very basic selectable table">
<thead>
<tr>
<th class="collapsing"></th>
<th>Message</th>
<th class="collapsing">Time</th>
</tr>
</thead>
<tbody>
%import time
%import datetime
%import pretty
%for log in logs:
%line = []
%line = log.split('|')
7 years ago
<tr class='log' data-message="\\
%try:
6 years ago
{{line[3]}}\\
7 years ago
%except:
\\
%end
" data-exception="\\
7 years ago
%try:
6 years ago
{{line[4]}}\\
7 years ago
%except:
\\
%end
">
<td class="collapsing"><i class="\\
7 years ago
%try:
6 years ago
%if line[1] == 'INFO ':
7 years ago
blue info circle icon \\
6 years ago
%elif line[1] == 'WARNING ':
7 years ago
yellow warning circle icon \\
6 years ago
%elif line[1] == 'ERROR ':
7 years ago
red bug icon \\
6 years ago
%elif line[1] == 'DEBUG ':
bug icon \\
7 years ago
%end
%except:
%pass
%end
"></i></td>
7 years ago
<td>\\
%try:
6 years ago
{{line[3]}}\\
7 years ago
%except:
\\
%end
</td>
<td title="\\
%try:
{{line[0]}}" class="collapsing">{{pretty.date(int(time.mktime(datetime.datetime.strptime(line[0], "%d/%m/%Y %H:%M:%S").timetuple())))}}</td>
%except:
" class="collapsing"></td>
%end
</tr>
%end
</tbody>
</table>
</div>
<div id="modal" class="ui small modal">
<i class="close icon"></i>
<div class="header">
<div>Details</div>
</div>
<div class="content">
Message
<div id='message' class="ui segment">
<p></p>
</div>
Exception
<div id='exception' class="ui segment">
<p></p>
</div>
</div>
<div class="actions">
<button class="ui cancel button" >Close</button>
</div>
</div>
</body>
</html>
<script>
$('.modal')
.modal({
autofocus: false
});
$('.log').on('click', function(){
$("#message").html($(this).data("message"));
let exception = $(this).data("exception");
exception = exception.replace(/'/g,"");
exception = exception.replace(/\\n\s\s\s\s/g, "\\n&emsp;&emsp;");
exception = exception.replace(/\\n\s\s/g, "\\n&emsp;");
exception = exception.replace(/\\n/g, "<br />");
$("#exception").html(exception);
$('#modal').modal('show');
});
</script>