Add merge requests - some fixes

prd
robo-bo 2 years ago
parent f3ef7145cb
commit c79749096e

@ -1,7 +1,7 @@
splitter1 = 'Рабочий процесс'
splitter2 = 'Пример доступных данных'
splitter3 = 'Пример запуска роботов'
title = 'Робот-кадровик'
title = 'Кадровик'
introHeader = 'Применение:'
introText = 'Робот-кадровик помогает проводить отбор кандидатов'
@ -47,7 +47,7 @@ html = f'''<!doctype html>
<head>
<title> Test </title>
<link rel="stylesheet" href="/HR_officer01/styles">
<link rel="stylesheet" href="/HR_01/styles">
</head>
@ -160,12 +160,45 @@ html = f'''<!doctype html>
</div>
<script src="/HR_officer01/scripts"></script>
<script src="/HR_01/scripts"></script>
<script type="text/javascript" src="https://viewer.diagrams.net/js/viewer-static.min.js"></script>
</body>
</html>'''
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)

@ -4,7 +4,7 @@
<head>
<title> Test </title>
<link rel="stylesheet" href="/HR_officer01/styles">
<link rel="stylesheet" href="/HR_01/styles">
</head>
@ -13,7 +13,7 @@
<div class="card" style="width:450px;" id="card1">
<div class="content">
<center><h1>Робот-кадровик</h1></center><br>
<center><h1>Кадровик</h1></center><br>
<div class="ui message">
<div class="header">Применение:</div>
<p>Робот-кадровик помогает проводить отбор кандидатов</p>
@ -105,7 +105,7 @@
<div class="default text">Выберите робота...</div>
<div class="menu">
<div class="item" data-value="1">Робот на вакансию 1</div>
<div class="item" data-value="0">робот на вакансию 2</div>
<div class="item" data-value="0">Робот на вакансию 2</div>
</div>
</div>
@ -117,7 +117,7 @@
</div>
<script src="/HR_officer01/scripts"></script>
<script src="/HR_01/scripts"></script>
<script type="text/javascript" src="https://viewer.diagrams.net/js/viewer-static.min.js"></script>
</body>

@ -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'''<!doctype html>
</div>
<script src="/Treasurer01/scripts"></script>
<script src="/TREASURER_01/scripts"></script>
</body>
</html>'''
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)

@ -12,7 +12,7 @@
<div class="card" style="width:450px;" id="card1">
<div class="content">
<center><h1>Робот-казначей</h1></center><br>
<center><h1>Казначей</h1></center><br>
<div class="ui message">
<div class="header">Применение:</div>
<p>Робот-казначей выполняет выгрузку банковских выписок</p>
@ -53,7 +53,7 @@
<div class="menu">
<div class="item" data-value="2">Сбербанк</div>
<div class="item" data-value="1">ВТБ</div>
<div class="item" data-value="0">Альфа-банк</div>
<div class="item" data-value="0">Альфа</div>
</div>
</div><br><br>
@ -117,7 +117,7 @@
<div><b>Укажите почту (необязательно):</b></div>
<p><div class="ui input focus">
<input type="text" placeholder="example@gmail.ru">
<input type="text" placeholder="example@mail.ru">
</div></p>
<button class="ui right labeled icon button"><i class="download icon"></i> Скачать </button>
@ -128,7 +128,7 @@
</div>
<script src="/Treasurer01/scripts"></script>
<script src="/TREASURER_01/scripts"></script>
</body>

@ -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)

@ -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):
"""

Loading…
Cancel
Save