diff --git a/Orchestrator/Demo/HR_officer01/All_results.csv b/Orchestrator/Demo/HR_01/All_results.csv similarity index 100% rename from Orchestrator/Demo/HR_officer01/All_results.csv rename to Orchestrator/Demo/HR_01/All_results.csv diff --git a/Orchestrator/Demo/HR_officer01/HR_officer01.css b/Orchestrator/Demo/HR_01/HR_officer01.css similarity index 100% rename from Orchestrator/Demo/HR_officer01/HR_officer01.css rename to Orchestrator/Demo/HR_01/HR_officer01.css diff --git a/Orchestrator/Demo/HR_officer01/HR_officer01.js b/Orchestrator/Demo/HR_01/HR_officer01.js similarity index 100% rename from Orchestrator/Demo/HR_officer01/HR_officer01.js rename to Orchestrator/Demo/HR_01/HR_officer01.js diff --git a/Orchestrator/Demo/HR_officer01/Questions.csv b/Orchestrator/Demo/HR_01/Questions.csv similarity index 100% rename from Orchestrator/Demo/HR_officer01/Questions.csv rename to Orchestrator/Demo/HR_01/Questions.csv diff --git a/Orchestrator/Demo/HR_officer01/config.py b/Orchestrator/Demo/HR_01/config.py similarity index 82% rename from Orchestrator/Demo/HR_officer01/config.py rename to Orchestrator/Demo/HR_01/config.py index c4670e38..9bfa9c41 100644 --- a/Orchestrator/Demo/HR_officer01/config.py +++ b/Orchestrator/Demo/HR_01/config.py @@ -1,7 +1,7 @@ splitter1 = 'Рабочий процесс' splitter2 = 'Пример доступных данных' splitter3 = 'Пример запуска роботов' -title = 'Робот-кадровик' +title = 'Кадровик' introHeader = 'Применение:' introText = 'Робот-кадровик помогает проводить отбор кандидатов' @@ -47,7 +47,7 @@ html = f''' Test - + @@ -160,12 +160,45 @@ html = f''' - + ''' -with open('index.html', 'w', encoding='UTF-8') as file: +from pyOpenRPA.Tools import CrossOS +from pyOpenRPA import Orchestrator # Import orchestrator main +from pyOpenRPA.Orchestrator.Server import app +import threading +from fastapi import Depends +from fastapi.responses import PlainTextResponse +from fastapi.responses import FileResponse + +# Подключени файлов связанных с роботом-кадровиком01 +@app.get(path="/HR_01/questions",tags=["HR_01"]) +def get_file(): + return FileResponse(CrossOS.PathStr("Demo\\HR_01\\Questions.csv")) + +@app.get(path="/HR_01/results",tags=["HR_01"]) +def get_file(): + return FileResponse(CrossOS.PathStr("Demo\\HR_01\\All_results.csv")) + +@app.get(path="/HR_01/logs",tags=["HR_01"]) +def get_file(): + return FileResponse(CrossOS.PathStr("Demo\\HR_01\\log.txt")) + +@app.get(path="/HR_01/scripts",tags=["HR_01"]) +def get_file(): + return FileResponse(CrossOS.PathStr("Demo\\HR_01\\HR_officer01.js")) + +@app.get(path="/HR_01/styles",tags=["HR_01"]) +def get_file(): + return FileResponse(CrossOS.PathStr("Demo\\HR_01\\HR_officer01.css")) + +lCPManager = Orchestrator.Managers.ControlPanel(inControlPanelNameStr="HR_officer01ControlPanel", + inRefreshHTMLJinja2TemplatePathStr=CrossOS.PathStr("Demo\\HR_01\\index.html"), inJinja2TemplateRefreshBool = True) + + +with open(CrossOS.PathStr("Demo\\HR_01\\index.html"), 'w', encoding='UTF-8') as file: file.write(html) diff --git a/Orchestrator/Demo/HR_officer01/index.html b/Orchestrator/Demo/HR_01/index.html similarity index 96% rename from Orchestrator/Demo/HR_officer01/index.html rename to Orchestrator/Demo/HR_01/index.html index 23545cb0..c547c333 100644 --- a/Orchestrator/Demo/HR_officer01/index.html +++ b/Orchestrator/Demo/HR_01/index.html @@ -4,7 +4,7 @@ Test - + @@ -13,7 +13,7 @@
-

Робот-кадровик


+

Кадровик


Применение:

Робот-кадровик помогает проводить отбор кандидатов

@@ -105,7 +105,7 @@
Выберите робота...
@@ -117,7 +117,7 @@
- + diff --git a/Orchestrator/Demo/HR_officer01/log.txt b/Orchestrator/Demo/HR_01/log.txt similarity index 100% rename from Orchestrator/Demo/HR_officer01/log.txt rename to Orchestrator/Demo/HR_01/log.txt diff --git a/Orchestrator/Demo/Treasurer01/config.py b/Orchestrator/Demo/TREASURER_01/config.py similarity index 85% rename from Orchestrator/Demo/Treasurer01/config.py rename to Orchestrator/Demo/TREASURER_01/config.py index 503b015f..3e50bc20 100644 --- a/Orchestrator/Demo/Treasurer01/config.py +++ b/Orchestrator/Demo/TREASURER_01/config.py @@ -1,7 +1,7 @@ splitter1 = 'Рабочий процесс' splitter2 = 'Окно настройки робота' -title = 'Робот-казначей' +title = 'Казначей' introHeader = 'Применение:' introText = 'Робот-казначей выполняет выгрузку банковских выписок' @@ -19,7 +19,7 @@ workflowHint3 = 'Например, размещение в сетевой пап dropBankTitle = 'Выберите банк...' dropBank1 = 'Сбербанк' dropBank2 = 'ВТБ' -dropBank3= 'Альфа-банк' +dropBank3 = 'Альфа' dropBankAccountTitle = 'Выберите счет' dropBankAccount1 = 'Счет 1' @@ -38,7 +38,7 @@ checkboxForm3 = 'WORD' checkboxForm4 = 'EXCEL' emailTitle = 'Укажите почту (необязательно):' -emailWindow = 'example@gmail.ru' +emailWindow = 'example@mail.ru' btnDownload = 'Скачать' btnEmail = 'Отправить' @@ -174,11 +174,30 @@ html = f'''
- + ''' -with open('index.html', 'w', encoding='UTF-8') as file: +from pyOpenRPA.Tools import CrossOS +from pyOpenRPA import Orchestrator # Import orchestrator main +from pyOpenRPA.Orchestrator.Server import app +import threading +from fastapi import Depends +from fastapi.responses import PlainTextResponse +from fastapi.responses import FileResponse + +# Подключени файлов связанных с роботом-казначеем01 +@app.get(path="/TREASURER_01/scripts",tags=["TREASURER_01"]) +def get_file(): + return FileResponse("Demo\\TREASURER_01\\Treasurer01.js") + + + +lCPManager = Orchestrator.Managers.ControlPanel(inControlPanelNameStr="Treasurer01ControlPanel", + inRefreshHTMLJinja2TemplatePathStr=CrossOS.PathStr("Demo\\TREASURER_01\\index.html"), inJinja2TemplateRefreshBool = True) + + +with open("Demo\\TREASURER_01\\index.html", 'w', encoding='UTF-8') as file: file.write(html) diff --git a/Orchestrator/Demo/Treasurer01/index.html b/Orchestrator/Demo/TREASURER_01/index.html similarity index 94% rename from Orchestrator/Demo/Treasurer01/index.html rename to Orchestrator/Demo/TREASURER_01/index.html index b7ee2afd..eba87332 100644 --- a/Orchestrator/Demo/Treasurer01/index.html +++ b/Orchestrator/Demo/TREASURER_01/index.html @@ -12,7 +12,7 @@
-

Робот-казначей


+

Казначей


Применение:

Робот-казначей выполняет выгрузку банковских выписок

@@ -53,7 +53,7 @@


@@ -117,7 +117,7 @@
Укажите почту (необязательно):

- +

@@ -128,7 +128,7 @@
- + diff --git a/Orchestrator/Demo/Treasurer01/treasurer01.css b/Orchestrator/Demo/TREASURER_01/treasurer01.css similarity index 100% rename from Orchestrator/Demo/Treasurer01/treasurer01.css rename to Orchestrator/Demo/TREASURER_01/treasurer01.css diff --git a/Orchestrator/Demo/Treasurer01/treasurer01.js b/Orchestrator/Demo/TREASURER_01/treasurer01.js similarity index 100% rename from Orchestrator/Demo/Treasurer01/treasurer01.js rename to Orchestrator/Demo/TREASURER_01/treasurer01.js diff --git a/Orchestrator/config.py b/Orchestrator/config.py index 6f9ddc7c..d6d86a48 100755 --- a/Orchestrator/config.py +++ b/Orchestrator/config.py @@ -19,33 +19,9 @@ from fastapi import Depends from fastapi.responses import PlainTextResponse from fastapi.responses import FileResponse -# Подключени файлов связанных с роботом-кадровиком01 -@app.get(path="/HR_officer01/questions",tags=["HR_officer01"]) -def get_file(): - return FileResponse(CrossOS.PathStr("Demo\\HR_officer01\\Questions.csv")) - -@app.get(path="/HR_officer01/results",tags=["HR_officer01"]) -def get_file(): - return FileResponse(CrossOS.PathStr("Demo\\HR_officer01\\All_results.csv")) - -@app.get(path="/HR_officer01/logs",tags=["HR_officer01"]) -def get_file(): - return FileResponse(CrossOS.PathStr("Demo\\HR_officer01\\log.txt")) -@app.get(path="/HR_officer01/scripts",tags=["HR_officer01"]) -def get_file(): - return FileResponse(CrossOS.PathStr("Demo\\HR_officer01\\HR_officer01.js")) - -@app.get(path="/HR_officer01/styles",tags=["HR_officer01"]) -def get_file(): - return FileResponse(CrossOS.PathStr("Demo\\HR_officer01\\HR_officer01.css")) -# Подключени файлов связанных с роботом-казначеем01 -@app.get(path="/Treasurer01/scripts",tags=["Treasurer01"]) -def get_file(): - return FileResponse("Demo\\Treasurer01\\Treasurer01.js") - # Пример создания функции на сервере (FASTAPI) /test/threads @app.get(path="/test/threads",tags=["Test"],response_class=PlainTextResponse) @@ -82,11 +58,7 @@ else: # Restore DUMP Orchestrator.OrchestratorSessionRestore(inGSettings=gSettings) # Autoinit control panels starts with CP_ - lPyModules = Orchestrator.OrchestratorPySearchInit(inGlobPatternStr="ControlPanel\\CP_*.py", inDefStr="SettingsUpdate", inDefArgNameGSettingsStr="inGSettings", inAsyncInitBool=True) - lCPManager = Orchestrator.Managers.ControlPanel(inControlPanelNameStr="HR_officer01ControlPanel", - inRefreshHTMLJinja2TemplatePathStr=CrossOS.PathStr("D:\\For work\\RPA\\OpenRPA\\Orchestrator\\Demo\\HR_officer01\\index.html"), inJinja2TemplateRefreshBool = True) - lCPManager = Orchestrator.Managers.ControlPanel(inControlPanelNameStr="Treasurer01ControlPanel", - inRefreshHTMLJinja2TemplatePathStr=CrossOS.PathStr("D:\\For work\\RPA\\OpenRPA\\Orchestrator\\Demo\\Treasurer01\\index.html"), inJinja2TemplateRefreshBool = True) + lPyModules = Orchestrator.OrchestratorPySearchInit(inGlobPatternStr="Demo\\*\\config.py", inAsyncInitBool=True) # Call the orchestrator def Orchestrator.Orchestrator(inGSettings=gSettings, inDumpRestoreBool=False) diff --git a/Sources/pyOpenRPA/Orchestrator/Managers/ControlPanel.py b/Sources/pyOpenRPA/Orchestrator/Managers/ControlPanel.py index 3ad49fed..22e8a715 100755 --- a/Sources/pyOpenRPA/Orchestrator/Managers/ControlPanel.py +++ b/Sources/pyOpenRPA/Orchestrator/Managers/ControlPanel.py @@ -86,9 +86,9 @@ class ControlPanel(): if inControlPanelNameStr in Orchestrator.GSettingsGet()["ServerDict"]["ControlPanelDict"]: raise Exception(f"Ошибка: Ранее уже была инициализирована панель управления с идентификатором: {inControlPanelNameStr}. Устраните ошибку и перезапустите оркестратор") Orchestrator.GSettingsGet()["ServerDict"]["ControlPanelDict"][inControlPanelNameStr] = self + self.mControlPanelNameStr = inControlPanelNameStr # Set the name of the control panel self.RefreshHTMLJinja2TemplatePathSet(inJinja2TemplatePathStr = inRefreshHTMLJinja2TemplatePathStr) self.mJinja2TemplateRefreshBool = inJinja2TemplateRefreshBool - self.mControlPanelNameStr = inControlPanelNameStr # Set the name of the control panel self.mRobotNameStr = inRobotNameStr # Set the robot name for robot it execute def Jinja2DataUpdateDictSet(self, inJinja2DataUpdateDict): @@ -116,7 +116,7 @@ class ControlPanel(): self.mRefreshHTMLJinja2Env = jinja2.Environment(loader=self.mRefreshHTMLJinja2Loader, trim_blocks=True) self.mRefreshHTMLJinja2Template = self.mRefreshHTMLJinja2Env.get_template(lTemplateFileNameStr) except Exception as e: - Orchestrator.OrchestratorLoggerGet().exception("Ошибка при инициализации Jinja2") + Orchestrator.OrchestratorLoggerGet().exception(f"Ошибка при инициализации Jinja2 ({inJinja2TemplatePathStr}). Панель управления: {self.mControlPanelNameStr}") def RefreshHTMLJinja2StrGenerate(self, inDataDict): """ @@ -145,7 +145,7 @@ class ControlPanel(): self.mInitJSJinja2Env = jinja2.Environment(loader=self.mInitJSJinja2Loader, trim_blocks=True) self.mInitJSJinja2Template = self.mInitJSJinja2Env.get_template(lTemplateFileNameStr) except Exception as e: - Orchestrator.OrchestratorLoggerGet().exception("Ошибка при инициализации Jinja2") + Orchestrator.OrchestratorLoggerGet().exception(f"Ошибка при инициализации Jinja2 ({inJinja2TemplatePathStr}). Панель управления: {self.mControlPanelNameStr}") def InitJSJinja2StrGenerate(self, inDataDict): """