add url_filter_kind to VSGService
diff --git a/xos/services/cord/admin.py b/xos/services/cord/admin.py
index 4195aaa..3cccc6c 100644
--- a/xos/services/cord/admin.py
+++ b/xos/services/cord/admin.py
@@ -108,6 +108,7 @@
wan_container_gateway_mac = forms.CharField(required=False)
wan_container_netbits = forms.CharField(required=False)
dns_servers = forms.CharField(required=False)
+ url_filter_kind = forms.ChoiceField(choices=VSGService.URL_FILTER_KIND_CHOICES, required=False)
node_label = forms.CharField(required=False)
def __init__(self,*args,**kwargs):
@@ -122,6 +123,7 @@
self.fields['wan_container_gateway_mac'].initial = self.instance.wan_container_gateway_mac
self.fields['wan_container_netbits'].initial = self.instance.wan_container_netbits
self.fields['dns_servers'].initial = self.instance.dns_servers
+ self.fields['url_filter_kind']. initial = self.instance.url_filter_kind
self.fields['node_label'].initial = self.instance.node_label
def save(self, commit=True):
@@ -134,6 +136,7 @@
self.instance.wan_container_gateway_mac = self.cleaned_data.get("wan_container_gateway_mac")
self.instance.wan_container_netbits = self.cleaned_data.get("wan_container_netbits")
self.instance.dns_servers = self.cleaned_data.get("dns_servers")
+ self.instance.url_filter_kind = self.cleaned_data.get("url_filter_kind")
self.instance.node_label = self.cleaned_data.get("node_label")
return super(VSGServiceForm, self).save(commit=commit)
@@ -148,7 +151,7 @@
list_display_links = ('backend_status_icon', 'name', )
fieldsets = [(None, {'fields': ['backend_status_text', 'name','enabled','versionNumber', 'description', "view_url", "icon_url", "service_specific_attribute", "node_label"],
'classes':['suit-tab suit-tab-general']}),
- ("backend config", {'fields': [ "backend_network_label", "bbs_api_hostname", "bbs_api_port", "bbs_server", "bbs_slice"],
+ ("backend config", {'fields': [ "backend_network_label", "url_filter_kind", "bbs_api_hostname", "bbs_api_port", "bbs_server", "bbs_slice"],
'classes':['suit-tab suit-tab-backend']}),
("vSG config", {'fields': [ "wan_container_gateway_ip", "wan_container_gateway_mac", "wan_container_netbits", "dns_servers"],
'classes':['suit-tab suit-tab-vsg']}) ]
diff --git a/xos/services/cord/models.py b/xos/services/cord/models.py
index b7f25af..263ebcd 100644
--- a/xos/services/cord/models.py
+++ b/xos/services/cord/models.py
@@ -362,6 +362,8 @@
class VSGService(Service):
KIND = VCPE_KIND
+ URL_FILTER_KIND_CHOICES = ( (None, "None"), ("safebrowsing", "Safe Browsing") )
+
simple_attributes = ( ("bbs_api_hostname", None),
("bbs_api_port", None),
("bbs_server", None),
@@ -370,6 +372,7 @@
("wan_container_gateway_mac", ""),
("wan_container_netbits", "24"),
("dns_servers", "8.8.8.8"),
+ ("url_filter_kind", None),
("node_label", None) )
def __init__(self, *args, **kwargs):