# Netbox Device View Plugin
![Version](https://img.shields.io/pypi/v/netbox-device-view) ![Downloads](https://img.shields.io/pypi/dm/netbox-device-view)
## Install
The plugin is available as a Python package and can be installed with pip.
Run `pip install netbox-device-view` in your virtual env.
To ensure NetBox Device View plugin is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the NetBox root directory (alongside `requirements.txt`) and list the `netbox-device-view` package:
```no-highlight
# echo netbox-device-view >> local_requirements.txt
```
Once installed, the plugin needs to be enabled in your `configuration.py` and optionally the `show_on_device_tab` setting enabled.
```python
# In your configuration.py
PLUGINS = ["netbox_device_view"]
PLUGINS_CONFIG = {
'netbox_device_view': {
'show_on_device_tab': True,
},
}
```
First run `source /opt/netbox/venv/bin/activate` to enter the Python virtual environment.
Then run
```bash
cd /opt/netbox/netbox
pip3 install netbox-device-view
python3 manage.py migrate netbox_device_view
python3 manage.py collectstatic --no-input
```
## How To Use
For each Device Type you need to add a DeviceView.
It is based on a CSS grid view with 32 columns and 2 rows.
You need to specify the grid-template-areas.
- Interface positions will use the following format: {interfacename}{module}-{port}
or fallback to all lower case + [^.a-zA-Z\d] changed to "-"
- leading "empties" can be specified as x
- trailing "empties" can be specified as z
- between "empties" can be named s{0-99}
- numeric only ports have to be prefixed with "p" e.g. "p1"
Example for Cisco C9300-24T with 8x 10G module ( more in [examples](https://github.com/peterbaumert/netbox-device-view/blob/main/examples/) folder )
```
/* C9300-24T */
.deviceview.area {
grid-template-areas:
"x x x x x x x x x x x x x x gigabitethernet0-1 gigabitethernet0-3 gigabitethernet0-5 gigabitethernet0-7 gigabitethernet0-9 gigabitethernet0-11 s0 gigabitethernet0-13 gigabitethernet0-15 gigabitethernet0-17 gigabitethernet0-19 gigabitethernet0-21 gigabitethernet0-23 z z z z z"
"x x x x x x x x x x x x x x gigabitethernet0-2 gigabitethernet0-4 gigabitethernet0-6 gigabitethernet0-8 gigabitethernet0-10 gigabitethernet0-12 s0 gigabitethernet0-14 gigabitethernet0-16 gigabitethernet0-18 gigabitethernet0-20 gigabitethernet0-22 gigabitethernet0-24 z z z z z";
}
/* C9300-24T with C9300-NM-8X */
.deviceview.moduleC9300-NM-8X.area {
grid-template-areas:
"x x x x x x x x x x x x x x gigabitethernet0-1 gigabitethernet0-3 gigabitethernet0-5 gigabitethernet0-7 gigabitethernet0-9 gigabitethernet0-11 s0 gigabitethernet0-13 gigabitethernet0-15 gigabitethernet0-17 gigabitethernet0-19 gigabitethernet0-21 gigabitethernet0-23 s1 tengigabitethernet1-1 tengigabitethernet1-3 tengigabitethernet1-5 tengigabitethernet1-7"
"x x x x x x x x x x x x x x gigabitethernet0-2 gigabitethernet0-4 gigabitethernet0-6 gigabitethernet0-8 gigabitethernet0-10 gigabitethernet0-12 s0 gigabitethernet0-14 gigabitethernet0-16 gigabitethernet0-18 gigabitethernet0-20 gigabitethernet0-22 gigabitethernet0-24 s1 tengigabitethernet1-2 tengigabitethernet1-4 tengigabitethernet1-6 tengigabitethernet1-8";
}
```
It will look like
![example](https://github.com/peterbaumert/netbox-device-view/blob/main/docs/example_view.png?raw=true)
Raw data
{
"_id": null,
"home_page": "https://github.com/peterbaumert/netbox-device-view",
"name": "netbox-device-view",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "netbox, netbox-plugin",
"author": "Peter Baumert",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/70/e2/83ed189546773b7ff30558d958290875605b8b7e7be2f79b3d574100bd6d/netbox_device_view-0.1.7.tar.gz",
"platform": null,
"description": "# Netbox Device View Plugin\n![Version](https://img.shields.io/pypi/v/netbox-device-view) ![Downloads](https://img.shields.io/pypi/dm/netbox-device-view)\n\n## Install\n\nThe plugin is available as a Python package and can be installed with pip.\n\nRun `pip install netbox-device-view` in your virtual env.\n\nTo ensure NetBox Device View plugin is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the NetBox root directory (alongside `requirements.txt`) and list the `netbox-device-view` package:\n\n```no-highlight\n# echo netbox-device-view >> local_requirements.txt\n```\n\nOnce installed, the plugin needs to be enabled in your `configuration.py` and optionally the `show_on_device_tab` setting enabled.\n\n```python\n# In your configuration.py\nPLUGINS = [\"netbox_device_view\"]\n\nPLUGINS_CONFIG = {\n 'netbox_device_view': {\n 'show_on_device_tab': True,\n },\n}\n```\n\nFirst run `source /opt/netbox/venv/bin/activate` to enter the Python virtual environment.\n\n\nThen run \n```bash\ncd /opt/netbox/netbox\npip3 install netbox-device-view\npython3 manage.py migrate netbox_device_view\npython3 manage.py collectstatic --no-input\n```\n\n## How To Use\n\nFor each Device Type you need to add a DeviceView.\n\nIt is based on a CSS grid view with 32 columns and 2 rows.\nYou need to specify the grid-template-areas. \n- Interface positions will use the following format: {interfacename}{module}-{port} \n or fallback to all lower case + [^.a-zA-Z\\d] changed to \"-\"\n- leading \"empties\" can be specified as x\n- trailing \"empties\" can be specified as z\n- between \"empties\" can be named s{0-99}\n- numeric only ports have to be prefixed with \"p\" e.g. \"p1\"\n\nExample for Cisco C9300-24T with 8x 10G module ( more in [examples](https://github.com/peterbaumert/netbox-device-view/blob/main/examples/) folder )\n\n```\n/* C9300-24T */\n.deviceview.area {\n\tgrid-template-areas:\n\t\"x x x x x x x x x x x x x x gigabitethernet0-1 gigabitethernet0-3 gigabitethernet0-5 gigabitethernet0-7 gigabitethernet0-9 gigabitethernet0-11 s0 gigabitethernet0-13 gigabitethernet0-15 gigabitethernet0-17 gigabitethernet0-19 gigabitethernet0-21 gigabitethernet0-23 z z z z z\"\n\t\"x x x x x x x x x x x x x x gigabitethernet0-2 gigabitethernet0-4 gigabitethernet0-6 gigabitethernet0-8 gigabitethernet0-10 gigabitethernet0-12 s0 gigabitethernet0-14 gigabitethernet0-16 gigabitethernet0-18 gigabitethernet0-20 gigabitethernet0-22 gigabitethernet0-24 z z z z z\";\n}\n\n/* C9300-24T with C9300-NM-8X */\n.deviceview.moduleC9300-NM-8X.area {\n\tgrid-template-areas:\n\t\"x x x x x x x x x x x x x x gigabitethernet0-1 gigabitethernet0-3 gigabitethernet0-5 gigabitethernet0-7 gigabitethernet0-9 gigabitethernet0-11 s0 gigabitethernet0-13 gigabitethernet0-15 gigabitethernet0-17 gigabitethernet0-19 gigabitethernet0-21 gigabitethernet0-23 s1 tengigabitethernet1-1 tengigabitethernet1-3 tengigabitethernet1-5 tengigabitethernet1-7\"\n\t\"x x x x x x x x x x x x x x gigabitethernet0-2 gigabitethernet0-4 gigabitethernet0-6 gigabitethernet0-8 gigabitethernet0-10 gigabitethernet0-12 s0 gigabitethernet0-14 gigabitethernet0-16 gigabitethernet0-18 gigabitethernet0-20 gigabitethernet0-22 gigabitethernet0-24 s1 tengigabitethernet1-2 tengigabitethernet1-4 tengigabitethernet1-6 tengigabitethernet1-8\";\n}\n```\n\nIt will look like\n\n![example](https://github.com/peterbaumert/netbox-device-view/blob/main/docs/example_view.png?raw=true)\n",
"bugtrack_url": null,
"license": null,
"summary": "NetBox Device View plugin",
"version": "0.1.7",
"project_urls": {
"Homepage": "https://github.com/peterbaumert/netbox-device-view"
},
"split_keywords": [
"netbox",
" netbox-plugin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5df4bc89dbee6f978a8350ac5412edf726c68e8fd8d5609962928cce40c2a76b",
"md5": "43b9f13a67b7c07c645817bf05b912e3",
"sha256": "213ac81d435d6d06f77190eb3b00b2458ef550f12f2d2bbe92c258d448fa0baa"
},
"downloads": -1,
"filename": "netbox_device_view-0.1.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "43b9f13a67b7c07c645817bf05b912e3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 12532,
"upload_time": "2024-08-29T09:54:41",
"upload_time_iso_8601": "2024-08-29T09:54:41.616993Z",
"url": "https://files.pythonhosted.org/packages/5d/f4/bc89dbee6f978a8350ac5412edf726c68e8fd8d5609962928cce40c2a76b/netbox_device_view-0.1.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "70e283ed189546773b7ff30558d958290875605b8b7e7be2f79b3d574100bd6d",
"md5": "a24a9f5fb7eb5b66381e293df17a3650",
"sha256": "12afe2bd38569c802db50945e68ee61a7dc4e582f96c117477e2716d134ab03b"
},
"downloads": -1,
"filename": "netbox_device_view-0.1.7.tar.gz",
"has_sig": false,
"md5_digest": "a24a9f5fb7eb5b66381e293df17a3650",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9226,
"upload_time": "2024-08-29T09:54:42",
"upload_time_iso_8601": "2024-08-29T09:54:42.780254Z",
"url": "https://files.pythonhosted.org/packages/70/e2/83ed189546773b7ff30558d958290875605b8b7e7be2f79b3d574100bd6d/netbox_device_view-0.1.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-29 09:54:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "peterbaumert",
"github_project": "netbox-device-view",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "netbox-device-view"
}