diff --git a/Sources/pyOpenRPA/Orchestrator/Server.py b/Sources/pyOpenRPA/Orchestrator/Server.py index a78e84d0..27765796 100755 --- a/Sources/pyOpenRPA/Orchestrator/Server.py +++ b/Sources/pyOpenRPA/Orchestrator/Server.py @@ -163,49 +163,54 @@ def InitFastAPI(): lL = __Orchestrator__.OrchestratorLoggerGet() __Orchestrator__.GSettingsGet()["ServerDict"]["ServerThread"] = app ServerSettings.SettingsUpdate() + BCURLUpdate() + +def BCURLUpdate(): for lConnectItemDict in __Orchestrator__.GSettingsGet()["ServerDict"]["URLList"]: - if "ResponseFolderPath" in lConnectItemDict: - app.mount(lConnectItemDict["URL"], - StaticFiles(directory=CrossOS.PathStr(lConnectItemDict["ResponseFolderPath"])), - name=lConnectItemDict["URL"].replace('/',"_")) - else: - if lConnectItemDict.get("MatchType") in ["EqualCase", "Equal","EqualNoParam"]: - if lConnectItemDict.get("UACBool",True): - app.add_api_route( - path=lConnectItemDict["URL"], - endpoint=BackwardCompatibityWrapperAuth, - response_class=PlainTextResponse, - methods=[lConnectItemDict["Method"]], - tags=["BackwardCompatibility"] - ) - else: - app.add_api_route( - path=lConnectItemDict["URL"], - endpoint=BackwardCompatibityWrapperNoAuth, - response_class=PlainTextResponse, - methods=[lConnectItemDict["Method"]], - tags=["BackwardCompatibility"] - ) - elif lConnectItemDict.get("MatchType") in ["BeginWith", "Contains"]: - lURLStr = lConnectItemDict["URL"] - if lURLStr[-1]!="/": lURLStr+="/" - lURLStr+="{inBeginTokenStr}" - if lConnectItemDict.get("UACBool",True): - app.add_api_route( - path=lURLStr, - endpoint=BackwardCompatibityBeginWrapperAuth, - response_class=PlainTextResponse, - methods=[lConnectItemDict["Method"]], - tags=["BackwardCompatibility"] - ) - else: - app.add_api_route( - path=lURLStr, - endpoint=BackwardCompatibityBeginWrapperNoAuth, - response_class=PlainTextResponse, - methods=[lConnectItemDict["Method"]], - tags=["BackwardCompatibility"] - ) + if "BCBool" not in lConnectItemDict: + if "ResponseFolderPath" in lConnectItemDict: + app.mount(lConnectItemDict["URL"], + StaticFiles(directory=CrossOS.PathStr(lConnectItemDict["ResponseFolderPath"])), + name=lConnectItemDict["URL"].replace('/',"_")) + else: + if lConnectItemDict.get("MatchType") in ["EqualCase", "Equal","EqualNoParam"]: + if lConnectItemDict.get("UACBool",True): + app.add_api_route( + path=lConnectItemDict["URL"], + endpoint=BackwardCompatibityWrapperAuth, + response_class=PlainTextResponse, + methods=[lConnectItemDict["Method"]], + tags=["BackwardCompatibility"] + ) + else: + app.add_api_route( + path=lConnectItemDict["URL"], + endpoint=BackwardCompatibityWrapperNoAuth, + response_class=PlainTextResponse, + methods=[lConnectItemDict["Method"]], + tags=["BackwardCompatibility"] + ) + elif lConnectItemDict.get("MatchType") in ["BeginWith", "Contains"]: + lURLStr = lConnectItemDict["URL"] + if lURLStr[-1]!="/": lURLStr+="/" + lURLStr+="{inBeginTokenStr}" + if lConnectItemDict.get("UACBool",True): + app.add_api_route( + path=lURLStr, + endpoint=BackwardCompatibityBeginWrapperAuth, + response_class=PlainTextResponse, + methods=[lConnectItemDict["Method"]], + tags=["BackwardCompatibility"] + ) + else: + app.add_api_route( + path=lURLStr, + endpoint=BackwardCompatibityBeginWrapperNoAuth, + response_class=PlainTextResponse, + methods=[lConnectItemDict["Method"]], + tags=["BackwardCompatibility"] + ) + lConnectItemDict["BCBool"]=True def InitUvicorn(inHostStr=None, inPortInt=None, inSSLCertPathStr=None, inSSLKeyPathStr=None, inSSLPasswordStr=None): if inHostStr is None: inHostStr="0.0.0.0" diff --git a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py index f7b4b7cf..0365203c 100755 --- a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py +++ b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py @@ -940,6 +940,7 @@ def WebURLConnectDef(inMethodStr, inURLStr, inMatchTypeStr, inDef, inContentType "UACBool": inUACBool } inGSettings["ServerDict"]["URLList"].append(lURLItemDict) + Server.BCURLUpdate() def WebURLConnectFolder(inMethodStr, inURLStr, inMatchTypeStr, inFolderPathStr, inGSettings = None, inUACBool = None, inUseCacheBool= False): @@ -970,6 +971,7 @@ def WebURLConnectFolder(inMethodStr, inURLStr, inMatchTypeStr, inFolderPathStr, "UseCacheBool": inUseCacheBool } inGSettings["ServerDict"]["URLList"].append(lURLItemDict) + Server.BCURLUpdate() def WebURLConnectFile(inMethodStr, inURLStr, inMatchTypeStr, inFilePathStr, inContentTypeStr=None, inGSettings = None, inUACBool = None, inUseCacheBool = False): @@ -998,6 +1000,7 @@ def WebURLConnectFile(inMethodStr, inURLStr, inMatchTypeStr, inFilePathStr, inCo "UseCacheBool": inUseCacheBool } inGSettings["ServerDict"]["URLList"].append(lURLItemDict) + Server.BCURLUpdate() def WebListenCreate(inServerKeyStr="Default", inAddressStr="0.0.0.0", inPortInt=1024, inCertFilePEMPathStr=None, inKeyFilePathStr=None, inGSettings = None): """L+,W+: Настроить веб-сервер Оркестратора. diff --git a/changelog.md b/changelog.md index 58011ad5..fc90d98d 100755 --- a/changelog.md +++ b/changelog.md @@ -6,9 +6,10 @@ AGT - AGENT [1.3.1] - ОРКЕСТРАТОР -- минорные правки в дизайн -- Orchestrator.OrchestratorPySearchInit - добавлена возможность импорта пакетов с импользованием relative imports внутри -- Web: Восстановлена функциональность кнопки "Перезагрузить оркестратор" +- - минорные правки в дизайн +- - Orchestrator.OrchestratorPySearchInit - добавлена возможность импорта пакетов с импользованием relative imports внутри +- - Web: Восстановлена функциональность кнопки "Перезагрузить оркестратор" +- - Исправлена ошибка обратной совместимости функций Orchestrator.WebConnect... - СТУДИЯ - - UI переведен на русский язык - - обновлен дизайн по аналогии с порталом и Оркестратором @@ -19,8 +20,6 @@ AGT - AGENT - - Jupyter: запуск из других дисков, отличных от C:// - - Utils: Функции подготовки файлов/ директорий - - [1.3.0] - ПОРТИРОВАНО НА LINUX (Ubuntu, Debian, Astra), адаптация функций - ОРКЕСТРАТОР