40 lines
No EOL
1.3 KiB
HTML
40 lines
No EOL
1.3 KiB
HTML
{% extends "base_with_list.html" %}
|
|
|
|
{% block content %}
|
|
|
|
<div class="content" id="logs">
|
|
<ul class="log-files">
|
|
{% for f in log.file_names().unwrap() %}
|
|
<li class="log-file
|
|
{%~ if current_log_file == f %}
|
|
current
|
|
{% endif %}
|
|
"><a href="/logs?log_file={{ f }}">{{ f }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
<div class="current-log-file">
|
|
{% match log.read_content(current_log_file) %}
|
|
{% when Ok(lines) %}
|
|
{% for l in lines %}
|
|
<div class="line
|
|
{%~ if loop.index0 % 2 == 0 %}
|
|
even
|
|
{% else %}
|
|
odd
|
|
{% endif %}
|
|
" >
|
|
{% let l_info = Log::split_line(l) %}
|
|
<span class="date-time">{{ l_info.date_time }}</span>
|
|
<span class="level {{~ l_info.level }}">{{ l_info.level }}</span>
|
|
<span class="thread-name">{{ l_info.thread_name }}</span>
|
|
<span class="thread-id">{{ l_info.thread_id }}</span>
|
|
<span class="message">{{ l_info.message | linebreaksbr }}</span>
|
|
</div>
|
|
{% endfor %}
|
|
{% when Err(err) %}
|
|
Error reading log: {{ err }}
|
|
{% endmatch %}
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %} |