Beispiel #1
0
def dashboard_breadcrumb(name: str, board: DashboardConfig,
                         title: str) -> Breadcrumb:
    breadcrumb = make_topic_breadcrumb(
        mega_menu_registry.menu_monitoring(),
        PagetypeTopics.get_topic(board["topic"]))
    breadcrumb.append(
        BreadcrumbItem(title, html.makeuri_contextless([("name", name)])))
    return breadcrumb
 def show_topology(self, topology_settings: TopologySettings) -> None:
     visual_spec = ParentChildTopologyPage.visual_spec()
     breadcrumb = make_topic_breadcrumb(mega_menu_registry.menu_monitoring(),
                                        PagetypeTopics.get_topic(visual_spec["topic"]))
     breadcrumb.append(make_current_page_breadcrumb_item(visual_spec["title"]))
     page_menu = PageMenu(breadcrumb=breadcrumb)
     self._extend_display_dropdown(page_menu, visual_spec["name"])
     html.header(visual_spec["title"], breadcrumb, page_menu)
     self.show_topology_content(topology_settings=topology_settings)
Beispiel #3
0
def page_index() -> None:
    title = _("Checkmk Mobile")
    mobile_html_head(title)
    jqm_page_header(
        title,
        right_button=("javascript:document.location.reload();", _("Reload"), "refresh"),
        id_="data",
    )
    items = []
    for view_name, view_spec in views.get_permitted_views().items():
        if view_spec.get("mobile") and not view_spec.get("hidden"):

            datasource = data_source_registry[view_spec["datasource"]]()
            context = visuals.get_merged_context(
                visuals.get_context_from_uri_vars(datasource.infos),
                view_spec["context"],
            )

            view = views.View(view_name, view_spec, context)
            view.row_limit = views.get_limit()
            view.only_sites = visuals.get_only_sites_from_context(context)
            view.user_sorters = views.get_user_sorters()
            view.want_checkboxes = views.get_want_checkboxes()

            url = "mobile_view.py?view_name=%s" % view_name
            count = ""
            if not view_spec.get("mustsearch"):
                painter_options = PainterOptions.get_instance()
                painter_options.load(view_name)
                count = '<span class="ui-li-count">%d</span>' % views.get_row_count(view)

            topic = PagetypeTopics.get_topic(view_spec.get("topic", ""))
            items.append((topic.title(), url, "%s %s" % (view_spec["title"], count)))

    jqm_page_index(_("Checkmk Mobile"), items)
    # Link to non-mobile GUI

    html.hr()
    html.open_ul(**{"data-role": "listview", "data-theme": "b", "data-inset": "true"})
    html.open_li()
    html.a(
        _("Classical web GUI"),
        href="index.py?mobile=",
        **{"data-ajax": "false", "data-transition": "fade"},
    )
    html.close_li()
    html.close_ul()

    html.open_ul(**{"data-role": "listview", "data-theme": "f", "data-inset": "true"})
    html.open_li()
    html.a(_("Logout"), href="logout.py", **{"data-ajax": "false", "data-transition": "fade"})
    html.close_li()
    html.close_ul()
    mobile_html_foot()
Beispiel #4
0
    def _breadcrumb(self, title: str) -> Breadcrumb:
        breadcrumb = make_topic_breadcrumb(mega_menu_registry.menu_monitoring(),
                                           PagetypeTopics.get_topic("analyze"))

        # Add the parent element: List of all crashes
        breadcrumb.append(
            BreadcrumbItem(
                title=_("Crash reports"),
                url=html.makeuri_contextless([("view_name", "crash_reports")], filename="view.py"),
            ))

        breadcrumb.append(make_current_page_breadcrumb_item(title))

        return breadcrumb
Beispiel #5
0
 def show_topology(self,
                   hostnames: List[HostName],
                   mode: str,
                   growth_auto_max_nodes: Optional[int] = None,
                   mesh_depth: int = 0,
                   max_nodes: int = 400) -> None:
     visual_spec = ParentChildTopologyPage.visual_spec()
     breadcrumb = make_topic_breadcrumb(
         mega_menu_registry.menu_monitoring(),
         PagetypeTopics.get_topic(visual_spec["topic"]))
     breadcrumb.append(
         make_current_page_breadcrumb_item(visual_spec["title"]))
     page_menu = PageMenu(breadcrumb=breadcrumb)
     self._extend_display_dropdown(page_menu, visual_spec["name"])
     html.header(visual_spec["title"], breadcrumb, page_menu)
     self.show_topology_content(hostnames,
                                mode,
                                growth_auto_max_nodes=growth_auto_max_nodes,
                                mesh_depth=mesh_depth,
                                max_nodes=max_nodes)