From 8cea6abb9923339ddc7b9690ddcc4d83a7d2fa90 Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Tue, 24 May 2022 10:44:58 +0300 Subject: [PATCH] Index path fixes --- Sources/pyOpenRPA/Orchestrator/Server.py | 15 +++++++++++++++ Sources/pyOpenRPA/Orchestrator/ServerSettings.py | 3 +-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Sources/pyOpenRPA/Orchestrator/Server.py b/Sources/pyOpenRPA/Orchestrator/Server.py index c8fc8ebf..02a992f8 100644 --- a/Sources/pyOpenRPA/Orchestrator/Server.py +++ b/Sources/pyOpenRPA/Orchestrator/Server.py @@ -483,6 +483,21 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler): # check if file in FileURL - File Path Mapping Dict if lFileURL.lower() in gSettingsDict["FileManager"]["FileURLFilePathDict"]: self.SendResponseContentTypeFile('application/octet-stream', gSettingsDict["FileManager"]["FileURLFilePathDict"][lFileURL]) + + # Index page + elif self.path == gSettingsDict["ServerDict"]["URLIndexStr"]: + lURLItemDict = { + "Method":"GET", + "URL": gSettingsDict["ServerDict"]["URLIndexStr"], + "MatchType": "EqualCase", + "ResponseFilePath": os.path.join(lOrchestratorFolder, "Web\\Index.xhtml"), + "ResponseContentType": "text/html"} + #Check if all condition are applied + lFlagURLIsApplied=False + lFlagURLIsApplied=self.URLItemCheckDo(lURLItemDict, "GET") + if lFlagURLIsApplied: + self.ResponseDictSend() + return else: #Set access denied code # Send response status code diff --git a/Sources/pyOpenRPA/Orchestrator/ServerSettings.py b/Sources/pyOpenRPA/Orchestrator/ServerSettings.py index 221b0efb..a16e0bee 100644 --- a/Sources/pyOpenRPA/Orchestrator/ServerSettings.py +++ b/Sources/pyOpenRPA/Orchestrator/ServerSettings.py @@ -457,8 +457,7 @@ def SettingsUpdate(inGlobalConfiguration): # "ResponseContentType": "", #HTTP Content-type # "ResponseDefRequestGlobal": None #Function with str result #} - #Orchestrator basic dependencies - {"Method":"GET", "URL": __Orchestrator__.GSettingsGet()["ServerDict"]["URLIndexStr"], "MatchType": "EqualCase", "ResponseFilePath": os.path.join(lOrchestratorFolder, "Web\\Index.xhtml"), "ResponseContentType": "text/html"}, + #Orchestrator basic dependencies # Index page in server.py because of special settings {"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"},