<!DOCTYPE html>

<%@ include file="EgTrackerA.jsp" %>
<%@ taglib prefix = "egui" uri = "../WEB-INF/eg-taglib.tld" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="com.eg.*"%>
<%@ page import="com.eg.EgURLEncoder"%>
<jsp:useBean id="port" scope="page" class="egurkha.ServiceBean"/>
<%

	EgServicesInfo servicesInfo = new EgServicesInfo("manager");
	boolean isAllowHostName = servicesInfo.isAllowHostNames();

	String uiFile = "eg_services.ini";
	String s_iniFile_dir = EgInstallInfo.getInstallDir() + "/manager/config/";
	IniFile testIniFile = new IniFile(s_iniFile_dir + uiFile);
	String memory=testIniFile.getValue("EXEC","VcDiscover_Mem");
	String  rediscoverDeletedComponentsStr = testIniFile.getValue("MISC_ARGS","RediscoverDeletedComponents");
	if(memory != "" && memory.length() > 0)
	{
		memory = memory.substring(0,memory.indexOf("M"));
	}
	else
	{
		memory="";
	}

	String componentType = "-1";
	String activeCompTypes = "";
	String urlStr = "EgServerDiscovery/data/EgChangePortsJson.jsp?from=changeSettings";
	String selectedNode = request.getParameter("selectedNode");
	if (selectedNode == null || selectedNode.equals("null") || selectedNode.length() == 0)
	{
		selectedNode = "node1";
		urlStr = "EgServerDiscovery/data/EgChangePortsJson.jsp?from=changeSettings";
	}
	else if (selectedNode.equalsIgnoreCase("node2"))
	{
		urlStr = "EgServerDiscovery/data/EgChangePortsJson.jsp?from=view&selectedNode=node2";
	}
	else if (selectedNode.equalsIgnoreCase("node3"))
	{
		urlStr = "EgServerDiscovery/data/EgChangePortsJson.jsp?from=cloudView&selectedNode=node3";
	}
	else if (selectedNode.equalsIgnoreCase("node4"))
	{
		urlStr = "EgServerDiscovery/data/EgChangePortsJson.jsp?from=EnableDisableDiscovery&selectedNode=node4";
	}
	else if (selectedNode.equalsIgnoreCase("node8"))
	{
		urlStr = "EgServerDiscovery/data/EgAgentDiscoverJson.jsp?from=General&selectedNode=node8";
	}
	else if (selectedNode.equalsIgnoreCase("node9"))
	{
		urlStr = "EgServerDiscovery/data/EgAgentDiscoverJson.jsp?from=Actions&selectedNode=node9";
	}
	else if (selectedNode.equalsIgnoreCase("node11"))
	{
		componentType = request.getParameter("server");
		activeCompTypes = request.getParameter("activeCompTypes");
		if (activeCompTypes == null)
		{
			activeCompTypes = "false";
		}
		if (componentType == null || componentType.equalsIgnoreCase("null") || componentType.length() == 0)
		{
			componentType = "-1";
		}
		urlStr = "EgServerDiscovery/data/EgConfigEnvJson.jsp?startDiscThread=false&executeAction=New&selectedNode=node11&server="+EgURLEncoder.encode(componentType,"UTF-8")+"&activeCompTypes="+activeCompTypes;
	}
	else if (selectedNode.equalsIgnoreCase("node10"))
	{
		urlStr = "EgServerDiscovery/data/EgChangePortsJson.jsp?from=commonSettings&selectedNode=node10";
	}
	else if (selectedNode.equalsIgnoreCase("node17"))
	{
		urlStr = "EgServerDiscovery/data/EgChangePortsJson.jsp?from=commonSettings&selectedNode=node17";
	}
	else if (selectedNode.equalsIgnoreCase("node18"))
	{
		urlStr = "EgServerDiscovery/data/EgChangePortsJson.jsp?from=commonSettings&selectedNode=node18";
	}
	else if (selectedNode.equalsIgnoreCase("node15"))
	{
		urlStr = "EgServerDiscovery/data/EgAutodeleteJson.jsp?from=autodeleteSettings&selectedNode=node15";
	}
	else if (selectedNode.equalsIgnoreCase("node16"))
	{
		urlStr = "EgServerDiscovery/data/EgRabbitMQNodeJson.jsp?from=viewRabbitMQ&selectedNode=node16";
	}
	else if (selectedNode.equalsIgnoreCase("node20"))
	{
		urlStr = "EgServerDiscovery/data/EgDiscoveryReport.jsp?from=DiscoveryReport&selectedNode=node20";
	}
	String automanageConfig = testIniFile.getValue("MISC_ARGS","Automanage");
	automanageConfig = (automanageConfig == null || automanageConfig.length() == 0)?"No":automanageConfig;

	port.createAdmin();
	String[] ipranges=port.getIpranges();
	StringBuffer ipRange = new StringBuffer(ipranges.length*30);
	String iprange = "";
	if(ipranges.length > 2)
	{
		for(int x=1;x<ipranges.length;x++)
		{
			ipRange.append(ipranges[x].trim());
		}
	}
	else if(ipranges.length > 1)
	{
		ipRange.append(ipranges[1].trim());
	}
	iprange = ipRange.toString().trim();

	String eg_inifile = "eg_ui.ini";
	IniFile discoveryUI = new IniFile(s_iniFile_dir + eg_inifile);
	String currentDateFormat = _user.getUserDateFormat();
	String managerDiscovery = discoveryUI.getValue("EASE_OF_USE","managerDiscovery");
	if (managerDiscovery == null || managerDiscovery.length() == 0)
	{
		managerDiscovery = "enabled";
	}
	String discoveryUIProcess = "no";
	managerDiscovery = managerDiscovery.toLowerCase();
	if (managerDiscovery.startsWith("enable") || managerDiscovery.equalsIgnoreCase("true"))
	{
		discoveryUIProcess = "yes";
	}
	
	String fromSegment = request.getParameter("from");
	String backHref = "";
	if (fromSegment != null && fromSegment.equalsIgnoreCase("seg_top"))
	{
		selectedNode = "node9";
		urlStr = "EgServerDiscovery/data/EgAgentDiscoverJson.jsp?from=Actions&selectedNode=node9";
		backHref = "EgAutoTopology.jsp";
	}
	IniFile egUI = new IniFile(EgInstallInfo.getInstallDir()+ "/manager/config/eg_ui.ini");
	String currentDateFormat1 = egUI.getValue("CURRENT_DATE_FORMAT","selectedDateFormat");
	String userDtFormat = _user.getUserDateFormat();
	if (userDtFormat.equalsIgnoreCase("default") || userDtFormat.length() == 0)
	{
		userDtFormat = currentDateFormat1;
	}
	String extjsDateFormat = egUI.getValue("EXTJS_DATE_FORMATS",userDtFormat);
	if (extjsDateFormat != null && extjsDateFormat.length() > 0)
	{
		extjsDateFormat = extjsDateFormat+" H:i:s";
	}
	else
	{
		extjsDateFormat = "M d, Y H:i:s";
	}

	boolean isMsp = false;
	String eGMgrModel = testIniFile.getValue("MISC_ARGS","eGMgrModel");
	if (eGMgrModel != null && eGMgrModel.equalsIgnoreCase("msp"))
	{
		isMsp = true;
	}
