Compare commits

..

3 commits

Author SHA1 Message Date
Luc Didry
a31c12e037
— Fix not-OK domains display if javascript is disabled 2024-11-14 09:41:59 +01:00
Luc Didry
04bbe21a66
💄 — Show only not-OK domains by default in domains list, to reduce the load on browser 2024-11-14 08:54:19 +01:00
Luc Didry
fdc219ba5c
🩹 — Fix CHANGELOG typo 2024-11-14 08:40:53 +01:00
2 changed files with 25 additions and 4 deletions

View file

@ -2,6 +2,9 @@
## [Unreleased]
- 💄 — Show only not-OK domains by default in domains list, to reduce the load on browser
- ♿️ — Fix not-OK domains display if javascript is disabled
## 0.5.0
Date: 2024-09-26
@ -68,7 +71,7 @@ Date: 2024-06-24
- 💄📯 — Improve notifications and result(s) pages
- 🔊 — Add level of log before the log message
— 🔊 — Add a warning messages in the logs if there is no tasks in database. (fix #41)
- 🔊 — Add a warning message in the logs if there is no tasks in database. (fix #41)
- ✨ — Add command to generate example configuration (fix #38)
- 📝 — Improve documentation
- ✨ — Add command to warn if its been long since last viewing an agent (fix #49)

View file

@ -12,15 +12,17 @@
</a>
</li>
</ul>
<ul>
{# djlint:off H021 #}
<ul id="status-selector" style="display: none;">{# djlint:on #}
<li>
<label for="select-status">Show domains with status:</label>
<select id="select-status">
<option value="all">All</option>
<option value="not-ok" selected>Not OK</option>
<option value="ok">✅ OK</option>
<option value="warning">⚠️ Warning</option>
<option value="critical">❌ Critical</option>
<option value="unknown">❔ Unknown</option>
<option value="all">All</option>
</select>
</li>
</ul>
@ -36,7 +38,7 @@
<tbody id="domains-body">
{% for (domain, status) in domains %}
<tr data-status={{ status }}>
<tr data-status="{{ status }}">
<td>
<a href="{{ url_for('get_domain_tasks_view', domain=domain) }}">
{{ domain }}
@ -65,6 +67,14 @@
document.querySelectorAll('[data-status]').forEach((item) => {
item.style.display = null;
})
} else if (e.currentTarget.value === 'not-ok') {
document.querySelectorAll('[data-status]').forEach((item) => {
if (item.dataset.status !== 'ok') {
item.style.display = null;
} else {
item.style.display = 'none';
}
})
} else {
document.querySelectorAll('[data-status]').forEach((item) => {
if (item.dataset.status === e.currentTarget.value) {
@ -75,5 +85,13 @@
})
}
});
document.querySelectorAll('[data-status]').forEach((item) => {
if (item.dataset.status !== 'ok') {
item.style.display = null;
} else {
item.style.display = 'none';
}
})
document.getElementById('status-selector').style.display = null;
</script>
{% endblock content %}