mirror of
https://github.com/itsdave-de/msp_remoteadmin.git
synced 2025-05-07 12:45:13 +02:00
fix get url output
This commit is contained in:
parent
eaad8306af
commit
d2b3f4e691
@ -13,12 +13,12 @@ PROTOCOL_PORT = {
|
|||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def create_session(name, protocol):
|
def create_session(name, protocol):
|
||||||
guaca_config = frappe.get_single('Remote Connections Settings')
|
guaca_config = frappe.get_single('Remote Connections Settings')
|
||||||
guacamole_url = f'{guaca_config.guacamole_server}/api/tokens'
|
guacamole_api = f'{guaca_config.guacamole_server}/api/tokens'
|
||||||
auth = {
|
auth = {
|
||||||
'username': guaca_config.guacamole_user,
|
'username': guaca_config.guacamole_user,
|
||||||
'password': guaca_config.get_password('guacamole_pass')
|
'password': guaca_config.get_password('guacamole_pass')
|
||||||
}
|
}
|
||||||
response = requests.post(guacamole_url, data=auth)
|
response = requests.post(guacamole_api, data=auth)
|
||||||
|
|
||||||
print(f"Response CODE: {response.status_code}\nResponde Content: {response.text}")
|
print(f"Response CODE: {response.status_code}\nResponde Content: {response.text}")
|
||||||
|
|
||||||
@ -39,5 +39,5 @@ def create_session(name, protocol):
|
|||||||
uri = urllib.parse.quote_plus(f"{protocol}://{username if username else ''}{':' + password if password else ''}@{doc.main_ip}{':' + str(PROTOCOL_PORT[protocol])}").lower()
|
uri = urllib.parse.quote_plus(f"{protocol}://{username if username else ''}{':' + password if password else ''}@{doc.main_ip}{':' + str(PROTOCOL_PORT[protocol])}").lower()
|
||||||
if protocol == 'RDP':
|
if protocol == 'RDP':
|
||||||
uri = f"{uri}/?ignore-cert=true&disable-audio=true"
|
uri = f"{uri}/?ignore-cert=true&disable-audio=true"
|
||||||
url = f'{guacamole_url}/?#/?token={token}&quickconnect={uri}'
|
url = f'{guaca_config.guacamole_server}/?#/?token={token}&quickconnect={uri}'
|
||||||
return url
|
return url
|
||||||
|
Loading…
x
Reference in New Issue
Block a user