mirror of https://github.com/jumpserver/jumpserver
feat: 客户端协议内容添加rdp文件名
parent
10f4ff4eec
commit
d1a3d31d3f
|
@ -150,15 +150,19 @@ class ClientProtocolMixin:
|
||||||
def get_client_protocol_data(self, serializer):
|
def get_client_protocol_data(self, serializer):
|
||||||
asset, application, system_user, user = self.get_request_resource(serializer)
|
asset, application, system_user, user = self.get_request_resource(serializer)
|
||||||
protocol = system_user.protocol
|
protocol = system_user.protocol
|
||||||
|
username = user.username
|
||||||
|
name = ''
|
||||||
if protocol == 'rdp':
|
if protocol == 'rdp':
|
||||||
name, config = self.get_rdp_file_content(serializer)
|
name, config = self.get_rdp_file_content(serializer)
|
||||||
elif protocol == 'vnc':
|
elif protocol == 'vnc':
|
||||||
raise HttpResponse(status=404, data={"error": "VNC not support"})
|
raise HttpResponse(status=404, data={"error": "VNC not support"})
|
||||||
else:
|
else:
|
||||||
config = 'ssh://system_user@asset@user@jumpserver-ssh'
|
config = 'ssh://system_user@asset@user@jumpserver-ssh'
|
||||||
|
filename = "{}-{}-jumpserver".format(username, name)
|
||||||
data = {
|
data = {
|
||||||
|
"filename": filename,
|
||||||
"protocol": system_user.protocol,
|
"protocol": system_user.protocol,
|
||||||
"username": user.username,
|
"username": username,
|
||||||
"config": config
|
"config": config
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
|
|
Loading…
Reference in New Issue