Archived
docs: add screenshots and generalise README
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
5314098b6c
commit
978709f50a
2 files changed
+97
-29
No files matched your search
@@ -1,53 +1,121 @@
|
|||||||
# NetBox Site Prefix
|
# NetBox Site Prefix
|
||||||
|
|
||||||
Plugin für NetBox 4.6.5, das in den Geräte- und Rack-Listen eine Spalte
|
Adds a **Prefix** column as the first data column of the NetBox device and rack
|
||||||
**Prefix** als erste Datenspalte anzeigt. Der Wert ist immer das erste Wort
|
lists. The value is always the first word of the assigned site name
|
||||||
des zugewiesenen Standortnamens (`Site.name`).
|
(`Site.name`).
|
||||||
|
|
||||||
Beispiele:
|
| | |
|
||||||
|
|
||||||
| Standort | Prefix |
|
|
||||||
|---|---|
|
|---|---|
|
||||||
| `Berlin Campus West` | `Berlin` |
|
| **Plugin name** | `netbox_site_prefix` |
|
||||||
| `DC01 Frankfurt` | `DC01` |
|
| **Package** | `netbox-site-prefix` |
|
||||||
| kein Standort | `—` |
|
| **NetBox** | `4.6.5` – `4.7.x` |
|
||||||
|
| **Python** | `>=3.12` |
|
||||||
|
| **Repository** | <https://git.mrblake.cc/MrBlake/Netbox-Prefixes> |
|
||||||
|
|
||||||
Das Plugin benötigt keine Datenbankmigration und speichert keine eigenen
|
## Screenshots
|
||||||
Daten.
|
|
||||||
|
Device list with the site prefix as the first column:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- **Prefix** column in the device and rack lists, derived from the site name:
|
||||||
|
|
||||||
|
| Site | Prefix |
|
||||||
|
|---|---|
|
||||||
|
| `Berlin Campus West` | `Berlin` |
|
||||||
|
| `DC01 Frankfurt` | `DC01` |
|
||||||
|
| no site | `—` |
|
||||||
|
|
||||||
|
- No database models, no migrations, no stored data.
|
||||||
|
|
||||||
|
## Compatibility
|
||||||
|
|
||||||
|
- NetBox `4.6.5` – `4.7.x`
|
||||||
|
- Python `>=3.12`
|
||||||
|
- Not to be installed together with
|
||||||
|
[Netbox-Utilities](https://git.mrblake.cc/MrBlake/Netbox-Utilities), which
|
||||||
|
includes the same column and supersedes this plugin. Both register a
|
||||||
|
`site_prefix` column, so NetBox refuses to start with both enabled.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Im Python-Virtualenv von NetBox installieren:
|
All paths assume a standard installation under `/opt/netbox`.
|
||||||
|
|
||||||
```shell
|
### 1. Install the package
|
||||||
/opt/netbox/venv/bin/pip install git+https://git.mrblake.cc/MrBlake/Netbox-Prefixes.git
|
|
||||||
|
```bash
|
||||||
|
/opt/netbox/venv/bin/pip install --upgrade --force-reinstall \
|
||||||
|
"git+https://git.mrblake.cc/MrBlake/Netbox-Prefixes.git@main"
|
||||||
```
|
```
|
||||||
|
|
||||||
In Local Requirements aufnehmen:
|
For reproducible production installs, replace `main` with a release tag or a
|
||||||
```shell
|
full commit ID.
|
||||||
echo "git+https://git.mrblake.cc/MrBlake/Netbox-Prefixes.git" >> /opt/netbox/local_requirements.txt
|
|
||||||
|
### 2. Add the plugin to `local_requirements.txt`
|
||||||
|
|
||||||
|
This makes `upgrade.sh` reinstall the plugin automatically on every NetBox upgrade:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
grep -qxF "git+https://git.mrblake.cc/MrBlake/Netbox-Prefixes.git@main" /opt/netbox/local_requirements.txt \
|
||||||
|
|| echo "git+https://git.mrblake.cc/MrBlake/Netbox-Prefixes.git@main" | sudo tee -a /opt/netbox/local_requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
Danach in `configuration.py` aktivieren:
|
If the repository is private, the NetBox server needs a read-only deploy token
|
||||||
|
or an SSH key. Do not store credentials in `local_requirements.txt`.
|
||||||
|
|
||||||
|
### 3. Enable the plugin
|
||||||
|
|
||||||
|
In `/opt/netbox/netbox/netbox/configuration.py`:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
PLUGINS = [
|
PLUGINS = [
|
||||||
# weitere Plugins ...
|
|
||||||
"netbox_site_prefix",
|
"netbox_site_prefix",
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
Anschließend NetBox neu starten. `upgrade.sh` ist nicht erforderlich, kann
|
If other plugins are already configured, add `netbox_site_prefix` to the
|
||||||
aber wie bei anderen Plugin-Installationen ausgeführt werden.
|
existing list instead of replacing it.
|
||||||
|
|
||||||
Bei bestehenden Benutzern kann eine bereits gespeicherte persönliche
|
### 4. Restart
|
||||||
Spaltenauswahl Vorrang vor den Standardspalten haben. In diesem Fall in der
|
|
||||||
Geräte- bzw. Rack-Liste **Spalten konfigurieren** öffnen, **Prefix** auswählen
|
|
||||||
und an die erste Position schieben oder die gespeicherte Tabellenkonfiguration
|
|
||||||
zurücksetzen.
|
|
||||||
|
|
||||||
## Kompatibilität
|
The plugin has no database models, so no migration is required.
|
||||||
|
|
||||||
- NetBox: 4.6.5 bis einschließlich 4.6.x
|
```bash
|
||||||
- Python: ab 3.12
|
sudo systemctl restart netbox netbox-rq
|
||||||
|
```
|
||||||
|
|
||||||
|
## Update
|
||||||
|
|
||||||
|
```bash
|
||||||
|
/opt/netbox/venv/bin/pip install --upgrade --force-reinstall \
|
||||||
|
"git+https://git.mrblake.cc/MrBlake/Netbox-Prefixes.git@main"
|
||||||
|
sudo systemctl restart netbox netbox-rq
|
||||||
|
```
|
||||||
|
|
||||||
|
When NetBox itself is upgraded, `upgrade.sh` reinstalls the plugin from
|
||||||
|
`local_requirements.txt`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo /opt/netbox/upgrade.sh
|
||||||
|
sudo systemctl restart netbox netbox-rq
|
||||||
|
```
|
||||||
|
|
||||||
|
## Uninstall
|
||||||
|
|
||||||
|
1. Remove `"netbox_site_prefix"` from `PLUGINS`.
|
||||||
|
2. Remove the line from `/opt/netbox/local_requirements.txt`.
|
||||||
|
3. Uninstall the package and restart NetBox:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
/opt/netbox/venv/bin/pip uninstall netbox-site-prefix
|
||||||
|
sudo systemctl restart netbox netbox-rq
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
The column is part of the default columns. Users with a saved personal column
|
||||||
|
selection may not see it: open **Configure Table** in the device or rack list,
|
||||||
|
select **Prefix** and move it to the first position, or reset the saved table
|
||||||
|
configuration.
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 183 KiB |
Reference in new issue
Block a user