feat: 客户端协议内容添加rdp文件名

pull/7056/head
feng626 3 years ago committed by 老广
parent 10f4ff4eec
commit d1a3d31d3f

@ -150,15 +150,19 @@ class ClientProtocolMixin:
def get_client_protocol_data(self, serializer):
asset, application, system_user, user = self.get_request_resource(serializer)
protocol = system_user.protocol
username = user.username
name = ''
if protocol == 'rdp':
name, config = self.get_rdp_file_content(serializer)
elif protocol == 'vnc':
raise HttpResponse(status=404, data={"error": "VNC not support"})
else:
config = 'ssh://system_user@asset@user@jumpserver-ssh'
filename = "{}-{}-jumpserver".format(username, name)
data = {
"filename": filename,
"protocol": system_user.protocol,
"username": user.username,
"username": username,
"config": config
}
return data

Loading…
Cancel
Save