<!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 = "java.util.*"%>
<%@ page import = "com.eg.EgCrypt"%>
<%@ page import = "com.eg.IniFile"%>
<%@ page import = "com.eg.EgMemInfo"%>
<%@ page import = "com.eg.EgInstallInfo"%>
<%@ page import = "com.egurkha.EgConstants"%>
<%@ page import = "com.egurkha.ini.IniUI"%>
<%@ page import = "com.egurkha.util.StringUtils"%>

<%
	response.setHeader("Cache-Control","no-store");
	response.setHeader("Pragma","no-cache");
	response.setDateHeader("Expires", -1);
	
	String dir = EgInstallInfo.getInstallDir()+ "/manager/config/";
	IniFile endUserDetailsIni = new IniFile(dir + "eg_endUserDetails.ini");
	String addSearchSub = "Additional_Search";
	String additionalSearch = endUserDetailsIni.getValue(addSearchSub,"EnableAddtionalSearch");
	boolean addtionalSearchF = false;
	if (additionalSearch!=null && additionalSearch.trim().length()>0 && (additionalSearch.equalsIgnoreCase("true") || additionalSearch.equalsIgnoreCase("yes")))
	{
		addtionalSearchF = true;
	}

%>
<%!
	String subject = "MISC_ARGS";
	String adminCommon="admin.common.";
