- Create new pyOpenRPA UAC Client hierarchy SettingsTemplate.__UACClientAdminCreate__ - need to update functionallity

- Orchestrator WEB: Update WEB to the new UACClient
dev-linux
Ivan Maslov 4 years ago
parent fea3809d85
commit caeae7c997

@ -23,16 +23,27 @@ if lPyOpenRPASourceFolderPathStr != "": sys.path.insert(0,os.path.abspath(os.pat
# Start import after config the pyOpenRPA folder
from pyOpenRPA.Orchestrator import SettingsTemplate # Import functionallity
if __name__ == "__main__": # New init way - allow run as module -m PyOpenRPA.Orchestrator
from pyOpenRPA.Orchestrator import Orchestrator # Import orchestrator main
gSettings = SettingsTemplate.Create(inModeStr="BASIC") # Create GSettings with basic configuration
# TEST Add User ND - Add Login ND to superuser of the Orchestrator
Orchestrator.OrchestratorAccessUserUpdate(inGSettings=gSettings, inADLoginStr="ND", inADStr="", inADIsDefaultBool=True, inURLList=[],inCPAllowKeyList=[])
lUACClientDict = SettingsTemplate.__UACClientAdminCreate__()
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["LogViewerBool"]
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["CMDInputBool"]
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["ScreenshotViewerBool"]
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["RestartOrchestratorBool"]
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["RestartOrchestratorGITPullBool"]
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["RestartPCBool"]
# del lUACClientDict["pyOpenRPADict"]["RDPKeyDict"]
# del lUACClientDict["pyOpenRPADict"]["AgentKeyDict"]
# del lUACClientDict["pyOpenRPADict"]["CPKeyDict"]
Orchestrator.OrchestratorUACUpdate(inGSettings=gSettings, inADLoginStr="ND", inADStr="", inADIsDefaultBool=True, inURLList=[], inCPAllowKeyList=[], inRoleHierarchyAllowedDict=lUACClientDict)
# TEST Add User IMaslov - Add Login IMaslov to superuser of the Orchestrator
Orchestrator.OrchestratorAccessUserUpdate(inGSettings=gSettings, inADLoginStr="IMaslov", inADStr="", inADIsDefaultBool=True, inURLList=[],inCPAllowKeyList=[])
Orchestrator.OrchestratorUACUpdate(inGSettings=gSettings, inADLoginStr="IMaslov", inADStr="", inADIsDefaultBool=True, inURLList=[], inCPAllowKeyList=[])
# TEST Add Supertoken for the all access between robots
Orchestrator.OrchestratorAccessSuperTokenAdd(inGSettings=gSettings, inSuperTokenStr="1992-04-03-0643-ru-b4ff-openrpa52zzz")
Orchestrator.OrchestratorUACSuperTokenUpdate(inGSettings=gSettings, inSuperTokenStr="1992-04-03-0643-ru-b4ff-openrpa52zzz")
## !!! For Relative import !!! CP Version Check
sys.path.insert(0,os.path.abspath(os.path.join(r"")))

@ -88,7 +88,7 @@ def OrchestratorSessionSave(inGSettings=None): ## Orchestrator session save
f"Orchestrator has dump the RDP list before the restart. The RDP List is {inGSettings['RobotRDPActive']['RDPList']}")
return True
# Update user access
def OrchestratorAccessUserUpdate(inGSettings, inADLoginStr, inADStr="", inADIsDefaultBool=True, inURLList=[], inCPAllowKeyList=[], inRoleHierarchyAllowedDict={}):
def OrchestratorUACUpdate(inGSettings, inADLoginStr, inADStr="", inADIsDefaultBool=True, inURLList=[], inCPAllowKeyList=[], inRoleHierarchyAllowedDict={}):
# Backward compatibility
if inURLList==[]:
inURLList=[
@ -120,9 +120,9 @@ def OrchestratorAccessUserUpdate(inGSettings, inADLoginStr, inADStr="", inADIsDe
inGSettings["Server"]["AccessUsers"]["RuleDomainUserDict"].update({("",inADLoginStr.upper()):lRuleDomainUserDict})
# Add supertoken for the all access (it is need for the robot communication without human)
def OrchestratorAccessSuperTokenAdd(inGSettings, inSuperTokenStr):
def OrchestratorUACSuperTokenUpdate(inGSettings, inSuperTokenStr):
lLoginStr = "SUPERTOKEN"
OrchestratorAccessUserUpdate(inGSettings=inGSettings, inADLoginStr=lLoginStr)
OrchestratorUACUpdate(inGSettings=inGSettings, inADLoginStr=lLoginStr)
inGSettings["Server"]["AccessUsers"]["AuthTokensDict"].update(
{inSuperTokenStr:{"User":lLoginStr, "Domain":"", "TokenDatetime": datetime.datetime.now(), "FlagDoNotExpire":True}}
)

@ -90,7 +90,7 @@ def pyOpenRPA_ServerData(inRequest,inGSettings):
lServerDataDict = {
"CPDict": HiddenCPDictGenerate(inRequest=inRequest, inGSettings=inGSettings),
"RDPDict": HiddenRDPDictGenerate(inRequest=inRequest, inGSettings=inGSettings),
"UserDict": {"RoleHierarchyDict": inRequest.OpenRPA["DefUserRoleHierarchyGet"]()}
"UserDict": {"UACClientDict": inRequest.OpenRPA["DefUserRoleHierarchyGet"]()}
}
# Create JSON
lServerDataDictJSONStr = json.dumps(lServerDataDict)

@ -291,6 +291,44 @@ def __Create__():
}
}
# Create full configuration for
def __UACClientAdminCreate__():
lResultDict = {
"pyOpenRPADict":{
"CPKeyDict":{ # Empty dict - all access
# "CPKeyStr"{
# }
},
"RDPKeyDict":{ # Empty dict - all access
#"RDPKeyStr"{
# "FullscreenBool": True,
# "IgnoreBool":True,
# "ReconnectBool": True
# "NothingBool": True # USe option if you dont want to give some access to the RDP controls
# }
},
"AgentKeyDict": { # Empty dict - all access
# "AgentKeyStr"{
# }
},
"AdminDict":{ # Empty dict - all access
"LogViewerBool":True, # Show log viewer on the web page
"CMDInputBool":True, # Execute CMD on the server side and result to the logs
"ScreenshotViewerBool":True, # Show button to look screenshots
"RestartOrchestratorBool": True, # Restart orchestrator activity
"RestartOrchestratorGITPullBool": True, # Turn off (RDP remember) orc + git pull + Turn on (rdp remember)
"RestartPCBool": True, # Send CMD to restart pc
"NothingBool":True # USe option if you dont want to give some access to the RDP controls
},
"ActivityDict": { # Empty dict - all access
"ActivityListExecuteBool": True, # Execute activity at the current thread
"ActivityListAppendProcessorQueueBool": True # Append activity to the processor queue
}
}
}
return lResultDict
# inModeStr:
# "BASIC" - create standart configuration
from pyOpenRPA.Orchestrator.Utils import LoggerHandlerDumpLogList

@ -389,6 +389,7 @@ $(document).ready(function() {
mGlobal.pyOpenRPA.ServerDataDict = lResponseJSON["ServerDataDict"]
mGlobal.pyOpenRPA.ServerDataHashStr = lResponseJSON["HashStr"]
mGlobal.pyOpenRPA.ServerDataRefreshDef_TechnicalRender()
mGlobal.UserRoleUpdate();
}
catch(error) {
}
@ -745,7 +746,7 @@ $(document).ready(function() {
// UAC Ask
mGlobal.UserRoleAsk=function(inList) {
var lResult = true; // Init flag
var lRoleHierarchyDict = mGlobal.UserRoleHierarchyDict; // get the Hierarchy
var lRoleHierarchyDict = mGlobal.pyOpenRPA.ServerDataDict.UserDict.UACClientDict; // get the Hierarchy
// Try to get value from key list
var lKeyValue = lRoleHierarchyDict; // Init the base
var lListLength = inList.length;
@ -771,42 +772,25 @@ $(document).ready(function() {
}
// Check user roles and update the Orchestrator UI
mGlobal.UserRoleUpdate=function() {
$.ajax({
type: "POST",
url: 'Orchestrator/UserRoleHierarchyGet',
data: "",
success:
function(lData,l2,l3)
{
var lUACAsk = mGlobal.UserRoleAsk // Alias
var lResponseDict=JSON.parse(lData)
mGlobal.UserRoleHierarchyDict = lResponseDict // set the user role hierarchy
//Turn on the Lookmachine screenshot button
if (lUACAsk(["Orchestrator","Controls","LookMachineScreenshots"])) {
$(".openrpa-control-lookmachinescreenshot").show() //Show button
}
//Turn on the restart orchestrator button
if (lUACAsk(["Orchestrator","Controls","RestartOrchestrator"])) {
$(".openrpa-control-restartorchestrator").show() //Show button
}
//Turn on the rdp session list
if (lUACAsk(["Orchestrator","RDPActive","ListRead"])) {
$(".openrpa-rdpactive-title").show() //Show section
$(".openrpa-robotrdpactive-control-panel-general").show() //Show section
}
//Turn on the restart PC button
if (lUACAsk(["Orchestrator","Controls","RestartPC"])) {
$(".openrpa-control-restartpc").show() //Show button
}
//Turn on the git update + restart orchestrator
if (lUACAsk(["Orchestrator","Controls","GITRestartOrchestrator"])) {
$(".openrpa-control-gitrestartorchestrator").show() //Show button
}
},
dataType: "text"
});
//CPKeyDict
if (lUACAsk(["pyOpenRPADict","CPKeyDict"])) { $(".UACClient-pyOpenRPADict-CPKeyDict").show(); }
//RDPKeyDict
if (lUACAsk(["pyOpenRPADict","RDPKeyDict"])) { $(".UACClient-pyOpenRPADict-RDPKeyDict").show(); }
//AgentKeyDict
if (lUACAsk(["pyOpenRPADict","AgentKeyDict"])) { $(".UACClient-pyOpenRPADict-AgentKeyDict").show(); }
// AdminDict
if (lUACAsk(["pyOpenRPADict","AdminDict","LogViewerBool"])) { $(".UACClient-pyOpenRPADict-AdminDict-LogViewerBool").show(); }
if (lUACAsk(["pyOpenRPADict","AdminDict","CMDInputBool"])) { $(".UACClient-pyOpenRPADict-AdminDict-CMDInputBool").show(); }
if (lUACAsk(["pyOpenRPADict","AdminDict","ScreenshotViewerBool"])) { $(".UACClient-pyOpenRPADict-AdminDict-ScreenshotViewerBool").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","RestartPCBool"])) { $(".UACClient-pyOpenRPADict-AdminDict-RestartPCBool").show(); }
}
mGlobal.UserRoleUpdate() // Cal the update User Roles function
// Orchestrator model
mGlobal.WorkingDirectoryPathStr = null
mGlobal.OrchestratorModelUpdate=function() {

@ -63,7 +63,7 @@
</div>
</div>
<div class="row">
<div class="sixteen wide column openrpa-control-panel-general" >
<div class="sixteen wide column openrpa-control-panel-general UACClient-pyOpenRPADict-CPKeyDict" style="display:none;" >
<h4 class="ui horizontal divider header">
<i class="clipboard list icon"></i>
Dashboard (Robot control panel)
@ -190,8 +190,8 @@
</div>
</div>
</script>
<div class="eight wide column openrpa-robotrdpactive-control-panel-general" style="display:none;">
<h2 class="ui header openrpa-rdpactive-title" style="display:none;">
<div class="eight wide column openrpa-robotrdpactive-control-panel-general UACClient-pyOpenRPADict-RDPKeyDict" style="display:none;">
<h2 class="ui header openrpa-rdpactive-title">
<i class="desktop icon"></i>
<div class="content">
RDP active list
@ -230,7 +230,7 @@
</div>
</script>
</div>
<div class="eight wide column" style="">
<div class="eight wide column UACClient-pyOpenRPADict-AgentKeyDict" style="display:none">
<h2 class="ui header " style="">
<i class="bug icon"></i>
<div class="content">
@ -258,14 +258,14 @@
<div class="row">
<div class="sixteen wide column" style="">
<h4 class="ui horizontal divider header">
<h4 class="ui horizontal divider header" >
<i class="clipboard list icon"></i>
Logs
</h4>
<textarea class="mGlobal-pyOpenRPA-ServerLogList " readonly="readonly" style="width:100%; resize: none; font-family:monospace; font-weight: bold;" id="textarea_id" rows="20">
<textarea class="mGlobal-pyOpenRPA-ServerLogList UACClient-pyOpenRPADict-AdminDict-LogViewerBool" readonly="readonly" style="width:100%; display:none; resize: none; font-family:monospace; font-weight: bold;" id="textarea_id" rows="20">
</textarea>
<div class="ui fluid action input">
<div class="ui fluid action input UACClient-pyOpenRPADict-AdminDict-CMDInputBool" style="display:none;">
<input class="openrpa-controller-cmd-run-input" type="text" placeholder="CMD Code...">
<div class="ui button" onclick="mGlobal.Controller.CMDRun();">Run!</div>
<div class="ui button" onclick="mGlobal.Controller.CMDRunGUILogout();">GUI Logout</div>
@ -278,25 +278,25 @@
Controls
</h4>
<div class="four ui buttons">
<div class="ui animated button openrpa-control-lookmachinescreenshot green" onclick="mGlobal.Monitor.ScreenshotModal.Show();" style="display: none; margin-top: 5px;">
<div class="ui animated button openrpa-control-lookmachinescreenshot green UACClient-pyOpenRPADict-AdminDict-ScreenshotViewerBool" onclick="mGlobal.Monitor.ScreenshotModal.Show();" style="display: none; margin-top: 5px;">
<div class="visible content">Show live screenshots</div>
<div class="hidden content">
<i class="right arrow icon"></i>
</div>
</div>
<div class="ui animated button openrpa-control-restartorchestrator orange" onclick="mGlobal.Controller.OrchestratorRestart();" style="display: none; margin-top: 5px;">
<div class="ui animated button openrpa-control-restartorchestrator orange UACClient-pyOpenRPADict-AdminDict-RestartOrchestratorBool" onclick="mGlobal.Controller.OrchestratorRestart();" style="display: none; margin-top: 5px;">
<div class="visible content">Restart orchestrator</div>
<div class="hidden content">
<i class="right arrow icon"></i>
</div>
</div>
<div class="ui animated button openrpa-control-gitrestartorchestrator teal" onclick="mGlobal.Controller.OrchestratorGITPullRestart();" style="display: none; margin-top: 5px;">
<div class="ui animated button openrpa-control-gitrestartorchestrator teal UACClient-pyOpenRPADict-AdminDict-RestartOrchestratorGITPullBool" onclick="mGlobal.Controller.OrchestratorGITPullRestart();" style="display: none; margin-top: 5px;">
<div class="visible content">Git pull, restart orchestrator</div>
<div class="hidden content">
<i class="right arrow icon"></i>
</div>
</div>
<div class="ui animated button openrpa-control-restartpc red" onclick="mGlobal.Controller.PCRestart();" style="display: none; margin-top: 5px;">
<div class="ui animated button openrpa-control-restartpc red UACClient-pyOpenRPADict-AdminDict-RestartPCBool" onclick="mGlobal.Controller.PCRestart();" style="display: none; margin-top: 5px;">
<div class="visible content">Restart PC</div>
<div class="hidden content">
<i class="right arrow icon"></i>

@ -28,8 +28,8 @@
- Add front autorefresh if front/back pyOpenRPA versions are differs (see CP_VersionCheck.py)
- Add absolute/relative import for the control panels
- Add new Orchestrator defs:
- - def OrchestratorAccessUserUpdate(inGSettings, inADLoginStr, inADStr="", inADIsDefaultBool=True, inURLList=[], inCPAllowKeyList=[]): - Update user access
- - def OrchestratorAccessSuperTokenAdd(inGSettings, inSuperTokenStr): # Add supertoken for the all access (it is need for the robot communication without human)
- - def OrchestratorUACUpdate(inGSettings, inADLoginStr, inADStr="", inADIsDefaultBool=True, inURLList=[], inCPAllowKeyList=[]): - Update user access
- - def OrchestratorUACSuperTokenUpdate(inGSettings, inSuperTokenStr): # Add supertoken for the all access (it is need for the robot communication without human)
- Create Web HTML / JS generators [pyOpenRPA.Orchestrator.Web.Basic]
- - 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
@ -46,7 +46,9 @@
- Orchestrator.OSCMD Add 2 input args inLogger + inRunAsyncBool
- WEB Update CMD Input line (tranfer to Log view). Change /Utils/Processor to /pyOpenRPA/ActivityListExecute
- Defs has been added in ProcessorAliasDict as Alias with own def name
- WEB Remove client freeze when back is dead
- WEB Remove client freeze when back is
- Create new pyOpenRPA UAC Client hierarchy SettingsTemplate.__UACClientAdminCreate__ - need to update functionallity
- Orchestrator WEB: Update WEB to the new UACClient
[1.1.0]
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

Loading…
Cancel
Save