#ActivityCMDRun #OrchestratorCMDRun

dev-linux
Ivan Maslov 6 years ago
parent e4ece8ab93
commit 400d5b6fd8

@ -82,6 +82,29 @@
dataType: "text"
});
}
//////////////////////////
/////Controller JS module
//////////////////////////
mGlobal.Controller={};
mGlobal.Controller.CMDRun=function() {
///Обнулить таблицу
lCMDCode=$(".openrpa-controller-cmd-run-input")[0].value
$.ajax({
type: "POST",
url: 'ProcessingRun',
data: '{"actionList":[{"type":"ActivityCMDRun", "code":"'+lCMDCode+'"}]}',
success:
function(lData,l2,l3)
{
var lResponseJSON=JSON.parse(lData)
///Отправить запрос на формирование таблицы
lHTMLCode=console.log("CMDRun result: "+lResponseJSON[0].result)
},
dataType: "text"
});
}
//////////////////////////
/////Monitor JS module
//////////////////////////
@ -346,7 +369,10 @@
</div>
<div class="content">
<img src="GetScreenshot" class="ui fluid image">
<div class="ui fluid action input">
<input class="openrpa-controller-cmd-run-input" type="text" placeholder="CMD Code...">
<div class="ui button" onclick="mGlobal.Controller.CMDRun();">Run!</div>
</div>
</div>
<div class="actions">
<div class="ui green ok inverted button" onclick="mGlobal.Monitor.ScreenshotModal.Close()">

@ -2,6 +2,8 @@ import datetime
import http.client
import json
import pdb
import os
import subprocess
#Глобальная переменная - все глобальные значения программы
global mGlobalDict
#{
@ -15,6 +17,10 @@ global mGlobalDict
# },
# {
# type: <ActivityLogScheduleListGet>
# },
# {
# type: <ActivityCMDRun>,
# code: <str>
# }
# ]
#
@ -45,5 +51,11 @@ def ProcessingRun(inConfigurationDict):
if lItem["type"]=="ActivityLogScheduleListGet":
#pdb.set_trace()
lResult["actionListResult"][-1] = {**lResult["actionListResult"][-1], **{"result":mGlobalDict["ActivityLogScheduleList"]}}
#Вернуть результат
#Обработка команды ActivityCMDRun
if lItem["type"]=="ActivityCMDRun":
lCMDCode="cmd /c "+lItem["code"]
subprocess.Popen(lCMDCode)
lResultCMDRun=1#os.system(lCMDCode)
lResult["actionListResult"][-1] = {**lResult["actionListResult"][-1], **{"result":str(lResultCMDRun)}}
#Вернуть результат
return lResult

Loading…
Cancel
Save