Archived
Use English source strings wrapped for gettext, ship a German catalogue, and check that README and package metadata match the PluginConfig. Co-Authored-By: Claude Opus 5.5 <[email protected]>
27 lines
839 B
Python
27 lines
839 B
Python
from django.utils.translation import gettext_lazy as _
|
|
from netbox.navigation import MenuItem
|
|
|
|
|
|
# The public plugin navigation API can only create a separate Plugins menu.
|
|
# NetBox 4.6.5 does not expose an API for extending an existing core menu, so
|
|
# this pinned-version integration appends our entry to IPAM's first group.
|
|
def register_ipam_menu_item():
|
|
from netbox.navigation.menu import IPAM_MENU
|
|
|
|
group = IPAM_MENU.groups[0]
|
|
link = "plugins:netbox_better_ips:network_overview"
|
|
if any(item.link == link for item in group.items):
|
|
return
|
|
group.items = (
|
|
*group.items,
|
|
MenuItem(
|
|
link=link,
|
|
link_text=_("IP Network Overview"),
|
|
permissions=["ipam.view_prefix"],
|
|
),
|
|
)
|
|
|
|
|
|
# Do not duplicate the entry in NetBox's generic Plugins menu.
|
|
menu_items = ()
|