fix a few things

This commit is contained in:
Ross
2026-06-08 10:57:01 +01:00
parent 9919af2b20
commit 161da980cf
12 changed files with 436 additions and 36 deletions
+57 -17
View File
@@ -26,6 +26,21 @@
border-radius: 0.375rem;
padding: 0.75rem;
}
.logs-filter-group {
border: 1px solid var(--bs-border-color);
border-radius: 0.5rem;
padding: 0.75rem;
background: rgba(255, 255, 255, 0.02);
}
.logs-filter-group legend {
width: auto;
padding: 0 0.35rem;
margin: 0;
font-size: 0.8rem;
color: var(--bs-secondary-color);
text-transform: uppercase;
letter-spacing: 0.04em;
}
</style>
{% endblock %}
@@ -58,35 +73,59 @@
<div class="card border-0 shadow-sm mb-4">
<div class="card-body">
<form method="get" class="row g-2">
<div class="col-12 col-md-5">
<form method="get" class="row g-3">
<div class="col-12 col-lg-5">
<label for="id_logs_query" class="form-label small text-muted mb-1">Keyword</label>
<input type="search"
id="id_logs_query"
name="q"
class="form-control"
placeholder="Search logs by keyword (error, warning, etc)…"
value="{{ search_query }}">
</div>
<div class="col-12 col-md-3">
<select name="level" class="form-select">
<div class="col-12 col-lg-3">
<label for="id_logs_level" class="form-label small text-muted mb-1">Level</label>
<select id="id_logs_level" name="level" class="form-select">
<option value="">All levels</option>
{% for level in available_levels %}
<option value="{{ level }}" {% if level_filter == level %}selected{% endif %}>{{ level }}</option>
{% 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 class="col-12 col-lg-4">
<fieldset class="logs-filter-group">
<legend>Date Range</legend>
<div class="row g-2">
<div class="col-12 col-sm-6">
<label for="id_logs_date_from" class="form-label small mb-1">From date</label>
<input id="id_logs_date_from" type="date" name="date_from" class="form-control" value="{{ date_from }}" aria-label="Date from">
</div>
<div class="col-12 col-sm-6">
<label for="id_logs_date_to" class="form-label small mb-1">To date</label>
<input id="id_logs_date_to" type="date" name="date_to" class="form-control" value="{{ date_to }}" aria-label="Date to">
</div>
</div>
</fieldset>
</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 class="col-12 col-lg-4">
<fieldset class="logs-filter-group">
<legend>Time Range</legend>
<div class="row g-2">
<div class="col-12 col-sm-6">
<label for="id_logs_time_from" class="form-label small mb-1">From time</label>
<input id="id_logs_time_from" type="time" name="time_from" class="form-control" value="{{ time_from }}" aria-label="Time from">
</div>
<div class="col-12 col-sm-6">
<label for="id_logs_time_to" class="form-label small mb-1">To time</label>
<input id="id_logs_time_to" type="time" name="time_to" class="form-control" value="{{ time_to }}" aria-label="Time to">
</div>
</div>
</fieldset>
</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="col-12 col-lg-4 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 %}>
<label class="form-check-label small" for="include_noise">
@@ -94,10 +133,11 @@
</label>
</div>
</div>
<div class="col-12 col-md-auto">
<div class="col-12 col-md-auto d-flex flex-wrap gap-2">
<button type="submit" class="btn btn-primary">Search</button>
{% if search_query or level_filter %}
<a href="{% url 'logs_view' %}" class="btn btn-outline-secondary ms-1">Clear</a>
<a href="{% url 'logs_view' %}" class="btn btn-outline-secondary">Clear</a>
{% endif %}
</div>
<div class="col-12 col-md-auto">