Exemplo n.º 1
0
    def page(self):
        if isinstance(self._manpages, list):
            _render_manpage_list(self._titles, self._manpages, self._path[-1],
                                 self._topic_title)
            return

        if len(self._path) == 1 and self._has_second_level:
            # For some topics we render a second level in the same optic as the first level
            menu = MainMenu()
            for path_comp, subnode in self._manpages.items():
                url = makeuri(request, [("topic", "%s/%s" %
                                         (self._path[0], path_comp))])
                title = self._titles.get(path_comp, path_comp)
                helptext = self._get_check_plugin_stats(subnode)

                menu.add_item(
                    MenuItem(
                        mode_or_url=url,
                        title=title,
                        icon="check_plugins",
                        permission=None,
                        description=helptext,
                    ))
            menu.show()

        else:
            # For the others we directly display the tables
            entries = []
            for path_comp, subnode in self._manpages.items():
                title = self._titles.get(path_comp, path_comp)
                entries.append((title, subnode, path_comp))

            for title, subnode, path_comp in sorted(
                    entries, key=lambda x: x[0].lower()):
                _render_manpage_list(self._titles, subnode, path_comp, title)
Exemplo n.º 2
0
    def page(self):
        html.help(
            _("This catalog of check plugins gives you a complete listing of all plugins "
              "that are shipped with your Check_MK installation. It also allows you to "
              "access the rule sets for configuring the parameters of the checks and to "
              "manually create services in case you cannot or do not want to rely on the "
              "automatic service discovery."))

        search_form("%s: " % _("Search for check plugins"), "check_plugins")

        # The maxium depth of the catalog paths is 3. The top level is being rendered
        # like the WATO main menu. The second and third level are being rendered like
        # the global settings.

        if self._topic and not self._search:
            self._render_manpage_topic()

        elif self._search:
            for path, manpages in self._get_manpages_after_search():
                self._render_manpage_list(manpages, path,
                                          self._titles.get(path, path))

        else:
            menu = MainMenu()
            for topic, _has_second_level, title, helptext in self._man_page_catalog_topics(
            ):
                menu.add_item(
                    MenuItem(mode_or_url=html.makeuri([("topic", topic)]),
                             title=title,
                             icon="plugins_" + topic,
                             permission=None,
                             description=helptext))
            menu.show()
Exemplo n.º 3
0
    def page(self):
        html.help(
            _(
                "This catalog of check plugins gives you a complete listing of all plugins "
                "that are shipped with your Check_MK installation. It also allows you to "
                "access the rule sets for configuring the parameters of the checks and to "
                "manually create services in case you cannot or do not want to rely on the "
                "automatic service discovery."
            )
        )

        menu = MainMenu()
        for topic, _has_second_level, title, helptext in _man_page_catalog_topics():
            menu.add_item(
                MenuItem(
                    mode_or_url=makeuri(
                        request,
                        [("mode", "check_plugin_topic"), ("topic", topic)],
                    ),
                    title=title,
                    icon="plugins_" + topic,
                    permission=None,
                    description=helptext,
                )
            )
        menu.show()
Exemplo n.º 4
0
 def _page_no_groups(self):
     menu = MainMenu()
     menu.add_item(
         MenuItem(
             mode_or_url="edit_host_group",
             title=_("Create new host group"),
             icon="new",
             permission="groups",
             description=_("Host groups are used for visualization and filtering of host"),
         ))
     menu.show()
Exemplo n.º 5
0
 def _page_no_groups(self):
     menu = MainMenu()
     menu.add_item(
         MenuItem(
             mode_or_url="edit_contact_group",
             title=_("Create new contact group"),
             icon="new",
             permission="users",
             description=
             _("Contact groups are needed for assigning hosts and services to people (contacts)"
               )))
     menu.show()