diff --git a/msp_remoteadmin/public/js/msp_remote.js b/msp_remoteadmin/public/js/msp_remote.js index 982e0f5..1258019 100644 --- a/msp_remoteadmin/public/js/msp_remote.js +++ b/msp_remoteadmin/public/js/msp_remote.js @@ -17,7 +17,7 @@ function connect_remote(frm, type) { frappe.call({ method: "msp_remoteadmin.tools.create_session", args: { - doc: frm.doc, + name: frm.doc.name, protocol: type }, callback: function (r) { diff --git a/msp_remoteadmin/tools.py b/msp_remoteadmin/tools.py index e83d7e3..fac66bd 100644 --- a/msp_remoteadmin/tools.py +++ b/msp_remoteadmin/tools.py @@ -11,7 +11,7 @@ PROTOCOL_PORT = { } @frappe.whitelist() -def create_session(doc, protocol): +def create_session(name, protocol): guaca_config = frappe.get_single('Remote Connections Settings') guacamole_url = f'{guaca_config.guacamole_server}/api/tokens' auth = { @@ -30,6 +30,8 @@ def create_session(doc, protocol): token = None if token: print(f"Token: {token}") + # Get values from IT Object + doc = frappe.get_doc('IT Object', name) # Get credentials from IT User Account print(f"Values from form: {doc}") print(f"Type: {type(doc.get('link'))}")