From de2bb66c78be3cf8d20c93afd2f0e3c5ed6b3d9c Mon Sep 17 00:00:00 2001 From: Emerson Felipe Date: Mon, 20 May 2024 18:54:26 +0000 Subject: [PATCH] Adapt to Netbox v4.0 --- netbox_proxbox/__init__.py | 2 +- netbox_proxbox/forms.py | 6 +++--- netbox_proxbox/navigation.py | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/netbox_proxbox/__init__.py b/netbox_proxbox/__init__.py index 4c885b2c..bdcc421d 100755 --- a/netbox_proxbox/__init__.py +++ b/netbox_proxbox/__init__.py @@ -1,5 +1,5 @@ # Netbox plugin related import -from extras.plugins import PluginConfig +from netbox.plugins import PluginConfig class ProxboxConfig(PluginConfig): name = "netbox_proxbox" diff --git a/netbox_proxbox/forms.py b/netbox_proxbox/forms.py index 42a5f3d6..c23fcfd7 100755 --- a/netbox_proxbox/forms.py +++ b/netbox_proxbox/forms.py @@ -1,6 +1,6 @@ from django import forms -from utilities.forms import BootstrapMixin +#from utilities.forms import BootstrapMixin from .models import ProxmoxVM @@ -8,7 +8,7 @@ # 'forms.ModelForm' is a Django helper class that allows building forms from models # 'BootstrapMixin' comes from Netbox and adds CSS classes -class ProxmoxVMForm(BootstrapMixin, forms.ModelForm): +class ProxmoxVMForm(forms.ModelForm): """Form for creating a new BgpPeering object.""" class Meta: @@ -24,7 +24,7 @@ class Meta: "disk", ] -class ProxmoxVMFilterForm(BootstrapMixin, forms.ModelForm): +class ProxmoxVMFilterForm(forms.ModelForm): """Form for filtering ProxmoxVM instances.""" q = forms.CharField(required=False, label="Search") diff --git a/netbox_proxbox/navigation.py b/netbox_proxbox/navigation.py index 9028994c..06de1942 100755 --- a/netbox_proxbox/navigation.py +++ b/netbox_proxbox/navigation.py @@ -1,5 +1,5 @@ -from extras.plugins import PluginMenuButton, PluginMenuItem, PluginMenu -from utilities.choices import ButtonColorChoices +from netbox.plugins import PluginMenuButton, PluginMenuItem, PluginMenu +#from utilities.choices import ButtonColorChoices fullupdate_item = PluginMenuItem( link='plugins:netbox_proxbox:home', @@ -19,19 +19,19 @@ "plugins:netbox_proxbox:discussions", "GitHub Discussions", "mdi mdi-github", - ButtonColorChoices.GRAY, + #ButtonColorChoices.GRAY, ), PluginMenuButton( "plugins:netbox_proxbox:discord", "Discord Community", "mdi mdi-forum", - ButtonColorChoices.BLACK, + #ButtonColorChoices.BLACK, ), PluginMenuButton( "plugins:netbox_proxbox:telegram", "Telegram Community", "mdi mdi-send", - ButtonColorChoices.BLUE, + #ButtonColorChoices.BLUE, ), ] )