Exemplo n.º 1
0
def render_wato(mini):
    if not config.wato_enabled:
        html.write_text(_("Setup is disabled."))
        return False
    if not user.may("wato.use"):
        html.write_text(_("You are not allowed to use the setup."))
        return False

    menu = get_wato_menu_items()

    if mini:
        for topic in menu:
            for item in topic.items:
                html.icon_button(
                    url=item.url,
                    class_="show_more_mode" if item.is_show_more else None,
                    title=item.title,
                    icon=item.icon or "wato",
                    target="main",
                )
    else:
        show_topic_menu(treename="wato", menu=menu, show_item_icons=True)

    pending_info = watolib.get_pending_changes_info()
    if pending_info:
        footnotelinks([(pending_info, "wato.py?mode=changelog")])
        html.div("", class_="clear")
Exemplo n.º 2
0
    def show(self):
        show_topic_menu(treename="views", menu=get_view_menu_items())

        links = []
        if user.may("general.edit_views"):
            if config.debug:
                links.append((_("Export"), "export_views.py"))
            links.append((_("Edit"), "edit_views.py"))
            footnotelinks(links)
Exemplo n.º 3
0
    def show(self):
        show_topic_menu(treename="dashboards",
                        menu=self._get_dashboard_menu_items())

        links = []
        if user.may("general.edit_dashboards"):
            if active_config.debug:
                links.append((_("Export"), "export_dashboards.py"))
            links.append((_("Edit"), "edit_dashboards.py"))
            footnotelinks(links)
Exemplo n.º 4
0
 def _show_footnote_links(self):
     edit_url = "../nagvis/"
     footnotelinks([(_("Edit"), edit_url)])