# Add Debugging toolbox in Web (ActivityItem send from front)

dev-linux
Ivan Maslov 3 years ago
parent 8cffeb627e
commit 1279fb3a64

@ -20,14 +20,18 @@ class Process():
mAgentHostNameStr = None mAgentHostNameStr = None
mAgentUserNameStr = None mAgentUserNameStr = None
mStartPathStr = None mStartPathStr = None
mStartCMDStr = None
mProcessNameWOExeStr = None mProcessNameWOExeStr = None
mStopSafeTimeoutSecFloat = None mStopSafeTimeoutSecFloat = None
mStatusStr = None # 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL mStatusStr = None # 0_STOPPED 1_STOPPED_MANUAL 2_STOP_SAFE 3_STOP_SAFE_MANUAL 4_STARTED 5_STARTED_MANUAL
def __init__(self, inAgentHostNameStr, inAgentUserNameStr, mStartPathStr, mProcessNameWOExeStr, mStopSafeTimeoutSecFloat=120): def __init__(self, inAgentHostNameStr, inAgentUserNameStr, inProcessNameWOExeStr, inStartPathStr=None, inStartCMDStr = None, inStopSafeTimeoutSecFloat=120):
self.mAgentHostNameStr = inAgentHostNameStr self.mAgentHostNameStr = inAgentHostNameStr
self.mAgentUserNameStr = inAgentUserNameStr self.mAgentUserNameStr = inAgentUserNameStr
self.mStartPathStr = inStartPathStr
self.mStartCMDStr = inStartCMDStr
self.mProcessNameWOExeStr = inProcessNameWOExeStr
self.mStopSafeTimeoutSecFloat = inStopSafeTimeoutSecFloat
def Manual2Auto(self): def Manual2Auto(self):
""" """
@ -47,7 +51,8 @@ class Process():
:return: :return:
""" """
# Send activity item to agent - wait result # Send activity item to agent - wait result
lCMDStr = f"start {os.path.abspath(self.mStartPathStr)}" if self.mStartPathStr is not None: lCMDStr = f"start {os.path.abspath(self.mStartPathStr)}"
elif self.mStartCMDStr is not None: lCMDStr = f"start {self.mStartCMDStr}"
lActivityItemStart = __Orchestrator__.ProcessorActivityItemCreate(inDef="OSCMD", lActivityItemStart = __Orchestrator__.ProcessorActivityItemCreate(inDef="OSCMD",
inArgDict={"inCMDStr":lCMDStr,"inSendOutputToOrchestratorLogsBool":False}, inArgDict={"inCMDStr":lCMDStr,"inSendOutputToOrchestratorLogsBool":False},
inArgGSettingsStr="inGSettings") inArgGSettingsStr="inGSettings")

