Browse Source

fix: 关闭ssh client后,sftp,telnet不显示客户端连接方式

pull/13266/head
wangruidong 6 months ago committed by 老广
parent
commit
606d2c8933
  1. 5
      apps/terminal/connect_methods.py

5
apps/terminal/connect_methods.py

@ -253,8 +253,9 @@ class ConnectMethodUtil:
def _filter_disable_protocols_connect_methods(cls, methods):
# 过滤一些特殊的协议方式
if not getattr(settings, 'TERMINAL_KOKO_SSH_ENABLED'):
protocol = Protocol.ssh
methods[protocol] = [m for m in methods[protocol] if m['type'] != 'native']
disable_ssh_client_protocols = [Protocol.ssh, Protocol.sftp, Protocol.telnet]
for protocol in disable_ssh_client_protocols:
methods[protocol] = [m for m in methods[protocol] if m['type'] != 'native']
return methods
@classmethod

Loading…
Cancel
Save