From 680cb1a0cd5a2ea924af78bd3ce1789abd82774d Mon Sep 17 00:00:00 2001 From: Lars Michelsen Date: Thu, 12 Oct 2023 10:12:50 +0200 Subject: [PATCH] Cleanup a few more page registrations Change-Id: Ica846478e8414479e33669b9ec219a600e9061c2 --- cmk/gui/sidebar/_snapin/__init__.py | 4 +++- cmk/gui/sidebar/_snapin/_search.py | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmk/gui/sidebar/_snapin/__init__.py b/cmk/gui/sidebar/_snapin/__init__.py index c39c06791ee..ccbd4bf4c19 100644 --- a/cmk/gui/sidebar/_snapin/__init__.py +++ b/cmk/gui/sidebar/_snapin/__init__.py @@ -30,7 +30,7 @@ from ._permission_section import PermissionSectionSidebarSnapins as PermissionSectionSidebarSnapins from ._registry import snapin_registry as snapin_registry from ._registry import SnapinRegistry as SnapinRegistry -from ._search import QuicksearchSnapin +from ._search import PageSearchMonitoring, PageSearchSetup, QuicksearchSnapin from ._server_time import CurrentTime from ._site_status import SiteStatus from ._speedometer import Speedometer @@ -53,3 +53,5 @@ def register(snapin_registry_: SnapinRegistry, page_registry: PageRegistry) -> N snapin_registry_.register(TacticalOverviewSnapin) snapin_registry_.register(Views) page_registry.register_page_handler("export_views", ajax_export_views) + page_registry.register_page("ajax_search_monitoring")(PageSearchMonitoring) + page_registry.register_page("ajax_search_setup")(PageSearchSetup) diff --git a/cmk/gui/sidebar/_snapin/_search.py b/cmk/gui/sidebar/_snapin/_search.py index a645630d7e6..ac834a88d27 100644 --- a/cmk/gui/sidebar/_snapin/_search.py +++ b/cmk/gui/sidebar/_snapin/_search.py @@ -32,7 +32,7 @@ from cmk.gui.log import logger from cmk.gui.logged_in import user from cmk.gui.main_menu import mega_menu_registry -from cmk.gui.pages import AjaxPage, page_registry, PageResult +from cmk.gui.pages import AjaxPage, PageResult from cmk.gui.plugins.wato.utils import main_module_registry from cmk.gui.type_defs import ( HTTPVariables, @@ -1571,14 +1571,12 @@ def _evaluate_iterable_up_to( return evaluated, False -@page_registry.register_page("ajax_search_monitoring") class PageSearchMonitoring(AjaxPage): def page(self) -> PageResult: query = request.get_str_input_mandatory("q") return MenuSearchResultsRenderer("monitoring").render(query) -@page_registry.register_page("ajax_search_setup") class PageSearchSetup(AjaxPage): def page(self) -> PageResult: query = request.get_str_input_mandatory("q")