Adding a custom tab for a Device #11884
-
Dear Community! I would like to add a custom tab for every Device, next to the "Changelog" tab, which would display the output of the "ipmitool". I cannot target the proper files that are responsible for displaying the "Changelog" and "Journal" tabs. Moreover, I have tried to create a workaround solution - adding an additional Custom button next to the "Add Components" and "Edit" buttons, within the 'netbox/templates/dcim/device/base.html', however the button does not appear after rebuilding the Netbox. The User account has the proper perms to display that custom button.
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You must not modify Netbox core: if you do, you are forking the project and you are 100% responsible for maintaining your fork going forwards. You will find it very difficult, if not impossible, to merge in future developments in Netbox. Large refactorings between versions are commonplace. What you should do instead is to write a plugin. This has a clearly-defined set of things which you are allowed to do, including being able to add tabs to existing model views. Whilst there are no guarantees that you won't have to make any changes to your plugin in future, it will at least have a clearly-defined set of touchpoints, and anything which affects you will be called out in the release notes. For custom buttons, you should use custom links for the same reason. Here is a Custom Link definition I made for IPMI access:
(Note: hasn't been tested for a while) To reiterate: never, never touch base.html or any existing source files within Netbox! |
Beta Was this translation helpful? Give feedback.
You must not modify Netbox core: if you do, you are forking the project and you are 100% responsible for maintaining your fork going forwards. You will find it very difficult, if not impossible, to merge in future developments in Netbox. Large refactorings between versions are commonplace.
What you should do instead is to write a plugin. This has a clearly-defined set of things which you are allowed to do, including being able to add tabs to existing model views. Whilst there are no guarantees that you won't have to make any changes to your plugin in future, it will at least have a c…