mirror of
https://framagit.org/framasoft/framaspace/argos.git
synced 2025-04-28 18:02:41 +02:00
💄 — Show only not-OK domains by default in domains list, to reduce the load on browser
This commit is contained in:
parent
fdc219ba5c
commit
04bbe21a66
2 changed files with 13 additions and 2 deletions
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
- 💄 — Show only not-OK domains by default in domains list, to reduce the load on browser
|
||||||
|
|
||||||
## 0.5.0
|
## 0.5.0
|
||||||
|
|
||||||
Date: 2024-09-26
|
Date: 2024-09-26
|
||||||
|
|
|
@ -16,11 +16,12 @@
|
||||||
<li>
|
<li>
|
||||||
<label for="select-status">Show domains with status:</label>
|
<label for="select-status">Show domains with status:</label>
|
||||||
<select id="select-status">
|
<select id="select-status">
|
||||||
<option value="all">All</option>
|
<option value="not-ok" selected>Not OK</option>
|
||||||
<option value="ok">✅ OK</option>
|
<option value="ok">✅ OK</option>
|
||||||
<option value="warning">⚠️ Warning</option>
|
<option value="warning">⚠️ Warning</option>
|
||||||
<option value="critical">❌ Critical</option>
|
<option value="critical">❌ Critical</option>
|
||||||
<option value="unknown">❔ Unknown</option>
|
<option value="unknown">❔ Unknown</option>
|
||||||
|
<option value="all">All</option>
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -36,7 +37,7 @@
|
||||||
|
|
||||||
<tbody id="domains-body">
|
<tbody id="domains-body">
|
||||||
{% for (domain, status) in domains %}
|
{% for (domain, status) in domains %}
|
||||||
<tr data-status={{ status }}>
|
<tr data-status={{ status }} {% if status == "ok" -%}style="display: none;"{%- endif -%}>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ url_for('get_domain_tasks_view', domain=domain) }}">
|
<a href="{{ url_for('get_domain_tasks_view', domain=domain) }}">
|
||||||
{{ domain }}
|
{{ domain }}
|
||||||
|
@ -65,6 +66,14 @@
|
||||||
document.querySelectorAll('[data-status]').forEach((item) => {
|
document.querySelectorAll('[data-status]').forEach((item) => {
|
||||||
item.style.display = null;
|
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 {
|
} else {
|
||||||
document.querySelectorAll('[data-status]').forEach((item) => {
|
document.querySelectorAll('[data-status]').forEach((item) => {
|
||||||
if (item.dataset.status === e.currentTarget.value) {
|
if (item.dataset.status === e.currentTarget.value) {
|
||||||
|
|
Loading…
Reference in a new issue