mirror of
https://github.com/itsdave-de/msp_remoteadmin.git
synced 2025-05-06 20:35:12 +02:00
try get document with python
This commit is contained in:
parent
894335f2c5
commit
88fbad4fcd
@ -17,7 +17,7 @@ function connect_remote(frm, type) {
|
|||||||
frappe.call({
|
frappe.call({
|
||||||
method: "msp_remoteadmin.tools.create_session",
|
method: "msp_remoteadmin.tools.create_session",
|
||||||
args: {
|
args: {
|
||||||
doc: frm.doc,
|
name: frm.doc.name,
|
||||||
protocol: type
|
protocol: type
|
||||||
},
|
},
|
||||||
callback: function (r) {
|
callback: function (r) {
|
||||||
|
@ -11,7 +11,7 @@ PROTOCOL_PORT = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def create_session(doc, 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_url = f'{guaca_config.guacamole_server}/api/tokens'
|
||||||
auth = {
|
auth = {
|
||||||
@ -30,6 +30,8 @@ def create_session(doc, protocol):
|
|||||||
token = None
|
token = None
|
||||||
if token:
|
if token:
|
||||||
print(f"Token: {token}")
|
print(f"Token: {token}")
|
||||||
|
# Get values from IT Object
|
||||||
|
doc = frappe.get_doc('IT Object', name)
|
||||||
# Get credentials from IT User Account
|
# Get credentials from IT User Account
|
||||||
print(f"Values from form: {doc}")
|
print(f"Values from form: {doc}")
|
||||||
print(f"Type: {type(doc.get('link'))}")
|
print(f"Type: {type(doc.get('link'))}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user