# Add "/pyOpenRPA/ServerData" - in progress

dev-linux
Ivan Maslov 4 years ago
parent 026a152dfc
commit c79c446888

@ -10,6 +10,17 @@ import time # sleep functions
import datetime # datetime functions import datetime # datetime functions
import threading # Multi-threading import threading # Multi-threading
#v1.2.0 Send data container to the client from the server
# /pyOpenRPA/ServerData return {"HashStr" , "ServerDataDict"}
# Client: mGlobal.pyOpenRPA.ServerDataHashStr
# Client: mGlobal.pyOpenRPA.ServerDataDict
def pyOpenRPA_ServerData(inRequest,inGSettings):
lResult = {"HashStr": "", "ServerDataDict": {}}
return lResult
# /Orchestrator/RobotRDPActive/ControlPanelDictGet # /Orchestrator/RobotRDPActive/ControlPanelDictGet
def RobotRDPActive_ControlPanelDictGet(inRequest,inGlobalDict): def RobotRDPActive_ControlPanelDictGet(inRequest,inGlobalDict):
inResponseDict = inRequest.OpenRPAResponseDict inResponseDict = inRequest.OpenRPAResponseDict
@ -213,7 +224,8 @@ def SettingsUpdate(inGlobalConfiguration):
{"Method": "GET", "URL": "/Monitor/ControlPanelDictGet", "MatchType": "Equal", "ResponseDefRequestGlobal": Monitor_ControlPanelDictGet_SessionCheckInit, "ResponseContentType": "application/json"}, {"Method": "GET", "URL": "/Monitor/ControlPanelDictGet", "MatchType": "Equal", "ResponseDefRequestGlobal": Monitor_ControlPanelDictGet_SessionCheckInit, "ResponseContentType": "application/json"},
{"Method": "GET", "URL": "/GetScreenshot", "MatchType": "BeginWith", "ResponseDefRequestGlobal": GetScreenshot, "ResponseContentType": "image/png"}, {"Method": "GET", "URL": "/GetScreenshot", "MatchType": "BeginWith", "ResponseDefRequestGlobal": GetScreenshot, "ResponseContentType": "image/png"},
{"Method": "GET", "URL": "/pyOpenRPA_logo.png", "MatchType": "Equal", "ResponseFilePath": os.path.join(lOrchestratorFolder, "..\\Resources\\Web\\pyOpenRPA_logo.png"), "ResponseContentType": "image/png"}, {"Method": "GET", "URL": "/pyOpenRPA_logo.png", "MatchType": "Equal", "ResponseFilePath": os.path.join(lOrchestratorFolder, "..\\Resources\\Web\\pyOpenRPA_logo.png"), "ResponseContentType": "image/png"},
{"Method": "POST", "URL": "/Orchestrator/UserRoleHierarchyGet", "MatchType": "Equal","ResponseDefRequestGlobal": UserRoleHierarchyGet, "ResponseContentType": "application/json"} {"Method": "POST", "URL": "/Orchestrator/UserRoleHierarchyGet", "MatchType": "Equal","ResponseDefRequestGlobal": UserRoleHierarchyGet, "ResponseContentType": "application/json"},
{"Method": "POST", "URL": "/pyOpenRPA/ServerData", "MatchType": "Equal","ResponseDefRequestGlobal": pyOpenRPA_ServerData, "ResponseContentType": "application/json"}
] ]
inGlobalConfiguration["Server"]["URLList"]=inGlobalConfiguration["Server"]["URLList"]+lURLList inGlobalConfiguration["Server"]["URLList"]=inGlobalConfiguration["Server"]["URLList"]+lURLList
return inGlobalConfiguration return inGlobalConfiguration

