Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New icons #79

Open
aruhri opened this issue Oct 20, 2021 · 2 comments
Open

New icons #79

aruhri opened this issue Oct 20, 2021 · 2 comments

Comments

@aruhri
Copy link

aruhri commented Oct 20, 2021

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?

@richardmeilinger
Copy link

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

@surgeon81
Copy link

I was not able to find next_app.js in the current release. is there any other way to use custom icons?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants