fix many issues

This commit is contained in:
Ross
2026-06-03 20:38:29 +01:00
parent 46518a45c1
commit 2e854c43b6
7 changed files with 166 additions and 12 deletions
+26 -3
View File
@@ -52,6 +52,10 @@
</div>
</div>
{% if action_message %}
<div class="alert alert-info">{{ action_message }}</div>
{% endif %}
<div class="card border-0 shadow-sm mb-4">
<div class="card-body">
<form method="get" class="row g-2">
@@ -70,6 +74,18 @@
{% endfor %}
</select>
</div>
<div class="col-12 col-md-2">
<input type="date" name="date_from" class="form-control" value="{{ date_from }}" aria-label="Date from">
</div>
<div class="col-12 col-md-2">
<input type="date" name="date_to" class="form-control" value="{{ date_to }}" aria-label="Date to">
</div>
<div class="col-12 col-md-1">
<input type="time" name="time_from" class="form-control" value="{{ time_from }}" aria-label="Time from">
</div>
<div class="col-12 col-md-1">
<input type="time" name="time_to" class="form-control" value="{{ time_to }}" aria-label="Time to">
</div>
<div class="col-12 col-md-2 d-flex align-items-center">
<div class="form-check mt-1">
<input class="form-check-input" type="checkbox" value="1" id="include_noise" name="include_noise" {% if include_noise %}checked{% endif %}>
@@ -86,15 +102,22 @@
</div>
<div class="col-12 col-md-auto">
{% if show_all %}
<a href="{% url 'logs_view' %}?q={{ search_query|urlencode }}&level={{ level_filter|urlencode }}{% if include_noise %}&include_noise=1{% endif %}" class="btn btn-outline-secondary">Show recent only</a>
<a href="{% url 'logs_view' %}?q={{ search_query|urlencode }}&level={{ level_filter|urlencode }}{% if date_from %}&date_from={{ date_from|urlencode }}{% endif %}{% if date_to %}&date_to={{ date_to|urlencode }}{% endif %}{% if time_from %}&time_from={{ time_from|urlencode }}{% endif %}{% if time_to %}&time_to={{ time_to|urlencode }}{% endif %}{% if include_noise %}&include_noise=1{% endif %}" class="btn btn-outline-secondary">Show recent only</a>
{% else %}
<a href="{% url 'logs_view' %}?q={{ search_query|urlencode }}&level={{ level_filter|urlencode }}&all=1{% if include_noise %}&include_noise=1{% endif %}" class="btn btn-outline-info">View all logs</a>
<a href="{% url 'logs_view' %}?q={{ search_query|urlencode }}&level={{ level_filter|urlencode }}&all=1{% if date_from %}&date_from={{ date_from|urlencode }}{% endif %}{% if date_to %}&date_to={{ date_to|urlencode }}{% endif %}{% if time_from %}&time_from={{ time_from|urlencode }}{% endif %}{% if time_to %}&time_to={{ time_to|urlencode }}{% endif %}{% if include_noise %}&include_noise=1{% endif %}" class="btn btn-outline-info">View all logs</a>
{% endif %}
</div>
<div class="col-12 col-md-auto">
<button type="submit" form="clear-log-form" class="btn btn-outline-danger" onclick="return confirm('Clear the log file?');">Reset log file</button>
</div>
<div class="col-12 col-md-auto">
<a href="{{ raw_url }}" class="btn btn-outline-dark" target="_blank" rel="noopener">View raw file</a>
</div>
</form>
<form id="clear-log-form" method="post" class="d-none">
{% csrf_token %}
<input type="hidden" name="action" value="clear">
</form>
</div>
</div>
@@ -153,7 +176,7 @@
{% endif %}
{% if noise_suppressed and not include_noise %}
Hidden {{ noise_suppressed }} noisy template debug entr{{ noise_suppressed|pluralize:"y,ies" }}.
<a href="{% url 'logs_view' %}?q={{ search_query|urlencode }}&level={{ level_filter|urlencode }}{% if show_all %}&all=1{% endif %}&include_noise=1" class="alert-link">Show them</a>.
<a href="{% url 'logs_view' %}?q={{ search_query|urlencode }}&level={{ level_filter|urlencode }}{% if show_all %}&all=1{% endif %}{% if date_from %}&date_from={{ date_from|urlencode }}{% endif %}{% if date_to %}&date_to={{ date_to|urlencode }}{% endif %}{% if time_from %}&time_from={{ time_from|urlencode }}{% endif %}{% if time_to %}&time_to={{ time_to|urlencode }}{% endif %}&include_noise=1" class="alert-link">Show them</a>.
{% endif %}
</div>
{% else %}