%>

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

	<!--Skin color--------->
	<egui:skin ui = "admin"/>

	<!---Components, icons, skin and Core ext script--->
	<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>
	<link rel="stylesheet" href="/final/styles/jscrollpane/jquery.jscrollpane.css"/>

	<script language="JavaScript1.2" src="../scripts/<%=script_src%>"></script>
	<script language="javascript1.2" src="eg_scripts/validate.js"></script>

	<script type="text/javascript">
		var csrfToken = '<%=strCsrfToken%>';
		var addtionalSearchFlag = <%=addtionalSearchF%>;
		var alarmsMainTitle = '<egui:intnl text="admin.minmax.ALARMS"/>';
		var graphsMainTitle = '<egui:intnl text="admin.minmax.GRAPHS"/>';
		var otherSetMainTitle = '<egui:intnl text="admin.minmax.OTHER SETTINGS"/>';

		var yesRadioOption = '<egui:intnl text="admin.minmax.Yes"/>';
		var noRadioOption = '<egui:intnl text="admin.minmax.No"/>';
		var updateBtnText = '<egui:intnl text="admin.minmax.Update"/>';

		var gridViewOption = '<egui:intnl text="admin.minmax.Grid view"/>';
		var listViewOption = '<egui:intnl text="admin.minmax.List view"/>';

		var alertForAlreadyExists = '<egui:intnl text="admin.minmax.Measure with chosen Display already exists"/>';
		var alertForNoDisplay = '<egui:intnl text="admin.minmax.Please choose the Display"/>';
		var alertForNoMeasure = '<egui:intnl text="admin.minmax.Please choose the Measure"/>';
		var alertForTestType = '<egui:intnl text="admin.minmax.Please choose the Test type"/>';
		var alertForEnableMetricsComp = '<egui:intnl text="admin.minmax.Please enable metrics computation"/>';
		var alertForNoMeasuresConfigured = '<egui:intnl text="admin.minmax.No measures configured"/>';

		var monitorSettingsAlarmsDesc = '<egui:intnl text="admin.minmax.This page enables the administrator to define the settings for the eG monitor interface"/>' + '.';
		var alarmsTitle = '<egui:intnl text="admin.minmax.Alarms"/>';
		//var mouseOverInAlarmLabel = '<egui:intnl text="admin.minmax.Mouse over in alarm page"/>';
		var alarmPopupLabel = '<egui:intnl text="admin.minmax.Alarm popup"/>';
		var nocurAlarms = '<egui:intnl text="admin.minmax.Show alarm window if no alarms "/>';
		var noOfRowsInAlarmLabel = '<egui:intnl text="admin.minmax.Number of rows to be displayed in alarm history page"/>';
		var alertForAlarmRows = '<egui:intnl text="admin.ui.Number of rows to be displayed in alarm history page should be a valid positive integer"/>';

		var monitorSettingsGraphsDesc = '<egui:intnl text="admin.minmax.This page enables the administrator to define the settings for the eG monitor interface"/>' + '.';
		var graphsTitle = '<egui:intnl text="admin.minmax.Graphs"/>';
		var showMonitorGraphs = '<egui:intnl text="admin.minmax.Show monitor graphs in 3D"/>';
		var showReporterGraphs = '<egui:intnl text="admin.minmax.Show reporter graphs in 3D"/>';
		var showNegativeValues = '<egui:intnl text="admin.minmax.Show negative values in graphs"/>';
		var linesToShowDepth  = '<egui:intnl text="admin.minmax.Use lines in 3D graph to show depth"/>';
		var timeline = '<egui:intnl text="admin.minmax.Default timeline for graphs (hours)"/>';
		var timelineDD = '<egui:intnl text="admin.minmax.Timeline for detailed diagnosis (hours)"/>';
		var timescaleMonitor = '<egui:intnl text="admin.minmax.Timescale monitor (secs)"/>';
		var timescaleReporter = '<egui:intnl text="admin.minmax.Timescale reporter (secs)"/>';
		var alertForMonitorTimescale = '<egui:intnl text="admin.ui.Timescale monitor should be a valid positive integer"/>';
		var alertForReporterTimescale = '<egui:intnl text="admin.ui.Timescale reporter should be a valid positive integer"/>';

		var otherDisplaySettingsDesc = '<egui:intnl text="admin.minmax.This page enables the administrator to define the settings for the eG monitor interface"/>' + '.';
		var otherDisplaySettingsTitle = '<egui:intnl text="admin.minmax.Other Display Settings"/>';
		var defaultRefreshFreq = '<egui:intnl text="admin.minmax.Default refresh frequency for monitor webpages (secs)"/>';
		var googleMapKey = '<egui:intnl text="admin.minmax.Google map key"/>';
		var dayWiseDistributionReports = '<egui:intnl text="admin.minmax.Daywise distribution reports in"/>';
		var viewAggComp = '<egui:intnl text="admin.minmax.View for aggregate components"/>';
		var userSearchTimeline = '<egui:intnl text="admin.minmax.Default timeline for User Search"/>';
		var sortCompInDashboard = '<egui:intnl text="admin.minmax.Sort components in dashboards"/>';
		var cmpCount = '<egui:intnl text="admin.minmax.Components count in segment/service/zone list"/>';
		var displayCmpType = '<egui:intnl text="admin.minmax.Display component types in segment/service list"/>';
		var showIconForComp = '<egui:intnl text="admin.minmax.Show icon for component type"/>';
		var showIconForSeg = '<egui:intnl text="admin.minmax.Show icon for segment"/>';
		var showIconForServiceGrp = '<egui:intnl text="admin.minmax.Show icon for service Group"/>';
		var showIconForService = '<egui:intnl text="admin.minmax.Show icon for service"/>';
		//var showAlertAgentExhausted = '<egui:intnl text="admin.minmax.Show alert when agent licenses are exhausted"/>';
		var showOptionalSegList = '<egui:intnl text="admin.minmax.Show Segments in"/>';
		var showOptionalSerList = '<egui:intnl text="admin.minmax.Show Services in"/>';
		var showOptionalZoneList = '<egui:intnl text="admin.minmax.Show Zones in"/>';
		var timeZoneFormat = '<egui:intnl text="admin.minmax.Time zone format to be used"/>';
		var showSubZoneAsTreeNode = '<egui:intnl text="admin.minmax.Show sub zones in Tree view"/>';

		var showAllDescriptors = '<egui:intnl text="admin.minmax.Show all descriptors for a component"/>';
		//var showLicenseAlert = '<egui:intnl text="admin.minmax.Show license expiry alert"/>';
		var showSegInService = '<egui:intnl text="admin.minmax.Show segment(s) in service list"/>';
		var showCompInService = '<egui:intnl text="admin.minmax.Show component(s) in service list"/>';
		var dateFormat = '<egui:intnl text="admin.minmax.Date format to be used"/>';
		var defaultLanguage = '<egui:intnl text="admin.minmax.Default language"/>';
		var problemCompClick = '<egui:intnl text="admin.minmax.When a problem component is clicked"/>';
		var defaultSearchOption = '<egui:intnl text="admin.minmax.Default search"/>';
		var alertForDefaultRefreshFreq = '<egui:intnl text="admin.ui.Default refresh frequency for monitor webpages should be a valid positive integer"/>';
		var alertForFreqGreater = "<egui:intnl text='admin.profile.Refresh frequency should be greater than or equal to 30 seconds'/>";
		var alertForMapKey = '<egui:intnl text="admin.ui.Google map key is not allowed in DBL(Chinese,Korean,Japanese)"/>';
		var alertForComponentsCount = '<egui:intnl text="admin.ui.Components count in segment/service/zone list should be a valid positive integer"/>';

		var configMeasuresDesc = '<egui:intnl text="admin.minmax.This page enables the administrator to configure the measures for Measures At-A-Glance panel of the monitor dashboard"/>' + '.';
		var uedConfigMeasuresDesc = '<egui:intnl text="admin.minmax.This page enables the administrator to configure the measures for User Experience Dashboard of the monitor dashboard"/>' + '.';
		var uedotherDisplaySettingsDesc = '<egui:intnl text="admin.minmax.This page enables the administrator to define the settings for User Experience Dashboard of the monitor dashboard"/>' + '.';
		var uedotherDisplaySettingsTitle = '<egui:intnl text="admin.minmax.Other Display Settings"/>';

		var uedTextMainTitle = '<egui:intnl text="admin.common.User Experience Dashboard"/>';
		var uedTextConfigMeaTitle = '<egui:intnl text="admin.common.Configured Measures"/>';
		var uedTextOtherSetTitle = '<egui:intnl text="admin.common.Other Display Settings"/>';
		var limitComboLabel = '<egui:intnl text="admin.minmax.Limits"/>';
		var dslimitComboLabel = '<egui:intnl text="admin.minmax.Datastore Limits"/>';
		var limitComboEmptyText = '<egui:intnl text="admin.minmax.Select a Limit"/>';
		var addSearchComboLabel = '<egui:intnl text="admin.minmax.User Type for Additional search"/>';
		var addSearchComboEmptyText = '<egui:intnl text="admin.minmax.Select a User Type"/>';
		var addSearchMultiLabel = '<egui:intnl text="admin.minmax.Show Additional search columns"/>';
		var dslimitComboEmptyText = '<egui:intnl text="admin.minmax.Select a Datastore Limit"/>';
		var refreshFreq = '<egui:intnl text="admin.minmax.Refresh frequency (Secs)"/>';
		var dataFromDBLabel = '<egui:intnl text="admin.minmax.Run this Dashboard in the Background"/>';
		//var EnableADGroupLabel = '<egui:intnl text="admin.minmax.Enable AD Group"/>';
		var EnableADGroupLabel = '<egui:intnl text="admin.minmax.Show AD Groups for User Types"/>';
		var noDataFromDBLabel = '<egui:intnl text="admin.minmax.No"/>';
		var radioBtnChange = '<egui:intnl text="admin.minmax.Please restart the manager to run this Dashboard in the Background"/>.';

		var configMeasuresTitle = '<egui:intnl text="admin.minmax.Configure Measures"/>';
		var testName = '<egui:intnl text="admin.minmax.Test name"/>';
		var noMeasures = '<egui:intnl text="admin.minmax.No measures for selections"/>';
		var testText = '<egui:intnl text="admin.minmax.Test"/>';
		var measureText = '<egui:intnl text="admin.minmax.Measure"/>';
		var displayText = '<egui:intnl text="admin.minmax.Display"/>';

		var addAMeasureTitle = '<egui:intnl text="admin.minmax.Add A New Measure"/>';
		var disableMeasureTitle = '<egui:intnl text="admin.minmax.Disable Metrics Computation"/>';
		var testNameInAdd = '<egui:intnl text="admin.minmax.Test name"/>';
		var fromLbl = '<egui:intnl text="admin.minmax.From"/>';
		var processLbl = '<egui:intnl text="admin.minmax.Process Name"/>';
		var procUnitLbl = '<egui:intnl text="admin.minmax.Process Unit"/>';
		var testTsbleLbl = '<egui:intnl text="admin.minmax.Test Table"/>';
		var ddLbl = '<egui:intnl text="admin.minmax.DD Table"/>';
		var measureInAdd = '<egui:intnl text="admin.minmax.Measure"/>';
		var displayInAdd = '<egui:intnl text="admin.minmax.Display"/>';
		var addBtnText = '<egui:intnl text="admin.minmax.Add"/>';
		
		var userTypeInAdd = '<egui:intnl text="admin.minmax.User Type"/>';
		var modifyMeasureTitle = '<egui:intnl text="admin.minmax.Modify Display Name"/>';
		var modifyBtnText = '<egui:intnl text="admin.minmax.Modify"/>';
		
		var limitComboEmptyText = '<egui:intnl text="admin.minmax.Select a Limit"/>';
		var testComboEmptyText = '<egui:intnl text="admin.minmax.Please choose a Test"/>';
		var measComboEmptyText = '<egui:intnl text="admin.minmax.Please choose a Measure"/>';
		var UEDSettingsTitle = '<egui:intnl text="admin.minmax.UED Default Settings"/>';
		var userTypeError = '<egui:intnl text="admin.minmax.Please Select a User Type"/>';
		var testError = '<egui:intnl text="admin.minmax.Please Select a Test"/>';
		var measureError = '<egui:intnl text="admin.minmax.Please Select a Measure"/>';
		var displayNameError = '<egui:intnl text="admin.minmax.Please Enter the Display Name"/>';
		var freqError = '<egui:intnl text="admin.minmax.Refresh Frequency must be valid positive Integer and greater than 0"/>';
		var specCharError = '<egui:intnl text="admin.minmax.Special Characters are not allowed"/>';
		var alertForDeleteMeasure = '<egui:intnl text="admin.minmax.Are you sure you want to delete the selected measure "/>';

		var minimumRadioOption = '<egui:intnl text="admin.minmax.Minimum"/>';
		var maximumRadioOption = '<egui:intnl text="admin.minmax.Maximum"/>';

		var enableOrDisableMetrics = '<egui:intnl text="admin.minmax.Enable/Disable Metrics"/>';
		var enableMetricComputation = '<egui:intnl text="admin.minmax.Please enable metrics computation" />';
		var alertDisableMetrics = '<egui:intnl text="admin.minmax.Are you sure you want to disable metrics computation ?" />';
		var alertEnableMetrics = '<egui:intnl text="admin.minmax.Are you sure you want to enable metrics computation ?" />';

		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 errorTitle = '<egui:intnl text="admin.user.Error"/>';

		var updateSuccess = '<egui:intnl text="admin.minmax.Settings have been updated successfully"/>.';
		var updateNotSuccess = '<egui:intnl text="admin.minmax.Settings have not been updated successfully"/>.';

		var metricsDisabled = '<egui:intnl text="admin.minmax.Metrics computation has been disabled"/>';
		var metricsEnabled = '<egui:intnl text="admin.minmax.Metrics computation has been enabled"/>';
	</script>

	<!-- Application folder -->
	<script type="text/javascript" src="EgMonitorSettings/app/app.js"></script>

	<script language="javascript">
		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
					{
						console.log(response.responseText);
						Ext.Msg.show({
							title : errorTitle,
							msg : probsErrorMessage,
							buttons : Ext.Msg.OK,
							icon : 'iconError'
						});
					}
				}
			});
		});
	</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>



