From 47fadea53c7e97ad9ab032c4d275e10486483007 Mon Sep 17 00:00:00 2001 From: catborise Date: Sat, 24 Oct 2026 16:48:41 +0300 Subject: [PATCH] feat(instances): the VM list filters by state, and a host's name finds its VMs The list gets a state selector beside the search box. The search now matches plain text in any case (a '(' no longer breaks it), and in the grouped list a host's name shows all of its VMs while a host row shows only while one of its VMs does. The filter moves to static/js/instance_filter.js with a Node test; the other lists keep filter-table.js. Collapsing a host now sets a class on its table body instead of each row's display, so a collapsed host and the filter no longer undo each other. --- instances/templates/allinstances.html | 10 +++- .../templates/allinstances_index_grouped.html | 12 ++--- instances/templates/instance_state.html | 2 +- instances/tests/js/instance_filter.test.js | 51 +++++++++++++++++++ instances/tests/test_instance_filter_js.py | 23 +++++++++ instances/tests/test_list_unreachable.py | 4 +- instances/tests/test_states.py | 10 ++++ instances/views.py | 4 +- static/css/webvirtcloud.css | 4 ++ static/js/instance_filter.js | 43 ++++++++++++++++ 10 files changed, 152 insertions(+), 11 deletions(-) create mode 100644 instances/tests/js/instance_filter.test.js create mode 100644 instances/tests/test_instance_filter_js.py create mode 100644 static/js/instance_filter.js diff --git a/instances/templates/allinstances.html b/instances/templates/allinstances.html index 52aff586..835fd56f 100644 --- a/instances/templates/allinstances.html +++ b/instances/templates/allinstances.html @@ -12,6 +12,14 @@ {% include 'create_inst_block.html' %} {% endif %} {% include 'search_block.html' %} + {% endblock page_heading_extra %} {% block content %} @@ -40,7 +48,7 @@ {% endblock content %} {% block script %} - + {% if request.user.is_superuser %}