-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
41 lines (34 loc) · 1.27 KB
/
__init__.py
File metadata and controls
41 lines (34 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from importlib.metadata import version
from netbox.plugins import PluginConfig
class NetBoxCustomObjectsTabConfig(PluginConfig):
name = "netbox_custom_objects_tab"
verbose_name = "Custom Objects Tab"
description = 'Adds a "Custom Objects" tab to NetBox object detail pages'
version = version("netbox-custom-objects-tab")
author = "Jan Krupa"
author_email = "jan.krupa@cesnet.cz"
base_url = "custom-objects-tab"
min_version = "4.5.0"
max_version = "4.5.99"
default_settings = {
# Per-type tabs: each Custom Object Type gets its own tab (opt-in, empty by default).
"typed_models": [],
# Combined tab: single "Custom Objects" tab showing all types (current behavior).
"combined_models": [
"dcim.*",
"ipam.*",
"virtualization.*",
"tenancy.*",
],
# Label shown on the combined tab; override in PLUGINS_CONFIG.
"combined_label": "Custom Objects",
# Tab sort weight for the combined tab.
"combined_weight": 2000,
# Tab sort weight for all typed tabs.
"typed_weight": 2100,
}
def ready(self):
super().ready()
from . import views
views.register_tabs()
config = NetBoxCustomObjectsTabConfig