@ -299,7 +299,8 @@ def __UACClientAdminCreate__():
"RestartOrchestratorBool": True, # Restart orchestrator activity "RestartOrchestratorBool": True, # Restart orchestrator activity
"RestartOrchestratorGITPullBool": True, # Turn off (RDP remember) orc + git pull + Turn on (rdp remember) "RestartOrchestratorGITPullBool": True, # Turn off (RDP remember) orc + git pull + Turn on (rdp remember)
"RestartPCBool": True, # Send CMD to restart pc "RestartPCBool": True, # Send CMD to restart pc
"NothingBool":True # USe option if you dont want to give some access to the RDP controls "NothingBool":True, # USe option if you dont want to give some access to the RDP controls
"Debugging":True # Debugging tool
}, },
"ActivityDict": { # Empty dict - all access "ActivityDict": { # Empty dict - all access
"ActivityListExecuteBool": True, # Execute activity at the current thread "ActivityListExecuteBool": True, # Execute activity at the current thread

@ -883,6 +883,7 @@ $(document).ready(function() {
if (lUACAsk(["pyOpenRPADict","AdminDict","RestartOrchestratorBool"])) { $(".UACClient-pyOpenRPADict-AdminDict-RestartOrchestratorBool").show(); } if (lUACAsk(["pyOpenRPADict","AdminDict","RestartOrchestratorBool"])) { $(".UACClient-pyOpenRPADict-AdminDict-RestartOrchestratorBool").show(); }
if (lUACAsk(["pyOpenRPADict","AdminDict","RestartOrchestratorGITPullBool"])) { $(".UACClient-pyOpenRPADict-AdminDict-RestartOrchestratorGITPullBool").show(); } if (lUACAsk(["pyOpenRPADict","AdminDict","RestartOrchestratorGITPullBool"])) { $(".UACClient-pyOpenRPADict-AdminDict-RestartOrchestratorGITPullBool").show(); }
if (lUACAsk(["pyOpenRPADict","AdminDict","RestartPCBool"])) { $(".UACClient-pyOpenRPADict-AdminDict-RestartPCBool").show(); } if (lUACAsk(["pyOpenRPADict","AdminDict","RestartPCBool"])) { $(".UACClient-pyOpenRPADict-AdminDict-RestartPCBool").show(); }
if (lUACAsk(["pyOpenRPADict","AdminDict","Debugging"])) { $(".UACClient-pyOpenRPADict-AdminDict-Debugging").show(); }
} }
@ -893,4 +894,44 @@ $(document).ready(function() {
mGlobal.pyOpenRPA.ServerLogListDoRenderTrue(); // Init button to freeze/unfreeze textare with logs mGlobal.pyOpenRPA.ServerLogListDoRenderTrue(); // Init button to freeze/unfreeze textare with logs
$('.ui.dropdown').dropdown(); $('.ui.dropdown').dropdown();
////////////////////////////////////////////
// Debugging
/// Execute ActivityItem
mGlobal.pyOpenRPA.DebuggingExecute=function() {
///EXAMPLE
// {
// "Def":"OSCMD", // def link or def alias (look gSettings["Processor"]["AliasDefDict"])
// "ArgList":[], // Args list
// "ArgDict":{"inCMDStr":lCMDCode,"inRunAsyncBool":false}, // Args dictionary
// "ArgGSettings": null, // Name of GSettings attribute: str (ArgDict) or index (for ArgList)
// "ArgLogger": "inLogger" // Name of GSettings attribute: str (ArgDict) or index (for ArgList)
// }
///Подготовить конфигурацию
lArgListStr = $(".mGlobal-pyOpenRPA-Debugging-ArgList")[0].value
lArgDictStr = $(".mGlobal-pyOpenRPA-Debugging-ArgDict")[0].value
lArgGSettingsStr = $(".mGlobal-pyOpenRPA-Debugging-ArgGSettings")[0].value
lArgLoggerStr = $(".mGlobal-pyOpenRPA-Debugging-ArgLogger")[0].value
lActivityItem = {
"Def":$(".mGlobal-pyOpenRPA-Debugging-Def")[0].value, // def link or def alias (look gSettings["Processor"]["AliasDefDict"])
"ArgList":(lArgListStr == "" ? [] : JSON.parse(lArgListStr)), // Args list
"ArgDict":(lArgDictStr == "" ? {} : JSON.parse(lArgDictStr)), // Args dictionary
"ArgGSettings": (lArgGSettingsStr == "" ? null : lArgGSettingsStr), // Name of GSettings attribute: str (ArgDict) or index (for ArgList)
"ArgLogger": (lArgLoggerStr == "" ? null : lArgLoggerStr) // Name of GSettings attribute: str (ArgDict) or index (for ArgList)
}
lData = [lActivityItem]
$.ajax({
type: "POST",
url: '/pyOpenRPA/ActivityListExecute',
data: JSON.stringify(lData),
success:
function(lData,l2,l3)
{
var lResponseJSON=JSON.parse(lData)
console.log(lResponseJSON)
$(".mGlobal-pyOpenRPA-Debugging-Output")[0].value = lData
},
dataType: "text"
});
}
}); });

@ -298,6 +298,52 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row UACClient-pyOpenRPADict-AdminDict-Debugging" style= "display:none;">
<div class="twelve wide column">
<h4 class="ui horizontal divider header" >
<i class="bug icon"></i>
Debugging - Send
</h4>
<div class="ui fluid labeled input" style="margin-bottom:10px;">
<div class="ui label">
Def
</div>
<input type="text" placeholder="Def name" class="mGlobal-pyOpenRPA-Debugging-Def">
</div>
<div class="ui fluid labeled input" style="margin-bottom:10px;">
<div class="ui label">
ArgList
</div>
<input type="text" placeholder="[1,2,3]" class="mGlobal-pyOpenRPA-Debugging-ArgList">
</div>
<div class="ui fluid labeled input" style="margin-bottom:10px;">
<div class="ui label">
ArgDict
</div>
<input type="text" placeholder="{&quot;Key1&quot;:&quot;Value1&quot;}" class="mGlobal-pyOpenRPA-Debugging-ArgDict">
</div>
<div class="ui fluid labeled input" style="margin-bottom:10px;">
<div class="ui label">
ArgGSettings
</div>
<input type="text" placeholder="inGSettings" class="mGlobal-pyOpenRPA-Debugging-ArgGSettings">
</div>
<div class="ui fluid labeled input" style="margin-bottom:10px;">
<div class="ui label">
ArgLogger
</div>
<input type="text" placeholder="inLogger" class="mGlobal-pyOpenRPA-Debugging-ArgLogger">
</div>
<div class="ui fluid button" onclick="mGlobal.pyOpenRPA.DebuggingExecute();">Execute</div>
</div>
<div class="four wide column">
<h4 class="ui horizontal divider header" >
<i class="bug icon"></i>
Debugging - Output
</h4>
<p><textarea class="mGlobal-pyOpenRPA-Debugging-Output" readonly="readonly" style="width:100%; font-family:monospace; font-weight: bold;" rows="16" cols="60"></textarea></p>
</div>
</div>
<h4 class="ui horizontal divider header"> <h4 class="ui horizontal divider header">
<i class="clipboard list icon"></i> <i class="clipboard list icon"></i>

Loading…
Cancel
Save