%>

<html>
<head>
<title>
</title>
<meta charset="utf-8">

<egui:skin ui="admin"/>

<script type="text/javascript" src="../extjs/ext-all.js"></script>

<!-- Fancy Scroll-->
<script src="/final/jquery/jquery.js"></script>
<script src="/final/styles/jscrollpane/jquery.jscrollpane.js" ></script>
<script src="/final/styles/jscrollpane/jquery.mousewheel.js" ></script>
<script src="/final/styles/jscrollpane/mwheelIntent.js" ></script>
<script src="/final/scripts/utilities/EncodeDecodeParams.js"></script>
<link rel="stylesheet" href="/final/styles/jscrollpane/jquery.jscrollpane.css"/>
<script type="text/javascript" src="/final/admin/eg_scripts/CustomGridSorting.js"></script>

<script language="javascript1.2" src="eg_scripts/ajaxutils.js"></script>
<script language="Javascript1.2" src="eg_scripts/date.js"></script>
<script language="javascript1.2" src="eg_scripts/validate.js"></script>
<script language="JavaScript1.2" src="../scripts/<%=script_src%>"></script>
<script language="JavaScript1.2" src="eg_scripts/eg_configtest.js"></script>
<script language="JavaScript1.2" src="/final/scripts/eg_DateUtil.js"></script>
<script language="javascript">
	var isMsp = <%=isMsp%>;
	var mgrDateFormat = getExtjsDateFormat('<%=currentDateFormat%>');
	var extjsDateFormat = '<%=extjsDateFormat%>';
	var csrfToken = '<%=strCsrfToken%>';
	var activeCompTypes = '<%=activeCompTypes%>';
	var userLanguage='<%=trackerLanguage%>';
	var pdfURLString = '/final/servlet/com.eg.EgPdfDownloadC';
	var backHref = '<%=backHref%>';
	var isDiscState = true;
	var publicJSON = '';
	var appURL = '<%=urlStr%>';
	var hiddenQstr = '';
	var appCnt = '';
	var fromQuickMenu = true;
	var memory = '<%=memory%>';
	var selectedNodeID = '<%=selectedNode%>';
	var iprange = "<%=iprange%>";
	var automanageConfig = '<%=automanageConfig%>';
	var managerDiscoveryUI = '<%=discoveryUIProcess%>';
	var reqfrom = '<%=fromSegment%>';
	var actionType = '';
	var reDiscDelComp = '<%=rediscoverDeletedComponentsStr%>';
	var settingPageDisc = '<egui:intnl description="EgChangePorts.jsp,changeSettings"/>.';
	var vCloudPageDisc = '<egui:intnl description="EgChangePorts.jsp,VcSettings"/>.';
	var hmcPageDisc = '<egui:intnl description="EgChangePorts.jsp,HmcSettings"/>.';
	var rhevPageDisc = '<egui:intnl description="EgRHEVDiscovery.jsp"/>.';
	var nutanixPageDisc = '<egui:intnl description="EgChangePorts.jsp,NutanixSettings"/>.';
	var cloudPageDisc = '<egui:intnl description="EgChangePorts.jsp,cloudSettings"/>.';
	var netscalerPageDisc = '<egui:intnl description="EgNetScalerJson.jsp,NetScaler"/>.';
	var ctxXenPoolPageDisc = '<egui:intnl description="EgChangePorts.jsp,CtxXenPool"/>.';
	var oracleVMPageDisc = '<egui:intnl description="EgChangePorts.jsp,OracleVM"/>.';
	var clouddirectoryPageDisc = '<egui:intnl description="EgCloudDirectoryJson.jsp,CloudDirectory"/>.';
	var storageplatformPageDisc = '<egui:intnl description="EgStoragePlatformJson.jsp,StoragePlatform"/>.';
	var rabbitMQPageDisc = '<egui:intnl description="EgRabbitMQNodeJson.jsp,RabbitMQ"/>.';
	var pageConfigDisc = '<egui:intnl description="EgChangePorts.jsp,EnableDisableDiscovery"/>.';
	var agentPageDisc = '<egui:intnl description="EgAgentDiscover.jsp"/>.';
	var manageCompDisc = '<egui:intnl description="EgConfigEnv.jsp"/>.';
	var commonPageDisc = '<egui:intnl description="EgChangePorts.jsp,commonsettings"/>.';
	var commonPageDisc2 = '<egui:intnl description="EgChangePorts.jsp,tcpsettings"/>.';
	var commonPageDisc3 = '<egui:intnl description="EgChangePorts.jsp,automanagesettings"/>.';
	var autodeletePageDisc = '<egui:intnl description="EgChangePorts.jsp,autodeletesettings"/>.';
	var pageTitle1 = '<egui:intnl text="admin.title.MANAGER DISCOVERY - GENERAL SETTINGS"/>';
	var pageTitle2 = '<egui:intnl text="admin.title.MANAGER DISCOVERY"/>';
	var pageTitle3 = '<egui:intnl text="admin.title.MANAGER DISCOVERY - VIRTUAL PLATFORM SETTINGS"/>';
	var pageTitle4 = '<egui:intnl text="admin.title.MANAGER DISCOVERY - ENABLE / DISABLE"/>';
	var pageTitle5 = '<egui:intnl text="admin.title.MANAGER DISCOVERY - PUBLIC CLOUD SETTINGS"/>';
	var pageTitle6 = '<egui:intnl text="admin.title.AGENT DISCOVERY - GENERAL SETTINGS"/>';
	var pageTitle7 = '<egui:intnl text="admin.title.AGENT DISCOVERY - ENABLE / DISABLE"/>';
	var pageTitle9 = '<egui:intnl text="admin.title.MANAGER DISCOVERY - CITRIX NETSCALER SETTINGS"/>';
	var pageTitle10 = '<egui:intnl text="admin.title.MANAGER DISCOVERY - vCLOUD DIRECTORS SETTINGS"/>';
	var pageTitle11 = '<egui:intnl text="admin.title.MANAGER DISCOVERY - STORAGE PLATFORM SETTINGS"/>';
	var pageTitle12 = '<egui:intnl text="admin.title.MANAGER DISCOVERY - RABBITMQ HOST DISCOVERY SETTINGS"/>';
	var validationMsg1 = '<egui:intnl text="admin.discovery.Invalid IP in IP range"/>';
	var validationMsg2 = '<egui:intnl text="admin.discovery.Space is not allowed"/>';
	var validationMsg3 = '<egui:intnl text="admin.discovery.IP range is not valid"/>';
	var validationMsg4 = '<egui:intnl text="admin.discovery.IP range not allowed in DBL(Chinese,Korean,Japanese)"/>';
	var validationMsg5 = '<egui:intnl text="admin.discovery.Second IP should be greater than the first IP"/>';
	var validationMsg6 = '<egui:intnl text="admin.discovery.SNMP community string is not allowed in DBL(Chinese,Korean,Japanese)"/>';
	var validationMsg7 = '<egui:intnl text="admin.snmp.First and last character should not be a hyphen symbol"/>';
	var validationMsg8 = "<egui:intnl text='admin.discovery.Cannot have \' , \' in consecutive positions'/>.";
	var validationMsg9 = '<egui:intnl text="admin.discovery.Blank values are not allowed"/>';
	var validationMsg10 = '<egui:intnl text="admin.discovery.Please enter a port number"/>';
	var validationMsg11= '<egui:intnl text="admin.common.Invalid port number"/>';
	var validationMsg12 = '<egui:intnl text="admin.discovery.Port number can consist of only valid numbers"/>';
	var validationMsg13 = '<egui:intnl text="admin.discovery.Special characters not allowed"/>';
	var validationMsg14 = '<egui:intnl text="admin.discovery.Select IP range for discovery using"/>&nbsp;<egui:intnl text="admin.discovery.Active Directory"/>';
	var validationMsg15 = '<egui:intnl text="admin.common.Yes" />';
	var validationMsg16 = '<egui:intnl text="admin.common.No" />';
	var validationMsg17 = '<egui:intnl text="admin.discovery.Active Directory Domain"/>';
	var validationMsg18 = '<egui:intnl text="admin.discovery.Select an Active Directory Site"/>';
	var validationMsg19 = '<egui:intnl text="admin.discovery.Select Subnets(s) From Site"/>';
	var validationMsg20 = '<egui:intnl text = "admin.discovery.IP range"/>';
	var validationMsg21 = '<egui:intnl text="admin.discovery.Type of network"/>';
	var validationMsg22 = '<egui:intnl text="admin.discovery.ICMP enabled"/>';
	var validationMsg23 = '<egui:intnl text="admin.discovery.Component types"/>';
	var validationMsg24 = '<egui:intnl text="admin.discovery.Discover components using"/>';
	var validationMsg25 = '<egui:intnl text="admin.discovery.Re-discovery period"/>';
	var validationMsg26 = '<egui:intnl text="admin.discovery.Is your environment DHCP enabled"/>?';
	var validationMsg27 = '<egui:intnl text="admin.discovery.SNMP community strings"/>';
	var validationMsg28 = '<egui:intnl text="admin.test.TCP ports for application discovery"/>';
	var validationMsg29 = '<egui:intnl text="admin.discovery.Choose a virtual platform to discover"/>';
	var validationMsg30 = '<egui:intnl text="admin.discovery.What action would you like to perform"/>?';
	var validationMsg31 = '<egui:intnl text="admin.discovery.RHEV Manager Preferences"/>';
	var validationMsg32 = '<egui:intnl text="admin.discovery.Virtual Center Preferences"/>';
	var validationMsg33 = '<egui:intnl text="admin.discovery.Hardware management console (HMC) Preferences"/>';
	var validationMsg34 = '<egui:intnl text="admin.discovery.AWS Cloud Preferences"/>';
	var validationMsg35 = '<egui:intnl text="admin.discovery.Please choose a vCenter identity"/>';
	var validationMsg36 = '<egui:intnl text="admin.discovery.Maximum host name length is 32 characters"/>';
	var validationMsg37 = '<egui:intnl text="admin.discovery.Please enter the username"/>';
	var validationMsg38 = '<egui:intnl text="admin.discovery.Please enter the password"/>';
	var validationMsg39 = "<egui:intnl text='admin.test.Password data should not contain pipe'/>";
	var validationMsg40 = '<egui:intnl text="admin.discovery.Please enter the confirm password"/>';
	var validationMsg41 = '<egui:intnl text="admin.discovery.Passwords do not match"/>';
	var validationMsg42 = '<egui:intnl text="admin.discovery.Blank values are not allowed"/>';
	var validationMsg43 = '<egui:intnl text="admin.discovery.Webport should be less than 99999"/>';
	var validationMsg44 = '<egui:intnl text="admin.discovery.Please choose a HMC IP"/>';
	var validationMsg45 = '<egui:intnl text="admin.discovery.Please enter the HMC IP"/>';
	var validationMsg46 = '<egui:intnl text="admin.discovery.Please enter the Host name"/>';
	var validationMsg47 = '<egui:intnl text="admin.discovery.Please choose a RHEV Manager identity"/>';
	var validationMsg48 = '<egui:intnl text="admin.discovery.Please enter the RHEV Manager identity"/>';
	var validationMsg49 = '<egui:intnl text="admin.discovery.Maximum host name length is 24 characters"/>';
	var validationMsg50 = '<egui:intnl text="admin.discovery.Please choose a AWS account"/>';
	var validationMsg51 = '<egui:intnl text="admin.discovery.Please enter the AWS account"/>';
	var validationMsg52 = '<egui:intnl text="admin.discovery.Please enter the accessKey"/>';
	var validationMsg53 = '<egui:intnl text="admin.discovery.Please enter the confirm accessKey"/>';
	var validationMsg54 = '<egui:intnl text="admin.discovery.Access keys do not match"/>';
	var validationMsg55 = '<egui:intnl text="admin.discovery.Please enter the secretKey"/>';
	var validationMsg56 = '<egui:intnl text="admin.discovery.Please enter the confirm secretKey"/>';
	var validationMsg57 = '<egui:intnl text="admin.discovery.Secret keys do not match"/>';
	var validationMsg58 = "<egui:intnl text='admin.AgentDiscovery.Agent discovery startup delay'/>";
	var validationMsg59 = '<egui:intnl text="admin.AgentDiscovery.Agent rediscovery period "/>';
	var validationMsg60 = "<egui:intnl text='admin.AgentDiscovery.Discovery timeout'/>";
	var validationMsg61 = "<egui:intnl text='admin.AgentDiscovery.Delay between topology discovery '/>";
	var validationMsg62 = "<egui:intnl text='admin.AgentDiscovery.Topology rediscovery period'/>";
	var validationMsg63 = '<egui:intnl text="admin.discovery.No Items selected"/>';
	var validationMsg64 = '<egui:intnl text="admin.discovery.Are you sure you want to delete this vCenter"/>?';
	var validationMsg65 = '<egui:intnl text="admin.discovery.Are you sure you want to delete this HMC server"/>?';
	var validationMsg66 = '<egui:intnl text="admin.discovery.Are you sure you want to delete this AWS Cloud account"/>?';
	var validationMsg67 = '<egui:intnl text="admin.discovery.Are you sure you want to delete this RHVM Manager"/>?';
	var validationMsg68 = '<egui:intnl text="admin.discovery.Click here"/>';
	var validationMsg69 = '<egui:intnl text="admin.discovery.Please select components to manage"/>.';
	var validationMsg70 = '<egui:intnl text="admin.discovery.Please select components to delete"/>.';
	var validationMsg71 = '<egui:intnl text="admin.server.Components once deleted will never be discovered again!! You can only manually add the deleted component! Are you sure you want to delete"/>?';
	var validationMsg72 = '<egui:intnl text="admin.user.No new components have been discovered"/>';
	var validationMsg73 = '<egui:intnl text="admin.user.No unmanaged components found"/>';
	var validationMsg74 = '<egui:intnl text="admin.server.No data found for your current search"/>';
	var validationMsg75 = '<egui:intnl text="admin.discovery.MANAGER DISCOVERY SETTINGS OF YOUR ENVIRONMENT"/>';
	var validationMsg76 = '<egui:intnl text="admin.discovery.COMMON DISCOVERY SETTINGS OF YOUR ENVIRONMENT"/>';
	var validationMsg77 = '<egui:intnl text="admin.AgentDiscovery.Agent Discovery Settings"/>';
	var validationMsg78 = '<egui:intnl text="admin.AgentDiscovery.Topology Discovery Settings"/>';
	var validationMsg79 = '<egui:intnl text="admin.common.Please choose an agent for validation"/>';
	var validationMsg80 = '<egui:intnl text="admin.common.No agents available to validate"/>.';
	var validationMsg81 = '<egui:intnl text="admin.discovery.Credentials [Optional]"/>';
	var validationMsg82 = '<egui:intnl text="admin.discovery.User Name"/>';
	var validationMsg83 = '<egui:intnl text="admin.discovery.Password"/>';
	var validationMsg84 = '<egui:intnl text="admin.discovery.Domain"/>';
	var validationMsg85 = '<egui:intnl text="admin.discovery.Discover multiple components on a system"/>';
	var validationMsg86 = '<egui:intnl text="admin.discovery.Please enable manager discovery before you attempt to change Re-discovery period"/>';
	//var validationMsg87 = '<egui:intnl text="admin.discovery.Discover components using"/>';
	var validationMsg87 = '<egui:intnl text="admin.discovery.Show discovered components in"/>';
	var validationMsg88 = '<egui:intnl text="admin.discovery.Discover local applications"/>';
	var validationMsg89 = '<egui:intnl text="admin.discovery.Discover remote applications"/>';
	var validationMsg90 = '<egui:intnl text="admin.discovery.NetScaler Preferences"/>';
	var validationMsg91 = '<egui:intnl text="admin.discovery.Please choose a NetScaler identity"/>';
	var validationMsg94 = '<egui:intnl text="admin.discovery.Are you sure you want to delete the selected NetScaler(s)"/>?';
	var validationMsg95 = '<egui:intnl text="admin.discovery.IP (or) Hostname already exist"/>.';
	var validationMsg96 = '<egui:intnl text="admin.discovery.Nutanix Prism Preferences"/>';
	var validationMsg97 = '<egui:intnl text="admin.discovery.Please choose a Nutanix IP"/>';
	var validationMsg98 = '<egui:intnl text="admin.discovery.Are you sure you want to delete this Nutanix Prism"/>?';
	var validationMsg99 = '<egui:intnl text="admin.discovery.Citrix XenServer Preferences"/>';
	var validationMsg100 = '<egui:intnl text="admin.discovery.Please choose a Citrix XenServer identity"/>';
	var validationMsg101 = '<egui:intnl text="admin.discovery.Please enter the Citrix XenServer identity"/>';
	var validationMsg102 = '<egui:intnl text="admin.discovery.Are you sure you want to delete this Citrix XenServer(s)"/> ?';
	var validationMsg103 = '<egui:intnl text="admin.discovery.vCloud Director Cell Preferences"/>';
	var validationMsg104 = '<egui:intnl text="admin.discovery.Please choose a vCloud Directory Cell identity"/>';
	var validationMsg105 = '<egui:intnl text="admin.discovery.Are you sure you want to delete the selected vCloud Director(s)"/> ?';
	var validationMsg106 = '<egui:intnl text="admin.discovery.XMS Preferences"/>';
	var validationMsg107 = '<egui:intnl text="admin.discovery.Choose a storage platform to discover"/>';
	var validationMsg108 = '<egui:intnl text="admin.discovery.Are you sure you want to delete the selected XMS preference(s)"/> ?';
	var validationMsg109 = '<egui:intnl text="admin.discovery.Please choose a XMS Preferences identity"/>';

	var validationMsg110 = '<egui:intnl text="admin.discovery.RabbitMQ Preferences"/>';
	var validationMsg111 = '<egui:intnl text="admin.discovery.Choose a RabbitMQ Host to discover"/>';
	var validationMsg112 = '<egui:intnl text="admin.discovery.Are you sure you want to delete the selected RabbitMQ preference(s)"/> ?';
	var validationMsg113 = '<egui:intnl text="admin.discovery.Please choose a RabbitMQ Cluster identity"/>';
	var validationMsg114 = '<egui:intnl text="admin.discovery.From date should be lesser than To date"/>';
	
	var validationMsg115 = '<egui:intnl text="admin.discovery.Oracle VM Manager Preferences"/>';
	var validationMsg116 = '<egui:intnl text="admin.discovery.Please choose a Oracle VM Manager identity"/>';
	var validationMsg117 = '<egui:intnl text="admin.discovery.Please enter the Oracle VM Manager identity"/>';
	var validationMsg118 = '<egui:intnl text="admin.discovery.Are you sure you want to delete this Oracle VM Manager(s)"/> ?';
	var validationMsg119 = '<egui:intnl text="admin.discovery.Agent discovery startup delay (Mins)"/>';
	var validationMsg120 = '<egui:intnl text="admin.discovery.Agent rediscovery period (Mins)"/>';
	var validationMsg121 = '<egui:intnl text="admin.discovery.Discovery timeout (Millisecs)"/>';
	var validationMsg122 = '<egui:intnl text="admin.discovery.Auto-manage aggregates"/>';
	var validationMsg123 = '<egui:intnl text="admin.discovery.Discover only operating systems"/>';
	var validationMsg124 = '<egui:intnl text="admin.discovery.Topology rediscovery period (Mins)"/>';
	var validationMsg125 = '<egui:intnl text="admin.discovery.Dependencies must be present"/>';
	var validationMsg126 = '<egui:intnl text="admin.discovery.Number of dependency discovery attempts"/>';
	var validationMsg127 = '<egui:intnl text="admin.discovery.Delay between successive dependency discovery attempts (Mins)"/>';
	var validationMsg128 = '<egui:intnl text="admin.discovery.Enable automatic actions on components that are not reporting"/>';
	var validationMsg129 = '<egui:intnl text="admin.discovery.Loopback IP addresses are not allowed"/>';

	var tmpValidationMsg =  "Cannot have \' , \' in consecutive positions";
	var tmpValidationMsg2 =  "Cannot be blank";
	var tmpValidationMsg3 =  "Please enter a value in";
	var tmpValidationMsg4 =  "can have only numeric values";
	var tmpValidationMsg5 =  "Special characters are not allowed in";
	var validationLoadingMsg="<table><tr><td align=center valign=bottom><img src=/final/monitor/eg_images/indicator_medium.gif></td></tr><tr><td align=center vlaign=top><egui:intnl text='admin.common.Trying to get validation information from the agent'/>...<br><egui:intnl text='admin.common.This may take a few minutes'/>...</td></tr></table>";
	var validationTitle = '<egui:intnl text="admin.common.Validating monitoring settings for" />&nbsp;vCenter';
	var validationNutanixTitle = '<egui:intnl text="admin.common.Validating monitoring settings for" />&nbsp;Nutanix Prism';
	var validationXenserverTitle = '<egui:intnl text="admin.common.Validating monitoring settings for" />&nbsp;Citrix Xenserver';
	var validationOracleVMTitle = '<egui:intnl text="admin.common.Validating monitoring settings for" />&nbsp;Oracle VM Manager';
	var validationURL="EgServerDiscovery/data/validateApplicationServerCredentails.jsp?action=pickAgentToValidate&taskName=VmEsx_i_server&componentType=VmEsx_i_server";
	var validationNutanixURL="EgServerDiscovery/data/validateApplicationServerCredentails.jsp?action=pickAgentToValidate&taskName=Nutanix_Acropolis&componentType=Nutanix_Acropolis";
	var validationXenserverURL="EgServerDiscovery/data/validateApplicationServerCredentails.jsp?action=pickAgentToValidate&taskName=Xen_virtual_server&componentType=Xen_virtual_server";
	var validationOracleVMURL="EgServerDiscovery/data/validateApplicationServerCredentails.jsp?action=pickAgentToValidate&taskName=Oracle_vm_mgr&componentType=Oracle_vm_mgr";
	var isAllowHostName = '<%=isAllowHostName%>';
	var paramsForURLVC = '';
	var agentDiscoveryMessage = '<egui:intnl text="Agent discovery is currently disabled for your environment"/>.'
	var lastCheckedRadioButton = '';

	var strServer = '<%=componentType%>';
	var pageTitle8 = '<egui:intnl text="admin.title.COMPONENTS - MANAGE / UNMANAGE"/>';
	var isComponentUpdated = true;
	var intnlLabel1 = '<egui:intnl text="admin.server.for manage/unmanage by systems"/>';
	var intnlLabel2 = '<egui:intnl text="admin.server.Component type"/>';
	var intnlLabel3 = '<egui:intnl text="admin.server.Show managed component types only"/>';
	var intnlLabel4 = '<egui:intnl text="admin.server.Unmanaged components"/>';
	var intnlLabel5 = '<egui:intnl text="admin.server.Managed components"/>';
	var intnlLabel6 = '<egui:intnl text="admin.server.Delete Components"/>';
	var intnlLabel7 = '<egui:intnl text="admin.common.Update"/>';
	var intnlLabel8 = '<egui:intnl text="admin.server.No managed components selected"/>';
	var intnlLabel9 = "<egui:intnl text='admin.server.Please update your manage/unmanage changes before attempting to delete a component'/>.";
	var intnlLabel10 = '<egui:intnl text="admin.server.Deleting managed component(s) can cause changes in your segment affecting your service configurations"/>.<egui:intnl text="admin.server.You might have to configure your segment again"/>.';
	var intnlLabel11 = '<egui:intnl text="admin.server.Newly discovered components cannot be deleted immediately"/>';
	var intnlLabel12 = '<egui:intnl text="admin.server.No unmanaged components selected"/>';
	var intnlLabel13 = '<egui:intnl text="admin.common.Please select a component type"/>';
	var backText = '<egui:intnl text="admin.header.Back"/>';
	var confirmMsgMgrEnable = '<egui:intnl text="admin.server.Are you sure you want to enable IP range discovery"/>?';
	var confirmMsgMgrDisable = '<egui:intnl text="admin.server.Are you sure you want to disable IP range discovery"/>?';
	var confirmMsgAgtEnable = '<egui:intnl text="admin.server.Are you sure you want to enable"/>';
	var confirmMsgAgtDisable = '<egui:intnl text="admin.server.Are you sure you want to disable"/>';
	var expandAll = '<egui:intnl text="admin.dashboard.Expand all"/>';
	var collapseAll = '<egui:intnl text="admin.dashboard.Collapse all"/>';
	var discoveryTitle = '<egui:intnl text="admin.discovery.DISCOVERY"/>';
	var intnlLabel14 = '<egui:intnl text="admin.discovery.Component types chosen for discovery"/>';
	var intnlLabel15 = '<egui:intnl text="admin.discovery.Select / Deselect Component Types"/>';
	var intnlLabel16 = '<egui:intnl text="admin.discovery.TCP ports for application discovery"/>';
	var intnlLabel17 = '<egui:intnl text="admin.common.Clear"/>';
	var intnlLabel18 = '<egui:intnl text="admin.common.Validate"/>';
	var discoveryStop = '<egui:intnl text="admin.error.Discovery has been stopped successfully"/>.';
	var errorTitle = '<egui:intnl text="admin.server.Error"/>';
	var errorReason = '<egui:intnl text="admin.filter.Possible reasons could be"/>';
	var intnlLabel19 = '<egui:intnl text="admin.discovery.Component/Port settings"/>';
	var intnlLabel20 = '<egui:intnl text="admin.discovery.Virtual Center Memory Settings"/>';
	var probsErrorMessage = '<egui:intnl text="admin.error.Problem encountered while loading the user interface"/>.';
	var requestTimeOut = '<egui:intnl text="admin.error.Response timed out"/>.';
	var intnlLabel21 = '<egui:intnl text="admin.discovery.Please enter the vCenter identity"/>';
	var intnlLabel22 = '<egui:intnl text="admin.discovery.Use SNMP over TCP"/>';
	var intnlLabel38 = '<egui:intnl text="admin.discovery.Please enter the NetScaler identity"/>';
	var intnlLabel39 = '<egui:intnl text="admin.discovery.Please enter the Nutanix IP"/>';
	var intnlLabel40 = '<egui:intnl text="admin.discovery.Component types to be automatically managed"/>';
	var intnlLabel41 = '<egui:intnl text="admin.discovery.Auto Management - Select / Deselect Component Types"/>';
	var intnlLabel42 = '<egui:intnl text="admin.server.Selected component types"/>';
	var intnlLabel43 = '<egui:intnl text="admin.server.Available component types"/>';
	var intnlLabel44 = '<egui:intnl text="admin.server.Category"/>';
	var intnlLabel45 = '<egui:intnl text="admin.server.Discovery - Select / Deselect Component Types"/>';
	var intnlLabel46 = '<egui:intnl text="admin.discovery.Add to available component types"/>';
	var intnlLabel47 = '<egui:intnl text="admin.discovery.Remove from available component types"/>';
	var intnlLabel48 = '<egui:intnl text="admin.discovery.Please enter the vCloud Director identity"/>';
	var intnlLabel49 = '<egui:intnl text="admin.discovery.Please enter the XMS Preferences identity"/>';
	var intnlLabel50 = '<egui:intnl text="admin.discovery.Please enter the RabbitMQ Cluster identity"/>';
	var intnlLabel51 = '<egui:intnl text="admin.discovery.Please enter auto delete check time"/>';
	var intnlLabel52 = '<egui:intnl text="admin.discovery.Days should not be less than 1"/>';
	var intnlLabel53 = '<egui:intnl text="admin.discovery.Days should be less than 365"/>';
	var intnlLabel56 = '<egui:intnl text="admin.server.Show component types chosen for discovery"/>'; 
	var intnlLabel57 = '<egui:intnl text="admin.discovery.RabbitMQ Cluster identity (IP or Host name)"/>';
	var intnlLabel58 = '<egui:intnl text="admin.discovery.Use SSL to connect to RabbitMQ Cluster"/>';
	var intnlLabel59 = '<egui:intnl text="admin.discovery.Management Port"/>';
	var intnlLabel60 = '<egui:intnl text="admin.discovery.Discover RabbitMQ hosts using this RabbitMQ Cluster"/>';
	var intnlLabel61 = '<egui:intnl text="admin.discovery.User"/>';
	var intnlLabel62 = '<egui:intnl text="admin.discovery.XMS identity (IP or Host name)"/>';
	var intnlLabel63 = '<egui:intnl text="admin.discovery.Use SSL to connect to XMS"/>';
	var intnlLabel64 = '<egui:intnl text="admin.discovery.Discover EMC XtremIO hosts using this XMS"/>';
	var intnlLabel65 = '<egui:intnl text="admin.discovery.Username to connect to XMS"/>';
	var intnlLabel66 = '<egui:intnl text="admin.discovery.Password for the user"/>';
	var intnlLabel67 = '<egui:intnl text="admin.discovery.Confirm password for the user"/>';
	var intnlLabel68 = '<egui:intnl text="admin.discovery.vCloud Director Cell (IP or Host name)"/>';
	var intnlLabel69 = '<egui:intnl text="admin.discovery.Use SSL to connect to vCloud Director Cell"/>';
	var intnlLabel70 = '<egui:intnl text="admin.discovery.Discover ESX hosts/vCenters"/>';
	var intnlLabel71 = '<egui:intnl text="admin.discovery.Discover Virtual Machines"/>';
	var intnlLabel72 = '<egui:intnl text="admin.discovery.Username to connect to vCloud Director Cell"/>';
	var intnlLabel73 = '<egui:intnl text="admin.discovery.NetScaler identity (IP or Host name)"/>';
	var intnlLabel74 = '<egui:intnl text="admin.discovery.Use SSL to connect to NetScaler"/>';
	var intnlLabel75 = '<egui:intnl text="admin.discovery.Discover StoreFront hosts using this NetScaler"/>';
	var intnlLabel76 = '<egui:intnl text="admin.discovery.Username to connect to NetScaler"/>';
	var intnlLabel77 = '<egui:intnl text="admin.common.Search by"/>';
	var intnlLabel78 = '<egui:intnl text="admin.common.Timeline"/>';
	var intnlLabel79 = '<egui:intnl text="admin.common.From"/>';
	var intnlLabel80 = '<egui:intnl text="admin.common.To"/>';
	var intnlLabel81 = '<egui:intnl text="admin.common.Search by name"/>';
	var intnlLabel82 = '<egui:intnl text="admin.discovery.DISCOVERED COMPONENTS REPORT"/>';
	var intnlLabel83 = '<egui:intnl text="admin.Take this action when components have not been reporting for"/>';
	var intnlLabel84 = '<egui:intnl text="admin.Take action on managed components also"/>?';
	var intnlLabel85 = '<egui:intnl text="admin.Take action immediately if the components have been removed from the IT infrastructure"/>';
	var intnlLabel86 = '<egui:intnl text="admin.Based on application/infrastructure APIs"/>';
	var intnlLabel87 = '<egui:intnl text="admin.What action would you like to take"/>?';
	var intnlLabel88 = '<egui:intnl text="admin.Take action only if the component type is in the auto-manage list"/>';
	var intnlLabel89 = '<egui:intnl text="admin.Take action even if the components have been manually added"/>';
	var associatedEntitiesTitle1 = '<egui:intnl text="admin.common.Entities"/>';
	var associatedEntitiesTitle2 = '<egui:intnl text="admin.common.Affected Entities"/>';


	var label4 = '<egui:intnl text="admin.snmp.SNMP version"/>';
	var label5 = '<egui:intnl text="admin.snmp.Engine ID"/>';
	var label6 = '<egui:intnl text="admin.snmp.User name"/>';
	var label7 = '<egui:intnl text="admin.snmp.Authentication password"/>';
	var label8 = '<egui:intnl text="admin.snmp.Confirm password"/>';
	var label9 = '<egui:intnl text="admin.snmp.Authentication type"/>';
	var label10 = '<egui:intnl text="admin.snmp.Encrypt flag"/>';
	var label11 = '<egui:intnl text="admin.snmp.Encrypt type"/>';
	var label12 = '<egui:intnl text="admin.snmp.Encrypt password"/>';
	var alert10='<egui:intnl text="admin.snmp.Field value cannot be blank" />';
	var alert16='<egui:intnl text="admin.snmp.Password do not match" />';
	var alert17='<egui:intnl text="admin.snmp.Special characters are not allowed" />';
	var alert19='<egui:intnl text="admin.snmp.Only whole numbers are allowed" />';
	var alert20='Cannot have'+" '.' "+'in consecutive positions';
	var alert21='Cannot have space '+"(\' \')"+' in consecutive positions';
	var label13 = '<egui:intnl text="admin.discovery.Auto-manage discovered components"/>?';
	var label14 = '<egui:intnl text="admin.discovery.Apply"/>';
	var intnlLabel23 = '<egui:intnl text="admin.discovery.Re-discover deleted components"/>';
	var intnlLabel24 = '<egui:intnl text="admin.discovery.Include/Exclude Host IP/Name"/>';
	var intnlLabel25 = '<egui:intnl text="admin.discovery.Please enter valid wildcard pattern"/>.';
	var intnlLabel26 = "<egui:intnl text='admin.discovery.Cannot have \' * \' in consecutive positions'/>.";
	var intnlLabel27 = "<egui:intnl text='admin.discovery.Wildcard pattern should not start or end with comma'/>.";
	var commonSetting = '<egui:intnl text="admin.title.COMMON DISCOVERY SETTINGS"/>';
	var commonSettingGeneral = '<egui:intnl text="admin.title.COMMON SETTINGS - GENERAL"/>';
	var commonSettingTCP = '<egui:intnl text="admin.title.COMMON SETTINGS - TCP PORTS FOR APPLICATION DISCOVERY"/>';
	var commonSettingAutomanage = '<egui:intnl text="admin.title.COMMON SETTINGS - AUTO MANAGE"/>';
	var commonSettingAutodelete = '<egui:intnl text="admin.title.COMMON SETTINGS - AUTO UNMANAGE/DELETE"/>';
	var autoDelSetting = '<egui:intnl text="admin.title.AUTO UNMANAGE/DELETE"/>';
	var intnlLabel28 = "<egui:intnl text='admin.title.Since the IP range contains IPV6 addresses, the flag \'Index components using\' under common settings will be set to hostname'/>.";
	var intnlLabel29 = '<egui:intnl text="admin.discovery.You are not permitted to change this setting as the IP range contains IPV6 addresses"/>.';
	var intnlLabel30 = '<egui:intnl text="admin.discovery.IP range discovery is currently disabled"/>.';
	var intnlLabel31 = '<egui:intnl text="admin.discovery.Please enable the IP range discovery and start the discovery process"/>.';
	var intnlLabel32 = '<egui:intnl text="admin.discovery.IP range discovery is currently enabled for your environment"/>.';
	var intnlLabel33 = '<egui:intnl text="admin.discovery.IP range discovery is currently disabled for your environment"/>.';
	var startDiscConfirm = '<egui:intnl text="admin.discovery.Are you sure you want to start discovery"/>';
	var stopDiscConfirm = '<egui:intnl text="admin.discovery.Are you sure you want to stop discovery"/>';
	var intnlLabel34 = '<egui:intnl text="admin.discovery.Discovered components cannot be indexed using IPAddress if your environment is DHCP enabled"/>.';
	var intnlLabel35 = '<egui:intnl text="admin.discovery.If your environment is DHCP enabled, the \"Discover components using\" flag will automatically change to Host name"/>'+". "+'<egui:intnl text="admin.discovery.Do you want to continue"/>?';
	var intnlLabel36 = '<egui:intnl text="admin.server.Component(s) once deleted will never be discovered again"/>. <egui:intnl text="admin.server.You can only manually add the deleted component"/>.';
	var intnlLabel37 = '<egui:intnl text="admin.server.Are you sure you want to delete"/>?';
	var intnlLabe500 = '<egui:intnl text="admin.server.Discovered by Agent with Host name/Nick name(s)"/>';
	var intnlLabe501 = '<egui:intnl text="admin.server.Discovered by Manager with Host IP/Name"/>';
	var noComponentFound = '<egui:intnl text="admin.ic.No component type(s) found for your current search"/>.'
	Ext.onReady(function(){
		Ext.Ajax.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};
		Ext.data.Connection.prototype.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};
		Ext.data.ScriptTagProxy.prototype.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};

		Ext.Ajax.on('requestexception', function (conn, response, options) {
			var errorStr = response.responseText;
			if (errorStr != undefined && errorStr != 'undefined' && errorStr.indexOf("customerror") != -1)
			{
				if (errorStr.indexOf("user-session-invalid") != -1)
				{
					callWindow(1);
				}
				else if (errorStr.indexOf("user-deleted") != -1)
				{
					callWindow(2);
				}
				else if (errorStr.indexOf("user-timedout") != -1)
				{
					callWindow(3);
				}
			}
			else
			{
				if (response.status == 302 || (response.timedout != undefined && response.timedout == true))
				{
					Ext.Msg.show({
						title : errorTitle,
						msg : requestTimeOut,
						buttons : Ext.Msg.OK,
						icon : 'iconError'
					});
				}
				else
				{
					if (response.aborted != undefined && response.aborted == true)
					{
						return;
					}

					console.log(response.responseText); // Do not comment this line
					Ext.Msg.show({
						title : errorTitle,
						msg : probsErrorMessage,
						buttons : Ext.Msg.OK,
						icon : 'iconError'
					});
				}
			}
		});
	});

</script>
<style type="text/css">

.fault{
background-position : -52px 0px;
background-image : url('/final/admin/eg_images/statecolor.png');
background-repeat : no-repeat;
width:16px;
height:17px;
}

td.wrap-text div {
white-space: normal;
word-wrap : break-word;  
}

.tick {
background-position : -36px 0px;
background-image : url('/final/admin/eg_images/statecolor.png');
background-repeat : no-repeat;
width:16px;
height:17px;
}

</style>
<script src="EgServerDiscovery/app/app.js"></script>
</head>
<body>
<div id="loadmask" class="x-mask-msg x-layer x-mask-msg-default" style="z-index: 19001;left:45%;top:35%;"><div class="x-mask-loading" style="position:relative">Loading...</div></div>
</body>
</html>
<%
	if(request.getQueryString()!= null)
	{
		session.setAttribute("adminLastAccessedURL","/final/admin/EgDiscoveryPane.jsp?"+request.getQueryString());
	}
	else
	{
		session.setAttribute("adminLastAccessedURL","/final/admin/EgDiscoveryPane.jsp?expiry=all");
	}
%>



