Skip to content

Commit

Permalink
Cleanup a few more page registrations
Browse files Browse the repository at this point in the history
Change-Id: Ica846478e8414479e33669b9ec219a600e9061c2
  • Loading branch information
LarsMichelsen committed Oct 17, 2023
1 parent 5164287 commit 680cb1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion cmk/gui/sidebar/_snapin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
4 changes: 1 addition & 3 deletions cmk/gui/sidebar/_snapin/_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 680cb1a

Please sign in to comment.