blob: 5ffc243918364c2c168d877df1cdc16899b97b3e [file] [log] [blame]
Rizwan Haider51fdb3f2016-11-09 18:29:32 -05001from core.admin import XOSBaseAdmin
2from django.contrib import admin
3from services.vnodlocal.models import *
4from django import forms
5
6class VnodLocalServiceAdmin(XOSBaseAdmin):
7 verbose_name = "VNOD Local Service"
8 verbose_name_plural = "VNOD Local Services"
9 list_display = ('servicehandle', 'portid', 'vlanid', 'administrativeState', 'operstate', 'autoattached')
10 list_display_links = ('servicehandle', 'portid', 'vlanid', 'administrativeState', 'operstate', 'autoattached')
11
12 fields = ('id', 'servicehandle', 'portid', 'vlanid', 'administrativeState', 'operstate', 'autoattached')
13 readonly_fields = ('id','autoattached')
14
15
16class VnodLocalSystemAdminForm(forms.ModelForm):
17
18 password = forms.CharField(required=False, widget = forms.PasswordInput(render_value=True))
19
20 class Meta:
21 model = VnodLocalSystem
22 fields = '__all__'
23
24class VnodLocalSystemAdmin(XOSBaseAdmin):
25 verbose_name = "VNOD Local System"
26 verbose_name_plural = "VNOD Local Systems"
27 form = VnodLocalSystemAdminForm
28 list_display = ('name', 'administrativeState', 'restUrl', 'username', 'pseudowireprovider', 'networkControllerUrl')
29 list_display_links = ('name', 'administrativeState', 'restUrl', 'username', 'pseudowireprovider', 'networkControllerUrl')
30
31 fields = ('name', 'administrativeState', 'restUrl', 'username', 'password', 'pseudowireprovider', 'networkControllerUrl')
32
33class VnodLocalPseudowireConnectorServiceAdmin(XOSBaseAdmin):
34 verbose_name = "VNOD Local Pseudowire Connector Service"
35 verbose_name_plural = "VNOD Local Pseudowire Connector Service"
36 list_display = ('servicehandle', 'internalport', 'pseudowirehandle','vnodlocal', 'administrativeState', 'operstate')
37 list_display_links = ('servicehandle', 'internalport', 'pseudowirehandle','vnodlocal', 'administrativeState', 'operstate')
38
39 fields = ('servicehandle', 'internalport', 'pseudowirehandle','vnodlocal', 'administrativeState', 'operstate')
40 readonly_fields = ('vnodlocal', 'operstate', 'pseudowirehandle')
41
42
43admin.site.register(VnodLocalSystem, VnodLocalSystemAdmin)
44admin.site.register(VnodLocalService, VnodLocalServiceAdmin)
45admin.site.register(VnodLocalPseudowireConnectorService, VnodLocalPseudowireConnectorServiceAdmin)
46
47