Move logs view from dev_panel page to a logs page

This commit is contained in:
Greg Burri 2025-04-26 16:26:35 +02:00
parent 1bb0f05fc0
commit b0f0633338
7 changed files with 110 additions and 42 deletions

View file

@ -5,37 +5,6 @@
<div class="content" id="dev-panel">
<input type="button" class="button" id="test-toast" value="Test toast">
<input type="button" class="button" id="test-modal-dialog" value="Test modal">
<div type="log">
<ul class="log-files">
{% for f in log.file_names().unwrap() %}
<li class="log-file"><a href="/dev_panel?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>
</div>
<div id="hidden-templates">