- Orch: /pyOpenRPA/ServerData - add sub dict "AgentDict"

- Orch WEB: Create Agent render
!NEED TEST!
dev-linux
Ivan Maslov 4 years ago
parent fc4a0b1f50
commit 383fc9b575

@ -1,4 +1,5 @@
import json import json
import copy
from inspect import signature # For detect count of def args from inspect import signature # For detect count of def args
#ControlPanelDict #ControlPanelDict
from desktopmagic.screengrab_win32 import ( from desktopmagic.screengrab_win32 import (
@ -55,7 +56,7 @@ def HiddenCPDictGenerate(inRequest, inGSettings):
# Return {"Key":{"",""}} # Return {"Key":{"",""}}
def HiddenRDPDictGenerate(inRequest, inGSettings): def HiddenRDPDictGenerate(inRequest, inGSettings):
lRDPDict = {} lRDPDict = {"HandlebarsList":[]}
# Iterate throught the RDP list # Iterate throught the RDP list
for lRDPSessionKeyStrItem in inGSettings["RobotRDPActive"]["RDPList"]: for lRDPSessionKeyStrItem in inGSettings["RobotRDPActive"]["RDPList"]:
lRDPConfiguration = inGSettings["RobotRDPActive"]["RDPList"][ lRDPConfiguration = inGSettings["RobotRDPActive"]["RDPList"][
@ -68,8 +69,26 @@ def HiddenRDPDictGenerate(inRequest, inGSettings):
"FullScreenRDPSessionKeyStr"] else False # Check the full screen for rdp window "FullScreenRDPSessionKeyStr"] else False # Check the full screen for rdp window
lDataItemDict["IsIgnoredBool"] = lRDPConfiguration["SessionIsIgnoredBool"] # Is ignored lDataItemDict["IsIgnoredBool"] = lRDPConfiguration["SessionIsIgnoredBool"] # Is ignored
lRDPDict[lDataItemDict["SessionKeyStr"]].append(lDataItemDict) lRDPDict[lDataItemDict["SessionKeyStr"]].append(lDataItemDict)
lHandlebarsDataItemDict = copy.deepcopy(lDataItemDict)
lHandlebarsDataItemDict["SessionKeyStr"]=lDataItemDict["SessionKeyStr"]
lRDPDict["HandlebarsList"].append(lHandlebarsDataItemDict)
return lRDPDict return lRDPDict
# Return {"HostNameUpperStr;UserUpperStr":{"IsListenBool":True}, "HandlebarsList":[{"HostnameUpperStr":"","UserUpperStr":"","IsListenBool":True}]}
def HiddenAgentDictGenerate(inRequest, inGSettings):
lAgentDict = {"HandlebarsList":[]}
# Iterate throught the RDP list
for lAgentItemKeyStrItem in inGSettings["AgentDict"]:
lKeyStr = f"{lAgentItemKeyStrItem[0]};{lAgentItemKeyStrItem[1]}" # turple ("HostNameUpperStr","UserUpperStr") > Str "HostNameUpperStr;UserUpperStr"
lDataItemDict = inGSettings["AgentDict"][lAgentItemKeyStrItem]
lAgentDict[lKeyStr]=lDataItemDict
lHandlebarsDataItemDict = copy.deepcopy(lDataItemDict)
lHandlebarsDataItemDict["HostnameUpperStr"]=lAgentItemKeyStrItem[0]
lHandlebarsDataItemDict["UserUpperStr"]=lAgentItemKeyStrItem[1]
lAgentDict["HandlebarsList"].append(lHandlebarsDataItemDict)
return lAgentDict
#v1.2.0 Send data container to the client from the server #v1.2.0 Send data container to the client from the server
# /pyOpenRPA/ServerData return {"HashStr" , "ServerDataDict": {"CPKeyStr":{"HTMLStr":"", DataDict:{}}}} # /pyOpenRPA/ServerData return {"HashStr" , "ServerDataDict": {"CPKeyStr":{"HTMLStr":"", DataDict:{}}}}
@ -90,7 +109,8 @@ def pyOpenRPA_ServerData(inRequest,inGSettings):
lServerDataDict = { lServerDataDict = {
"CPDict": HiddenCPDictGenerate(inRequest=inRequest, inGSettings=inGSettings), "CPDict": HiddenCPDictGenerate(inRequest=inRequest, inGSettings=inGSettings),
"RDPDict": HiddenRDPDictGenerate(inRequest=inRequest, inGSettings=inGSettings), "RDPDict": HiddenRDPDictGenerate(inRequest=inRequest, inGSettings=inGSettings),
"UserDict": {"UACClientDict": inRequest.OpenRPA["DefUserRoleHierarchyGet"]()} "AgentDict": HiddenAgentDictGenerate(inRequest=inRequest, inGSettings=inGSettings),
"UserDict": {"UACClientDict": inRequest.OpenRPA["DefUserRoleHierarchyGet"]()},
} }
# Create JSON # Create JSON
lServerDataDictJSONStr = json.dumps(lServerDataDict) lServerDataDictJSONStr = json.dumps(lServerDataDict)

@ -343,7 +343,7 @@ $(document).ready(function() {
///Прогрузить новую таблицу ///Прогрузить новую таблицу
$(".openrpa-control-panel").html(lHTMLCode) $(".openrpa-control-panel").html(lHTMLCode)
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
///Сформировать HTML код новой таблицы - список RDP /// !RDP List ! Сформировать 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
@ -351,6 +351,15 @@ $(document).ready(function() {
$(".openrpa-robotrdpactive-control-panel").html(lHTMLCode) $(".openrpa-robotrdpactive-control-panel").html(lHTMLCode)
///Очистить дерево ///Очистить дерево
//mGlobal.ElementTree.fClear(); //mGlobal.ElementTree.fClear();
////////////////////////////////////////////////////
/// !UserAgent List ! Сформировать HTML код новой таблицы - список RDP
lHTMLCode=mGlobal.GeneralGenerateHTMLCodeHandlebars(".pyOpenRPA-Agent-ListTemplate",lResponseJSON)
//Присвоить ответ в mGlobal.RobotRDPActive.mResponseList
mGlobal.RobotRDPActive.mResponseList = lResponseJSON
///Прогрузить новую таблицу
$(".pyOpenRPA-Agent-List").html(lHTMLCode)
///Очистить дерево
//mGlobal.ElementTree.fClear();
} }
} }
} }
@ -374,6 +383,22 @@ $(document).ready(function() {
lHTMLCode += '</div>' lHTMLCode += '</div>'
///Прогрузить новую таблицу ///Прогрузить новую таблицу
$(".openrpa-control-panel").html(lHTMLCode) $(".openrpa-control-panel").html(lHTMLCode)
////////////////////////////////////////////////////
/// !RDP List ! Сформировать HTML код новой таблицы - список RDP
lHTMLCode=mGlobal.GeneralGenerateHTMLCodeHandlebars(".openrpa-hidden-robotrdpactive-control-panel",lResponseJSON["RDPDict"])
//Присвоить ответ в mGlobal.RobotRDPActive.mResponseList
mGlobal.RobotRDPActive.mResponseList = lResponseJSON["RDPDict"]
///Прогрузить новую таблицу
$(".openrpa-robotrdpactive-control-panel").html(lHTMLCode)
///Очистить дерево
//mGlobal.ElementTree.fClear();
////////////////////////////////////////////////////
/// !UserAgent List ! Сформировать HTML код новой таблицы - список RDP
lHTMLCode=mGlobal.GeneralGenerateHTMLCodeHandlebars(".pyOpenRPA-Agent-ListTemplate",lResponseJSON["AgentDict"])
///Прогрузить новую таблицу
$(".pyOpenRPA-Agent-List").html(lHTMLCode)
///Очистить дерево
//mGlobal.ElementTree.fClear();
} }
} }
mGlobal.pyOpenRPA.ServerDataRefreshDef=function() { mGlobal.pyOpenRPA.ServerDataRefreshDef=function() {

@ -201,7 +201,7 @@
<script class="openrpa-hidden-robotrdpactive-control-panel" style="display:none" type="text/x-handlebars-template"> <script class="openrpa-hidden-robotrdpactive-control-panel" style="display:none" type="text/x-handlebars-template">
<div class="ui inverted segment"> <div class="ui inverted segment">
<div class="ui inverted relaxed divided list"> <div class="ui inverted relaxed divided list">
{{#RenderRDPList}} {{#HandlebarsList}}
<div class="item"> <div class="item">
<div class="right floated content"> <div class="right floated content">
<div class="ui button" onclick="mGlobal.Processor.ServerValueAppend(['RobotRDPActive','ActivityList'],{'DefNameStr': 'RDPSessionReconnect', 'ArgList': [], 'ArgDict': {'inRDPSessionKeyStr': '{{{SessionKeyStr}}}'} })" >Reconnect</div> <div class="ui button" onclick="mGlobal.Processor.ServerValueAppend(['RobotRDPActive','ActivityList'],{'DefNameStr': 'RDPSessionReconnect', 'ArgList': [], 'ArgDict': {'inRDPSessionKeyStr': '{{{SessionKeyStr}}}'} })" >Reconnect</div>
@ -237,6 +237,37 @@
Agent active list Agent active list
</div> </div>
</h2> </h2>
<div class="pyOpenRPA-Agent-List"></div>
<script class="pyOpenRPA-Agent-ListTemplate" style="display:none" type="text/x-handlebars-template">
<div class="ui inverted segment">
<div class="ui inverted relaxed divided list">
{{#HandlebarsList}}
<div class="item">
<div class="right floated content">
<div class="ui button" onclick="" >Reconnect</div>
</div>
<div class="right floated content">
{{#if IsListenBool}}
<div class="ui button red" onclick="">Online</div>
{{else}}
<div class="ui button" onclick="">Offline</div>
{{/if}}
</div>
<div class="right floated content">
{{#if IsFullScreenBool}}
<div class="ui button green" onclick="">Full screen</div>
{{else}}
<div class="ui button" onclick="">Full screen</div>
{{/if}}
</div>
<div class="content">
<div class="header">Hostname: {{{HostnameUpperStr}}}, User: {{{UserUpperStr}}}</div>
</div>
</div>
{{/RenderRDPList}}
</div>
</div>
</script>
</div> </div>
</div> </div>

@ -51,6 +51,8 @@
- Orchestrator WEB: Update WEB to the new UACClient - Orchestrator WEB: Update WEB to the new UACClient
- Create pyOpenRPA.Agent - just prototype, need test - Create pyOpenRPA.Agent - just prototype, need test
- Create Agent support in Orchestrator (/pyOpenRPA/Agent/O2A and /pyOpenRPA/Agent/A2O) - Create Agent support in Orchestrator (/pyOpenRPA/Agent/O2A and /pyOpenRPA/Agent/A2O)
- Orch: /pyOpenRPA/ServerData - add sub dict "AgentDict"
- Orch WEB: Create Agent render
[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