perf: Remove applets, no longer display remote application connection methods

pull/13879/head
wangruidong 2024-07-31 15:26:34 +08:00 committed by Bryan
parent e2df85bddd
commit 5e69c03cb7
1 changed files with 3 additions and 1 deletions

View File

@ -102,6 +102,8 @@ class AppletMethod:
methods = defaultdict(list)
has_applet_hosts = AppletHost.objects.filter(is_active=True).exists()
if not has_applet_hosts:
return methods
applets = Applet.objects.filter(is_active=True)
for applet in applets:
for protocol in applet.protocols:
@ -110,7 +112,7 @@ class AppletMethod:
'label': applet.display_name,
'type': 'applet',
'icon': applet.icon,
'disabled': not applet.is_active or not has_applet_hosts,
'disabled': not applet.is_active,
})
return methods