|
|
|
# !ATTENTION - Current Control panel works only from pyOpenRPA v1.2.0!
|
|
|
|
from pyOpenRPA import Orchestrator
|
|
|
|
def CPRender(inGSettings):
|
|
|
|
|
|
|
|
lJSCheckVersion="""
|
|
|
|
lT = 9;
|
|
|
|
lY="123";
|
|
|
|
console.log(lT+1);
|
|
|
|
if (lT==9) {
|
|
|
|
alert(123)
|
|
|
|
}
|
|
|
|
"""
|
|
|
|
|
|
|
|
lResultDict={
|
|
|
|
"HeaderLeftText":"CP_TEST",
|
|
|
|
"HeaderRightText":"NAME",
|
|
|
|
"DataStorageKey":"", #Use key for set current dict in mGlobal.DataStorage["DataStorageKey"] on client side
|
|
|
|
"SubheaderText":"",
|
|
|
|
"BodyKeyValueList":[
|
|
|
|
{"Key": "HTMLLinkURL", "Value": Orchestrator.Web.Basic.HTMLLinkURL(inURLStr="test",inColorStr="orange")},
|
|
|
|
{"Key": "HTMLLinkJSOnClick", "Value": Orchestrator.Web.Basic.HTMLLinkJSOnClick(inJSOnClickStr=lJSCheckVersion, inTitleStr="!Click me!",inColorStr="green")},
|
|
|
|
],
|
|
|
|
"FooterText":"",
|
|
|
|
"FooterButtonX2List":[],
|
|
|
|
"FooterButtonX1List":[],
|
|
|
|
"GlobalStorage": "" # UNCOMMENT FOR DEBUG PURPOSE TO WATCH inGSettings on client side
|
|
|
|
}
|
|
|
|
return lResultDict
|
|
|
|
# Check in control panel, that process is runnning
|
|
|
|
|
- Orc new structure for CP: "CPDict": { # "CPKey": {"HTMLRenderDef":None, "JSONGeneratorDef":None, "JSInitGeneratorDef":None}},
- - Back: inGSettings["CPDict"][RobotKeyStr]["HTMLRenderDef"] > Front: mGlobal.pyOpenRPA.ServerDataDict.CPDict.RobotKeyStr.HTMLStr
- - Back: inGSettings["CPDict"][RobotKeyStr]["JSONGeneratorDef"] > Front: mGlobal.pyOpenRPA.ServerDataDict.CPDict.RobotKeyStr.JSONDict
- - CPDict > HTMLRenderDef > def (inGSettings); def (inRequest, inGSettings); def ()
- - CPDict > JSONGeneratorDef > def (inGSettings); def (inRequest, inGSettings); def ()
- - CPDict > JSInitGeneratorDef > def (inGSettings); def (inRequest, inGSettings); def ()
Orc connect JSONGenerators to WEB Front (mGlobal.)
- Orc back: add new block: OrchestratorWeb
- - def OrchestratorWebCPUpdate(inGSettings, inCPKeyStr, inHTMLRenderDef=None, inJSONGeneratorDef=None, inJSInitGeneratorDef=None): # Add control panel HTML, JSON generator or JS when page init
4 years ago
|
|
|
# Test JSON generator when page init
|
|
|
|
def JSONGenerator():
|
|
|
|
lJSONDict=[1,2,2,4,2,2,2]
|
|
|
|
return lJSONDict
|
|
|
|
|
|
|
|
# Test JS when page init
|
|
|
|
def JSInitGenerator():
|
|
|
|
lJSCheckVersion="""
|
|
|
|
lT = 9;
|
|
|
|
lY="123";
|
|
|
|
console.log(lT+1);
|
|
|
|
if (lT==9) {
|
|
|
|
alert(123)
|
|
|
|
}
|
|
|
|
"""
|
|
|
|
return lJSCheckVersion
|
|
|
|
|
|
|
|
#Orchestrator settings
|
|
|
|
def SettingsUpdate(inGSettings):
|
- Orc new structure for CP: "CPDict": { # "CPKey": {"HTMLRenderDef":None, "JSONGeneratorDef":None, "JSInitGeneratorDef":None}},
- - Back: inGSettings["CPDict"][RobotKeyStr]["HTMLRenderDef"] > Front: mGlobal.pyOpenRPA.ServerDataDict.CPDict.RobotKeyStr.HTMLStr
- - Back: inGSettings["CPDict"][RobotKeyStr]["JSONGeneratorDef"] > Front: mGlobal.pyOpenRPA.ServerDataDict.CPDict.RobotKeyStr.JSONDict
- - CPDict > HTMLRenderDef > def (inGSettings); def (inRequest, inGSettings); def ()
- - CPDict > JSONGeneratorDef > def (inGSettings); def (inRequest, inGSettings); def ()
- - CPDict > JSInitGeneratorDef > def (inGSettings); def (inRequest, inGSettings); def ()
Orc connect JSONGenerators to WEB Front (mGlobal.)
- Orc back: add new block: OrchestratorWeb
- - def OrchestratorWebCPUpdate(inGSettings, inCPKeyStr, inHTMLRenderDef=None, inJSONGeneratorDef=None, inJSInitGeneratorDef=None): # Add control panel HTML, JSON generator or JS when page init
4 years ago
|
|
|
# New way to add CP defs in orchestrator - no gSettings..
|
|
|
|
Orchestrator.OrchestratorWebCPUpdate(inGSettings=inGSettings,inCPKeyStr="TEST",inHTMLRenderDef=CPRender, inJSONGeneratorDef=JSONGenerator, inJSInitGeneratorDef=JSInitGenerator)
|
|
|
|
return inGSettings
|