Ext.define("NewComponent.controller.Main",{extend:"Ext.app.Controller",views:["AddNewComponent","IntermediateView","ViewWindow","AddNewRUMComponent","ViewWindow","AddNewNodeComponent"],requires:["NewComponent.view.AddNewComponent","NewComponent.view.IntermediateView","NewComponent.view.ViewWindow","NewComponent.view.AddNewRUMComponent","NewComponent.view.AddNewNodeComponent"],refs:[{selector:"addnewcomponent",ref:"addnewcomponent"},{selector:"addnewrumcomponent",ref:"addnewrumcomponent"},{selector:"addnewnodecomponent",ref:"addnewnodecomponent"},{selector:"intermediateview",ref:"intermediateview"},{selector:"scriptDiv",ref:"scriptDiv"}],init:function(){ctrler=this;
if(serverType=="Real_user_monitor"){this.getController("MainRUM").init();}else{if(serverType=="NodeJS"){this.getController("MainNode").init();}else{this.buildMainData();}}this.control({"addnewcomponent":{"boxready":this.afterMainRender},'addnewcomponent combo[id="addCategory"]':{"select":this.categorySelection},'addnewcomponent combo[id="stype"]':{"select":this.compTypesSelection},'addnewcomponent combo[id="almode"]':{"select":this.remoteModeSelection},'addnewcomponent button[id="addButton"]':{"click":this.addComponent},'intermediateview button[id="hostCheckUpdate"]':{"click":this.hostCheckAddComponent},'intermediateview button[id="hostCheckBack"]':{"click":this.hostCheckBack},'addnewcomponent combo[id="alos"]':{"select":this.remoteOsSelection},'addnewcomponent button[id="backButton"]':{"click":this.addNewBack},'addnewcomponent combo[id="alencrypt"]':{"select":this.remoteEncryptSelection}});
},buildMainData:function(){var a="NewComponent/data/EgNewServerJson.jsp?&serverType="+encodeURIComponent(serverType)+"&selectedServerGroup="+serverCategory;if(currentAction=="add"){a+="&server=new";}else{if(currentAction=="manage"){a="NewComponent/data/EgNewServerJson.jsp?"+qryStr;}else{a+="&server="+encodeURIComponent(server)+"&modifyserver=true";
}}Ext.Ajax.request({url:a,method:"POST",async:false,success:function(b){if(b.status==200&&!Ext.isEmpty(b.responseText)){var c=b.responseText;publicJSON=Ext.decode(c);}}});jsonDataCache=publicJSON;},getData:function(b,a){Ext.Ajax.request({url:b,method:"POST",async:false,success:function(c){var d=c.responseText;
publicJSON=Ext.decode(d);},failure:function(c){}});if(a){jsonDataCache=publicJSON;}},afterMainRender:function(){if(fromTopology=="yes"){Ext.getCmp("backButton").hide();Ext.getCmp("addCategory").setReadOnly(true);Ext.getCmp("stype").setReadOnly(true);Ext.getCmp("hostip").setReadOnly(true);}if(publicJSON.AlertType=="Error"){Ext.Msg.show({title:publicJSON.AlertTitle,msg:publicJSON.AlertMsg,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(w){if(w=="ok"){Ext.getCmp("addCategory").getStore().clearFilter(true);
Ext.getCmp("addCategory").getStore().loadRawData(publicJSON.category);Ext.getCmp("addCategory").setValue("-1");Ext.getCmp("stype").getStore().clearFilter(true);Ext.getCmp("stype").getStore().loadRawData(publicJSON.componentTypes);Ext.getCmp("stype").setValue("-1");Ext.getCmp("addPageContainer").hide();
Ext.getCmp("buttonContainer").hide();return;}}});}var h=publicJSON.serverType;if(h=="Horizon_Pod"){Ext.getCmp("vMwareHorizonPodMsg").show();}else{Ext.getCmp("vMwareHorizonPodMsg").hide();}Ext.getCmp("addCategory").getStore().clearFilter(true);Ext.getCmp("addCategory").getStore().loadRawData(publicJSON.category);
Ext.getCmp("addCategory").setValue(publicJSON.selectedServerGroup);Ext.getCmp("stype").getStore().clearFilter(true);Ext.getCmp("stype").getStore().loadRawData(publicJSON.componentTypes);Ext.getCmp("stype").setValue(publicJSON.serverType);var o=compNick.length;if(publicJSON.serverType=="-1"&&o=="0"){Ext.getCmp("addPageContainer").hide();
Ext.getCmp("buttonContainer").hide();return;}else{if(publicJSON.serverType=="-1"){Ext.getCmp("addPageContainer").hide();Ext.getCmp("buttonContainer").hide();}else{Ext.getCmp("addPageContainer").show();Ext.getCmp("buttonContainer").show();}}Ext.suspendLayouts();Ext.getCmp("extAgents").getStore().loadRawData(publicJSON.externalAgents);
Ext.getCmp("extAgents").setValue(publicJSON.externalAgentsSelected);if(compIp!=null&&compIp!=""){Ext.getCmp("hostip").setValue(compIp);}isMicrosoftType=publicJSON.jsonisMicrosoftType;microsoftComponentkeys=publicJSON.microsoftComponentkeys;microsoftComponentkeysSize=microsoftComponentkeys.length;microsoftSuffixNameValues=publicJSON.microsoftSuffixNameValues;
isTypeHasExternalTests=publicJSON.isTypeHasExternalTests;if(isTypeHasExternalTests){Ext.getCmp("extAgentsContainer").show();}else{Ext.getCmp("extAgentsContainer").hide();}if(isMicrosoftType){microsoftDisplyNames=publicJSON.microsoftDisplyNames;var a=publicJSON.microsofthostSuffixName;Ext.getCmp("hostip").setValue("portal.office.com");
Ext.getCmp("hostnameSuffix").show();var m=Ext.getCmp("extAgents").getWidth();if(m==0){m=295;}var c=((m/6)*5);var s=(m/6);Ext.getCmp("hostname").setWidth(c);Ext.getCmp("hostnameSuffix").setWidth(s-2);Ext.getCmp("hostnameSuffix").setValue(a);}else{var m=Ext.getCmp("extAgents").getWidth();if(m==0){m=295;
}Ext.getCmp("hostip").reset();Ext.getCmp("hostnameSuffix").hide();Ext.getCmp("hostname").setWidth(m);}if(compNick!=null&&compNick!=""){if(isMicrosoftType){var j=compNick.lastIndexOf("_");var k=(compNick.length>4&&j>-1)?compNick.substring(0,j):compNick;Ext.getCmp("hostname").setValue(k);}else{Ext.getCmp("hostname").setValue(compNick);
}}Ext.getCmp("addPageContainer").show();var b=publicJSON.hideHostIPField;if(b==true){Ext.getCmp("hostIpCt").hide();Ext.getCmp("hostip").hide();Ext.getCmp("hostIpTip").hide();}else{Ext.getCmp("hostIpCt").show();Ext.getCmp("hostip").show();Ext.getCmp("hostIpTip").show();}if(publicJSON.serverType=="Oracle_server"){Ext.getCmp("sid").show();
Ext.getCmp("sid").enable();}else{Ext.getCmp("sid").hide();Ext.getCmp("sid").disable();}if(publicJSON.mts){Ext.getCmp("mtsCheck").show();Ext.getCmp("mtsCheck").enable();}else{Ext.getCmp("mtsCheck").hide();Ext.getCmp("mtsCheck").disable();}if(publicJSON.portParam){Ext.getCmp("sportno").show();Ext.getCmp("sportno").enable();
var l=publicJSON.portValue;if(l.indexOf(":")>0){l=l.substring(0,l.indexOf(":"));}Ext.getCmp("sportno").setValue(l);}else{Ext.getCmp("sportno").hide();Ext.getCmp("sportno").disable();}if(publicJSON.isPassiveParam){Ext.getCmp("isPassiveCheck").show();Ext.getCmp("isPassiveCheck").enable();}else{Ext.getCmp("isPassiveCheck").hide();
Ext.getCmp("isPassiveCheck").disable();}var r=publicJSON.isLocal;if(!r&&publicJSON.agentlessOption){Ext.getCmp("agentlessCheckGr").show();Ext.getCmp("enableRemoteAgent").show();Ext.getCmp("enableRemoteAgent").enable();if(publicJSON.agentlessElement=="label"){Ext.getCmp("agentlessCheckGr").show();Ext.getCmp("enableRemoteAgent").setReadOnly(true);
Ext.getCmp("enableRemoteAgent").setValue(true);this.agentlessChange();this.remoteModeSelection();}else{if(publicJSON.agentlessEnabled=="checked"){Ext.getCmp("agentlessCheckGr").show();Ext.getCmp("enableRemoteAgent").setReadOnly(false);Ext.getCmp("enableRemoteAgent").setValue(true);this.agentlessChange();
this.remoteModeSelection();}else{Ext.getCmp("agentlessCheckGr").show();Ext.getCmp("enableRemoteAgent").setReadOnly(false);Ext.getCmp("enableRemoteAgent").setValue(false);Ext.getCmp("alos").hide();Ext.getCmp("alos").disable();Ext.getCmp("almode").hide();Ext.getCmp("almode").disable();Ext.getCmp("remoteAgent").hide();
Ext.getCmp("remoteAgent").disable();Ext.getCmp("sshPort").hide();Ext.getCmp("sshPort").disable();Ext.getCmp("aluser").hide();Ext.getCmp("aluser").disable();Ext.getCmp("alpwd").hide();Ext.getCmp("alpwd").disable();Ext.getCmp("alencrypt").hide();Ext.getCmp("alencrypt").disable();Ext.getCmp("alkeyfile").hide();
Ext.getCmp("alkeyfile").disable();}}}else{Ext.getCmp("agentlessCheckGr").hide();Ext.getCmp("enableRemoteAgent").hide();Ext.getCmp("enableRemoteAgent").disable();Ext.getCmp("alos").hide();Ext.getCmp("alos").disable();Ext.getCmp("almode").hide();Ext.getCmp("almode").disable();Ext.getCmp("remoteAgent").hide();
Ext.getCmp("remoteAgent").disable();Ext.getCmp("sshPort").hide();Ext.getCmp("sshPort").disable();Ext.getCmp("aluser").hide();Ext.getCmp("aluser").disable();Ext.getCmp("alpwd").hide();Ext.getCmp("alpwd").disable();Ext.getCmp("alencrypt").hide();Ext.getCmp("alencrypt").disable();Ext.getCmp("alkeyfile").hide();
Ext.getCmp("alkeyfile").disable();}if(!r&&publicJSON.internalAgentOption){Ext.getCmp("intAgentModeGr").show();Ext.getCmp("intAgentModeGr").enable();Ext.getCmp("intAgentAuto").setValue(true);Ext.getCmp("currAgents").hide();Ext.getCmp("currAgents").disable();}else{Ext.getCmp("intAgentModeGr").hide();Ext.getCmp("intAgentModeGr").disable();
Ext.getCmp("currAgents").hide();Ext.getCmp("currAgents").disable();}Ext.getCmp("cloudVirtual").hide();if(!isMicrosoftType){if(publicJSON.cloudEnv){if(Ext.getCmp("cloudVirtual").isDisabled()){Ext.getCmp("cloudVirtual").show();Ext.getCmp("cloudVirtual").enable();}Ext.getCmp("underCloudCheck").show();Ext.getCmp("underCloudCheck").enable();
Ext.getCmp("cloudServer").getStore().loadRawData(publicJSON.cloudServers);Ext.getCmp("cloudServer").setValue(publicJSON.cloudServerSelected);Ext.getCmp("cloudVirtual").show();}if(publicJSON.virtualEnv){if(Ext.getCmp("cloudVirtual").isDisabled()){Ext.getCmp("cloudVirtual").show();Ext.getCmp("cloudVirtual").enable();
}Ext.getCmp("underVmwareCheck").show();Ext.getCmp("underVmwareCheck").enable();Ext.getCmp("esxServer").getStore().loadRawData(publicJSON.virtualServers);Ext.getCmp("esxServer").setValue(publicJSON.virtualServerSelected);Ext.getCmp("cloudVirtual").show();}}if(currentAction=="modify"){Ext.getCmp("addCategory").setReadOnly(true);
Ext.getCmp("stype").setReadOnly(true);Ext.getCmp("hostip").setValue(publicJSON.hostIPValue);Ext.getCmp("hostip").setReadOnly(true);var t=publicJSON.hostname;if(isMicrosoftType){var j=t.lastIndexOf("_");var k=(t.length>4&&j>-1)?t.substring(0,j):t;Ext.getCmp("hostname").setValue(k);}else{Ext.getCmp("hostname").setValue(t);
}if(publicJSON.sidParam){Ext.getCmp("sid").setValue(publicJSON.sidValue);}if(publicJSON.isPassiveParam){if(publicJSON.isPassiveEnabled=="checked"){Ext.getCmp("isPassive").setValue(true);}else{if(publicJSON.isPassiveDisabled=="checked"){Ext.getCmp("isPassive").setValue(false);}}}if(publicJSON.agentlessEnabled=="checked"||publicJSON.agentlessElement=="label"){Ext.getCmp("agentlessCheckGr").show();
var q=Ext.getCmp("enableRemoteAgent");q.show();q.enable();q.setValue(true);if(publicJSON.agentlessElement=="label"){q.setReadOnly(true);}Ext.getCmp("alos").show();Ext.getCmp("alos").enable();Ext.getCmp("almode").show();Ext.getCmp("almode").enable();if(publicJSON.rmtPortOption){if(publicJSON.rmtEncryptionType){var p=Ext.getCmp("alencrypt");
p.show();p.enable();p.getStore().loadRawData(publicJSON.rmtEncryptOpts);p.setValue(publicJSON.rmtEncryptSelected);}if(publicJSON.rmtKeyFile){var g=Ext.getCmp("alkeyfile");g.show();g.enable();g.setValue(publicJSON.rmtKeyFileValue);}var n=Ext.getCmp("sshPort");var i=Ext.getCmp("aluser");var e=Ext.getCmp("alpwd");
n.show();n.enable();n.setValue(publicJSON.rmtPortValue);i.show();i.enable();i.setValue(publicJSON.rmtUserValue);e.show();e.enable();e.setValue(publicJSON.rmtPwdValue);}Ext.getCmp("remoteAgent").show();Ext.getCmp("remoteAgent").enable();Ext.getCmp("alos").getStore().loadRawData(publicJSON.rmtOS);Ext.getCmp("alos").setValue(publicJSON.rmtOSSelected);
Ext.getCmp("almode").getStore().loadRawData(publicJSON.rmtMode);Ext.getCmp("almode").setValue(publicJSON.rmtModeSelected);Ext.getCmp("remoteAgent").getStore().loadRawData(publicJSON.remoteAgentsList);if(!Ext.isEmpty(remAgentForAgentlessDisc)){Ext.getCmp("remoteAgent").setValue(remAgentForAgentlessDisc);
}else{Ext.getCmp("remoteAgent").setValue(publicJSON.remoteAgentSelected);}}if(publicJSON.internalAgentManual=="checked"){Ext.getCmp("intAgentModeGr").show();Ext.getCmp("intAgentModeGr").enable();Ext.getCmp("intAgentManual").setValue(true);var f=Ext.getCmp("currAgents");f.show();f.enable();f.getStore().loadRawData(publicJSON.internalAgents);
f.setValue(publicJSON.internalAgentSelected);}else{if(publicJSON.internalAgentAuto=="checked"){Ext.getCmp("intAgentModeGr").show();Ext.getCmp("intAgentModeGr").enable();Ext.getCmp("intAgentAuto").setValue(true);Ext.getCmp("currAgents").hide();Ext.getCmp("currAgents").disable();}}if(publicJSON.cloudEnv){if(publicJSON.cloudEnvEnabled=="Yes"){Ext.getCmp("underCloud").setValue(true);
var d=Ext.getCmp("cloudServer");d.show();d.enable();d.getStore().loadRawData(publicJSON.cloudServers);d.setValue(publicJSON.cloudServerSelected);}}if(publicJSON.virtualEnv){if(publicJSON.virtualEnvEnabled=="Yes"){Ext.getCmp("underVmware").setValue(true);var v=Ext.getCmp("esxServer");v.show();v.enable();
v.getStore().loadRawData(publicJSON.virtualServers);v.setValue(publicJSON.virtualServerSelected);}}if(publicJSON.mts){Ext.getCmp("mts").show();Ext.getCmp("mts").disable();if(publicJSON.mtsEnabled=="checked"){Ext.getCmp("mts").setValue(true);}else{Ext.getCmp("mts").setValue(false);}}Ext.getCmp("addButton").setText(label_Update);
}if(currentAction=="manage"){if(publicJSON.serverType=="Real_user_monitor"){Ext.getCmp("rumNickName").setValue(publicJSON.hostname);}Ext.getCmp("hostip").setValue(publicJSON.hostIPValue);Ext.getCmp("hostname").setValue(publicJSON.hostname);if(publicJSON.sidParam){var l=publicJSON.portValue;var u="";if(l.indexOf(":")>0&&publicJSON.serverType=="Oracle_server"){u=l.substring(l.indexOf(":")+1,l.length);
Ext.getCmp("sid").setValue(u);}else{Ext.getCmp("sid").setValue(publicJSON.sidValue);}}if(publicJSON.agentlessEnabled=="checked"){Ext.getCmp("agentlessCheckGr").show();Ext.getCmp("enableRemoteAgent").show();Ext.getCmp("enableRemoteAgent").enable();Ext.getCmp("enableRemoteAgent").setValue(true);Ext.getCmp("alos").show();
Ext.getCmp("alos").enable();Ext.getCmp("almode").show();Ext.getCmp("almode").enable();if(publicJSON.rmtPortOption){if(publicJSON.rmtEncryptionType){var p=Ext.getCmp("alencrypt");p.show();p.enable();p.getStore().loadRawData(publicJSON.rmtEncryptOpts);p.setValue(publicJSON.rmtEncryptSelected);}Ext.getCmp("sshPort").show();
Ext.getCmp("sshPort").enable();Ext.getCmp("sshPort").setValue(publicJSON.rmtPortValue);Ext.getCmp("aluser").show();Ext.getCmp("aluser").enable();Ext.getCmp("aluser").setValue(publicJSON.rmtUserValue);Ext.getCmp("alpwd").show();Ext.getCmp("alpwd").enable();Ext.getCmp("alpwd").setValue(publicJSON.rmtPwdValue);
}Ext.getCmp("remoteAgent").show();Ext.getCmp("remoteAgent").enable();Ext.getCmp("alos").getStore().loadRawData(publicJSON.rmtOS);Ext.getCmp("alos").setValue(publicJSON.rmtOSSelected);Ext.getCmp("almode").getStore().loadRawData(publicJSON.rmtMode);Ext.getCmp("almode").setValue(publicJSON.rmtModeSelected);
Ext.getCmp("remoteAgent").getStore().loadRawData(publicJSON.remoteAgentsList);if(!Ext.isEmpty(remAgentForAgentlessDisc)){Ext.getCmp("remoteAgent").setValue(remAgentForAgentlessDisc);}else{Ext.getCmp("remoteAgent").setValue(publicJSON.remoteAgentSelected);}}}Ext.resumeLayouts(true);},addNewBack:function(){if(fromAPP=="NotificationManager"){window.location.href="/final/admin/EgViewManagerNotificationDetails.jsp?type="+requestType+"&fromWizard="+fromWizard;
}else{if(fromAPP=="ManUnmanSystems"){window.location.href="/final/admin/EgManageServers.jsp?nick="+encodeURIComponent(compNick)+"&fromWizard="+fromWizard;}else{var b=backHref;var a=b.indexOf("?");if(a>-1){b=b.substring(0,a);}b+="?category="+serverCategory+"&comptype="+encodeURIComponent(serverType)+"&fromWizard="+fromWizard;
window.location.href=b;}}},categorySelection:function(){var b=Ext.getCmp("addCategory").getValue();var a="NewComponent/data/EgNewServerJson.jsp?selectedServerGroup="+b;this.getData(a);var c=Ext.getCmp("stype").getStore();c.removeAll();c.clearFilter(true);c.loadRawData(publicJSON.componentTypes);Ext.getCmp("stype").setValue("-1");
Ext.getCmp("addPageContainer").hide();Ext.getCmp("buttonContainer").hide();},compTypesSelection:function(){var c=Ext.getCmp("stype").getValue();c=encodeURIComponent(c);var b=Ext.getCmp("addCategory").getValue();b=encodeURIComponent(b);if(c==-1){Ext.getCmp("addPageContainer").hide();Ext.getCmp("buttonContainer").hide();
return;}var a="NewComponent/data/EgNewServerJson.jsp?selectedServerGroup="+b+"&server=new&serverType="+c;if(c=="Real_user_monitor"){Ext.getCmp("newcomponentview").removeAll();Ext.getCmp("newcomponentview").add({xtype:"addnewrumcomponent"});this.getController("MainRUM").init();this.getController("MainRUM").getData(a,true);
this.getController("MainRUM").afterMainRender();}else{if(c=="NodeJS"){Ext.getCmp("newcomponentview").removeAll();Ext.getCmp("newcomponentview").add({xtype:"addnewnodecomponent"});this.getController("MainNode").init();this.getController("MainNode").getData(a,true);this.getController("MainNode").afterMainRender();
}else{this.getData(a,true);Ext.getCmp("addPageContainer").show();Ext.getCmp("buttonContainer").show();this.afterMainRender();}}},agentlessChange:function(){var b=Ext.getCmp("enableRemoteAgent").getValue();var c=Ext.getCmp("hostname").getValue();if(b&&this.validateHostNameWithRemote(c)){Ext.getCmp("enableRemoteAgent").setValue(false);
return false;}var h=Ext.getCmp("stype").getValue();h=encodeURIComponent(h);var e=Ext.getCmp("addCategory").getValue();e=encodeURIComponent(e);var f="NewComponent/data/EgNewServerJson.jsp?&selectedServerGroup="+e+"&serverType="+h+"&server=new&from=addnew";f+="&enableRemoteAgent="+b;if(currentAction=="manage"){f="NewComponent/data/EgNewServerJson.jsp?&selectedServerGroup="+e+"&serverType="+h+"&enableRemoteAgent="+b+"&from=addnew";
f+="&"+qryStr;}else{if(currentAction=="modify"){f="NewComponent/data/EgNewServerJson.jsp?&selectedServerGroup="+e+"&serverType="+h+"&enableRemoteAgent="+b;f+="&server="+encodeURIComponent(server)+"&modifyserver=true";}}this.getData(f);var d=publicJSON.isLocal;if(b){Ext.getCmp("intAgentModeGr").hide();
Ext.getCmp("intAgentModeGr").disable();Ext.getCmp("currAgents").hide();Ext.getCmp("currAgents").disable();Ext.getCmp("alos").show();Ext.getCmp("alos").enable();Ext.getCmp("alos").getStore().loadRawData(publicJSON.rmtOS);Ext.getCmp("alos").setValue(publicJSON.rmtOSSelected);Ext.getCmp("almode").show();
Ext.getCmp("almode").enable();Ext.getCmp("almode").getStore().loadRawData(publicJSON.rmtMode);Ext.getCmp("almode").setValue(publicJSON.rmtModeSelected);Ext.getCmp("remoteAgent").show();Ext.getCmp("remoteAgent").enable();Ext.getCmp("remoteAgent").getStore().loadRawData(publicJSON.remoteAgentsList);if(!Ext.isEmpty(remAgentForAgentlessDisc)){Ext.getCmp("remoteAgent").setValue(remAgentForAgentlessDisc);
}else{Ext.getCmp("remoteAgent").setValue(publicJSON.remoteAgentSelected);}if(publicJSON.agentlessEnabled=="checked"){this.remoteModeSelection();}}else{Ext.getCmp("alos").hide();Ext.getCmp("alos").disable();Ext.getCmp("almode").hide();Ext.getCmp("almode").disable();Ext.getCmp("remoteAgent").hide();Ext.getCmp("remoteAgent").disable();
if(!Ext.getCmp("sshPort").isDisabled()){Ext.getCmp("sshPort").hide();Ext.getCmp("sshPort").disable();Ext.getCmp("aluser").hide();Ext.getCmp("aluser").disable();Ext.getCmp("alpwd").hide();Ext.getCmp("alpwd").disable();}if(!d&&publicJSON.internalAgentOption){Ext.getCmp("intAgentModeGr").show();Ext.getCmp("intAgentModeGr").enable();
Ext.getCmp("intAgentAuto").setValue(true);}var a=Ext.getCmp("alencrypt");a.hide();a.disable();var g=Ext.getCmp("alkeyfile");g.hide();g.disable();}},remoteModeSelection:function(){var f=Ext.getCmp("almode").getValue();var c=Ext.getCmp("sshPort");var e=Ext.getCmp("aluser");var b=Ext.getCmp("alpwd");var d=Ext.getCmp("alencrypt");
var a=Ext.getCmp("alkeyfile");if(f=="Rexec"){c.show();c.enable();c.setValue("512");e.show();e.enable();e.setValue("None");b.show();b.enable();b.setValue("None");d.hide();d.disable();a.hide();a.disable();}else{if(f=="SSH"){d.show();d.enable();d.getStore().loadRawData(publicJSON.rmtEncryptOpts);d.setValue(publicJSON.rmtEncryptSelected);
c.show();c.enable();c.setValue("22");e.show();e.enable();e.setValue("None");b.show();b.enable();b.setValue("None");}else{d.hide();d.disable();c.hide();c.disable();e.hide();e.disable();b.hide();b.disable();}}},remoteOsSelection:function(){var b=Ext.getCmp("alos").getValue();var c=Ext.getCmp("alencrypt");
var a=Ext.getCmp("alkeyfile");if(b=="other"){Ext.getCmp("almode").setValue("SNMP");}else{if(b=="vmware"||b=="xen"){Ext.getCmp("almode").setValue("Other");}else{if(b!="None"&&b!="nt"&&b!="2003"&&b!="2008"&&b!="w2k"&&b!="xp"&&b!="2012"&&b!="2016"&&b!="2019"&&b!="win7"&&b!="win8"&&b!="win10"){if(b=="SSH"){c.show();
c.enable();}else{c.hide();c.disable();a.hide();a.disable();}Ext.getCmp("almode").setValue("Rexec");Ext.getCmp("sshPort").show();Ext.getCmp("sshPort").enable();Ext.getCmp("sshPort").setValue("512");Ext.getCmp("aluser").show();Ext.getCmp("aluser").enable();Ext.getCmp("aluser").setValue("None");Ext.getCmp("alpwd").show();
Ext.getCmp("alpwd").enable();Ext.getCmp("alpwd").setValue("None");}else{if(b!="None"&&(b=="nt"||b=="2003"||b=="2008"||b=="w2k"||b=="xp"||b=="2012"||b=="2016"||b=="2019"||b=="win7"||b=="win8"||b=="win10")){Ext.getCmp("almode").setValue("Perfmon");Ext.getCmp("sshPort").hide();Ext.getCmp("sshPort").disable();
Ext.getCmp("aluser").hide();Ext.getCmp("aluser").disable();Ext.getCmp("alpwd").hide();Ext.getCmp("alpwd").disable();c.hide();c.disable();a.hide();a.disable();}else{if(b=="None"){Ext.getCmp("almode").setValue("None");Ext.getCmp("sshPort").hide();Ext.getCmp("sshPort").disable();Ext.getCmp("aluser").hide();
Ext.getCmp("aluser").disable();Ext.getCmp("alpwd").hide();Ext.getCmp("alpwd").disable();c.hide();c.disable();a.hide();a.disable();}}}}}},remoteEncryptSelection:function(){var b=Ext.getCmp("alencrypt").getValue();var a=Ext.getCmp("alkeyfile");if(b=="Keybased"){a.show();a.enable();}else{a.hide();a.disable();
}},internalAssignChange:function(){var b=Ext.getCmp("intAgentAuto").getValue();var a="auto";if(!b){a="manual";}var e=Ext.getCmp("stype").getValue();e=encodeURIComponent(e);var c=Ext.getCmp("addCategory").getValue();c=encodeURIComponent(c);var d="NewComponent/data/EgNewServerJson.jsp?agentmap="+a+"&enableRemoteAgent=false&selectedServerGroup="+c+"&serverType="+e+"&server=new&from=addnew";
if(currentAction=="manage"){d+="&"+qryStr;}else{if(currentAction=="modify"){d="NewComponent/data/EgNewServerJson.jsp?agentmap="+a+"&enableRemoteAgent=false&selectedServerGroup="+c+"&serverType="+e;d+="&server="+encodeURIComponent(server)+"&modifyserver=true";}}this.getData(d);if(!b){Ext.getCmp("currAgents").show();
Ext.getCmp("currAgents").enable();Ext.getCmp("currAgents").getStore().loadRawData(publicJSON.internalAgents);Ext.getCmp("currAgents").setValue(publicJSON.internalAgents[0].displayField);}else{Ext.getCmp("currAgents").hide();Ext.getCmp("currAgents").disable();}},virtualEnvChange:function(){var a="false";
if(Ext.getCmp("underVmware").getValue()){a="true";var d=Ext.getCmp("stype").getValue();d=encodeURIComponent(d);var b=Ext.getCmp("addCategory").getValue();b=encodeURIComponent(b);var c="NewComponent/data/EgNewServerJson.jsp?underVmware="+a+"&selectedServerGroup="+b+"&serverType="+d+"&server=new&from=addnew";
this.getData(c);Ext.getCmp("esxServer").show();Ext.getCmp("esxServer").enable();Ext.getCmp("esxServer").getStore().loadRawData(publicJSON.virtualServers);Ext.getCmp("esxServer").setValue(publicJSON.virtualServerSelected);}else{Ext.getCmp("esxServer").hide();Ext.getCmp("esxServer").disable();}},cloundEnvChange:function(){var a="false";
if(Ext.getCmp("underCloud").getValue()){a="true";var d=Ext.getCmp("stype").getValue();d=encodeURIComponent(d);var b=Ext.getCmp("addCategory").getValue();b=encodeURIComponent(b);var c="NewComponent/data/EgNewServerJson.jsp?underCloud="+a+"&selectedServerGroup="+b+"&serverType="+d+"&server=new&from=addnew";
this.getData(c);Ext.getCmp("cloudServer").show();Ext.getCmp("cloudServer").enable();Ext.getCmp("cloudServer").getStore().loadRawData(publicJSON.cloudServers);Ext.getCmp("cloudServer").setValue(publicJSON.cloudServerSelected);}else{Ext.getCmp("cloudServer").hide();Ext.getCmp("cloudServer").disable();}},specificCompWindow:function(f,q,h){var b=this;
var r="";var s="";var g=f;var a=publicJSON.host_Name;for(var e=0;e<microsoftComponentkeysSize;e++){var n=microsoftComponentkeys[e];if(f==n){g=microsoftDisplyNames[e];s=microsoftSuffixNameValues[e];break;}}if(h==""&&h.length==0){a=Ext.getCmp("hostname").getValue();s=Ext.getCmp("hostnameSuffix").getValue();
if(a!=null&&a!==undefined){r=a;}a+=s;}var l=(q!=null&&q!=undefined&&q.length>0);if(l){checkboxes=[];d+=" "+alertMsg55;var o=q.split(",");for(var c=0;c<o.length;c++){sType=o[c];for(var e=0;e<=microsoftComponentkeysSize;e++){var n=microsoftComponentkeys[e];var p=microsoftSuffixNameValues[e];var k=microsoftDisplyNames[e];
if(sType==n){checkboxes.push({boxLabel:k,name:p,id:p,inputValue:"yes",cls:"checkbt",checked:true,});}}}}if(currentAction=="modify"){var d="The "+g+" component ("+a+") has been modified successfully. ";var m=alertMsg52;}else{var d="The "+g+" component ("+a+") has been added successfully. ";var m=alertMsg51;
}if(l){Ext.widget("window",{extend:"Ext.window.Window",title:pageTitle,id:"specificCompWin",closeAction:"destory",modal:true,ghost:false,padding:8,doClose:function(){this.destroy();var i="/final/admin/EgDispServer.jsp?&category=-1&comptype="+encodeURIComponent(f)+"&fromWizard="+fromWizard;window.location.href=i;
},dockedItems:[{dock:"bottom",layout:{type:"hbox",align:"stretch",pack:"center"},border:false,padding:"10 0 5 0",items:[{xtype:"button",text:"OK",width:80,cls:"quickMenuWhiteButton",id:"proceed",name:"proceed",handler:function(){var t="";var x=checkboxes.length;for(var w=0;w<x;w++){var v=checkboxes[w].id;
var j=Ext.getCmp(v).getValue();if(j){t+=v+",";}}if(t.length>0){t=t.substring(0,t.length-1);b.addSpecificComponent(t,h);}else{Ext.getCmp("specificCompWin").destroy();var u="/final/admin/EgDispServer.jsp?&category=-1&comptype="+encodeURIComponent(f)+"&fromWizard="+fromWizard;window.location.href=u;}}}]}],items:[{xtype:"container",layout:{type:"vbox",pack:"start",align:"stretch"},margin:5,items:[{xtype:"label",id:"dispAlert1",cls:"x-form-item",margin:"5 5 10 4",text:d},{xtype:"fieldcontainer",id:"specificCompChkGrpCnt",layout:{type:"auto"},defaults:{labelSeparator:""},items:[{xtype:"checkboxgroup",fieldLabel:m+"&nbsp;'"+r+"'?",columns:1,vertical:true,labelAlign:"top",id:"specificCompChkGrp",name:"chkt123",flex:1,items:checkboxes}]}]}]}).show();
}else{Ext.Msg.show({title:pageTitle,msg:d,id:"compModConfirmBox",icon:"iconInformation",buttons:Ext.Msg.OK,fn:function(i){if(i=="ok"||i=="yes"||i=="cancel"){var j="/final/admin/EgDispServer.jsp?&category=-1&comptype="+encodeURIComponent(f)+"&fromWizard="+fromWizard;window.location.href=j;}}});}},addSpecificComponent:function(d,h){var b=this;
if(d!=null&&d.length>0){var g="/final/admin/NewComponent/data/EgspecificserverpJson.jsp?server=new&serverType=-1&from=addnew&treeViewSrc=null&serverGategory=-1"+"&compIp="+publicJSON.host_IP+"&compNick="+encodeURIComponent(publicJSON.host_Name)+"&fromWizard="+fromWizard+"&checkBoxValues="+encodeURIComponent(d);
if(currentAction=="modify"){g="/final/admin/NewComponent/data/EgspecificserverpJson.jsp?modifyserver=true&checkBoxValues="+encodeURIComponent(d);}var e=publicJSON.hiddenVals;var f=Ext.getCmp("hiddenContnr");var a=new Ext.LoadMask(Ext.getBody(),{msg:updating+"..."});a.show();var c=(h=="intermediate")?this.getIntermediateview():this.getAddnewcomponent();
c.submit({url:g,method:"POST",timeout:120,success:function(k,n){a.hide();var x=n.response.responseText;publicJSON=Ext.decode(x);var m=publicJSON.errRespType;var q=publicJSON.compType;var r="";var t=publicJSON["Result_info"];if(currentAction=="modify"){var s=q;for(var o=0;o<microsoftComponentkeysSize;
o++){var y=microsoftComponentkeys[o];if(q==y){s=microsoftDisplyNames[o];break;}}var l=publicJSON.host_Name;if(h==""&&h.length==0){l=Ext.getCmp("hostname").getValue();var A=Ext.getCmp("hostnameSuffix").getValue();l+=A;}r="The "+s+" component ("+l+") has been modified successfully.<br/>";}if(t!=null&&t!==undefined){r+=(currentAction=="modify")?(alertMsg55+t):t;
}var w=publicJSON.resp_type_size;var z=parseInt(w);for(var j=1;j<=z;j++){var v=publicJSON["Error_Info_"+j];if(v!=null&&v!==undefined){if(j==1){r+=publicJSON["Error_Info_"+j]["Error_Msg_A_"+j];}else{r+="</br>"+publicJSON["Error_Info_"+j]["Error_Msg_A_"+j];}var u=publicJSON["Error_Info_"+j]["Error_Msg_B_"+j];
if(u!=null&&u!==undefined){r+=u;}}}Ext.Msg.show({title:pageTitle,msg:r,id:"compConfirmBox",icon:"iconInformation",buttons:Ext.Msg.OK,fn:function(i){if(i=="ok"||i=="yes"||i=="cancel"){var p="/final/admin/EgDispServer.jsp?&category=-1&comptype="+encodeURIComponent(q)+"&fromWizard="+fromWizard;window.location.href=p;
}}});},failure:function(i,j){a.hide();switch(j.failureType){case Ext.form.action.Action.CLIENT_INVALID:Ext.Msg.alert("Failure",alertMsg33+". Form fields may not be submitted with invalid values");break;case Ext.form.action.Action.CONNECT_FAILURE:Ext.Msg.alert("Failure",alertMsg33+". Ajax communication failed");
break;case Ext.form.action.Action.SERVER_INVALID:Ext.Msg.alert("Failure",alertMsg33+". "+j.result.msg);}}});}},addComponent:function(a){var b=this.addComponentValidation();if(!b){return;}},actualAdd:function(){var d=this;var b=true;var a=Ext.getCmp("stype").getValue();var c="";d.addServerComponent(b," ");
},addServerComponent:function(a,e){var j=e;var f=Ext.getCmp("stype").getValue();if(a){var h=this;var d=Ext.getCmp("alpwd").getValue();var g="/final/admin/NewComponent/data/EgHostCheckJson.jsp?strPass=&from=addNew&server=new&isAggregateType=false&alpwd="+encodeURIComponent(filterEncode(d));if(currentAction=="modify"){var b=publicJSON.hiddenVals["$_alpwd"];
g="/final/admin/NewComponent/data/EgHostCheckJson.jsp?isAggregateType=false&modifyserver=true&alpwd="+encodeURIComponent(filterEncode(d))+"&$_alpwd="+encodeURIComponent(filterEncode(b));}if(fromTopology!=null&&fromTopology=="yes"){g+="&frmTopology="+fromTopology+"&topoSegName=Topo_Auto&frmPage="+frmPage;
}var k=publicJSON.hiddenVals;if(f=="Real_user_monitor"){g+=j;k=rumHiddenField;}var i=Ext.getCmp("hiddenContnr");i.removeAll();Ext.suspendLayouts();for(var c in k){i.add({xtype:"hidden",name:c,value:k[c]});}Ext.resumeLayouts(true);var l=new Ext.LoadMask(Ext.getBody(),{msg:updating+"..."});l.show();this.getAddnewcomponent().submit({url:g,method:"POST",timeout:120,success:function(m,q){l.hide();
var v=q.response.responseText;publicJSON=Ext.decode(v);var x=publicJSON.requestStatus;if(x=="failed"){if(publicJSON.error_type=="alert"){var u=publicJSON.error_Info.compTypes;if(!Ext.isEmpty(u)){Ext.Msg.show({title:publicJSON.error_Info.error_Title,msg:publicJSON.error_Info.error_Msg_1+"<br>Host IP/Name : "+publicJSON.error_Info.IP+"<br>Nick name : "+publicJSON.error_Info.nickName+"<br>"+u+"<br>"+publicJSON.error_Info.error_Msg_2,buttons:Ext.Msg.OK,icon:"iconExclamation"});
}else{Ext.Msg.show({title:publicJSON.error_Info.error_Title,msg:alertMsg33+"<br>"+publicJSON.error_Info.error_Msg_1+"<br>"+publicJSON.error_Info.error_Msg_2,buttons:Ext.Msg.OK,icon:"iconExclamation"});}publicJSON=jsonDataCache;}else{if(publicJSON.error_type=="radio"){var s=Ext.getCmp("newcomponentview");
s.removeAll();s.add({xtype:"intermediateview"});Ext.getCmp("intermediategrid").setTitle(publicJSON.main_Msg_Title);Ext.getCmp("intermediategrid").getStore().loadRawData(publicJSON.gridData);var r=Ext.getCmp("radioOne");var n=Ext.getCmp("radioTwo");Ext.getCmp("radioOpts").setFieldLabel(publicJSON.radio_Msg_Title);
r.boxLabelEl.update(publicJSON.radio1_Msg);n.boxLabelEl.update(publicJSON.radio2_Msg);r.inputValue=publicJSON.radio1_value;n.enable();if(publicJSON.radio2_enable=="disabled"){n.disable();}if(publicJSON.radio1_checked){r.setValue(true);}}else{if(publicJSON.error_type=="confirm"){Ext.Msg.show({title:publicJSON.error_Info.error_Title,msg:publicJSON.error_Info.error_Msg_1+"<br>Host IP/Name : "+publicJSON.error_Info.IP+"<br>Nick name : "+publicJSON.error_Info.nickName+"<br>"+publicJSON.error_Info.compTypes+"<br>"+publicJSON.error_Info.error_Msg_2,buttons:Ext.Msg.YESNO,icon:"iconConfirmation",fn:function(F){if(F=="yes"){var G=publicJSON.error_Info.forward_URL;
var z=publicJSON.error_Info.IP;var B=publicJSON.error_Info.nickName;var J=publicJSON.hiddenValues;var H=Ext.getCmp("hiddenContnr");H.removeAll();Ext.suspendLayouts();for(var E in J){var I=J[E];if(E=="hostip"){I=z;}else{if(E=="hostname"){I=B;}}H.add({xtype:"hidden",name:E,value:I});}Ext.resumeLayouts(true);
G="/final/admin/NewComponent/data/"+G;h.forwardGivenURL(G);}else{Ext.getCmp("hostname").setValue("");var C=encodeURIComponent(f);var D=Ext.getCmp("addCategory").getValue();D=encodeURIComponent(D);var A="NewComponent/data/EgNewServerJson.jsp?selectedServerGroup="+D+"&server=new&serverType="+C;ctrler.getData(A,true);
}}});}else{if(publicJSON.error_type=="confirmNickSuggestion"){Ext.Msg.show({title:publicJSON.error_Info.error_Title,msg:alertMsg33+"<br>"+publicJSON.error_Info.error_Msg_1+"<br>"+publicJSON.error_Info.error_Msg_2,buttons:Ext.Msg.YESNO,icon:"iconConfirmation",fn:function(F){if(F=="yes"){var G=publicJSON.error_Info.forward_URL;
var z=publicJSON.error_Info.IP;var B=publicJSON.error_Info.nickName;var J=publicJSON.hiddenValues;var H=Ext.getCmp("hiddenContnr");H.removeAll();Ext.suspendLayouts();for(var E in J){var I=J[E];if(E=="hostip"){I=z;}else{if(E=="hostname"){I=B;}}H.add({xtype:"hidden",name:E,value:I});}Ext.resumeLayouts(true);
G="/final/admin/NewComponent/data/"+G;h.forwardGivenURL(G);}else{Ext.getCmp("hostname").focus();var C=encodeURIComponent(f);var D=Ext.getCmp("addCategory").getValue();D=encodeURIComponent(D);var A="NewComponent/data/EgNewServerJson.jsp?selectedServerGroup="+D+"&server=new&serverType="+C;ctrler.getData(A,true);
}}});}}}}}else{if(x=="success"){var o=publicJSON.CompoAlreadyAssoUser;if(publicJSON.forward){if(publicJSON.AlreadyAsoociatedFlag){Ext.Msg.show({title:pageTitle,msg:nickShareMsg1+" ("+o+"). "+nickShareMsg2+". "+nickShareMsg3,buttons:Ext.Msg.OKCANCEL,icon:"iconConfirmation",fn:function(z){if(z=="ok"){o=publicJSON.CompoAlreadyAssoUser;
var D=publicJSON.forward_URL;var B=publicJSON.hiddenValues;var C=Ext.getCmp("hiddenContnr");C.removeAll();for(var E in B){C.add({xtype:"hidden",name:E,value:B[E]});}Ext.resumeLayouts(true);D="/final/admin/NewComponent/data/"+D+"&AlreadyAsoociatedUserList="+o;h.forwardGivenURL(D);}else{var A="NewComponent/data/EgNewServerJson.jsp?&serverType="+encodeURIComponent(serverType)+"&selectedServerGroup="+serverCategory;
Ext.Ajax.request({url:A,method:"POST",async:false,success:function(F){if(F.status==200&&!Ext.isEmpty(F.responseText)){var G=F.responseText;publicJSON=Ext.decode(G);}}});}}});}else{var t=publicJSON.forward_URL;var y=publicJSON.hiddenValues;var w=Ext.getCmp("hiddenContnr");w.removeAll();Ext.suspendLayouts();
for(var p in y){w.add({xtype:"hidden",name:p,value:y[p]});}Ext.resumeLayouts(true);t="/final/admin/NewComponent/data/"+t;h.forwardGivenURL(t);}}}}},failure:function(m,n){l.hide();switch(n.failureType){case Ext.form.action.Action.CLIENT_INVALID:Ext.Msg.alert("Failure",alertMsg33+". Form fields may not be submitted with invalid values");
break;case Ext.form.action.Action.CONNECT_FAILURE:Ext.Msg.alert("Failure",alertMsg33+". Ajax communication failed");break;case Ext.form.action.Action.SERVER_INVALID:Ext.Msg.alert("Failure",alertMsg33+". "+n.result.msg);}}});}},forwardGivenURL:function(d){var e=window.parent;var b=alertMsg34;if(currentAction=="modify"){b=alertMsg35;
}var c=this;var a=new Ext.LoadMask(Ext.getBody(),{msg:updating+"..."});a.show();this.getAddnewcomponent().submit({url:d,method:"POST",timeout:120,success:function(g,h){a.hide();var l=h.response.responseText;var i=Ext.decode(l);var k=i["requestStatus"];if(k=="success"){if(fromTopology=="yes"){Ext.Msg.show({title:pageTitle,msg:alertMsg42,buttons:Ext.Msg.OK,icon:"iconInformation",fn:function(m){if(m=="ok"){e.closedManagedWindow();
}}});}else{var f=i.compType;var j=i.remainingTypes;if(isMicrosoftType){c.specificCompWindow(f,j,"");}else{if(currentAction=="modify"){Ext.Msg.show({title:pageTitle,msg:b+"<br>"+alertMsg43,buttons:Ext.Msg.YESNO,icon:"iconInformation",fn:function(m){if(m=="yes"||m=="ok"){var n="/final/admin/EgNewServer.jsp?server=new&serverType=-1&from=addnew&isAggregateLink=false&treeViewSrc=null&serverGategory=-1";
n+="&compIp="+i.host_IP+"&compNick="+encodeURIComponent(i.host_Name)+"&fromWizard="+fromWizard;window.location.href=n;}else{if(fromAPP=="ManUnmanSystems"){window.location.href="/final/admin/EgManageServers.jsp?nick="+encodeURIComponent(compNick)+"&fromWizard="+fromWizard;}else{if(fromAPP=="wizard"){window.location.href="/final/admin/EgAdminOperations.jsp?fromAction="+fromWizard+"&server="+encodeURIComponent(wizCType);
}else{var n="/final/admin/EgDispServer.jsp?&category=-1&comptype="+encodeURIComponent(f)+"&fromWizard="+fromWizard;window.location.href=n;}}}}});}else{Ext.Msg.show({title:pageTitle,msg:b+"<br>"+alertMsg43,buttons:Ext.Msg.YESNO,id:"compConfirmBox",icon:"iconConfirmation",fn:function(m){if(m=="yes"||m=="ok"){var n="/final/admin/EgNewServer.jsp?server=new&serverType=-1&from=addnew&isAggregateLink=false&treeViewSrc=null&serverGategory=-1";
n+="&compIp="+i.host_IP+"&compNick="+encodeURIComponent(i.host_Name)+"&fromWizard="+fromWizard;if(fromAPP=="ManUnmanSystems"){n+="&fromAPP=ManUnmanSystems";}else{if(fromAPP=="wizard"){n+="&fromAPP="+fromAPP+"&wizCType="+encodeURIComponent(wizCType);}}window.location.href=n;}else{if(fromAPP=="ManUnmanSystems"){window.location.href="/final/admin/EgManageServers.jsp?nick="+encodeURIComponent(compNick)+"&fromWizard="+fromWizard;
}else{if(fromAPP=="wizard"||fromWizard=="componentsGlance_unconfigured"||fromWizard=="componentsGlance_configured"||fromWizard=="componentsGlance"){if(wizCType==null||wizCType=="null"||wizCType==undefined||wizCType==""){wizCType=f;}window.location.href="/final/admin/EgAdminOperations.jsp?fromAction="+fromWizard+"&server="+encodeURIComponent(wizCType);
}else{var n="/final/admin/EgDispServer.jsp?&category=-1&comptype="+encodeURIComponent(f)+"&fromWizard="+fromWizard;window.location.href=n;}}}}});}}}}else{if(k=="failed"){var l=h.response.responseText;var i=Ext.decode(l);var k=i["requestStatus"];Ext.Msg.show({title:i.Error_Title,msg:alertMsg33+"<br>"+i.Error_Info.Error_Msg_1+"<br>"+i.Error_Info.Error_Msg_2,buttons:Ext.Msg.OK,icon:"iconError",fn:function(m){if(m=="ok"){if(fromTopology=="yes"){e.closedManagedWindow();
}else{var n="/final/admin/EgDispServer.jsp?&category=-1&comptype=-1&fromWizard="+fromWizard;window.location.href=n;}}}});}}},failure:function(f,g){a.hide();switch(g.failureType){case Ext.form.action.Action.CLIENT_INVALID:Ext.Msg.alert("Failure",alertMsg33+". Form fields may not be submitted with invalid values");
break;case Ext.form.action.Action.CONNECT_FAILURE:Ext.Msg.alert("Failure",alertMsg33+". Ajax communication failed");break;case Ext.form.action.Action.SERVER_INVALID:Ext.Msg.alert("Failure",alertMsg33+". "+g.result.msg);}}});},hostCheckAddComponent:function(){AlreadyAsoociatedUserList=publicJSON.CompoAlreadyAssoUser;
var a=this;var c=Ext.getCmp("radioOpts").getValue().notify;var b="NewComponent/data/EgnewserverpJson.jsp?action="+c;if(publicJSON.AlreadyAsoociatedFlag){Ext.Msg.show({title:pageTitle,msg:nickShareMsg1+" ("+AlreadyAsoociatedUserList+"). "+nickShareMsg2+". "+nickShareMsg3,buttons:Ext.Msg.OKCANCEL,icon:"iconConfirmation",fn:function(d){var f="";
if(d=="ok"){f=publicJSON.CompoAlreadyAssoUser;b=b+"&AlreadyAsoociatedUserList="+f;a.forwardHostCheckAddComponent(b);}else{var e="/final/admin/EgNewServer.jsp?server=new&serverType="+encodeURIComponent(publicJSON.selectedServer)+"&from=addnew&isAggregateLink=false&treeViewSrc=null&serverGategory=-1";window.location.href=e;
}}});}else{a.forwardHostCheckAddComponent(b);}},forwardHostCheckAddComponent:function(f){var d=this;var c=publicJSON.hiddenValues;var e=Ext.getCmp("hiddenContnr2");e.removeAll();Ext.suspendLayouts();for(var g in c){e.add({xtype:"hidden",name:g,value:c[g]});}Ext.resumeLayouts(true);var b=alertMsg34;if(currentAction=="modify"){b=alertMsg35;
}var a=new Ext.LoadMask(Ext.getBody(),{msg:updating+"..."});a.show();this.getIntermediateview().submit({url:f,method:"POST",timeout:120,success:function(i,j){a.hide();var l=j.response.responseText;publicJSON=Ext.decode(l);var k=publicJSON["requestStatus"];if(k=="success"){var h=publicJSON.compType;if(h==null||h==undefined){h=publicJSON.selectedServer;
}if(currentAction=="modify"){Ext.Msg.show({title:pageTitle,msg:b+"<br>"+alertMsg43,buttons:Ext.Msg.YESNO,icon:"iconInformation",fn:function(m){if(m=="yes"){var n="/final/admin/EgNewServer.jsp?server=new&serverType=-1&from=addnew&isAggregateLink=false&treeViewSrc=null&serverGategory=-1";n+="&compIp="+publicJSON.host_IP+"&compNick="+encodeURIComponent(publicJSON.host_Name)+"&fromWizard="+fromWizard;
if(fromAPP=="wizard"){n+="&fromAPP="+fromAPP+"&wizCType="+encodeURIComponent(wizCType);}window.location.href=n;}else{var n="/final/admin/EgDispServer.jsp?&category="+publicJSON.selectedServerGroup+"&comptype="+encodeURIComponent(publicJSON.selectedServer)+"&fromWizard="+fromWizard;window.location.href=n;
}}});}else{if(fromTopology=="yes"){Ext.Msg.show({title:pageTitle,msg:b,buttons:Ext.Msg.OK,icon:"iconConfirmation",fn:function(m){if(m=="ok"){window.parent.closedManagedWindow();}}});}else{Ext.Msg.show({title:pageTitle,msg:b+"<br>"+alertMsg43,buttons:Ext.Msg.YESNO,icon:"iconConfirmation",fn:function(m){if(m=="yes"){var n="/final/admin/EgNewServer.jsp?server=new&serverType=-1&from=addnew&isAggregateLink=false&treeViewSrc=null&serverGategory=-1";
n+="&compIp="+publicJSON.host_IP+"&compNick="+encodeURIComponent(publicJSON.host_Name)+"&fromWizard="+fromWizard;if(fromAPP=="wizard"){n+="&fromAPP="+fromAPP+"&wizCType="+encodeURIComponent(wizCType);}window.location.href=n;}else{if(fromAPP=="wizard"){window.location.href="/final/admin/EgAdminOperations.jsp?fromAction="+fromWizard+"&server="+encodeURIComponent(wizCType);
}else{var n="/final/admin/EgDispServer.jsp?&category="+publicJSON.selectedServerGroup+"&comptype="+encodeURIComponent(publicJSON.selectedServer)+"&fromWizard="+fromWizard;window.location.href=n;}}}});}}}else{if(k=="failed"){Ext.Msg.show({title:publicJSON.Error_Info.Error_Title,msg:alertMsg33+"<br>"+publicJSON.Error_Info.Error_Msg_1+"<br>"+publicJSON.Error_Info.Error_Msg_2,buttons:Ext.Msg.OK,icon:"iconError",fn:function(m){if(m=="ok"){if(fromTopology=="yes"){window.parent.closedManagedWindow();
}else{if(fromAPP=="wizard"){window.location.href="/final/admin/EgAdminOperations.jsp?fromAction="+fromWizard+"&server="+encodeURIComponent(wizCType);}else{var n="/final/admin/EgDispServer.jsp?&category="+publicJSON.selectedServerGroup+"&comptype="+encodeURIComponent(publicJSON.selectedServer)+"&fromWizard="+fromWizard;
window.location.href=n;}}}}});}}},failure:function(h,i){a.hide();switch(i.failureType){case Ext.form.action.Action.CLIENT_INVALID:Ext.Msg.alert("Failure",alertMsg33+". Form fields may not be submitted with invalid values");break;case Ext.form.action.Action.CONNECT_FAILURE:Ext.Msg.alert("Failure",alertMsg33+". Ajax communication failed");
break;case Ext.form.action.Action.SERVER_INVALID:Ext.Msg.alert("Failure",alertMsg33+". "+i.result.msg);}}});},addComponentValidation:function(){var m=this;var u=Ext.getCmp("stype").getValue();var r=Ext.getCmp("hostname");var S=Ext.getCmp("hostname").getValue();var I=Ext.getCmp("hostnameSuffix");if(I!=null&&I!=undefined){var a=I.getValue();
S+=a;}for(var O=0;O<microsoftComponentkeysSize;O++){var P=microsoftComponentkeys[O];var J=microsoftSuffixNameValues[O];if(u==P&&!checkForNameWithSuffix(S,J)){Ext.Msg.show({title:pageTitle,msg:alertMsg50,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){r.focus(true);}}});return false;
break;}}var u=Ext.getCmp("stype").getValue();var q=Ext.getCmp("enableRemoteAgent").getValue();if(isDoubleByteMgr=="false"){if(!validateSingleByte(S)){Ext.Msg.show({title:pageTitle,msg:alertMsg1,buttons:Ext.Msg.OK,icon:"iconExclamation",width:700,fn:function(i){if(i=="ok"){r.focus(true);}}});return false;
}}var H="";if(u.indexOf("_")>0){H=(u.substring(0,u.indexOf("_"))=="Agg");if(H){if(!checkblank(S)){Ext.Msg.show({title:pageTitle,msg:alertMsg22,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){r.focus(true);}}});return false;}}}var n=Ext.getCmp("extAgents").getValue().toString();if(isTypeHasExternalTests&&(n==""||n.toLowerCase()=="not applicable")){Ext.Msg.show({title:pageTitle,msg:alertMsg7,buttons:Ext.Msg.OK,layout:"auto",icon:"iconExclamation",fn:function(i){if(i=="ok"){}}});
return false;}if(q){var x=Ext.getCmp("remoteAgent").getValue().toString();if(x==""||x.toLowerCase()=="not applicable"){Ext.Msg.show({title:pageTitle,msg:alertMsg61,buttons:Ext.Msg.OK,layout:"auto",icon:"iconExclamation",fn:function(i){if(i=="ok"){}}});return false;}}var B=Ext.getCmp("alos");if(!B.isDisabled()){var c=B.getValue();
if(c=="None"){Ext.Msg.show({title:pageTitle,msg:alertMsg2,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){B.focus(true);}}});return false;}var e=Ext.getCmp("almode");var E=e.getValue();if(E=="None"){Ext.Msg.show({title:pageTitle,msg:alertMsg3,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){e.focus(true);
}}});return false;}else{if(E=="Perfmon"&&c!="nt"&&c!="2003"&&c!="2008"&&c!="w2k"&&c!="xp"&&c!="2012"&&c!="2016"&&c!="2019"&&c!="win7"&&c!="win8"&&c!="win10"){Ext.Msg.show({title:pageTitle,msg:alertMsg4,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){e.focus(true);}}});return false;
}else{if((E=="SSH"||E=="Rexec")&&(c=="nt"||c=="2003"||c=="2008"||c=="w2k"||c=="xp"||c=="2012"||c=="2016"||c=="2019"||c=="win7"||c=="win8"||c=="win10")){Ext.Msg.show({title:pageTitle,msg:E+" "+alertMsg5,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){e.focus(true);}}});return false;
}else{if(E!="SNMP"&&(u=="AS400_server"||u=="Snmp_generic_server"||u=="Netware_server")){Ext.Msg.show({title:pageTitle,msg:alertMsg6,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){e.focus(true);}}});return false;}else{if(E=="SSH"){var y=Ext.getCmp("alencrypt").getValue();if(y=="Keybased"){var G=Ext.getCmp("alkeyfile");
var z=G.getValue();if(z==""||z.toLowerCase()=="none"){Ext.Msg.show({title:pageTitle,msg:alertMsg40,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){G.focus(true);}}});return false;}}}}}}}}var D=Ext.getCmp("sshPort");if(!D.isDisabled()){var d=D.getValue();if(!checkblank(d)){Ext.Msg.show({title:pageTitle,msg:alertMsg8,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){D.focus(true);
}}});return false;}else{if(!checknumber("+",d)){Ext.Msg.show({title:pageTitle,msg:alertMsg9,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){D.focus(true);}}});return false;}else{if(!checkfordecimal(d)){Ext.Msg.show({title:pageTitle,msg:alertMsg10,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){D.focus(true);
}}});return false;}else{if(d<1){Ext.Msg.show({title:pageTitle,msg:alertMsg11,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){D.focus(true);}}});return false;}else{if(d>99999){Ext.Msg.show({title:pageTitle,msg:alertMsg12,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){D.focus(true);
}}});return false;}else{if(!checkspace(d)){Ext.Msg.show({title:pageTitle,msg:alertMsg13,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){D.focus(true);}}});return false;}}}}}}}if(!Ext.getCmp("aluser").isDisabled()&&!Ext.getCmp("alpwd").isDisabled()){if(!this.checkUserPwd()){return false;
}}var Q=Ext.getCmp("hostip");var o=Ext.getCmp("hostip").getValue();if(!publicJSON.hideHostIPField&&!checkblank(o)){if(isAllowHostName=="false"){Ext.Msg.show({title:pageTitle,msg:alertMsg18,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);}}});}else{Ext.Msg.show({title:pageTitle,msg:alertMsg19,buttons:Ext.Msg.OK,width:300,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);
}}});}return false;}else{if(!publicJSON.hideHostIPField&&isAllowHostName=="false"&&validateIpAddressExtjs(o)!="0"){var v=validateIpAddressExtjs(o);if(v=="1"){Ext.Msg.show({title:pageTitle,msg:_checkIp,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);}}});return false;
}else{if(v=="5"){Ext.Msg.show({title:pageTitle,msg:_checkspaceIp,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);}}});return false;}else{if(v=="6"){Ext.Msg.show({title:pageTitle,msg:_checkAlpha,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);
}}});return false;}else{if(v=="7"){Ext.Msg.show({title:pageTitle,msg:_checkspecial,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);}}});return false;}else{if(v=="8"){Ext.Msg.show({title:pageTitle,msg:_valIp,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);
}}});return false;}else{if(v=="9"){Ext.Msg.show({title:pageTitle,msg:_validateIp,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);}}});return false;}else{if(v=="10"){Ext.Msg.show({title:pageTitle,msg:_checknum,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);
}}});return false;}}}}}}}}else{if(!publicJSON.hideHostIPField&&isAllowHostName=="true"&&validateHostFieldExtjs(o)!="0"){var v=validateHostFieldExtjs(o);if(v=="1"){Ext.Msg.show({title:pageTitle,msg:_checkIp,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);}}});return false;
}else{if(v=="5"){Ext.Msg.show({title:pageTitle,msg:_checkspaceIp,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);}}});return false;}else{if(v=="6"){Ext.Msg.show({title:pageTitle,msg:_checkAlpha,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);
}}});return false;}else{if(v=="7"){Ext.Msg.show({title:pageTitle,msg:_checkspecial,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);}}});return false;}else{if(v=="8"){Ext.Msg.show({title:pageTitle,msg:_valIp,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);
}}});return false;}else{if(v=="9"){Ext.Msg.show({title:pageTitle,msg:_validateIp,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);}}});return false;}else{if(v=="10"){Ext.Msg.show({title:pageTitle,msg:_checknum,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);
}}});return false;}else{if(v=="11"){Ext.Msg.show({title:pageTitle,msg:_chkIpv6,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);}}});return false;}else{if(v=="12"){Ext.Msg.show({title:pageTitle,msg:_doubleColon,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);
}}});return false;}else{if(v=="13"){Ext.Msg.show({title:pageTitle,msg:_grpIpv6,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);}}});return false;}else{if(v=="14"){Ext.Msg.show({title:pageTitle,msg:_digitIpv6,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);
}}});return false;}else{if(v=="15"){Ext.Msg.show({title:pageTitle,msg:_validateIpv6,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);}}});return false;}else{if(v=="16"){Ext.Msg.show({title:pageTitle,msg:_checkNumberLabel,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);
}}});return false;}else{if(v=="17"){Ext.Msg.show({title:pageTitle,msg:_checkblank,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);}}});return false;}}}}}}}}}}}}}}}else{if(!publicJSON.hideHostIPField&&isAllowHostName=="true"&&checkspaceExtjs(o)!="0"){var v=checkspaceExtjs(o);
if(v=="17"){Ext.Msg.show({title:pageTitle,msg:_checkblank,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);}}});return false;}}else{if(!publicJSON.hideHostIPField&&isAllowHostName=="true"&&checkSpecialExtjs(o,"`~!@#$%^&*()+={}[]|\\;\"'<>,?/")!="0"){Ext.Msg.show({title:pageTitle,msg:_checkspecial,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Q.focus(true);
}}});return false;}else{if(isAllowHostName=="true"&&!this.checkForHostType(S)){Ext.Msg.show({title:pageTitle,msg:alertMsg20+alertMsg21,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){r.focus(true);}}});return false;}else{if(!checkblank(S)){Ext.Msg.show({title:pageTitle,msg:alertMsg22,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){r.focus(true);
}}});return false;}else{if(checkspaceExtjs(S)!="0"){Ext.Msg.show({title:pageTitle,msg:"Space is not allowed",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){r.focus(true);}}});return false;}else{if(checkSpecialExtjs(S,"`~!@#$%^&*()+={}[]|\\:;\"'<>,?/")!="0"){Ext.Msg.show({title:pageTitle,msg:_checkspecial,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){r.focus(true);
}}});return false;}else{if(S.toLowerCase()=="none"){Ext.Msg.show({title:pageTitle,msg:"You are not allowed to use eG reserved keyword '"+S+"' as component name",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){r.focus(true);}}});return false;}else{if(!this.checkForHostType(S)){Ext.Msg.show({title:pageTitle,msg:alertMsg20+alertMsg21,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){r.focus(true);
}}});return false;}else{if(!Ext.getCmp("underVmware").isDisabled()&&Ext.getCmp("underVmware").getValue()){if(Ext.getCmp("esxServer").getValue()==-1){Ext.Msg.show({title:pageTitle,msg:alertMsg23,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Ext.getCmp("esxServer").focus(true);}}});
return false;}}else{if(!Ext.getCmp("underCloud").isDisabled()&&Ext.getCmp("underCloud").getValue()){if(Ext.getCmp("cloudServer").getValue()==-1){Ext.Msg.show({title:pageTitle,msg:alertMsg24,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Ext.getCmp("cloudServer").focus(true);}}});
return false;}}else{if(!this.checkdots(S)){r.focus(true);return;}else{if(!this.isValidateHostName(S)&&!H){if(S!=hostIpVale){Ext.Msg.show({title:pageTitle,msg:alertMsg25,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){r.focus(true);}}});return false;}}}}}}}}}}}}}}}}if(q&&this.validateHostNameWithRemote(S)){Ext.getCmp("enableRemoteAgent").setValue(false);
return false;}if(isDoubleByteMgr=="false"){if(S.toLowerCase()==u.toLowerCase()){Ext.Msg.show({title:pageTitle,msg:alertMsg26,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){r.focus(true);}}});return false;}}var F=Ext.getCmp("sportno");var g=Ext.getCmp("sportno").getValue();if(!F.isDisabled()){if(!checkblank(g)){Ext.Msg.show({title:pageTitle,msg:alertMsg27,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){F.focus(true);
}}});return false;}else{if(!checknumber("+",g)&&g!="NULL"){Ext.Msg.show({title:pageTitle,msg:alertMsg28,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){F.focus(true);}}});return false;}else{if(!checkfordecimal(g)){F.focus(true);return false;}else{if(g<1){Ext.Msg.show({title:pageTitle,msg:alertMsg11,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){F.focus(true);
}}});return false;}else{if(g>99999){Ext.Msg.show({title:pageTitle,msg:alertMsg12,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){F.focus(true);}}});return false;}else{if(!checkspace(g)){F.focus(true);return false;}else{if(Ext.getCmp("extAgents").getValue()==""){Ext.Msg.show({title:pageTitle,msg:alertMsg7,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Ext.getCmp("extAgents").focus(true);
}}});return false;}}}}}}}}if(u=="Oracle_server"){var p=Ext.getCmp("sid");var R=Ext.getCmp("sid").getValue();if(!checkblank(R)){Ext.Msg.show({title:pageTitle,msg:alertMsg29,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){p.focus(true);}}});return false;}else{if(checkSpecialExtjs(R,"&():<")!="0"){Ext.Msg.show({title:pageTitle,msg:_checkspecial,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){p.focus(true);
}}});return false;}else{if(!checkCommaValue(R)){Ext.Msg.show({title:pageTitle,msg:alertMsg29,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){p.focus(true);}}});return false;}else{if(checkspaceExtjs(R)!="0"){Ext.Msg.show({title:pageTitle,msg:"Space is not allowed",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){p.focus(true);
}}});return false;}else{if(!checkduplicateValue(R)){Ext.Msg.show({title:pageTitle,msg:alertMsg30,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){p.focus(true);}}});return false;}}}}}}if(currentAction=="modify"){var s=publicJSON.hostname;var L=publicJSON.portValue;if(S!=s){if(!this.validateHostName()){return false;
}}if(autoIpNameCheck=="false"){var T=publicJSON.hostname;if(S!=T){Ext.Msg.show({title:pageTitle,msg:alertMsg59+". "+alertMsg60+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i!="ok"){return false;}}});}}if(serverType=="Oracle_server"){var K=publicJSON.sidValue;var b=Ext.getCmp("sid").getValue();
if(K!=""){var f=K.split(",");var w=b.split(",");for(var O=0;O<f.length;O++){var N=0;for(;N<w.length;N++){if(f[O]==w[N]){break;}}if(N==w.length){Ext.Msg.show({title:pageTitle,msg:alertMsg37,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){p.focus(true);}}});return false;}}}}}var k=Ext.getCmp("intAgentManual").getValue();
if(k&&!q){var C=false;var A=false;for(var O=0;O<extListArr.length;O++){var h=extListArr[O].trim();if(h==S){C=true;break;}}for(var O=0;O<rmtListArr.length;O++){var t=rmtListArr[O].trim();if(t==S){A=true;break;}}if(C||A){Ext.Msg.show({title:pageTitle,msg:alertMsg46,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){Ext.getCmp("intAgentAuto").setValue(true);
Ext.getCmp("currAgents").hide();Ext.getCmp("currAgents").disable();}}});return false;}var M=Ext.getCmp("currAgents");var l=M.getValue();if(S.toLowerCase()==l.toLowerCase()){Ext.Msg.show({title:pageTitle,msg:alertMsg56+". "+alertMsg57,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){if(i=="ok"){M.focus(true);
}}});return false;}}if(currentAction=="modify"){var s=publicJSON.hostname;var L=publicJSON.portValue;if(s!=""&&(S!=s||g!=L)){Ext.Msg.show({title:pageTitle,msg:alertMsg36,buttons:Ext.Msg.OKCANCEL,icon:"iconExclamation",fn:function(i){if(i=="ok"){m.actualAdd();}else{return false;}}});}else{m.actualAdd();
}}else{m.actualAdd();}},isValidateHostName:function(b){var a=false;if(checkDigit(b)){a=true;}else{if(isDoubleByteMgr=="false"){if(checkAlpha(b)){a=true;}}else{a=true;}}return a;},checkdots:function(a){var c=a;if(c.charAt(0)=="."||c.charAt(c.length-1)=="."){Ext.Msg.show({title:pageTitle,msg:alertMsg31,buttons:Ext.Msg.OK,icon:"iconExclamation"});
return false;}else{for(var b=0;b<c.length;b++){if(c.charAt(b)=="."&&c.charAt(b+1)=="."){Ext.Msg.show({title:pageTitle,msg:alertMsg41,buttons:Ext.Msg.OK,icon:"iconExclamation"});return false;}else{continue;}}}return true;},checkUserPwd:function(){var b=Ext.getCmp("aluser").getValue();var a=Ext.getCmp("alpwd").getValue();
if(b=="null"||b==""){Ext.Msg.show({title:pageTitle,msg:alertMsg14,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(c){if(c=="ok"){Ext.getCmp("aluser").focus(true);}}});return false;}else{if(checkSpecialExtjs(b,"#$%^&*+={}|:;\"'<>,/")!="0"){Ext.Msg.show({title:pageTitle,msg:_checkspecial,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(c){if(c=="ok"){Ext.getCmp("aluser").focus(true);
}}});return false;}else{if(a=="null"||a==""){Ext.Msg.show({title:pageTitle,msg:alertMsg15,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(c){if(c=="ok"){Ext.getCmp("alpwd").focus(true);}}});return false;}}}if(a==""){Ext.Msg.show({title:pageTitle,msg:_checkempty,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(c){if(c=="ok"){Ext.getCmp("alpwd").focus(true);
}}});return false;}else{if(!checkspecialnomess(a,'"|')){Ext.Msg.show({title:pageTitle,msg:alertMsg16,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(c){if(c=="ok"){Ext.getCmp("alpwd").focus(true);}}});return false;}else{if(!checkForPassValidity(a)){Ext.getCmp("alpwd").focus(true);return false;}}}if(b!=null&&b.indexOf(" ")>-1){Ext.Msg.show({title:pageTitle,msg:alertMsg17,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(c){if(c=="ok"){Ext.getCmp("aluser").focus(true);
}}});return false;}return true;},validateHostNameWithRemote:function(a){var c=this;var e=publicJSON.hiddenVals.allRemAgents;var d=false;if((e!=undefined&&e!="")&&(a!=undefined&&a!="")){if(c.contains2(e,a)){var b=alertMsg47+". "+alertMsg49;if(currentAction=="modify"){b=alertMsg48+". "+alertMsg49;}Ext.Msg.show({title:pageTitle,msg:b,buttons:Ext.Msg.OK,icon:"iconExclamation"});
d=true;}}return d;},validateHostName:function(){var c=publicJSON.hiddenVals.allExtAgents;var e=publicJSON.hiddenVals.allRemAgents;var a=publicJSON.hostname;var d=false;var b=false;if(a!=""&&this.contains2(c,a)){Ext.Msg.show({title:pageTitle,msg:alertMsg38,buttons:Ext.Msg.OK,icon:"iconExclamation"});d=true;
}if(a!=""&&this.contains2(e,a)){Ext.Msg.show({title:pageTitle,msg:alertMsg39,buttons:Ext.Msg.OK,icon:"iconExclamation"});b=true;}if(d||b){return false;}else{return true;}},contains2:function(a,d){var c=a;var g=false;var f=0;var b=c.indexOf(",");while(b>-1){var e=c.substring(f,b);if(e.toLowerCase()==d.toLowerCase()){g=true;
break;}else{f=b;c=c.substring(1,c.length);b=c.indexOf(",");}}if(c.toLowerCase()==d.toLowerCase()){g=true;}return g;},checkForHostType:function(b){var c=publicJSON.servTypes;for(var a=0;a<c.length;a++){if(c[a]==b){return false;}}return true;},usedSiteNameCheck:function(){var b=Ext.getCmp("rumNickName").getValue();
var a=Ext.getCmp("rumserviceNameList").getValue();Ext.Ajax.request({url:"NewComponent/data/newRUMServerJson.jsp?selectedSite="+a+"&compName="+encodeURIComponent(b)+"&currentAction="+currentAction,method:"POST",async:false,success:function(f){if(f.status==200&&!Ext.isEmpty(f.responseText)){var i=f.responseText;
var c=Ext.decode(i.substring(0,i.indexOf("&*&")));var e=c["siteFound"];var h=c["used_Site_name"];var d=c["existingSite"];var g=c["usedComponetName"];if(e){Ext.Msg.show({title:pageTitle,msg:"Website "+d+" is associated with component "+g+" ,Please select different website.",buttons:Ext.Msg.OK,icon:"iconExclamation"});
if(currentAction=="modify"){Ext.getCmp("rumserviceNameList").setValue(h);}else{Ext.getCmp("rumserviceNameList").setValue("-1");}return false;}}}});},hostCheckBack:function(){var a="/final/admin/EgNewServer.jsp?"+addCompURL+"&fromWizard="+fromWizard;window.location.href=a;}});