fix: limit connect method xpack

pull/14728/head
Bai 2024-12-25 16:25:55 +08:00 committed by Bryan
parent 11f6fe0bf9
commit 2e7bd076f4
1 changed files with 4 additions and 0 deletions

View File

@ -105,6 +105,8 @@ class AppletMethod:
if not has_applet_hosts:
return methods
applets = Applet.objects.filter(is_active=True)
if not settings.XPACK_LICENSE_IS_VALID:
applets = applets.filter(builtin=True)
for applet in applets:
for protocol in applet.protocols:
methods[protocol].append({
@ -125,6 +127,8 @@ class VirtualAppMethod:
methods = defaultdict(list)
if not getattr(settings, 'VIRTUAL_APP_ENABLED'):
return methods
if not settings.XPACK_LICENSE_IS_VALID:
return methods
virtual_apps = VirtualApp.objects.filter(is_active=True)
for virtual_app in virtual_apps:
for protocol in virtual_app.protocols: