From e5c7dc338d46baf7aec80968cd27ca7d6ded0485 Mon Sep 17 00:00:00 2001 From: catborise Date: Sun, 25 Oct 2026 22:59:36 +0300 Subject: [PATCH] fix(templates): the list pages search their rows as text, with one script The list pages' search (filter-table.js) read what was typed as a regular expression: a "(" or "[" stopped it with an error. It also needed jQuery, while the instance list had its own script for the same search. Both are now static/js/table_filter.js: plain text in any case, the instance list's state list and host groups where a page has them, remembered for a day as before. A group's header row is marked as one (data-group-header) instead of being any row without a state. --- admin/templates/admin/group_list.html | 2 +- admin/templates/admin/tombstone_list.html | 2 +- admin/templates/admin/user_list.html | 2 +- computes/templates/computes/instances.html | 2 +- computes/templates/computes/list.html | 2 +- instances/templates/allinstances.html | 2 +- .../templates/allinstances_index_grouped.html | 4 +- ...ce_filter.test.js => table_filter.test.js} | 27 +++++++++++--- instances/tests/test_states.py | 2 +- ...e_filter_js.py => test_table_filter_js.py} | 10 ++--- nwfilters/templates/nwfilters.html | 2 +- static/js/filter-table.js | 18 --------- .../{instance_filter.js => table_filter.js} | 37 +++++++++++-------- storages/templates/storage.html | 2 +- 14 files changed, 58 insertions(+), 56 deletions(-) rename instances/tests/js/{instance_filter.test.js => table_filter.test.js} (63%) rename instances/tests/{test_instance_filter_js.py => test_table_filter_js.py} (53%) delete mode 100644 static/js/filter-table.js rename static/js/{instance_filter.js => table_filter.js} (50%) diff --git a/admin/templates/admin/group_list.html b/admin/templates/admin/group_list.html index 78d61186..7d56d1ab 100644 --- a/admin/templates/admin/group_list.html +++ b/admin/templates/admin/group_list.html @@ -57,5 +57,5 @@ {% endblock content %} {% block script %} - + {% endblock script %} diff --git a/admin/templates/admin/tombstone_list.html b/admin/templates/admin/tombstone_list.html index b182c031..48328576 100644 --- a/admin/templates/admin/tombstone_list.html +++ b/admin/templates/admin/tombstone_list.html @@ -61,5 +61,5 @@ {% endblock content %} {% block script %} - + {% endblock script %} diff --git a/admin/templates/admin/user_list.html b/admin/templates/admin/user_list.html index ea69cfbc..c1ca7afb 100644 --- a/admin/templates/admin/user_list.html +++ b/admin/templates/admin/user_list.html @@ -85,5 +85,5 @@ {% endblock content %} {% block script %} - + {% endblock script %} diff --git a/computes/templates/computes/instances.html b/computes/templates/computes/instances.html index a8e5b211..f4bfb2cf 100644 --- a/computes/templates/computes/instances.html +++ b/computes/templates/computes/instances.html @@ -113,5 +113,5 @@ {% block script %} {% job_panel_script job_resource %} - + {% endblock %} \ No newline at end of file diff --git a/computes/templates/computes/list.html b/computes/templates/computes/list.html index ad5ad4a0..2bc49784 100644 --- a/computes/templates/computes/list.html +++ b/computes/templates/computes/list.html @@ -106,5 +106,5 @@ {% endblock content %} {% block script %} - + {% endblock script %} diff --git a/instances/templates/allinstances.html b/instances/templates/allinstances.html index 7c5f1192..4e7e91c0 100644 --- a/instances/templates/allinstances.html +++ b/instances/templates/allinstances.html @@ -94,7 +94,7 @@ {% endblock content %} {% block script %} - + {% if request.user.is_superuser %} + {% job_panel_script job_resource %} - +