Exemple #1
0
def _show_file_breadcrumb(host_name: HostName, title: str) -> Breadcrumb:
    breadcrumb = make_host_breadcrumb(host_name)
    breadcrumb.append(
        BreadcrumbItem(
            title=_("Log files of host %s") % host_name,
            url=makeuri(request, [("file", "")]),
        ))
    breadcrumb.append(make_current_page_breadcrumb_item(title))
    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)
Exemple #3
0
def _show_file_breadcrumb(host_name: HostName, title: str) -> Breadcrumb:
    breadcrumb = make_host_breadcrumb(host_name)
    breadcrumb.append(
        BreadcrumbItem(
            title=_("Log files of host %s") % host_name,
            url=html.makeuri([('file', '')]),
        ))
    breadcrumb.append(make_current_page_breadcrumb_item(title))
    return breadcrumb
Exemple #4
0
def page_werk():
    load_werks()
    werk_id = request.get_integer_input_mandatory("werk")
    if werk_id not in g_werks:
        raise MKUserError("werk", _("This werk does not exist."))
    werk = g_werks[werk_id]

    title = ("%s %s - %s") % (_("Werk"), render_werk_id(
        werk, with_link=False), werk["title"])

    breadcrumb = make_main_menu_breadcrumb(mega_menu_registry["help_links"])
    breadcrumb.append(
        BreadcrumbItem(
            title=_("Change log (Werks)"),
            url="change_log.py",
        ))
    breadcrumb.append(make_current_page_breadcrumb_item(title))
    html.header(title, breadcrumb, _page_menu_werk(breadcrumb, werk))

    html.open_table(class_=["data", "headerleft", "werks"])

    def werk_table_row(caption, content, css=None):
        html.open_tr()
        html.th(caption)
        html.td(content, class_=css)
        html.close_tr()

    translator = cmk.utils.werks.WerkTranslator()
    werk_table_row(_("ID"), render_werk_id(werk, with_link=False))
    werk_table_row(_("Title"), html.render_b(render_werk_title(werk)))
    werk_table_row(_("Component"), translator.component_of(werk))
    werk_table_row(_("Date"), render_werk_date(werk))
    werk_table_row(_("Checkmk Version"), werk["version"])
    werk_table_row(_("Level"),
                   translator.level_of(werk),
                   css="werklevel werklevel%d" % werk["level"])
    werk_table_row(_("Class"),
                   translator.class_of(werk),
                   css="werkclass werkclass%s" % werk["class"])
    werk_table_row(
        _("Compatibility"),
        translator.compatibility_of(werk),
        css="werkcomp werkcomp%s" % werk["compatible"],
    )
    werk_table_row(_("Description"),
                   render_werk_description(werk),
                   css="nowiki")

    html.close_table()

    html.footer()
Exemple #5
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
Exemple #6
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)
Exemple #7
0
def _host_log_list_breadcrumb(host_name: HostName, title: str) -> Breadcrumb:
    breadcrumb = make_host_breadcrumb(host_name)
    breadcrumb.append(make_current_page_breadcrumb_item(title))
    return breadcrumb