@ -276,59 +276,75 @@ $(document).ready(function() {
mGlobal.Monitor.fControlPanelRefresh_TechnicalRender = function() mGlobal.Monitor.fControlPanelRefresh_TechnicalRender = function()
{ {
lResponseJSON = mGlobal.Monitor.mDatasetLast lResponseJSON = mGlobal.Monitor.mDatasetLast
if (lResponseJSON!= null) { if (lResponseJSON!= null) {
///Escape onclick /// New version of control panels
/// RenderRobotList for (var lKeyStr in lResponseJSON){
lResponseJSON["RenderRobotList"].forEach( if (lKeyStr != "RenderRobotList") { /// Check if not "RenderRobotList"
function(lItem){ lCPDict = lResponseJSON[lKeyStr]
if ('FooterButtonX2List' in lItem) { /// Render HTML
/// FooterButtonX2List if ("HTMLStr" in lCPDict) {
lItem["FooterButtonX2List"].forEach(
function(lItem2){ }
if ('OnClick' in lItem) { }
lOnClickEscaped = lItem["OnClick"]; }
lOnClickEscaped = lOnClickEscaped.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
lItem["OnClick"] = lOnClickEscaped;
/// v1.2.0 Backward compatibility - support old control panels
if ("RenderRobotList" in lResponseJSON) {
///Escape onclick
/// RenderRobotList
lResponseJSON["RenderRobotList"].forEach(
function(lItem){
if ('FooterButtonX2List' in lItem) {
/// FooterButtonX2List
lItem["FooterButtonX2List"].forEach(
function(lItem2){
if ('OnClick' in lItem) {
lOnClickEscaped = lItem["OnClick"];
lOnClickEscaped = lOnClickEscaped.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
lItem["OnClick"] = lOnClickEscaped;
}
} }
} );
); /// FooterButtonX1List
/// FooterButtonX1List lItem["FooterButtonX1List"].forEach(
lItem["FooterButtonX1List"].forEach( function(lItem2){
function(lItem2){ if ('OnClick' in lItem) {
if ('OnClick' in lItem) { lOnClickEscaped = lItem["OnClick"];
lOnClickEscaped = lItem["OnClick"]; lOnClickEscaped = lOnClickEscaped.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
lOnClickEscaped = lOnClickEscaped.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;"); lItem["OnClick"] = lOnClickEscaped;
lItem["OnClick"] = lOnClickEscaped; }
} }
} );
); }
} }
} );
); //////////////////////////////////////////////////////////
////////////////////////////////////////////////////////// ///Сформировать HTML код новой таблицы - контрольная панель
///Сформировать HTML код новой таблицы - контрольная панель lHTMLCode+=mGlobal.GeneralGenerateHTMLCodeHandlebars(".openrpa-hidden-control-panel",lResponseJSON)
lHTMLCode=mGlobal.GeneralGenerateHTMLCodeHandlebars(".openrpa-hidden-control-panel",lResponseJSON) //Присвоить ответ в mGlobal.Monitor.mResponseList
//Присвоить ответ в mGlobal.Monitor.mResponseList mGlobal.Monitor.mResponseList = lResponseJSON
mGlobal.Monitor.mResponseList = lResponseJSON ///Set result in mGlobal.DataStorage
///Set result in mGlobal.DataStorage lResponseJSON["RenderRobotList"].forEach(
lResponseJSON["RenderRobotList"].forEach( function(lItem){
function(lItem){ if ('DataStorageKey' in lItem) {
if ('DataStorageKey' in lItem) { mGlobal["DataStorage"][lItem['DataStorageKey']]=lItem
mGlobal["DataStorage"][lItem['DataStorageKey']]=lItem }
} }
} )
) ///Прогрузить новую таблицу
///Прогрузить новую таблицу $(".openrpa-control-panel").html(lHTMLCode)
$(".openrpa-control-panel").html(lHTMLCode) ////////////////////////////////////////////////////
//////////////////////////////////////////////////// ///Сформировать HTML код новой таблицы - список RDP
///Сформировать HTML код новой таблицы - список RDP lHTMLCode=mGlobal.GeneralGenerateHTMLCodeHandlebars(".openrpa-hidden-robotrdpactive-control-panel",lResponseJSON)
lHTMLCode=mGlobal.GeneralGenerateHTMLCodeHandlebars(".openrpa-hidden-robotrdpactive-control-panel",lResponseJSON) //Присвоить ответ в mGlobal.RobotRDPActive.mResponseList
//Присвоить ответ в mGlobal.RobotRDPActive.mResponseList mGlobal.RobotRDPActive.mResponseList = lResponseJSON
mGlobal.RobotRDPActive.mResponseList = lResponseJSON ///Прогрузить новую таблицу
///Прогрузить новую таблицу $(".openrpa-robotrdpactive-control-panel").html(lHTMLCode)
$(".openrpa-robotrdpactive-control-panel").html(lHTMLCode) ///Очистить дерево
///Очистить дерево //mGlobal.ElementTree.fClear();
//mGlobal.ElementTree.fClear(); }
} }
} }
mGlobal.Monitor.mDatasetLast = null mGlobal.Monitor.mDatasetLast = null

@ -33,7 +33,7 @@
- - def JSEscapeForHTMLInline(inJSStr): # Escape JS to the safe JS for the inline JS in HTML tags ATTENTION! Use it only if want to paste JS into HTML tag - not in <script> - - def JSEscapeForHTMLInline(inJSStr): # Escape JS to the safe JS for the inline JS in HTML tags ATTENTION! Use it only if want to paste JS into HTML tag - not in <script>
- - def HTMLLinkURL(inURLStr, inTitleStr=None, inColorStr=None): # Generate HTML code of the simple URL link by the URL - - def HTMLLinkURL(inURLStr, inTitleStr=None, inColorStr=None): # Generate HTML code of the simple URL link by the URL
- - def HTMLLinkJSOnClick(inJSOnClickStr, inTitleStr, inColorStr=None): # Generate HTML code of the simple URL link by the JS when onclick - - def HTMLLinkJSOnClick(inJSOnClickStr, inTitleStr, inColorStr=None): # Generate HTML code of the simple URL link by the JS when onclick
- Add URL "/pyOpenRPA/ServerData" - consolidated function
[1.1.0] [1.1.0]
After 2 month test prefinal with new improovements (+RobotRDPActive in Orchestrator + Easy ControlPanelTemplate) After 2 month test prefinal with new improovements (+RobotRDPActive in Orchestrator + Easy ControlPanelTemplate)
Beta before 1.1.0 (new way of OpenRPA with improvements. Sorry, but no backward compatibility)/ Backward compatibility will start from 1.0.1 Beta before 1.1.0 (new way of OpenRPA with improvements. Sorry, but no backward compatibility)/ Backward compatibility will start from 1.0.1

Loading…
Cancel
Save