#ActivityCMDRun #OrchestratorCMDRun

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

@ -82,6 +82,29 @@
dataType: "text" 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 /////Monitor JS module
////////////////////////// //////////////////////////
@ -346,7 +369,10 @@
</div> </div>
<div class="content"> <div class="content">
<img src="GetScreenshot" class="ui fluid image"> <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>
<div class="actions"> <div class="actions">
<div class="ui green ok inverted button" onclick="mGlobal.Monitor.ScreenshotModal.Close()"> <div class="ui green ok inverted button" onclick="mGlobal.Monitor.ScreenshotModal.Close()">

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

Loading…
Cancel
Save