show address pools in vrouter admin
diff --git a/xos/core/admin.py b/xos/core/admin.py
index 5cc0ddd..a0fd3cb 100644
--- a/xos/core/admin.py
+++ b/xos/core/admin.py
@@ -2381,6 +2381,17 @@
return tabs
+class AddressPoolInline(XOSTabularInline):
+ model = AddressPool
+ extra = 0
+ suit_classes = 'suit-tab suit-tab-addresspools'
+ fields = ['cidr', 'gateway_ip', 'gateway_mac']
+ readonly_fields = ['cidr',]
+
+ # disable the add link
+ def has_add_permission(self, request):
+ return False
+
# Now register the new UserAdmin...
admin.site.register(User, UserAdmin)
# ... and, since we're not using Django's builtin permissions,
diff --git a/xos/services/vrouter/admin.py b/xos/services/vrouter/admin.py
index 318b3dc..4bd99b6 100644
--- a/xos/services/vrouter/admin.py
+++ b/xos/services/vrouter/admin.py
@@ -11,7 +11,7 @@
from django.contrib.contenttypes import generic
from suit.widgets import LinkedSelect
from core.models import AddressPool
-from core.admin import ServiceAppAdmin,SliceInline,ServiceAttrAsTabInline, ReadOnlyAwareAdmin, XOSTabularInline, ServicePrivilegeInline, TenantRootTenantInline, TenantRootPrivilegeInline
+from core.admin import ServiceAppAdmin,SliceInline,ServiceAttrAsTabInline, ReadOnlyAwareAdmin, XOSTabularInline, ServicePrivilegeInline, AddressPoolInline
from core.middleware import get_request
from functools import update_wrapper
@@ -38,7 +38,7 @@
fieldsets = [(None, {'fields': ['backend_status_text', 'name','enabled','versionNumber', 'description', "view_url", "icon_url", ],
'classes':['suit-tab suit-tab-general']})]
readonly_fields = ('backend_status_text', )
- inlines = [SliceInline,ServiceAttrAsTabInline,ServicePrivilegeInline]
+ inlines = [SliceInline,ServiceAttrAsTabInline,ServicePrivilegeInline,AddressPoolInline]
form = VRouterServiceForm
extracontext_registered_admins = True
@@ -47,6 +47,7 @@
suit_form_tabs =(('general', 'vRouter Service Details'),
('administration', 'Administration'),
+ ('addresspools', 'Addresses'),
#('tools', 'Tools'),
('slices','Slices'),
('serviceattrs','Additional Attributes'),