nextbox-ui-plugin icon indicating copy to clipboard operation
nextbox-ui-plugin copied to clipboard

New icons

Open aruhri opened this issue 4 years ago • 3 comments

I would appreciate, if there were more available icons like

  • printer
  • passive components like
    • network wall socket
    • patchfield
    • splice-box
    • PoE-injector
    • PSU
    • PDU
  • other network attached devices like components of electronic door-locking system

or in other words is there a possibility to enhace the iconset by config?

aruhri avatar Oct 20 '21 15:10 aruhri

You can register custom icons at the plugin.

  1. Clone the repo as described here

https://github.com/iDebugAll/nextbox-ui-plugin#package-installation-from-source-code

  1. Download icon to nextbox-ui-plugin/nextbox_ui_plugin/static/nextbox_ui_plugin/img

  2. Modify nextbox-ui-plugin/nextbox_ui_plugin/static/nextbox_ui_plugin/next_app.js

topo.registerIcon("dead_node", "/static/nextbox_ui_plugin/img/dead_node.png", 49, 49);
topo.registerIcon("server", "/static/nextbox_ui_plugin/img/server.png", 35, 35);
  1. reinstall the plugin
pip3 install /opt/netbox/nextbox-ui-plugin/
python3 netbox/manage.py collectstatic --no-input
  1. Edit netbox config netbox/netbox/configuration.py
PLUGINS_CONFIG = {
    'nextbox_ui_plugin': {
#        'layers_sort_order': (
#            ADD YOUR SETTINGS HERE
#            layer_sort_order is a tuple
#        ),
#        'icon_model_map': {
#            ADD YOUR SETTINGS HERE
#            icon_model_map is a dict
#        },
        'icon_role_map': {
#            ADD YOUR SETTINGS HERE
#            icon_role_map is a dict
             'firewall': 'dead_node',
             'server': 'server',
       },
#        'undisplayed_device_role_slugs': (
# #          ADD YOUR SETTINGS HERE
#            undisplayed_device_role_slugs value is a list or a tuple
#            Listed device role slugs are hidden on initial view load,
#            you may then hide/display any layer with a control button.
#        ),
#        'undisplayed_device_tags': (
#           ADD YOUR SETTINGS HERE
#           undisplayed_device_tags value is a list or a tuple of regex strings.
#           Devices with tags matching any of listed regular expressions are hidden
#           on initial view load, you may then hide/display any layer with a control button.
#        ),
#        'select_layers_list_include_device_tags': (
#           ADD YOUR SETTINGS HERE
#           select_layers_list_include_device_tags value is a list or a tuple of regex strings.
#           Use this parameter to control tags listed in Select Layers menu.
#           If specified, it works as allow list.
#        ),
#        'select_layers_list_exclude_device_tags': (
#           ADD YOUR SETTINGS HERE
#           select_layers_list_exclude_device_tags value is a list or a tuple of regex strings.
#           Use this parameter to control tags listed in Select Layers menu.
#           If specified, it filters out matched tags from the list, except ones mathcing 'undisplayed_device_tags'.
#        ),
#        'DISPLAY_PASSIVE_DEVICES': True|False,
         'DISPLAY_PASSIVE_DEVICES': True,
#        'DISPLAY_LOGICAL_MULTICABLE_LINKS': True|False,
#        'DISPLAY_UNCONNECTED': True|False,
#        'INITIAL_LAYOUT': 'vertical'|'horizontal'|'auto'
         'INITIAL_LAYOUT': 'auto'
    }
}
  1. Restart Netbox Service

  2. Now it should display a custom icon

image

richardmeilinger avatar Aug 05 '22 10:08 richardmeilinger