From 949551845f32ed45bdb0c4aa77bf222457c2d4ac Mon Sep 17 00:00:00 2001 From: Arthur Hanson Date: Mon, 15 Jul 2024 21:32:29 +0700 Subject: [PATCH] 14731 quick search --- netbox/core/views.py | 5 ++++- netbox/templates/core/plugin_list.html | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/netbox/core/views.py b/netbox/core/views.py index 73789361d..5eeb6e775 100644 --- a/netbox/core/views.py +++ b/netbox/core/views.py @@ -788,7 +788,10 @@ class PluginListView(UserPassesTestMixin, View): q = request.GET.get('q', None) plugins = get_plugins() - plugins = [v for k, v in plugins.items()] + if q: + plugins = [v for k, v in plugins.items() if q.casefold() in v['name'].casefold()] + else: + plugins = [v for k, v in plugins.items()] table = CertifiedPluginTable(plugins, user=request.user) table.configure(request) diff --git a/netbox/templates/core/plugin_list.html b/netbox/templates/core/plugin_list.html index 60883e482..01a776b2c 100644 --- a/netbox/templates/core/plugin_list.html +++ b/netbox/templates/core/plugin_list.html @@ -23,9 +23,9 @@
-
+
+ hx-get="{{ request.full_path }}" hx-target="#object_list" hx-trigger="keyup changed delay:500ms, search"/>