Ext.Msg.bodyPadding="10 0";Ext.Msg.cls="adminAlert";var me=this;Ext.define("EgMonitorSettings.controller.Main",{extend:"Ext.app.Controller",views:["SettingList","Alarms","Graphs","OtherDisplaySettings","ConfiguredMeasures","NewMeasure","Viewport","UEDConfiguredMeasures","UEDModifyMeasure","UEDNewMeasure","UEDOtherDisplaySettings"],refs:[{selector:"settinglist",ref:"settinglist"},{selector:"main",ref:"main"},{selector:"refresh",ref:"refresh"},{selector:"alarms",ref:"alarms"},{selector:"graphs",ref:"graphs"},{selector:"otherdisplaysettings",ref:"otherdisplaysettings"},{selector:"newmeasure",ref:"newmeasure"},{selector:"configuredmeasures",ref:"configuredmeasures"},{selector:"viewport",ref:"viewport"},],init:function(){this.control({"viewport":{"afterrender":this.afterMainRender},"settinglist":{"itemclick":this.onClickData},'alarms button[id="alarmUpdateBtn"]':{"click":this.alarmsUpdate},'graphs button[id="graphsUpdateBtn"]':{"click":this.graphsUpdate},'otherdisplaysettings button[id="otherSetUpdateBtn"]':{"click":this.otherSetUpdate},'viewport button[id="tbarEnableId"]':{"click":this.enableOrDisableMetrics},'viewport button[id="tbarAddId"]':{"click":this.addNewMeasure},'configuredmeasures combo[id="viewTestsId"]':{"select":this.viewTestsComboChange},'configuredmeasures actioncolumn[id="deleteMetrics"]':{"click":this.deleteMetrics},'configuredmeasures grid[id="mainGrid"]':{},'newmeasure combo[id="testnameId"]':{"select":this.testComboChange},'newmeasure button[id="measuresAddBtn"]':{"click":this.measuresAdd},'uedconfiguredmeasures combo[id="uedUserTypeId"]':{"select":this.userTypeUEDComboChange},'uedconfiguredmeasures actioncolumn[id="uedModifyMetrics"]':{"click":this.modifyUEDMetrics},'uedconfiguredmeasures actioncolumn[id="uedDeleteMetrics"]':{"click":this.deleteUEDMetrics},'uednewmeasure combo[id="userTypeId"]':{"select":this.loadUEDTests},'uednewmeasure combo[id="testnameId"]':{"select":this.loadUEDMeasureForTest},'uednewmeasure radiogroup[id="tableData"]':{"change":this.loadUEDTests},'uednewmeasure combo[id="measureid"]':{"select":this.loadUEDMeasureDisplay},'uednewmeasure combo[id="processId"]':{"select":this.loadUEDProcessDisplay},'viewport button[id="tbarUEdAddId"]':{"click":this.addUEDNewMetrics},'uednewmeasure button[id="uedmeasAddBtn"]':{"click":this.addUEDMeasures},'uedmodifymeasure button[id="modifyBtn"]':{"click":this.modifyUEDMeasures},'uedotherdisplaysettings button[id="UEDUpdateBtn"]':{"click":this.updateUEDSettings},"uedotherdisplaysettings textfield[id=addUedLimit]":{specialkey:function(b,a){if(a.getKey()==a.ENTER){this.addUedLimit();
}}},});},afterMainRender:function(){Ext.getCmp("innerPanel").setTitle("ALARMS");var g="alarms";var c=Ext.getCmp("tbarfillId");var b=Ext.getCmp("tbarEnableId");var e=Ext.getCmp("tbarAddId");var d=Ext.getCmp("monitorSetTreePanel");var f="alarmsId";var a="/final/admin/EgMonitorSettings/data/eguiJSON.jsp?process="+g;
Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(j){var o=j.responseText;var m=Ext.decode(o);var l=m.alarmsDataJson.show_alarm_popup;var p=m.alarmsDataJson.max_page_items;var k=m.alarmsDataJson.no_curr_alarms;var n=Ext.getCmp("nocurAlarms");if(l=="yes"){Ext.getCmp("yesAlarmsPopup").setValue(l);
n.setVisible(true);}if(l=="no"){Ext.getCmp("noAlarmsPopup").setValue(l);}if(k=="yes"){Ext.getCmp("nocurAlarmsyes").setValue(k);}if(k=="no"){Ext.getCmp("nocurAlarmsno").setValue(k);}Ext.getCmp("rowMultiplierID").setValue(p);var h=d.getStore().getNodeById(f);d.getSelectionModel().select(h);}});},onClickData:function(o,j,s,k,l,m){var n=Ext.getCmp("mainViewId");
var r=Ext.getCmp("innerPanel");var h=Ext.getCmp("tbarfillId");var c=Ext.getCmp("tbarEnableId");var g=Ext.getCmp("tbarAddId");var d=Ext.getCmp("monitorSetTreePanel");var f="";if(k=="1"){r.removeAll();r.add({xtype:"alarms"});Ext.getCmp("innerPanel").setTitle(alarmsMainTitle);Ext.getCmp("mainViewDesc").update('<center><img src="/final/images/spacer.gif" class="iconAdminInfo" valign="middle" style="margin-right:2px"/>&nbsp'+monitorSettingsAlarmsDesc+"</center>");
var b="alarms";var a="/final/admin/EgMonitorSettings/data/eguiJSON.jsp?process="+b;Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(e){var x=e.responseText;var v=Ext.decode(x);var u=v.alarmsDataJson.show_alarm_popup;var y=v.alarmsDataJson.max_page_items;var t=v.alarmsDataJson.no_curr_alarms;
var w=Ext.getCmp("nocurAlarms");if(u=="yes"){Ext.getCmp("yesAlarmsPopup").setValue(u);w.setVisible(true);}if(u=="no"){Ext.getCmp("noAlarmsPopup").setValue(u);}if(t=="yes"){Ext.getCmp("nocurAlarmsyes").setValue(t);}if(t=="no"){Ext.getCmp("nocurAlarmsno").setValue(t);}Ext.getCmp("rowMultiplierID").setValue(y);
}});}if(k=="2"){r.removeAll();r.add({xtype:"graphs"});Ext.getCmp("innerPanel").setTitle(graphsMainTitle);Ext.getCmp("mainViewDesc").update('<center><img src="/final/images/spacer.gif" class="iconAdminInfo" valign="middle" style="margin-right:2px"/>&nbsp'+monitorSettingsGraphsDesc+"</center>");var b="graphs";
var a="/final/admin/EgMonitorSettings/data/eguiJSON.jsp?process="+b;Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(v){var e=v.responseText;var y=Ext.decode(e);var z=y.graphsDataJson.show_negatives;var u=y.graphsDataArrayJson;var A=y.dataDisplayJson.dataDisplay;var B=y.detailedDiagnosisArrayJson;
var w=y.ddDisplayJson.ddDisplay;var x=y.timeScaleMonitorJson.timeScaleMonitor;var t=y.timeScaleReporterJson.timeScaleReporter;if(z=="TRUE"){Ext.getCmp("yesSHOW_NEGATIVES").setValue(true);}if(z=="FALSE"){Ext.getCmp("noSHOW_NEGATIVES").setValue(true);}Ext.getCmp("GRAPHS$DATA_DISPLAY").getStore().loadRawData(u);
Ext.getCmp("GRAPHS$DATA_DISPLAY").setValue(u[0].displayField);if(!Ext.isEmpty(A)){Ext.getCmp("GRAPHS$DATA_DISPLAY").setValue(A);}else{Ext.getCmp("GRAPHS$DATA_DISPLAY").setValue(u[0].displayField);}Ext.getCmp("GRAPHS$DD_DISPLAY").getStore().loadRawData(B);Ext.getCmp("GRAPHS$DD_DISPLAY").setValue(B[0].displayField);
if(!Ext.isEmpty(w)){Ext.getCmp("GRAPHS$DD_DISPLAY").setValue(w);}else{Ext.getCmp("GRAPHS$DD_DISPLAY").setValue(B[0].displayField);}Ext.getCmp("GRAPHS$TIMESCALE_MONITOR").setValue(x);Ext.getCmp("GRAPHS$TIMESCALE_REPORTER").setValue(t);}});}if(k=="3"){r.removeAll();r.add({xtype:"otherdisplaysettings"});
Ext.getCmp("innerPanel").setTitle(otherSetMainTitle);Ext.getCmp("mainViewDesc").update('<center><img src="/final/images/spacer.gif" class="iconAdminInfo" valign="middle" style="margin-right:2px"/>&nbsp'+otherDisplaySettingsDesc+"</center>");var b="othersettings";var a="/final/admin/EgMonitorSettings/data/eguiJSON.jsp?process="+b;
Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(y){var B=y.responseText;var M=Ext.decode(B);var aa=M.refreshDataJson.defaultt;var J=M.otherSettingsJson.iMapSettings;var E=M.eventDurationArrayJson;var z=M.otherSettingsJson.eventduration;var N=M.aggregateCompArrayJson;var e=M.otherSettingsJson.aggregateComp;
var C=M.sortPerCountArrayJson;var I=M.otherSettingsJson.sortpercount;var W=M.otherSettingsJson.no_of_servers;var D=M.otherSettingsJson.display_comp_type;var X=M.otherSettingsJson.component;var v=M.otherSettingsJson.Segment;var R=M.otherSettingsJson.serviceGroup;var t=M.otherSettingsJson.Service;var w=M.otherSettingsJson.expand;
var P=M.otherSettingsJson.show_segment;var A=M.otherSettingsJson.show_component;var ab=M.otherSettingsJson.optionalSegmentList;var T=M.otherSettingsJson.optionalServiceList;var x=M.otherSettingsJson.optionalZoneList;var H=M.dateFormatForOtherSetArrayJson;var Z=M.otherSettingsJson.selectedDateFormat;var Y=M.otherSettingsJson.selectedTimezoneFormat;
var S=M.timeZoneForOtherSetArrayJson;var ac=M.countryNamForOtherSetArrayJson;var K=M.otherSettingsJson.defaultLanguage;var u=M.defaultLanguageJson;var G=M.problemActionArrayJson;var V=M.otherSettingsJson.show_problematic_measure;var Q=M.defaultSearchOptionForOtherSetArrayJson;var O=M.otherSettingsJson.selectedDefaultSearchOption;
var U=M.otherSettingsJson.showSubZoneAsTreeNode;Ext.getCmp("refreshID").setValue(aa);Ext.getCmp("googleMapKey").setValue(J);Ext.getCmp("componentsCount").setValue(W);Ext.getCmp("reporterDaywiseDistributionId").getStore().loadRawData(E);if(!Ext.isEmpty(z)){Ext.getCmp("reporterDaywiseDistributionId").setValue(z);
}else{Ext.getCmp("reporterDaywiseDistributionId").setValue(E[0].displayField);}var L=M.otherSettingsJson.usersearchtimeline;var F=M.userSaerchArrayJson;Ext.getCmp("userSearchTimelineId").getStore().loadRawData(F);if(!Ext.isEmpty(L)){Ext.getCmp("userSearchTimelineId").setValue(L);}else{if(F.length>0){Ext.getCmp("userSearchTimelineId").setValue(F[0].displayField);
}else{Ext.getCmp("userSearchTimelineId").hide();}}Ext.getCmp("aggregateCompView").getStore().loadRawData(N);if(!Ext.isEmpty(e)){Ext.getCmp("aggregateCompView").setValue(e);}else{if(N.length>0){Ext.getCmp("aggregateCompView").setValue(N[0].displayField);}else{Ext.getCmp("aggregateCompView").hide();}}Ext.getCmp("sortCompInDash").getStore().loadRawData(C);
if(I=="TRUE"||I=="True"){I="True";}if(!Ext.isEmpty(I)){Ext.getCmp("sortCompInDash").setValue(I);}else{Ext.getCmp("sortCompInDash").setValue(C[0].displayField);}Ext.getCmp("dateFormat").getStore().loadRawData(H);if(!Ext.isEmpty(I)){Ext.getCmp("dateFormat").setValue(Z);}else{Ext.getCmp("dateFormat").setValue(H[0].displayField);
}Ext.getCmp("defaultLanguage").getStore().loadRawData(ac);if(!Ext.isEmpty(K)){Ext.getCmp("defaultLanguage").setValue(K);}else{Ext.getCmp("defaultLanguage").setValue(ac[0].displayField);}Ext.getCmp("problemAction").getStore().loadRawData(G);if(!Ext.isEmpty(V)){Ext.getCmp("problemAction").setValue(V);}else{Ext.getCmp("problemAction").setValue(G[0].displayField);
}Ext.getCmp("defaultSearchOption").getStore().loadRawData(Q);if(!Ext.isEmpty(O)){Ext.getCmp("defaultSearchOption").setValue(O);}else{Ext.getCmp("defaultSearchOption").setValue(defaultSearchOption[0].displayField);}if(D=="true"||D=="True"){Ext.getCmp("yesSERVER_DISP_DETAILS$DISPLAY_COMP_TYPE").setValue("True");
}if(D=="false"||D=="False"){Ext.getCmp("noSERVER_DISP_DETAILS$DISPLAY_COMP_TYPE").setValue("False");}if(X=="True"){Ext.getCmp("yesSHOW_IMAGE$Component").setValue("True");}if(X=="False"){Ext.getCmp("noSHOW_IMAGE$Component").setValue("False");}if(v=="True"){Ext.getCmp("yesSHOW_IMAGE$Segment").setValue("True");
}if(v=="False"){Ext.getCmp("noSHOW_IMAGE$Segment").setValue("False");}if(R=="True"){Ext.getCmp("yesSHOW_IMAGE$serviceGroup").setValue("True");}if(R=="False"){Ext.getCmp("noSHOW_IMAGE$serviceGroup").setValue("False");}if(t=="True"){Ext.getCmp("yesSHOW_IMAGE$Service").setValue("True");}if(t=="False"){Ext.getCmp("yesSHOW_IMAGE$Service").setValue("False");
}if(w=="True"){Ext.getCmp("yesALLOW_INFO_EXPANDING$expand").setValue("True");}if(w=="False"){Ext.getCmp("noALLOW_INFO_EXPANDING$expand").setValue("False");}if(P=="True"){Ext.getCmp("yesALLOW_INFO_EXPANDING$expand").setValue("True");}if(P=="False"){Ext.getCmp("yesSERVICE_LIST$show_segment").setValue("False");
}if(A=="True"){Ext.getCmp("yesSERVICE_LIST$show_component").setValue("True");}if(A=="False"){Ext.getCmp("noSERVICE_LIST$show_component").setValue("False");}if(ab=="True"||ab=="true"){Ext.getCmp("yesOptionalList_Pages$segmentList").setValue("True");}if(ab=="False"||ab=="false"){Ext.getCmp("noOptionalList_Pages$segmentList").setValue("False");
}if(T=="True"||T=="true"){Ext.getCmp("yesOptionalList_Pages$serviceList").setValue("True");}if(T=="False"||T=="false"){Ext.getCmp("noOptionalList_Pages$serviceList").setValue("False");}if(x=="True"||x=="true"){Ext.getCmp("yesOptionalList_Pages$zonelist").setValue("True");}if(x=="False"||x=="false"){Ext.getCmp("noOptionalList_Pages$zonelist").setValue("False");
}if(!Ext.isEmpty(Y)){Ext.getCmp("timeFormat").setValue(Y);}else{Ext.getCmp("timeFormat").setValue("SHORT");}if(U=="True"||U=="true"||U=="TRUE"){Ext.getCmp("yesMISC_ARGS$ShowSubZoneAsTreeNode").setValue("True");}if(U=="False"||U=="false"||U=="FALSE"){Ext.getCmp("noMISC_ARGS$ShowSubZoneAsTreeNode").setValue("False");
}}});}if(k=="5"){var q="";r.removeAll();r.add({xtype:"configuredmeasures"});Ext.getCmp("innerPanel").setTitle("CONFIGURED MEASURES");Ext.getCmp("mainViewDesc").update('<center><img src="/final/images/spacer.gif" class="iconAdminInfo" valign="middle" style="margin-right:2px"/>&nbsp'+configMeasuresDesc+"</center>");
var b="AllMeasures";var a="/final/admin/EgMonitorSettings/data/minmaxConfigJSON.jsp?index=main&process="+b;Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(u){var w=u.responseText;var v=Ext.decode(w);q=v.enableorDisableMetricsJson.minmaxEnabled;if(q=="true"||q){meadis="NO";Ext.getCmp("tbarEnableId").setText("Disable Metrics Computation");
}if(q=="false"||!q){meadis="YES";Ext.getCmp("tbarEnableId").setText("Enable Metrics Computation");Ext.getCmp("viewTestsId").setDisabled(true);Ext.getCmp("tbarAddId").setDisabled(true);}var t=Ext.getCmp("mainGrid");var e=Ext.getCmp("viewTestsId");t.show();t.getStore().loadRawData(v.configMeasuresArrayJson);
if(Ext.isEmpty(v.testArrayJson)){t.getStore().loadRawData("");e.setValue("Not Applicable");Ext.get("emptyTextDiv").update(alertForEnableMetricsComp);}else{e.getStore().loadRawData(v.testArrayJson);e.setValue(v.testArrayJson[0].displayField);t.getStore().loadRawData(v.configMeasuresArrayJson);}}});}if(k=="7"){r.removeAll();
r.add({xtype:"uedconfiguredmeasures"});Ext.getCmp("innerPanel").setTitle("CONFIGURED MEASURES");Ext.getCmp("mainViewDesc").update('<center><img src="/final/images/spacer.gif" class="iconAdminInfo" valign="middle" style="margin-right:2px"/>&nbsp'+uedConfigMeasuresDesc+"</center>");var b="ShowAllMeasures";
var p=Ext.getCmp("uedUserTypeId").getValue();if(p==null||p==undefined){p="AllUserTypes";}var a="/final/admin/EgMonitorSettings/data/uedConfigJSON.jsp?index=main&process="+b+"&user_type="+p;Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(t){var w=t.responseText;var v=Ext.decode(w);var e=Ext.getCmp("mainGrid");
var u=Ext.getCmp("uedUserTypeId");e.show();e.getStore().loadRawData(v.configMeasuresArrayJson);if(Ext.isEmpty(v.testArrayJson)){e.getStore().loadRawData("");u.setValue("Not Applicable");Ext.get("emptyTextDiv").update(alertForEnableMetricsComp);}else{u.getStore().loadRawData(v.testArrayJson);u.setValue(v.testArrayJson[0].valueField);
e.getStore().loadRawData(v.configMeasuresArrayJson);}}});}if(k=="8"){r.removeAll();r.add({xtype:"uedotherdisplaysettings"});Ext.getCmp("innerPanel").setTitle("OTHER DISPLAY SETTINGS");Ext.getCmp("mainViewDesc").update('<center><img src="/final/images/spacer.gif" class="iconAdminInfo" valign="middle" style="margin-right:2px"/>&nbsp'+uedotherDisplaySettingsDesc+"</center>");
var b="uedOtherSettings";var a="/final/admin/EgMonitorSettings/data/uedConfigJSON.jsp?process="+b;Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(A){var v=A.responseText;var D=Ext.decode(v);var e=D.limitsJson.limitsArrayJson;var w=D.limitsJson.limitsDefaultJson;var C=D.dsLimitsJson.dslimitsArrayJson;
var z=D.dsLimitsJson.dslimitsDefaultJson;Ext.getCmp("limitId").getStore().loadRawData(e);Ext.getCmp("limitId").setValue(w);Ext.getCmp("dslimitId").getStore().loadRawData(C);Ext.getCmp("dslimitId").setValue(z);var E=D.refreshFrequencyJson.refreshFrequency;Ext.getCmp("refreshFreqId").setValue(E);var F=D.enableAdGroupJson;
var y=D.defaultADGroupJson.defaultADGroup;if(!Ext.isEmpty(F)){Ext.getCmp("adGroupId").getStore().loadRawData(F);}if(Ext.isEmpty(y)){Ext.getCmp("adGroupId").setValue("None");}else{Ext.getCmp("adGroupId").setValue(y);}if(!Ext.isEmpty(D.asUsrTypeJson)&&D.asUsrTypeJson!=undefined&&D.asUsrTypeJson!=null){var u=D.asUsrTypeJson.asUsrTypeArr;
var B=D.asUsrTypeJson.adSearchSelectedType;Ext.getCmp("searchUserTypeId").getStore().loadRawData(u);Ext.getCmp("searchUserTypeId").setValue(B);var x=D.asUsrTypeMulJson;var t=D.adSearchSelectedVal;if(!Ext.isEmpty(x)){Ext.getCmp("searchUserTypeMulId").getStore().loadRawData(x);}if(Ext.isEmpty(t)){Ext.getCmp("searchUserTypeMulId").setValue("None");
}else{Ext.getCmp("searchUserTypeMulId").setValue(t);}}}});}},alarmsUpdate:function(){var e=new Ext.form.field.Hidden({xtype:"hidden",id:"$_HIDE_ALARM_POPUP$alarm_popup",name:"$_HIDE_ALARM_POPUP$alarm_popup",});Ext.getCmp("generalPanel").add(e);var g=new Ext.form.field.Hidden({xtype:"hidden",id:"$_ALARMS$Row_Multiplier",name:"$_ALARMS$Row_Multiplier",});
Ext.getCmp("generalPanel").add(g);var j=new Ext.form.field.Hidden({xtype:"hidden",id:"$_HIDE_ALARM_POPUP$no_curr_alarms",name:"$_HIDE_ALARM_POPUP$no_curr_alarms",});Ext.getCmp("generalPanel").add(j);var d=Ext.getCmp("rowMultiplierID").getValue();var c="";var h="";var k="";var f="true";var b="alarms";
var a="/final/admin/EgMonitorSettings/data/eguiJSON.jsp?process="+b;Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(q){var o=q.responseText;var t=Ext.decode(o);var p=t.alarmsDataJson.show_alarm_popup;var w=t.alarmsDataJson.no_curr_alarms;var v=t.alarmsDataJson.max_page_items;var l=Ext.getCmp("yesAlarmsPopup");
var r=Ext.getCmp("noAlarmsPopup");if(p=="yes"||p=="Yes"||p=="YES"){h="Alarm popup$True";}if(p=="no"||p=="No"||p=="NO"){h="Alarm popup$False";}e.setValue(h);var s=Ext.getCmp("nocurAlarms");var s=Ext.getCmp("nocurAlarms");if(w=="yes"||w=="Yes"||w=="YES"){k="CurrAlarms$True";}if(w=="no"||w=="No"||w=="NO"){k="CurrAlarms$False";
}j.setValue(k);var u="Number of rows to be displayed in alarm page$"+v;g.setValue(u);var n=validateTextBoxes("alarms","noOfRows",d);if(n=="false"){Ext.Msg.show({title:alarmsTitle,msg:alertForAlarmRows,buttons:Ext.Msg.OK,icon:"iconExclamation"});f="false";}var m=this.getAlarms().getForm();if(f=="true"){if(m.isValid()){m.submit({url:"/final/admin/EgMonitorSettings/data/eguiJSONp.jsp?process=alarms",method:"POST",success:function(x,y){Ext.Msg.show({title:alarmsTitle,msg:updateSuccess,width:400,buttons:Ext.Msg.OK,icon:"iconInformation"});
},failure:function(x,y){Ext.Msg.show({title:alarmsTitle,msg:updateNotSuccess,width:400,buttons:Ext.Msg.OK,icon:"iconExclamation"});}});}else{Ext.Msg.show({title:alarmsTitle,msg:updateNotSuccess,width:400,buttons:Ext.Msg.OK,icon:"iconExclamation"});}}}});},graphsUpdate:function(){var n=new Ext.form.field.Hidden({xtype:"hidden",id:"$_GRAPHS$SHOW_NEGATIVESID",name:"$_GRAPHS$SHOW_NEGATIVES",});
Ext.getCmp("generalPanel").add(n);var a=new Ext.form.field.Hidden({xtype:"hidden",id:"$_GRAPHS$DATA_DISPLAYID",name:"$_GRAPHS$DATA_DISPLAY",});Ext.getCmp("generalPanel").add(a);var o=new Ext.form.field.Hidden({xtype:"hidden",id:"$_GRAPHS$DD_DISPLAYID",name:"$_GRAPHS$DD_DISPLAY",});Ext.getCmp("generalPanel").add(o);
var h=new Ext.form.field.Hidden({xtype:"hidden",id:"$_GRAPHS$TIMESCALE_MONITORID",name:"$_GRAPHS$TIMESCALE_MONITOR",});Ext.getCmp("generalPanel").add(h);var r=new Ext.form.field.Hidden({xtype:"hidden",id:"$_GRAPHS$TIMESCALE_REPORTERID",name:"$_GRAPHS$TIMESCALE_REPORTER",});Ext.getCmp("generalPanel").add(r);
var p=Ext.getCmp("GRAPHS$TIMESCALE_MONITOR").getValue();var j=Ext.getCmp("GRAPHS$TIMESCALE_REPORTER").getValue();var q="";var c="";var s="";var k="";var m="";var b="";var f="";var d="";var g="true";var l="graphs";var e="/final/admin/EgMonitorSettings/data/eguiJSON.jsp?process="+l;Ext.Ajax.request({url:e,scope:this,method:"POST",success:function(u){var D=u.responseText;
var x=Ext.decode(D);var I=x.graphsDataJson.show_negatives;var K=x.graphsDataArrayJson;var C=x.dataDisplayJson.dataDisplay;var y=x.detailedDiagnosisArrayJson;var w=x.ddDisplayJson.ddDisplay;var B=x.timeScaleMonitorJson.timeScaleMonitor;var J=x.timeScaleReporterJson.timeScaleReporter;var L="";var v=Ext.getCmp("yesSHOW_NEGATIVES");
var F=Ext.getCmp("noSHOW_NEGATIVES");if(I=="TRUE"){L="Show negative values in graphs$true";}if(I=="FALSE"){L="Show negative values in graphs$false";}n.setValue(L);var z=Ext.getCmp("GRAPHS$DATA_DISPLAY").getValue();m="Timeline for graphs in hours$"+C;a.setValue(m);var H=Ext.getCmp("GRAPHS$DD_DISPLAY").getValue();
b="Timeline for detailed diagnosis in hours$"+w;o.setValue(b);f="Timescale monitor$"+B;h.setValue(f);d="Timescale reporter$"+J;r.setValue(d);var G=validateTextBoxes("graphs","monitorTimeScale",p);var E=validateTextBoxes("graphs","reporterTimeScale",j);if(G=="false"||G==false){Ext.Msg.show({title:graphsTitle,msg:alertForMonitorTimescale,buttons:Ext.Msg.OK,icon:"iconExclamation"});
g="false";}if(E=="false"||E==false){Ext.Msg.show({title:graphsTitle,msg:alertForReporterTimescale,buttons:Ext.Msg.OK,icon:"iconExclamation"});g="false";}if(g=="true"){var t=new Ext.LoadMask(Ext.getBody(),{msg:"Processing..."});t.show();var A=this.getGraphs().getForm();if(A.isValid()){A.submit({url:"/final/admin/EgMonitorSettings/data/eguiJSONp.jsp?process=graphs",method:"POST",success:function(M,N){Ext.Msg.show({title:graphsTitle,msg:updateSuccess,width:300,buttons:Ext.Msg.OK,icon:"iconInformation"});
t.hide();},failure:function(M,N){Ext.Msg.show({title:graphsTitle,msg:updateNotSuccess,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});t.hide();}});}else{t.hide();Ext.Msg.show({title:graphsTitle,msg:updateNotSuccess,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});}}}});},otherSetUpdate:function(){var aj=Ext.getCmp("noOptionalList_Pages$serviceList").getValue();
var W=Ext.getCmp("noOptionalList_Pages$zonelist").getValue();var ab=Ext.getCmp("noOptionalList_Pages$segmentList").getValue();var aI="true";if(W=="true"||W==true){localStorage.setItem("optionallistpanel","2");}else{if(aj=="true"||aj==true){localStorage.setItem("serviceoptionallistpanel","2");}else{if(ab=="true"||ab==true){localStorage.setItem("segmentoptionallistpanel","2");
}else{localStorage.setItem("optionallistpanel","1");localStorage.setItem("serviceoptionallistpanel","1");localStorage.setItem("segmentoptionallistpanel","1");}}}var ax=Ext.getCmp("refreshID").getValue();var ah=Ext.getCmp("$_REFRESH$DefaultID");var aG=Ext.getCmp("$_Search_Default_Selection$defaultID");
var h=Ext.getCmp("ZONE_MAP$google_map_keyID");var Z=Ext.getCmp("$_REPORTER$EVENTDURATIONID");var D=Ext.getCmp("SEARCH_DISPLAY$Timeline");var r=Ext.getCmp("$_SERVER_DISP_DETAILS$NO_OF_SERVERSID");var ad=Ext.getCmp("$_COMPONENT_METRIC_VIEW$AggregateCompID");var af=Ext.getCmp("$_SERVER_DISP_DETAILS$SORTPERCOUNTID");
var aw=Ext.getCmp("$_TIMEZONE_FORMAT$selectedTimezoneFormatID");var ai=Ext.getCmp("$_CURRENT_DATE_FORMAT$selectedDateFormatID");var q=Ext.getCmp("$_DEFAULT_LANGUAGE$defaultLanguageID");var f=Ext.getCmp("$_LayerModel_OpenMeasures$ProblematicMeasureID");var R=Ext.getCmp("$_SERVER_DISP_DETAILS$DISPLAY_COMP_TYPEID");
var av=Ext.getCmp("$_SHOW_IMAGE$ComponentID");var aA=Ext.getCmp("$_SHOW_IMAGE$SegmentID");var aD=Ext.getCmp("$_SHOW_IMAGE$serviceGroupID");var K=Ext.getCmp("$_SHOW_IMAGE$ServiceID");var w=Ext.getCmp("$_ALLOW_INFO_EXPANDING$expandID");var al=Ext.getCmp("$_SERVICE_LIST$show_segmentID");var O=Ext.getCmp("$_SERVICE_LIST$show_componentID");
var e=Ext.getCmp("OptionalList_Pages$segmentList_ID");var ac=Ext.getCmp("$OptionalList_Pages$serviceList_ID");var aF=Ext.getCmp("$OptionalList_Pages$zonelist_ID");var az=Ext.getCmp("$_OptionalList_Pages$segmentList_ID");var M=Ext.getCmp("$_OptionalList_Pages$serviceList_ID");var V=Ext.getCmp("$_OptionalList_Pages$zonelist_ID");
var m=Ext.getCmp("googleMapKey").getValue();var ap=Ext.getCmp("componentsCount").getValue();var G=Ext.getCmp("reporterDaywiseDistributionId").getValue();var at=Ext.getCmp("aggregateCompView").getValue();var p=Ext.getCmp("sortCompInDash").getValue();var aa=Ext.getCmp("dateFormat").getValue();var aC=Ext.getCmp("defaultLanguage").getValue();
var u=Ext.getCmp("problemAction").getValue();var ag=Ext.getCmp("yesSERVER_DISP_DETAILS$DISPLAY_COMP_TYPE");var z=Ext.getCmp("noSERVER_DISP_DETAILS$DISPLAY_COMP_TYPE");var J=Ext.getCmp("yesSHOW_IMAGE$Component");var ae=Ext.getCmp("noSHOW_IMAGE$Component");var am=Ext.getCmp("yesSHOW_IMAGE$Segment");var X=Ext.getCmp("noSHOW_IMAGE$Segment");
var Y=Ext.getCmp("yesSHOW_IMAGE$serviceGroup");var j=Ext.getCmp("noSHOW_IMAGE$serviceGroup");var b=Ext.getCmp("yesSHOW_IMAGE$Service");var aB=Ext.getCmp("noSHOW_IMAGE$Service");var aE=Ext.getCmp("yesALLOW_INFO_EXPANDING$expand");var L=Ext.getCmp("noALLOW_INFO_EXPANDING$expand");var A=Ext.getCmp("yesSERVICE_LIST$show_segment");
var ay=Ext.getCmp("noSERVICE_LIST$show_segment");var ak=Ext.getCmp("yesSERVICE_LIST$show_component");var n=Ext.getCmp("noSERVICE_LIST$show_component");var k=Ext.getCmp("yesOptionalList_Pages$segmentList");var Q=Ext.getCmp("noOptionalList_Pages$segmentList");var S=Ext.getCmp("yesOptionalList_Pages$serviceList");
var x=Ext.getCmp("noOptionalList_Pages$serviceList");var a=Ext.getCmp("yesOptionalList_Pages$zonelist");var s=Ext.getCmp("noOptionalList_Pages$zonelist");var T=Ext.getCmp("$MISC_ARGS$ShowSubZoneAsTreeNode_ID");var aq="";var N="";var aH="";var o="";var ao="";var B="";var ar="";var t="";var l="";var I="";
var U="";var g="";var F="";var d="";var au="";var an="";var H="";var C="";var v="";var E="";var P="";var c="othersettings";var y="/final/admin/EgMonitorSettings/data/eguiJSON.jsp?process="+c;Ext.Ajax.request({url:y,scope:this,method:"POST",success:function(aP){var aT=aP.responseText;var a6=Ext.decode(aT);
var bm=a6.refreshDataJson.defaultt;var a3=a6.otherSettingsJson.iMapSettings;var aY=a6.eventDurationArrayJson;var aQ=a6.otherSettingsJson.eventduration;var a7=a6.aggregateCompArrayJson;var aJ=a6.otherSettingsJson.aggregateComp;var aU=a6.sortPerCountArrayJson;var a1=a6.otherSettingsJson.sortpercount;var bi=a6.otherSettingsJson.no_of_servers;
var aX=a6.otherSettingsJson.display_comp_type;var bj=a6.otherSettingsJson.component;var aM=a6.otherSettingsJson.Segment;var bb=a6.otherSettingsJson.serviceGroup;var aK=a6.otherSettingsJson.Service;var aN=a6.otherSettingsJson.expand;var a9=a6.otherSettingsJson.show_segment;var aS=a6.otherSettingsJson.show_component;
var bn=a6.otherSettingsJson.optionalSegmentList;var bd=a6.otherSettingsJson.optionalServiceList;var aO=a6.otherSettingsJson.optionalZoneList;var a0=a6.dateFormatForOtherSetArrayJson;var bl=a6.otherSettingsJson.selectedDateFormat;var bk=a6.otherSettingsJson.selectedTimezoneFormat;var bc=a6.timeZoneForOtherSetArrayJson;
var bo=a6.countryNamForOtherSetArrayJson;var a5=a6.otherSettingsJson.defaultLanguage;var aL=a6.defaultLanguageJson;var aZ=a6.problemActionArrayJson;var bh=a6.otherSettingsJson.show_problematic_measure;var ba=a6.defaultSearchOptionForOtherSetArrayJson;var a8=a6.otherSettingsJson.selectedDefaultSearchOption;
var bf=a6.otherSettingsJson.showSubZoneAsTreeNode;var aW="Default refresh frequency for monitor webpages in secs$"+bm;ah.setValue(aW);aG.setValue(Ext.getCmp("defaultSearchOption").value);aq="Google map key$"+a3;h.setValue(aq);aH="Daywise distribution reports in$"+aQ;Z.setValue(aH);N="Components count in segment/service/zone list$"+bi;
r.setValue(N);ao="View for aggregate components$"+aJ;ad.setValue(ao);B="Sort components in dashboards$"+a1;af.setValue(B);timeZoneStr="Time zone format to be used$"+bk;aw.setValue(timeZoneStr);ar="Date format to be used$"+bl;ai.setValue(ar);t="Default language$"+aC;q.setValue(t);l="When a problem component is clicked$"+u;
f.setValue(l);if(aX=="True"||aX=="true"){I="Display component types in segment/service list$True";}if(aX=="False"||aX=="false"){I="Display component types in segment/service list$False";}R.setValue(I);if(bj=="True"||bj=="true"){U="Show icon for component type$True";}if(bj=="False"||bj=="false"){U="Show icon for component type$False";
}av.setValue(U);if(aM=="True"||aM=="true"){g="Show icon for segment$True";}if(aM=="False"||aM=="false"){g="Show icon for segment$False";}aA.setValue(g);if(bb=="True"||bb=="true"){F="Show icon for serviceGroup$True";}if(bb=="False"||bb=="false"){F="Show icon for serviceGroup$False";}aD.setValue(F);if(aK=="True"||aK=="true"){d="Show icon for service$True";
}if(aK=="False"||aK=="false"){d="Show icon for service$False";}K.setValue(d);if(aN=="True"||aN=="true"){au="Show all descriptors for a component$True";}if(aN=="False"||aN=="false"){au="Show all descriptors for a component$False";}w.setValue(au);if(a9=="True"||a9=="true"){an="Show segments in service list$True";
}if(a9=="False"||a9=="false"){an="Show segments in service list$False";}al.setValue(an);if(aS=="True"||aS=="true"){H="Show components in service list$True";}if(aS=="False"||aS=="false"){H="Show components in service list$False";}O.setValue(H);if(bn=="True"||bn=="true"){C="Show optional segment list$True";
}if(bn=="False"||bn=="false"){C="Show optional segment list$False";}e.setValue(C);az.setValue(C);if(bd=="True"||bd=="true"){v="Show optional service list$True";}if(bd=="False"||bd=="false"){v="Show optional service list$False";}ac.setValue(v);M.setValue(v);if(aO=="True"||aO=="true"){E="Show optional zone list$True";
}if(aO=="False"||aO=="false"){E="Show optional zone list$False";}if(bf=="True"||bf=="true"||bf=="TRUE"){P="MISC_ARGS$ShowSubZoneAsTreeNode$True";}if(bf=="False"||bf=="false"||bf=="FALSE"){P="MISC_ARGS$ShowSubZoneAsTreeNode$False";}T.setValue(P);aF.setValue(E);V.setValue(E);var be=isAValidNumber(ax);var aR=ax<30;
var a4=validateSingleByte(m);var a2=isAValidNumber(ap);if(be=="false"||be==false){Ext.Msg.show({title:otherDisplaySettingsTitle,msg:alertForDefaultRefreshFreq,buttons:Ext.Msg.OK,icon:"iconExclamation"});aI="false";}if(aR=="true"||aR==true){Ext.Msg.show({title:otherDisplaySettingsTitle,msg:alertForFreqGreater,buttons:Ext.Msg.OK,icon:"iconExclamation"});
aI="false";}if(a4=="false"||a4==false){Ext.Msg.show({title:otherDisplaySettingsTitle,msg:alertForMapKey,buttons:Ext.Msg.OK,icon:"iconExclamation"});aI="false";}if(a2=="false"||a2==false){Ext.Msg.show({title:otherDisplaySettingsTitle,msg:alertForComponentsCount,buttons:Ext.Msg.OK,icon:"iconExclamation"});
aI="false";}var aV=this.getOtherdisplaysettings().getForm();if(aI=="true"){var bg=new Ext.LoadMask(Ext.getBody(),{msg:"Processing..."});bg.show();if(aV.isValid()){aV.submit({url:"/final/admin/EgMonitorSettings/data/eguiJSONp.jsp?process=othersettings",method:"POST",success:function(bp,bq){Ext.Msg.show({title:otherDisplaySettingsTitle,msg:updateSuccess,width:300,buttons:Ext.Msg.OK,icon:"iconInformation"});
bg.hide();},failure:function(bp,bq){Ext.Msg.show({title:otherDisplaySettingsTitle,msg:updateNotSuccess,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});bg.hide();}});}else{bg.hide();Ext.Msg.show({title:otherDisplaySettingsTitle,msg:updateNotSuccess,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
}}}});},enableOrDisableMetrics:function(){var b="enable/disable";var h="";var g="";var j="";var c="fromupdate";var e=Ext.getCmp("viewTestsId");var f=Ext.getCmp("tbarAddId");var d=Ext.getCmp("tbarEnableId");var a="/final/admin/EgMonitorSettings/data/minmaxConfigJSON.jsp?index=main&process="+b;Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(k){var m=k.responseText;
var l=Ext.decode(m);h=l.enableorDisableMetricsJson.minmaxEnabled;if(h=="true"||h){g="NO";j=alertDisableMetrics;}if(h=="false"||!h){g="YES";j=alertEnableMetrics;}Ext.MessageBox.confirm(configMeasuresTitle,j,function(o){if(o=="yes"){var n="/final/admin/EgMonitorSettings/data/minmaxConfigJSONp.jsp?serdistype="+g+"&process="+b+"&reqFrom=thisPage"+"&measuredisplay="+c;
if(h=="true"||h){Ext.getCmp("tbarAddId").setDisabled(true);}if(h=="false"||!h){Ext.getCmp("tbarAddId").setDisabled(false);}Ext.Ajax.request({url:n,scope:this,method:"POST",success:function(p){var s=p.responseText;var r=Ext.decode(s);if(g=="NO"){Ext.getCmp("tbarEnableId").setText("Enable Metrics Computation");
Ext.Msg.show({title:enableOrDisableMetrics,msg:metricsDisabled,width:300,buttons:Ext.Msg.OK,icon:"iconInformation"});}if(g=="YES"){Ext.getCmp("tbarEnableId").setText("Disable Metrics Computation");Ext.Msg.show({title:enableOrDisableMetrics,msg:metricsEnabled,width:300,buttons:Ext.Msg.OK,icon:"iconInformation"});
}var t="AllMeasures";var q="/final/admin/EgMonitorSettings/data/minmaxConfigJSON.jsp?index=main&process="+t;Ext.Ajax.request({url:q,scope:this,method:"POST",success:function(w){var z=w.responseText;var y=Ext.decode(z);var x=y.enableorDisableMetricsJson.minmaxEnabled;var v=Ext.getCmp("mainGrid");var u=Ext.getCmp("viewTestsId");
if(x=="false"||!x){e.setDisabled(true);}if(x=="true"||x){e.setDisabled(false);v.getStore().loadRawData(y.configMeasuresArrayJson);}if(Ext.isEmpty(y.testArrayJson)){v.getStore().loadRawData("");u.setValue("Not Applicable");Ext.get("emptyTextDiv").update(alertForEnableMetricsComp);}else{u.getStore().loadRawData(y.testArrayJson);
u.setValue(y.testArrayJson[0].displayField);}}});}});}});}});},addNewMeasure:function(){Ext.widget("newmeasure").show();Ext.getCmp("newMeasureWindow").show();var c="new";var b="";var a="/final/admin/EgMonitorSettings/data/minmaxConfigJSON.jsp?index=add&process="+c;Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(d){var f=d.responseText;
var e=Ext.decode(f);b=e.enableorDisableMetricsJson.minmaxEnabled;if(b){Ext.getCmp("minimumId").setValue("minimum");}if(!b){Ext.getCmp("maximumId").setValue("maximum");}Ext.getCmp("testnameId").getStore().loadRawData(e.testArrayJson);Ext.getCmp("testnameId").setValue(e.testArrayJson[0].displayField);Ext.getCmp("measureid").getStore().removeAll();
Ext.getCmp("measureid").setValue("Choose measure");}});},viewTestsComboChange:function(){var b=Ext.getCmp("viewTestsId");var e="AllMeasures";var f="add";var a=Ext.getCmp("viewTestsId").getValue();var d="";if(a=="All tests"){e="existingmeasure";}var c="/final/admin/EgMonitorSettings/data/minmaxConfigJSON.jsp?index=main&process="+e+"&mode="+f+"&testname="+a;
Ext.Ajax.request({url:c,scope:this,method:"POST",success:function(h){var k=h.responseText;var j=Ext.decode(k);d=j.enableorDisableMetricsJson.minmaxEnabled;if(d=="false"){Ext.Msg.show({title:configMeasuresTitle,msg:alertForEnableMetricsComp,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});}var g=Ext.getCmp("mainGrid");
if(a=="All tests"){g.getStore().loadRawData(j.configMeasuresArrayJson);}else{g.getStore().loadRawData(j.measuresForTestArrayJson);}}});},onGridEnter:function(a,b,d,g,f){var c=Ext.DomQuery.select(".x-action-col-icon",d);Ext.each(c,function(e){Ext.get(e).removeCls("x-hidden");});},onGridLeave:function(a,b,d,g,f){var c=Ext.DomQuery.select(".x-action-col-icon",d);
Ext.each(c,function(e){Ext.get(e).addCls("x-hidden");});},deleteMetrics:function(h,t,k,r,a){var m="delete";var l="";var u="";var e=Ext.getCmp("mainGrid");var f=e.getStore();var c=f.getAt(k);var d=c.get("Test");var j=c.get("Measure");var b=c.get("Measure");var p=c.get("Display");if(p=="Minimum"){l="minimum";
u="Min";}if(p=="Maximum"){l="maximum";u="Max";}var n="enable/disable";var o="AllMeasures";var g=d;var q="add";var s=alertForDeleteMeasure+" '"+b+"' ?";Ext.MessageBox.confirm(configMeasuresTitle,s,function(w){if(w=="yes"){var v="/final/admin/EgMonitorSettings/data/minmaxConfigJSON.jsp?index=main&process="+o;
Ext.Ajax.request({url:v,scope:this,method:"POST",success:function(y){var x=y.responseText;var B=Ext.decode(x);computeTopMetricsOptions=B.enableorDisableMetricsJson.minmaxEnabled;var C=B.testArrayJson2;var F="";var A="";for(var z=0;z<C.length;z++){A=B.testArrayJson2[z].displayField;if(A==d){F=B.testArrayJson2[z].valueField;
}}var D=Ext.getCmp("viewTestsId").getValue();var E="/final/admin/EgMonitorSettings/data/minmaxConfigJSON.jsp?index=main&process="+o+"&minmaxEnabled="+computeTopMetricsOptions+"&testname="+F+"&mode="+q;Ext.Ajax.request({url:E,scope:this,method:"POST",success:function(H){var L=H.responseText;var J=Ext.decode(L);
var N=J.measuresArrayJson;var K="";var G="";for(var I=0;I<N.length;I++){G=J.measuresArrayJson[I].displayField;if(G==j){K=J.measuresArrayJson[I].valueField;}}b=encodeURIComponent(parent.filterEncode(b));var M="/final/admin/EgMonitorSettings/data/minmaxConfigJSONp.jsp?index=main&process="+o+"&reqFrom=thisPage&testname="+F+"&measuretype="+K+"&radioType="+l+"&mode="+m+"&displayname="+b+"&radioType="+l;
Ext.Ajax.request({url:M,scope:this,method:"POST",success:function(O){var S=O.responseText;var R=Ext.decode(S);Ext.Msg.show({title:configMeasuresTitle,msg:updateSuccess,width:300,buttons:Ext.Msg.OK,icon:"iconInformation"});var T="AllMeasures";var Q=Ext.getCmp("viewTestsId").getValue();if(Q=="All tests"){T="existingmeasure";
}var P="/final/admin/EgMonitorSettings/data/minmaxConfigJSON.jsp?index=main&process="+T+"&testname="+Q+"&mode="+q;Ext.Ajax.request({url:P,scope:this,method:"POST",success:function(W){var Y=W.responseText;var X=Ext.decode(Y);var V=Ext.getCmp("mainGrid");var U=Ext.getCmp("viewTestsId");if(Q=="All tests"){V.getStore().loadRawData(X.configMeasuresArrayJson);
}else{V.getStore().loadRawData(X.measuresForTestArrayJson);}Ext.getCmp("configuredMeasures").doLayout();}});}});}});}});}});},testComboChange:function(){var e="";var d=Ext.getCmp("measureid");var c="enable/disable";var f="new";var a=Ext.getCmp("testnameId").getValue();var g="add";if(!Ext.isEmpty(a)&&a=="Choose test"){d.getStore().removeAll();
d.setValue("Choose measure");return;}var b="/final/admin/EgMonitorSettings/data/minmaxConfigJSON.jsp?process="+c;Ext.Ajax.request({url:b,scope:this,method:"POST",success:function(h){var l=h.responseText;var k=Ext.decode(l);e=k.enableorDisableMetricsJson.minmaxEnabled;var j="/final/admin/EgMonitorSettings/data/minmaxConfigJSON.jsp?index=add&process="+f+"&minmaxEnabled="+e+"&testname="+a+"&mode="+g;
Ext.Ajax.request({url:j,scope:this,method:"POST",success:function(m){var o=m.responseText;var n=Ext.decode(o);var p=n.measuresArrayJson;d.getStore().loadRawData(p);if(!Ext.isEmpty(p)){d.setValue(n.measuresArrayJson[0].displayField);}if(e){Ext.getCmp("minimumId").setValue("minimum");}if(!e){Ext.getCmp("maximumId").setValue("maximum");
}}});}});},measuresAdd:function(){var h="add";var c="new";var k="";var b="";var g="true";var j=Ext.getCmp("minimumId");var f=Ext.getCmp("maximumId");var d=Ext.getCmp("testnameId").getValue();var l=Ext.getCmp("measureid").getValue();var e=Ext.getCmp("measureid").getDisplayValue();if(j.getValue()){k="minimum";
b="Min";}if(f.getValue()){k="maximum";b="Max";}if(Ext.isEmpty(d)||d=="Choose test"){Ext.Msg.show({title:addAMeasureTitle,msg:alertForTestType,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});g="false";}if(g=="true"&&(Ext.isEmpty(l)||l=="Choose measure")){Ext.Msg.show({title:addAMeasureTitle,msg:alertForNoMeasure,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
g="false";}var a="/final/admin/EgMonitorSettings/data/minmaxConfigJSON.jsp?index=add&process="+c;Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(n){var m=n.responseText;var s=Ext.decode(m);var p=s.allMeasuresArrayJson;for(var o=0;o<p.length;o++){var t=p[o];var u=t.substring(t.indexOf(":")+1,t.length);
var q=u.substring(0,u.indexOf(":"));var r=u.substring(u.indexOf(":")+1,u.length);if(r==l&&q==d){Ext.Msg.show({title:addAMeasureTitle,msg:alertForAlreadyExists,width:500,buttons:Ext.Msg.OK,icon:"iconExclamation"});g="false";}}if(g=="true"){e=encodeURIComponent(parent.filterEncode(e));var v="/final/admin/EgMonitorSettings/data/minmaxConfigJSONp.jsp?process="+c+"&reqFrom=thisPage&testname="+d+"&measuretype="+l+"&radioType="+k+"&mode="+h+"&displayname="+e;
Ext.Ajax.request({url:v,scope:this,method:"POST",success:function(w){var z=w.responseText;var y=Ext.decode(z);Ext.Msg.show({title:addAMeasureTitle,msg:updateSuccess,width:300,buttons:Ext.Msg.OK,icon:"iconInformation"});Ext.getCmp("newMeasureWindow").destroy();var A="AllMeasures";var x="/final/admin/EgMonitorSettings/data/minmaxConfigJSON.jsp?index=main&process="+A;
Ext.Ajax.request({url:x,scope:this,method:"POST",success:function(D){var F=D.responseText;var E=Ext.decode(F);var C=Ext.getCmp("mainGrid");var B=Ext.getCmp("viewTestsId");if(Ext.isEmpty(E.testArrayJson)){Ext.Msg.show({title:addAMeasureTitle,msg:alertForEnableMetricsComp,width:300,buttons:Ext.Msg.OK,icon:"iconExclamation"});
C.getStore().loadRawData("");B.setValue("Not Applicable");}B.getStore().loadRawData(E.testArrayJson);B.setValue(E.testArrayJson[0].displayField);C.getStore().loadRawData(E.configMeasuresArrayJson);Ext.getCmp("configuredMeasures").doLayout();}});}});}}});},userTypeUEDComboChange:function(){var c="ShowAllMeasures";
var b=Ext.getCmp("uedUserTypeId").getValue();if(b==null||b==undefined){b="AllUserTypes";}var a="/final/admin/EgMonitorSettings/data/uedConfigJSON.jsp?index=main&process="+c+"&user_type="+b;Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(e){var g=e.responseText;var f=Ext.decode(g);var d=Ext.getCmp("mainGrid");
if(d!=null&&d!=undefined){d.getStore().loadRawData(f.configMeasuresArrayJson);}}});},modifyUEDMetrics:function(a,k,o,l,f){var d=Ext.getCmp("mainGrid");var q=d.getStore();var j=q.getAt(o);var e=j.get("Test");var p=j.raw.Process_Value;var b=j.raw.Unit_Value;var m=j.get("Measure");var c=j.get("Display");
Ext.widget("uedmodifymeasure").show();Ext.getCmp("uedmodifyMeasureWindow").show();Ext.getCmp("testnameId").setValue(e);Ext.getCmp("measurenameid").setValue(m);if(p!=-1&&p!=""&&p!=undefined){Ext.getCmp("processnameid").show();Ext.getCmp("processnameid").setValue(p);Ext.getCmp("processId").setValue(p);
Ext.getCmp("unitnameid").show();Ext.getCmp("unitnameid").setValue(b);Ext.getCmp("unitId").setValue(b);}Ext.getCmp("displaynameid").setValue(c);var n=j.get("Test_Value");var h=j.get("Measure_Value");var g=j.get("User_Type");Ext.getCmp("testId").setValue(n);Ext.getCmp("measureId").setValue(h);Ext.getCmp("userTypeId").setValue(g);
},deleteUEDMetrics:function(b,l,p,m,g){var f=Ext.getCmp("mainGrid");var q=f.getStore();var k=q.getAt(p);var n=k.get("Test_Value");var j=k.get("Measure_Value");var a=k.get("Display_Value");var h=k.get("User_Type");var d=k.raw.Process_Value;var e=k.raw.Unit_Value;var c="delete";var r=alertForDeleteMeasure+" '"+a+"' ?";
var o=alertForDeleteMeasure+" '"+a+"' for All users?";Ext.MessageBox.confirm(configMeasuresTitle,r,function(t){if(t=="yes"||t=="YES"){a=encodeURIComponent(parent.filterEncode(a));var s="/final/admin/EgMonitorSettings/data/uedConfigJSONp.jsp?index=main&process="+c+"&reqFrom=thisPage&testname="+n+"&measurename="+j+"&displayname="+a+"&user_type="+h;
if(d!=-1&&d!=""&&d!=undefined){s=s+"&processname="+d+"&unit="+e+"&tableType=dd";}Ext.MessageBox.confirm(configMeasuresTitle,o,function(u){if(u=="yes"||u=="YES"){s=s+"&allUser=true";}else{s=s+"&allUser=false";}Ext.Ajax.request({url:s,scope:this,method:"POST",success:function(v){var z=v.responseText;var x=Ext.decode(z);
Ext.Msg.show({title:configMeasuresTitle,msg:updateSuccess,width:300,buttons:Ext.Msg.OK,icon:"iconInformation"});var A="ShowAllMeasures";var y=Ext.getCmp("uedUserTypeId").getValue();if(y==null||y==undefined){y="AllUserTypes";}var w="/final/admin/EgMonitorSettings/data/uedConfigJSON.jsp?index=main&process="+A+"&user_type="+y;
Ext.Ajax.request({url:w,scope:this,method:"POST",success:function(C){var F=C.responseText;var E=Ext.decode(F);var B=Ext.getCmp("mainGrid");var D=Ext.getCmp("uedUserTypeId");if(B!=null&&B!=undefined){B.getStore().loadRawData(E.configMeasuresArrayJson);}Ext.getCmp("uedConfiguredMeasures").doLayout();}});
}});});}});},loadUEDTests:function(){var f=Ext.getCmp("userTypeId").getValue();var c=Ext.getCmp("displaynameid");var g=Ext.getCmp("tableData");var d=g.items.items[0].getGroupValue();if(!Ext.isEmpty(c)){c.setValue("");}var b="/final/monitor/endUserDashboardConfigJson.jsp?referrerModule=admin&";var e="add";
var a=b+"loadTest=true&fromAdmin=true&addOrDelete="+e;if(f!=null&&f!="null"&&f!=""&&f!="undefined"){a=a+"&userType="+f;}if(d!=null&&d!="null"&&d!=""&&d!="undefined"){a=a+"&tableType="+d;}else{a=a+"&tableType=test";}Ext.Ajax.request({url:a,method:"POST",scope:this,timeout:280000,success:function(n,k){var m=n.responseText;
var t=Ext.decode(m);var j=Ext.getCmp("testnameId");var q=Ext.getCmp("measureid");var s=Ext.getCmp("displaynameid");var l=Ext.getCmp("tableData");var h=Ext.getCmp("processId");var p=Ext.getCmp("unitId");var o=t["HideTableType"];if(o!=null&&o!=undefined&&o=="true"){l.items.items[0].setValue(true);l.hide();
h.hide();p.hide();}else{l.show();}if(!Ext.isEmpty(j)&&!Ext.isEmpty(t["TEST"])){if(t["TEST"].length>1){j.getStore().loadRawData(t["TEST"]);q.show();s.show();j.setValue("-1");q.setValue("-1");var r=g.items.items[0].getGroupValue();if(r=="dd"){h.show();p.show();}else{h.hide();p.hide();}}else{if(t["TEST"].length==1){j.getStore().loadRawData({"displayField":"Not Applicable","valueField":"-1"});
j.setValue("-1");q.hide();s.hide();h.hide();p.hide();}}}else{j.getStore().loadRawData("");q.getStore().loadRawData("");}},failure:function(){}});},loadUEDMeasureForTest:function(){var d=Ext.getCmp("userTypeId").getValue();var l=Ext.getCmp("tableData");var k=l.items.items[0].getGroupValue();var e=Ext.getCmp("displaynameid");
var b=Ext.getCmp("testnameId").getValue();var f=Ext.getCmp("measureid").getValue();if(!Ext.isEmpty(e)){var j=e.getValue();if(!Ext.isEmpty(b)&&b=="-1"){if(!Ext.isEmpty(j)){e.setValue("");}}}var c="add";var h=Ext.getCmp("testnameId").getValue();var g="/final/monitor/endUserDashboardConfigJson.jsp?referrerModule=admin&";
var a=g+"loadMeasure=true&fromAdmin=true&addOrDelete="+c+"&test="+h;a=a+"&userType="+d;if(k!=null&&k!="null"&&k!=""&&k!="undefined"){a=a+"&tableType="+k;}else{a=a+"&tableType=test";}Ext.Ajax.request({url:a,method:"POST",scope:this,timeout:280000,success:function(m,p){var q=m.responseText;var n=Ext.decode(q);
var r=Ext.getCmp("measureid");var o=Ext.getCmp("processId");r.getStore().loadRawData(n["MEASURE"]);r.setValue("-1");},failure:function(){}});},loadUEDMeasureDisplay:function(){var m=Ext.getCmp("tableData");var l=m.items.items[0].getGroupValue();var g=Ext.getCmp("measureid");if(l=="dd"){var e=Ext.getCmp("userTypeId").getValue();
var b=Ext.getCmp("testnameId").getValue();var f=g.getValue();var c="add";var k=Ext.getCmp("testnameId").getValue();var h="/final/monitor/endUserDashboardConfigJson.jsp?referrerModule=admin&";var a=h+"loadDDColumns=true&test="+k;a=a+"&userType="+e;if(f!=null&&f!="null"&&f!=""&&f!="undefined"){a=a+"&measure="+f;
}Ext.Ajax.request({url:a,method:"POST",scope:this,timeout:280000,success:function(o,r){var s=o.responseText;var p=Ext.decode(s);var q=Ext.getCmp("processId");var t=Ext.getCmp("unitId");q.getStore().loadRawData(p["DD_COLUMNS"]);q.setValue("-1");t.setValue("NONE");},failure:function(){}});}if(!Ext.isEmpty(g)){var n=g.getRawValue();
var j=g.getValue();var d=Ext.getCmp("displaynameid");if(!Ext.isEmpty(n)&&j!="-1"){if(!Ext.isEmpty(d)){d.setValue(n);}}else{if(!Ext.isEmpty(j)&&j=="-1"){if(!Ext.isEmpty(d)){d.setValue("");}}}}},addUEDNewMetrics:function(){Ext.widget("uednewmeasure").show();Ext.getCmp("uednewMeasureWindow").show();var c=Ext.getCmp("uedUserTypeId");
var a="";if(!Ext.isEmpty(c)){a=c.getValue();}var d="new";var b="/final/admin/EgMonitorSettings/data/uedConfigJSON.jsp?index=add&process="+d;Ext.Ajax.request({url:b,scope:this,method:"POST",success:function(e){var g=e.responseText;var f=Ext.decode(g);Ext.getCmp("userTypeId").getStore().loadRawData(f.userTypeArrayJson);
if(!Ext.isEmpty(a)&&a!=undefined&&a!=null&&a!=""&&a!="AllUserTypes"){Ext.getCmp("userTypeId").setValue(a);}else{Ext.getCmp("userTypeId").setValue(f.userTypeArrayJson[0].valueField);}Ext.getCmp("measureid").getStore().removeAll();this.loadUEDTests();}});},addUEDMeasures:function(){var e=Ext.getCmp("userTypeId").getValue();
var k=Ext.getCmp("tableData");var j=k.items.items[0].getGroupValue();var c="add";var f=Ext.getCmp("testnameId").getValue();var b=Ext.getCmp("measureid").getValue();var l=Ext.getCmp("processId").getValue();var g=Ext.getCmp("unitId").getValue();var h=Ext.getCmp("displaynameid").getValue();h=h.trim();if(Ext.isEmpty(h)){Ext.Msg.alert("alert","Display name is empty",function(m,n){if(m=="ok"){Ext.getCmp("displaynameid").focus(true,10);
}});return;}if(this.specialCharacterCheck(h)){Ext.Msg.alert("alert","Special characters not supported",function(m,n){if(m=="ok"){Ext.getCmp("displaynameid").focus(true,10);}});return;}var d=true;if(e=="-1"){Ext.Msg.alert("Error",userTypeError);d=false;}else{if(f=="-1"){Ext.Msg.alert("Error",testError);
d=false;}else{if(b=="-1"){Ext.Msg.alert("Error",measureError);d=false;}else{if(c=="add"&&f!="-1"&&h==""){Ext.Msg.alert("Error",displayNameError);d=false;}}}}if(d){h=encodeURIComponent(parent.filterEncode(h));var a="/final/monitor/endUserDashboardConfigJson.jsp?referrerModule=admin&isUpdate=true&fromAdmin=true&addOrDelete="+c+"&test="+f+"&measure="+b+"&displayName="+h;
a=a+"&userType="+e;if(j!=null&&j!="null"&&j!=""&&j!="undefined"){if(j=="dd"){a=a+"&processName="+l+"&processUnit="+g;}a=a+"&tableType="+j;}else{a=a+"&tableType=test";}Ext.Ajax.request({url:a,method:"POST",scope:this,timeout:280000,success:function(m,q){var r=m.responseText;var o=Ext.decode(r);if(o["UPDATE"]=="SUCCESS"){Ext.Msg.show({title:UEDSettingsTitle,msg:updateSuccess,width:300,buttons:Ext.Msg.OK,icon:"iconInformation"});
var s="ShowAllMeasures";var p=Ext.getCmp("uedUserTypeId").getValue();if(p==null||p==undefined){p="AllUserTypes";}var n="/final/admin/EgMonitorSettings/data/uedConfigJSON.jsp?index=main&process="+s+"&user_type="+p;Ext.Ajax.request({url:n,scope:this,method:"POST",success:function(u){var x=u.responseText;
var w=Ext.decode(x);var t=Ext.getCmp("mainGrid");var v=Ext.getCmp("uedUserTypeId");if(t!=null&&t!=undefined){t.getStore().loadRawData(w.configMeasuresArrayJson);}Ext.getCmp("uedConfiguredMeasures").doLayout();}});}else{if(o["UPDATE"]=="FAILED"){Ext.Msg.show({title:UEDSettingsTitle,msg:updateNotSuccess,width:300,buttons:Ext.Msg.OK,icon:"iconInformation"});
}}},failure:function(){}});Ext.getCmp("uednewMeasureWindow").close();}},modifyUEDMeasures:function(a,m,o,n,k){var g=Ext.getCmp("testId").getValue();var e=Ext.getCmp("measureId").getValue();var b=Ext.getCmp("processnameid").getValue();var p=Ext.getCmp("unitnameid").getValue();var j=Ext.getCmp("displaynameid").getValue();
j=j.trim();if(Ext.isEmpty(j)){Ext.Msg.alert("alert","Display name is empty",function(r,s){if(r=="ok"){Ext.getCmp("displaynameid").focus(true,10);}});return;}if(this.specialCharacterCheck(j)){Ext.Msg.alert("alert","Special characters not supported",function(r,s){if(r=="ok"){Ext.getCmp("displaynameid").focus(true,10);
}});return;}var h=Ext.getCmp("userTypeId").getValue();var d="modify";var f=Ext.getCmp("mainGrid");var q=f.getStore();var l=q.getAt(o);if(h==null||h==undefined){h="AllUserTypes";}j=encodeURIComponent(parent.filterEncode(j));var c="/final/admin/EgMonitorSettings/data/uedConfigJSONp.jsp?index=main&process="+d+"&testname="+g+"&measurename="+e+"&displayname="+j+"&user_type="+h;
if(b!=null&&b!=""&&b!=undefined){c=c+"&processname="+b+"&unit="+p+"&tableType=dd";}Ext.Ajax.request({url:c,scope:this,method:"POST",success:function(r){var v=r.responseText;var t=Ext.decode(v);Ext.Msg.show({title:modifyMeasureTitle,msg:updateSuccess,width:300,buttons:Ext.Msg.OK,icon:"iconInformation"});
var w="ShowAllMeasures";var u=Ext.getCmp("uedUserTypeId").getValue();if(u==null||u==undefined){u="AllUserTypes";}var s="/final/admin/EgMonitorSettings/data/uedConfigJSON.jsp?index=main&process="+w+"&user_type="+u;Ext.Ajax.request({url:s,scope:this,method:"POST",success:function(y){var B=y.responseText;
var A=Ext.decode(B);var x=Ext.getCmp("mainGrid");var z=Ext.getCmp("uedUserTypeId");if(x!=null&&x!=undefined){x.getStore().loadRawData(A.configMeasuresArrayJson);}Ext.getCmp("uedConfiguredMeasures").doLayout();}});}});Ext.getCmp("uedmodifyMeasureWindow").close();},addUedLimit:function(){var a=Ext.getCmp("addUedLimit")!=null?Ext.getCmp("addUedLimit").value:"";
if(a!=null&&a!="undefined"&&a!="Add Limit"){if(isNaN(a)||a==null||a<=0){Ext.Msg.alert("Error","Please enter valid number");Ext.getCmp("addUedLimit").reset();return;}var b="/final/admin/EgMonitorSettings/data/uedConfigJSONp.jsp?index=main&process=addUEDLimit&addUedLimit="+a;Ext.Ajax.request({url:b,scope:this,method:"POST",success:function(c){var e=c.responseText;
var d=Ext.decode(e);Ext.Msg.show({title:uedotherDisplaySettingsTitle,msg:updateSuccess,width:300,buttons:Ext.Msg.OK,icon:"iconInformation"});Ext.getCmp("addUedLimit").hide();Ext.getCmp("iconPlusBut").show();},failure:function(){Ext.getCmp("addUedLimit").show();Ext.getCmp("iconPlusBut").hide();}});}else{if(isNaN(a)||a==null||a<=0){Ext.Msg.alert("Error","Please enter valid number");
Ext.getCmp("addUedLimit").reset();return;}}},updateUEDSettings:function(){var d=Ext.getCmp("limitId").getValue();var j=Ext.getCmp("dslimitId").getValue();var h=Ext.getCmp("refreshFreqId");var k=h.getValue();var e=parseInt(k);if(isNaN(e)||e==null||e<=0){Ext.Msg.alert("Error",freqError);h.reset();return;
}var l="`~!@#$%^&()+={}[]|;\"'<>,?/";for(var f=0;f<k.length;f++){check_char=l.indexOf(k.charAt(f));if(check_char>=0){Ext.Msg.alert("Error",specCharError);return;}}var m=Ext.getCmp("adGroupId").getValue();var g=Ext.getCmp("searchUserTypeMulId").getValue();var c=Ext.getCmp("searchUserTypeId").getValue();
var b="update";var a="/final/admin/EgMonitorSettings/data/uedConfigJSONp.jsp?index=main&process="+b+"&limit="+d+"&refreshFreq="+encodeURIComponent(parent.filterEncode(k))+"&adGroup="+m+"&adSearUsrType="+encodeURIComponent(c)+"&adSearchMulSelVal="+encodeURIComponent(g)+"&dslimit="+j;Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(n){var p=n.responseText;
var o=Ext.decode(p);Ext.Msg.show({title:uedotherDisplaySettingsTitle,msg:updateSuccess,width:300,buttons:Ext.Msg.OK,icon:"iconInformation"});}});},loadUEDProcessDisplay:function(){var d=Ext.getCmp("processId");if(!Ext.isEmpty(d)){var a=d.getRawValue();var c=d.getValue();var b=Ext.getCmp("displaynameid");
if(!Ext.isEmpty(a)&&c!="-1"){if(!Ext.isEmpty(b)){b.setValue(a);}}else{if(!Ext.isEmpty(c)&&c=="-1"){if(!Ext.isEmpty(b)){b.setValue("");}}}}},specialCharacterCheck:function(d){var b='`~!@#$%^&*()+={}[]|\\":;<,?\\';try{for(count=0;count<d.length;count++){var a=b.indexOf(d.charAt(count));if(a>=0){return true;
}}}catch(c){}return false;}});function isAValidNumber(a){validFigures="0123456789";if(a.length>1&&a.indexOf("0")==0){return"false";}if(a.length==0){return"false";}for(i=0;i<a.length;i++){if(validFigures.indexOf(a.charAt(i),0)==-1){return"false";}}return"true";}var noFileToUpload=false;function validateTextBoxes(d,c,b){var a="true";
if(d=="alarms"&&c=="noOfRows"&&isAValidNumber(b)=="false"){a="false";}if(d=="graphs"&&c=="monitorTimeScale"&&isAValidNumber(b)=="false"){a="false";}if(d=="graphs"&&c=="reporterTimeScale"&&isAValidNumber(b)=="false"){a="false";}return a;}function validateSingleByte(b){for(var c=0;c<b.length;c++){var a=b.charCodeAt(c);
if(a>255){return false;}}return true;}