iDebugAll / phonebox_plugin

A Telephone Number Management Plugin for Netbox and more
MIT License
89 stars 27 forks source link

How to make this plugin have its own menu section? #56

Open goteamkor opened 3 weeks ago

goteamkor commented 3 weeks ago

please edit the navigation.py to move towards a modern user interface. Most all plugins are moving away from being a submenu underneath the "plugins" menu and moving towards top level menus.

Here is the code (tested) to accomplish this for the phonebox plugin.

from netbox.plugins import PluginMenu, PluginMenuItem

menu = PluginMenu(
    label="Voice",
    icon_class="mdi mdi-phone-outgoing",
    groups=(
        (
            "Voice",
            (
                PluginMenuItem(
                    link="plugins:phonebox_plugin:list_view",
                    link_text="Numbers",
                ),
                PluginMenuItem(
                    link="plugins:phonebox_plugin:voice_circuit_list_view",
                    link_text="Voice Circuits",
                ),
            ),
        ),
    ),
)