From 90b59f9d9f37e4acb57c1ee67cde3bc2912fbd65 Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Tue, 24 May 2022 10:38:21 +0300 Subject: [PATCH] ORC: You can change the index page (def WebURLIndexChange) --- Sources/pyOpenRPA/Orchestrator/BackwardCompatibility.py | 6 ++++++ Sources/pyOpenRPA/Orchestrator/ServerSettings.py | 2 +- Sources/pyOpenRPA/Orchestrator/SettingsTemplate.py | 1 + Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py | 7 +++++++ changelog.md | 7 +++++++ 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Sources/pyOpenRPA/Orchestrator/BackwardCompatibility.py b/Sources/pyOpenRPA/Orchestrator/BackwardCompatibility.py index b8f7052b..bc67c8da 100644 --- a/Sources/pyOpenRPA/Orchestrator/BackwardCompatibility.py +++ b/Sources/pyOpenRPA/Orchestrator/BackwardCompatibility.py @@ -533,3 +533,9 @@ def Update(inGSettings): lURLItemDict["UACBool"]=None if lL: lL.warning( f"Backward compatibility (v1.2.4 to v1.2.7): ServerDict > URLList > item: add UACBool = None") # Log about compatibility + + # "URLIndexStr" + if "URLIndexStr" not in inGSettings["ServerDict"]: + inGSettings["ServerDict"]["URLIndexStr"] = "/" + if lL: lL.warning( + f"Backward compatibility (v1.2.11 to v1.2.12): ServerDict > URLIndexStr: add URLIndexStr = /") # Log about compatibility \ No newline at end of file diff --git a/Sources/pyOpenRPA/Orchestrator/ServerSettings.py b/Sources/pyOpenRPA/Orchestrator/ServerSettings.py index 8fcfebaf..221b0efb 100644 --- a/Sources/pyOpenRPA/Orchestrator/ServerSettings.py +++ b/Sources/pyOpenRPA/Orchestrator/ServerSettings.py @@ -458,7 +458,7 @@ def SettingsUpdate(inGlobalConfiguration): # "ResponseDefRequestGlobal": None #Function with str result #} #Orchestrator basic dependencies - {"Method":"GET", "URL": "/", "MatchType": "EqualCase", "ResponseFilePath": os.path.join(lOrchestratorFolder, "Web\\Index.xhtml"), "ResponseContentType": "text/html"}, + {"Method":"GET", "URL": __Orchestrator__.GSettingsGet()["ServerDict"]["URLIndexStr"], "MatchType": "EqualCase", "ResponseFilePath": os.path.join(lOrchestratorFolder, "Web\\Index.xhtml"), "ResponseContentType": "text/html"}, {"Method":"GET", "URL": "/Index.js", "MatchType": "EqualCase", "ResponseFilePath": os.path.join(lOrchestratorFolder, "Web\\Index.js"), "ResponseContentType": "text/javascript"}, {"Method":"GET", "URL": "/3rdParty/Semantic-UI-CSS-master/semantic.min.css", "MatchType": "EqualCase", "ResponseFilePath": os.path.join(lOrchestratorFolder, "..\\Resources\\Web\\Semantic-UI-CSS-master\\semantic.min.css"), "ResponseContentType": "text/css"}, {"Method":"GET", "URL": "/3rdParty/Semantic-UI-CSS-master/semantic.min.js", "MatchType": "EqualCase", "ResponseFilePath": os.path.join(lOrchestratorFolder, "..\\Resources\\Web\\Semantic-UI-CSS-master\\semantic.min.js"), "ResponseContentType": "application/javascript"}, diff --git a/Sources/pyOpenRPA/Orchestrator/SettingsTemplate.py b/Sources/pyOpenRPA/Orchestrator/SettingsTemplate.py index d2f7fac4..a3209029 100644 --- a/Sources/pyOpenRPA/Orchestrator/SettingsTemplate.py +++ b/Sources/pyOpenRPA/Orchestrator/SettingsTemplate.py @@ -43,6 +43,7 @@ def __Create__(): "ControlPanelDict": { # "CPKey": }, + "URLIndexStr":"/", # The index html page for the orchestrator control panel. Default is / "AgentLimitLogSizeBytesInt": 300, # Don't show body if json body of transmition is more than "ServerThread": None, # Server thread is there "AgentActivityLifetimeSecFloat": 1200.0, # Time in seconds to life for activity for the agent diff --git a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py index 38cb7a9c..1067e0a2 100644 --- a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py +++ b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py @@ -847,6 +847,13 @@ def UACSuperTokenUpdate(inSuperTokenStr, inGSettings=None): # OrchestratorWeb defs # # # # # # # # # # # # # # # # # # # # # # # +def WebURLIndexChange(inURLIndexStr:str ="/"): + """Change the index page of the orchestrator if you dont want the '/' (main) path + + :param inURLIndexStr: New url for the index page of the orchestrator, defaults to "/" + :type inURLIndexStr: str, optional + """ + GSettingsGet()["ServerDict"]["URLIndexStr"] = inURLIndexStr def WebURLConnectDef(inMethodStr, inURLStr, inMatchTypeStr, inDef, inContentTypeStr="application/octet-stream", inGSettings = None, inUACBool = None): """ diff --git a/changelog.md b/changelog.md index 2f1143c0..606bc183 100644 --- a/changelog.md +++ b/changelog.md @@ -1,9 +1,16 @@ +LEGEND: +ORC - ORCHESTRATOR +STD - STUDIO +RBT - ROBOT +AGT - AGENT + [1.2.12] 2022_Q2 - ORCHESTRATOR - - WebURL... Support inUseCacheBool - cache the web pages - - Web server auto detect MIME type from the file name - - Raise debug session from production. Support init_debug file in working directory +- - You can change the index page (def WebURLIndexChange) - - MANAGERS - - - ControlPanel - - - Git CI