Add script link
diff --git a/xos/core/admin.py b/xos/core/admin.py
index 21b7565..34dba02 100644
--- a/xos/core/admin.py
+++ b/xos/core/admin.py
@@ -271,7 +271,7 @@
return mark_safe(backend_text(obj))
def script_link(self, obj):
- return mark_safe('<a href="%s" target="_blank">Script link</a>' % obj.file_name)
+ return mark_safe('<a href="/static/vpn/%s" target="_blank">Script link</a>' % obj.script)
def backend_status_icon(self, obj):
return mark_safe(backend_icon(obj))
diff --git a/xos/services/vpn/admin.py b/xos/services/vpn/admin.py
index 1b780a4..1f10083 100644
--- a/xos/services/vpn/admin.py
+++ b/xos/services/vpn/admin.py
@@ -125,10 +125,11 @@
list_display_links = ('id', 'backend_status_icon', 'instance')
fieldsets = [(None, {'fields': ['backend_status_text', 'kind',
'provider_service', 'instance', 'creator',
- 'server_address', 'client_address',
- 'is_persistent', 'can_view_subnet'],
+ 'script_link', 'server_address',
+ 'client_address', 'is_persistent',
+ 'can_view_subnet'],
'classes': ['suit-tab suit-tab-general']})]
- readonly_fields = ('backend_status_text', 'instance')
+ readonly_fields = ('backend_status_text', 'instance', 'script_link')
form = VPNTenantForm
suit_form_tabs = (('general', 'Details'),)