GithubHelp home page GithubHelp logo

pieterl75 / netbox_contextmenus Goto Github PK

View Code? Open in Web Editor NEW
55.0 4.0 6.0 86 KB

Add context buttons to the links, making navigating in netbox less clicky

JavaScript 75.31% Python 24.69%
netbox netbox-plugin

netbox_contextmenus's Introduction

netbox_contextmenus

Add context buttons to the links, making navigating in netbox less clicky

nbcm1

nbcm2

The menu items can easliy be personalised

INSTALLATION

NBCM is compatible with NetBox v3 and v4.0


IMPORTANT NOTE !

NBCM version <= 1.4.3 used the 'BOTTOM_BANNER' variable to inject the javascript.

As of v1.4.4, the javascript is injected using django middleware. Make sure to remove the setting from the ConfigRevision BOTTOM_BANNER or from your configuration.py The nbcm.js file located in /opt/netbox/netbox/netbox/scripts can be removed.

This is a preparation to create a GUI to modifiy the Contect Menu items


CONFIGURATION

These settings can be customized using the PLUGINS_CONFIG variable in 'configuration.py'

PLUGINS_CONFIG = {
    'netbox_contextmenus': {
        'nbcmopendelay': 150
    }
}
variable default function
nbcmopendelay 150 Time in milliseconds that the opening of the contextmenu will be delayed

netbox_contextmenus's People

Contributors

kani999 avatar pieterl75 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

netbox_contextmenus's Issues

netbox-docker installation

When installing this plugin within a netbox-docker you got an error

Traceback (most recent call last):
  File "/opt/netbox/venv/lib/python3.11/site-packages/django_redis/cache.py", line 29, in _decorator
    return method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django_redis/cache.py", line 118, in clear
    return self.client.clear()
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django_redis/client/default.py", line 438, in clear
    raise ConnectionInterrupted(connection=client) from e
django_redis.exceptions.ConnectionInterrupted: Redis ConnectionError: Error 99 connecting to localhost:6379. Cannot assign requested address.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/netbox/netbox/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 416, in execute
    django.setup()
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/apps/registry.py", line 124, in populate
    app_config.ready()
  File "/opt/netbox/venv/lib/python3.11/site-packages/netbox_contextmenus/__init__.py", line 42, in ready
    cache.clear()
  File "/opt/netbox/venv/lib/python3.11/site-packages/django_redis/cache.py", line 36, in _decorator
    raise e.__cause__
  File "/opt/netbox/venv/lib/python3.11/site-packages/django_redis/client/default.py", line 436, in clear
    client.flushdb()
  File "/opt/netbox/venv/lib/python3.11/site-packages/redis/commands/core.py", line 946, in flushdb
    return self.execute_command("FLUSHDB", *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/redis/client.py", line 542, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/redis/connection.py", line 1109, in get_connection
    connection.connect()
  File "/opt/netbox/venv/lib/python3.11/site-packages/redis/connection.py", line 282, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 99 connecting to localhost:6379. Cannot assign requested address.

That's raised because, in ready() method is called cache.clear() and redis cache is not ready at the moment.

I think there could be added a simple try/catch for handling that problem.

Context menu not staying next to item further down page

Netbox Version: 4.0.3
Context Menu Version: 1.4.1

Context menus do appear when hovering over the icon, however the context menu won't pop up next to the item after line 12, it will pop up next to item 12. This is also the case if I scroll at all, the menu will pop up in the incorrect location. This is true for all items that would have a context menu next to it (interfaces, cables, devices, etc.)

I have followed the installation instructions exactly as described in this git.

Here is an example picture:
2024-06-10 09_47_49-Window
I am hovering over the bottom context menu icon, however it pops up higher on the list than it should.

Image Attachments on Devices Broken

Hi, it appears that this plugin is causing issues with displaying image attachments on devices. I don't know exactly when this started occurring as my instance of netbox is still being spun up, but I do know it worked at least 2 weeks ago and doesn't now. See this issue that was opened on the Netbox GitHub: netbox-community/netbox#16579. Note I did not open that issue, however I am also experiencing it.

If you need any additional info let me know and i'll pull whatever debugs you need.

No context menu in others pages

Hello,
Thank you for your great add-on.

I have a problem to display context menu when I try to go to page 2 etc... in devices page for example.
Same problem for prefixes page or other page with multipages.

This problem also occurs when I'm doing a quick search on the first page (devices/prefixes...).

NetBox version : 3.3.2

image

image

image

Delay menu

Is there any way to add a delay when hovering over the burger before opening the menu?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.