Ext.define("MyDashBoard.controller.WidgetConfigurationController",{extend:"Ext.app.Controller",requires:["MyDashBoard.view.WidgetOptionsWindow","MyDashBoard.view.AddExternalMetrics","MyDashBoard.view.KpiConfigListWidget","MyDashBoard.view.TextEditor","MyDashBoard.view.AddHealthSummaryWidget"],refs:[{ref:"widgetOptionsWindow",selector:"widgetOptionsWindow"},{ref:"comparisontable",selector:"comparisontable"},{ref:"gridstackpanel",selector:"gridstackpanel"},{ref:"portlet",selector:"portlet"},{ref:"topologysettingswindow",selector:"topologysettingswindow"},{ref:"gridcomparisontable",selector:"gridcomparisontable"},{ref:"addexternalmetrics",selector:"addexternalmetrics"}],init:function(){this.control({'widgetOptionsWindow button[id="descriptorExpandSelector"]':{"click":this.expandMe},'widgetOptionsWindow button[id="componentExpandSelector"]':{"click":this.expandMe},'widgetOptionsWindow button[id="measureExpandSelector"]':{"click":this.expandMe},'widgetOptionsWindow button[id="ddColumnsExpandSelector"]':{"click":this.expandMe},'widgetOptionsWindow button[id="summarizeDDColumnExpandSelector"]':{"click":this.expandMe},'widgetOptionsWindow button[id="addNewGridData"]':{"click":this.addBlockConfig},'widgetOptionsWindow combo[id="testCombo"]':{"select":this.testsOnChange},'widgetOptionsWindow combo[id="componentTypeCombo"]':{"select":this.loadComponents},'widgetOptionsWindow multiselect[id="componentCombo"]':{"change":this.loadDescriptors},'widgetOptionsWindow combo[id="measureCombo"]':{"select":this.measureComboOnChange},'widgetOptionsWindow multiselect[id="measureCombo"]':{"change":this.measureComboOnChange},'widgetOptionsWindow combo[id="componentCombo"]':{"select":this.componentOnChange},'widgetOptionsWindow switchfield[id="showAggOpt"]':{"change":this.showAggOptions},"#descriptorListC1":{"itemclick":this.testFn},'widgetOptionsWindow button[id="doneButton"]':{"click":this.updateWidget},'widgetOptionsWindow  combo[id="viewTypeCombo"]':{"select":this.getViewTypeValueForHealthSummary},'widgetOptionsWindow combo[id="period"]':{"select":this.durationComboOnChange},'widgetOptionsWindow button[id="addVMBlockConfig"]':{"click":this.addVMConfigGrid},'widgetOptionsWindow combo[id="displayType"]':{"select":this.displayTypeOnChange},'widgetOptionsWindow switchfield[id="ChartSummaryEnabled"]':{"change":this.enableDigitalChartSummary},'widgetOptionsWindow multiselect[id="descriptorCombo"]':{"change":this.descriptorOnChange},'widgetOptionsWindow combo[id="descriptorCombo"]':{"change":this.descriptorOnChange},'widgetOptionsWindow switchfield[id="useExternalData"]':{"change":this.externalDataSourceOnChange},'widgetOptionsWindow switchfield[id="enableChartSummary"]':{"change":this.enableTableChartSummary},'kpiConfigurationWindow button[id="kpiDoneButton"]':{"click":this.updateKpiWidget},'widgetOptionsWindow  combo[id="categoryOpts"]':{"select":this.changeCategoryOptionCombo},'widgetOptionsWindow  combo[id="healthCenterCompTypeCombo"]':{"select":this.changeHealthCenterCompTypeVal},'widgetOptionsWindow  combo[id="healthCenterCompScrollCombo"]':{"select":this.changeHealthCenterCompScrollCombo},'widgetOptionsWindow  combo[id="healthCenterTestScrollCombo"]':{"select":this.changeHealthCenterTestScrollCombo},'widgetOptionsWindow button[id="updateHealthCenter"]':{"click":this.updateHealthCenterServers},'widgetOptionsWindow button[id="addHealthCenter"]':{"click":this.addHealthCenterDescriptors},'widgetOptionsWindow button[id="updateBlockConfig"]':{"click":this.updateHealthCenterDescriptors},'widgetOptionsWindow multiselect[id="healthCenterComponentCombo"]':{"change":this.loadVms},'widgetOptionsWindow combo[id="chartTypeCombo"]':{"select":this.onChangeDDChartType}});
},externalDataSourceOnChange:function(d){var e=this;var a=d.getValue();if(a!=null&&a==true){if(d.isSettingDefaultValue){return;}var b=Ext.getCmp("widgetOptionsWindow");b.removeAll();b.add(e.createExternalConfigWindow());if(!b.isExternalDataSourceWidget){b.setDefaultWidgetPreviewImage(b.widgetType,b.widgetID);
}else{b.loadSampleSnippet();}}else{var b=Ext.getCmp("widgetOptionsWindow");b.removeAll();b.createConfigLayout(true);}var c=this.getWidgetOptionsWindow();if(!Ext.isEmpty(c)){c.isExternalDataSourceWidget=a;}Ext.getCmp("doneButton").enable();},createExternalConfigWindow:function(){var a=this.getWidgetOptionsWindow();
var b=a.widgetID;var c="";if(b!=null&&b.indexOf("_")>0){c=b.substr(0,b.indexOf("_"));}return{xtype:"addexternalmetrics",id:"widgetChartAttrs",name:"widgetChartAttrs",margin:"5 0 10 5",widgetID:b,widgetType:c,isKpi:a.isKpi,Kpicount:a.Kpicount,totalKpiCount:a.totalKpiCount,kpiBlckId:a.kpiBlckId};},descriptorOnChange:function(){var a=this.getWidgetOptionsWindow();
var b=a.widgetID;var c="";if(b!=null&&b.indexOf("_")>0){c=b.substr(0,b.indexOf("_"));}if(c!=null&&(c=="TopNAnalysis"||c=="dialChart"||c=="digitalChart"||c=="liveMeasuresBox")){Ext.getCmp("doneButton").enable();}else{if(c=="ddTable"){Ext.getCmp("doneButton").enable();}}if(c!=null&&c=="ScatterPlot"){this.saveSelection("descCombo");
}},enableDigitalChartSummary:function(a){if(a!=null&&a.getValue()==true){Ext.getCmp("SummaryGraphType").setDisabled(false);Ext.getCmp("ShowIcon").setDisabled(false);}else{Ext.getCmp("SummaryGraphType").setDisabled(true);Ext.getCmp("ShowIcon").setDisabled(true);Ext.getCmp("ShowIcon").setValue(false);}},enableTableChartSummary:function(a){if(a!=null&&a.getValue()==true){Ext.Msg.show({title:myDashboardAlertLbl,msg:performanceAlertLbl,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
Ext.getCmp("SummaryGraphType").setDisabled(false);}else{Ext.getCmp("SummaryGraphType").setDisabled(true);}},displayTypeOnChange:function(c){var b=this.getWidgetOptionsWindow();var a=b.getComponent("configForm").getForm();if(c.getValue()=="bar"){a.findField("ViewType").show();a.findField("ColorPalette").show();
}else{a.findField("ViewType").hide();a.findField("ColorPalette").hide();}},addVMConfigGrid:function(){var n=Ext.getCmp("configForm").getForm();var C=n.findField("componentTypeCombo");var f=C.getValue();var q=C.getRawValue();var v=n.findField("componentCombo");var H=v.getValue();var r=v.getRawValue();
var g=n.findField("vmListCombo");var c=g.getValue();if(f!=null&&f=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:compTypAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}else{if(H!=null&&(H==""||H=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:componentAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}else{if(c!=null&&c=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:descriptorAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}}}var p=g.getStore();var F="";var s="";for(var a in c){var G=c[a];var I=p.findRecord(g.valueField,G,0,false,true,true);var J=p.indexOf(I);var D=p.getAt(J).get("displayField");
var m=p.getAt(J).get("valueField");if(m!=null&&m.indexOf("+")==0){m=m.substring(1);}F=F+D+",";s=s+m+"!@!";}var A=s.lastIndexOf("!@!");var z=s.substring(0,A);var u=F.lastIndexOf(",");var o=F.substring(0,u);hiddenVals=H+"!$!"+r+"!$!"+z;var h=this.getGridcomparisontable();var l=h.getStore();var e=l.find("ComponentName",r,0,false,true,true);
var b=l.find("hiddenVal",hiddenVals,0,false,true,true);var h=this.getGridcomparisontable();var l=h.getStore();var j=h.getStore().getCount();var k=z.split("!@!");if(k!=null&&(k.length>1)&&z.indexOf("allVms")>-1){Ext.Msg.show({title:myDashboardAlertLbl,msg:individualVMsCannotAdd,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}if(b==-1&&e==-1){l.add({VmName:o,ComponentName:r,ComponentType:q,hiddenVal:hiddenVals});Ext.getCmp("doneButton").enable();}else{if(e>-1){var d=l.findRecord("ComponentName",r);var w=d.get("hiddenVal");var B=w.substring(w.lastIndexOf("!$!")+3);var E=z.split("!@!");for(var x=0;x<E.length;x++){if(B!=null&&B.indexOf(E[x])>-1){Ext.Msg.show({title:myDashboardAlertLbl,msg:selAlreadyExt,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}}var t=B.split("!@!");if(t[0]!=null&&t[0]!="allVms"&&z.indexOf("allVms")>-1){Ext.Msg.show({title:myDashboardAlertLbl,msg:allVMsCannotAdd,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}else{if(B!=null&&B.indexOf("allVms")>-1){Ext.Msg.show({title:myDashboardAlertLbl,msg:selAlreadyExt,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}else{var y=d.get("VmName");w=w+"!@!"+z;y=y+","+o;d.set("hiddenVal",w);d.set("VmName",y);d.commit();}}Ext.getCmp("doneButton").enable();}else{Ext.Msg.show({title:myDashboardAlertLbl,msg:selAlreadyExt,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}}},changeTopology:function(j){var k=Ext.getCmp(j.topologyWidgetId);
var g=j.getValue();k.destoryChart();var d=k.topologyData.infraType;var m=k.topologyData.selectedInfraElement;if(d!=null&&d=="Service"){var m=k.topologyData.selectedInfraElement;var b=k.topologyData.serviceState;var h="/final/monitor/EgServiceTopologyD3JS.jsp?physical_topology=0&type=monitor&treeFlag=null&zoneName=&currentTab=null&aggregateTab=null&openNode=null&treeFlag=null&fromHomepage=&serviceGroup=null&iszoneName=&isFromZone=null&parentZone=undefined&action=service&serviceState=service20New_"+b+"&service="+encodeURIComponent(m)+"&segment="+encodeURIComponent(g)+"&site="+encodeURIComponent(m)+"&fromMyDashboard=true&myDashboardTheme="+strSkin+"&widgetWidth="+encodeURIComponent(k.getWidth())+"&widgetHeight="+encodeURIComponent(k.getHeight());
var c=Ext.getCmp("dashboardLayoutObj").profileName;if(isAnonymousUserAccess){h=h+"&anonymousUser=true";}else{if(isMonitorHome){h=h+"&setMonitorHome=true";}else{if(disableMydashboardPopout){h=h+"&isDisablePopupOption=true";}}}var f=c;if(!Ext.isEmpty(f)){f=this.filterEncode(f);}h=h+"&profileName="+encodeURIComponent(f);
Ext.state.Manager.set("selectedProfile",c);Ext.state.Manager.set(c+"_"+j.topologyWidgetId+"_selectedSegment",g);k.update("");k.suspendEvents(true);k.update('<iframe src="'+h+'" width="100%" height="100%" border="0" scrolling="yes" marginwidth="0px" marginheight="0px" frameborder="0" leftmargin="10" topmargin="10" allowtransparency="true" style="border-width:0px; border-style:solid; border-color:yellow;"></iframe>');
}else{if(d!=null&&d=="Segment"){var m=k.topologyData.selectedInfraElement;var e=j.getStore();var i=j.getStore().findRecord(j.valueField,g,0,false,true,true);var a=e.indexOf(i);var l=e.getAt(a).get("state");var h="/final/monitor/EgSegmentTopologyD3JS.jsp?segment="+encodeURIComponent(g)+"&physical_topology=1&fromHomepage=&type=segment&zoom=100&isFromZone=null&iszoneName=&parentZone=null&segmentState="+encodeURIComponent("segment20New_"+l)+"&fromMyDashboard=true&myDashboardTheme="+strSkin+"&widgetWidth="+encodeURIComponent(k.getWidth())+"&widgetHeight="+encodeURIComponent(k.getHeight());
var c=Ext.getCmp("dashboardLayoutObj").profileName;if(isAnonymousUserAccess){h=h+"&anonymousUser=true";}else{if(isMonitorHome){h=h+"&setMonitorHome=true";}else{if(disableMydashboardPopout){h=h+"&isDisablePopupOption=true";}}}var f=c;if(!Ext.isEmpty(f)){f=this.filterEncode(f);}h=h+"&profileName="+encodeURIComponent(f);
k.update("");k.suspendEvents(true);k.update('<iframe src="'+h+'" width="100%" height="100%" border="0" scrolling="yes" marginwidth="0px" marginheight="0px" frameborder="0" leftmargin="10" topmargin="10" allowtransparency="true" style="border-width:0px; border-style:solid; border-color:yellow;"></iframe>');
}}k.resumeEvents();k.doComponentLayout();},saveTopologyConfig:function(){return saveTopologyConfig(false,"");},saveTopologyConfig:function(c,j){var h=this;var i=this.getWidgetOptionsWindow();var a=Ext.getCmp("topologyconfigform").getForm();var f=a.findField("viewTypeValueCombo");var g=a.findField("viewTypeCombo").getValue();
var n=i.widgetID;var l=f.getValue();if(l!=null&&l=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:screenLabelsObj["chooseGrouping"],buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}var b=Ext.getCmp("dashboardLayoutObj").profileName;var d=b;if(!Ext.isEmpty(d)){d=this.filterEncode(d);}paramsForSave="action=saveToplogyConfig&profileName="+encodeURIComponent(d)+"&blockId="+n+"&configuredViewTypeVal="+encodeURIComponent(l);
if(g!=null&&g!=""){paramsForSave=paramsForSave+"&configuredViewType="+encodeURIComponent(g);}var e=this.getGridstackpanel();var k=e._serializationStr();if(k!=null&&k!=""){paramsForSave=paramsForSave+"&layoutConfig="+encodeURIComponent(k);}gridSterObj=null;delete gridSterObj;var m=null;if(c){m=j;paramsForSave=paramsForSave+"&widgetPreviewMode=yes";
}else{m=Ext.getCmp(n);i.close();}Ext.Ajax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:paramsForSave+"&screenWidth="+(m.getWidth()-2)+"&screenHeight="+(m.getHeight()-20),scope:this,success:function(o){var q=o.responseText;if(q!=null&&q!=""){m.isConfigured=true;var p=Ext.decode(q);
myDashApp.getController("Main").showLiveDataForBlock(p,m,n);p=null;delete p;}q=null;delete q;},failure:function(o,p){if(o.timedout){m.removeAll();m.add({xtype:"panel",html:'<div><table border="0" cellspacing="0" cellpadding="0" width="98%" height="'+(m.getHeight()-20)+'"><tr><td  align="center" valign="middle" class="msgFont"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></td></tr></table></div>"});
m.setLoading(false);m.doLayout();}}});},durationComboOnChange:function(c){var d=Ext.getCmp("er_timeline");var a=c.getValue();var b=d.getValue();if(a!=null&&a.toLowerCase()==("h")){b="24 hours";}else{if(a!=null&&a.toLowerCase()==("d")){b="1 week";}else{if(a!=null&&a.toLowerCase()==("m")){b="6 months";
}}}var a=c.getValue();var e="comesFrom=myDashboard&action=TrendDurationChanged&time="+b+"&period="+a;Ext.Ajax.request({url:"/final/servlet/com.eg.EgMonitorRequestDispatcher",params:e,scope:this,method:"POST",success:function(i){var o=i.responseText;var l=Ext.decode(o);if(!Ext.isEmpty(l)){var f=Ext.getCmp("er_timeline");
f.getStore().loadRawData(l["timelinedetails"]["timeline"]);f.setValue(b);var m=Ext.getCmp("er_stdate");var g=Ext.getCmp("er_enddate");var k=Ext.getCmp("er_sthr");var n=Ext.getCmp("er_endhr");var h=Ext.getCmp("er_stmin");var j=Ext.getCmp("er_endmin");m.setValue(l["timelinedetails"]["timelineSelections"]["selectedStartDate"]);
m.dataArray=l["timelinedetails"]["timelineSelections"]["startDateInMgrDateFormat"];g.setValue(l["timelinedetails"]["timelineSelections"]["selectedEndDate"]);g.dataArray=l["timelinedetails"]["timelineSelections"]["endDateInMgrDateFormat"];k.setValue(l["timelinedetails"]["timelineSelections"]["selectedStartHour"]);
k.dataArray=l["timelinedetails"]["timelineSelections"]["startHrInMgrDate"];n.setValue(l["timelinedetails"]["timelineSelections"]["selectedEndHour"]);n.dataArray=l["timelinedetails"]["timelineSelections"]["endHourInMgrDate"];stmin=l["timelinedetails"]["timelineSelections"].startMinInMgrDate;enmin=l["timelinedetails"]["timelineSelections"].endMinInMgrDate;
h.setValue(l["timelinedetails"]["timelineSelections"]["selectedStartMin"]);j.setValue(l["timelinedetails"]["timelineSelections"]["selectedEndMin"]);mgr_stmin=l["timelinedetails"]["timelineSelections"].startMinInMgrDate;mgr_enmin=l["timelinedetails"]["timelineSelections"].endMinInMgrDate;if(displayTimeline){if(b!=null&&b=="Any"){timelineContObj.selectedMgrStMin=mgr_stmin;
timelineContObj.selectedMgrEndMin=mgr_enmin;timelineContObj.selectedStMinForDisplay=l["timelinedetails"]["timelineSelections"]["selectedStartMin"];timelineContObj.selectedEndminForDisplay=l["timelinedetails"]["timelineSelections"]["selectedEndMin"];f.fireEvent("select",f);}}}}});},showStackedChart:function(i){if(!Ext.isEmpty(i)){var e=this.getWidgetOptionsWindow();
var h=e.widgetID;var b="";if(h!=null&&h.indexOf("_")>0){b=h.substr(0,h.indexOf("_"));}if(b!=null&&b!="BarChart"){return;}var a=e.getComponent("configForm").getForm();var d=i.getValue();var g="";if(!Ext.isEmpty(d)&&d.hasOwnProperty("stacked")){g=d.stacked;}if(g!=null&&g=="yes"){a.findField("showAggOpt").hide();
a.findField("aggOptions").show();a.findField("descriptorCombo").hide();Ext.getCmp("descriptorExpandSelector").hide();Ext.getCmp("descriptorComboLbl").hide();Ext.getCmp("descriptorSearchTextBox").hide();Ext.getCmp("descriptorMultiSelectOuterBox").hide();}else{var c=Ext.getCmp("descriptorCombo");if(!Ext.isEmpty(c)){var f=c.getValue();
if(!Ext.isEmpty(f)&&f!="-1"){a.findField("showAggOpt").show();}}a.findField("aggOptions").hide();a.findField("descriptorCombo").show();Ext.getCmp("descriptorExpandSelector").show();Ext.getCmp("descriptorComboLbl").show();Ext.getCmp("descriptorSearchTextBox").show();Ext.getCmp("descriptorMultiSelectOuterBox").show();
}}},getViewTypeValueForHealthSummary:function(i){var f=this.getWidgetOptionsWindow();if(Ext.isEmpty(f)){f=Ext.widget("widgetOptionsWindow");}var b=Ext.getCmp("topologyconfigform").getForm();var h=b.findField("viewTypeCombo").getValue();var c=b.findField("viewTypeValueCombo");var g=Ext.getCmp("dashboardLayoutObj");
var a=g.profileName;if(a==null||a==""){a="None";}var d=a;if(!Ext.isEmpty(d)){d=this.filterEncode(d);}var e=this;iAjax.request({url:"/final/servlet/com.eg.EgMonitorRequestDispatcher",method:"POST",params:"comesFrom=myDashboard&action=loadTopologyConfigPopup&profileName="+encodeURIComponent(d)+"&selectedViewType="+h+"&viewByTypeChange=true&screenWidth="+(Ext.getBody().getViewSize().width)+"&screenHeight="+(Ext.getBody().getViewSize().height),scope:this,success:function(j){var l=j.responseText;
if(l!=null&&l!=""){var k=Ext.decode(l);e.setValueWithOptionInList(c,k["configuredDetails"]["viewByType"],k["configuredDetails"]["selectedTypeValue"],"");c.setFieldLabel(b.findField("viewTypeCombo").getRawValue());k=null;delete k;}l=null;delete l;}});},measureComboOnChange:function(a){var b=this.getWidgetOptionsWindow();
var c=b.widgetID;var d=c.substr(0,c.indexOf("_"));if(!Ext.isEmpty(d)&&d=="ddTable"){this.loadDDColumns(a);}if(d!=null&&(d=="ddTable"||d=="TopNAnalysis"||d=="dialChart"||d=="digitalChart"||d=="liveMeasuresBox"||d=="ScatterPlot")){var e=Ext.getCmp("controllerSetting");if(!Ext.isEmpty(e)){e.setDisabled(false);
}}if(d!=null&&d=="ScatterPlot"){this.saveSelection("measureCombo");}},openWidgetConfigurationWindow:function(c,m,e){var f=false;var o=[];if(publicJson!=null&&publicJson["myDashboardConfigDetails"].hasOwnProperty("IsOneClickDashboard")){o=publicJson["myDashboardConfigDetails"]["oneClickWidgets"];}var g=m;
if(g!=null&&g.indexOf("ChartArea_")>-1){g=g.substring(g.indexOf("_")+1,g.length);}var k=g.split("_");var d=configTitle[k[0]]+" - "+configurationMsg;var b=g;if(g!=null&&g.indexOf("_")>0){b=g.substr(0,g.indexOf("_"));}var h=publicJson["action"];if(h!=null&&h=="showMyDashboard"){if(b!=null&&b=="weather"){var j=Ext.widget("widgetmetrics",{blockId:g,renderTo:g+"-body",blckType:b,isFluidWindowConfigPopup:true});
if(j!=null){j.setTitle(weatherTitle+" - "+settingsLbl);j.show();}}else{if(b!=null&&b=="textWidget"){var l=this;var i="";var n=Ext.getCmp("dashboardLayoutObj");var a=n.profileName;Ext.getCmp(g).removeAll();Ext.getCmp(g).getHeader().setVisible(false);Ext.getCmp(g).add({xtype:"texteditor",partalID:g,profileName:a});
}else{if(b!=null&&b=="news"){var j=Ext.widget("newswidgetmetrics",{blockId:g,renderTo:g+"-body",blckType:b,isFluidWindowConfigPopup:true});if(j!=null){j.setTitle(newsConfTitle);j.show();}}else{if(b!=null&&b=="mapwidget"){this.mapWindowModifyClick(g);}else{if(b!=null&&b=="KpiWidget"){var j=Ext.widget("kpiConfigurationWindow",{blockId:g,blckType:b,isFluidWindowConfigPopup:true});
if(j!=null){j.setTitle("KPI Configuration");j.show();}}else{if(b!=null&&b=="healthsummary"){var j=Ext.widget("addhealthsummarywidget",{blockId:g,blckType:b,isFluidWindowConfigPopup:true});if(j!=null){j.show();}}else{if(Ext.Array.contains(o,g)){var j=Ext.widget("oneclickwidgetconfiguration",{blockId:g,blckType:b,isFluidWindowConfigPopup:true});
if(j!=null){j.setTitle(d);j.show();}}else{this.showWidgetOptionsWindow(c,m,e,false,"",null,"","",false);}}}}}}}}},showWidgetPreviewAtPopupStartUp:function(a){return showWidgetPreviewAtPopupStartUp(a,false);},showWidgetPreviewAtPopupStartUp:function(j,c){var l=j;var i=this.getWidgetOptionsWindow();var h="";
var a="";var f=false;if(!Ext.isEmpty(i)){h=i.kpiBlckId;a=i.Kpicount;}if(h!=null&&h.indexOf("KpiWidget")>-1){f=true;l=h;}var m=Ext.getCmp("dashboardLayoutObj");var d=m.profileName;if(!Ext.isEmpty(d)){d=this.filterEncode(d);}var k="&action=loadBlockData&defaultwidgetpreview=yes&profileName="+encodeURIComponent(d)+"&blockId="+l;
var e=publicJson["action"];var b=j;if(j!=null&&j.indexOf("_")>-1){b=j.substring(0,j.indexOf("_"));}if(b!=null&&(b=="TopologyWidget"||b=="vmAlarmsWidget")){return;}var g=Ext.getCmp(j+"_previewImage");g.setLoading(true,true);g.showLoadingMsg=true;iAjax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:k+"&screenWidth="+(g.getWidth()-2)+"&screenHeight="+(g.getHeight()-20),scope:this,success:function(n){var t=n.responseText;
if(t!=null&&t!=""){var r=Ext.decode(t);var p=j+"_previewImage";g.widgetPreviewOnStartup=true;if(c){if(f){var o=r.kpiChartData;var q="";for(var s in o){if(a==s){q=o[s];r=q;break;}}}myDashApp.getController("ExternalIntegrationController").showExternalDataForBlock(r,g,p);}else{if(f){var o=r.kpiChartData;
var q="";for(var s in o){if(a==s){q=o[s];r=q;break;}}}myDashApp.getController("Main").showLiveDataForBlock(r,g,p);}}},failure:function(n){g.setLoading(false);g.showLoadingMsg=false;}});},validateWidgetConfiguration:function(m){var d=this.getWidgetOptionsWindow();var m=d.widgetID;var g=m.substr(0,m.indexOf("_"));
var y=false;var v=Ext.getCmp("useExternalData");if(!Ext.isEmpty(v)){y=v.getValue();}if(y){return;}else{if(g!=null&&(g=="ddTable"||g=="TopNAnalysis"||g=="dialChart"||g=="digitalChart"||g=="liveMeasuresBox"||g=="ScatterPlot")){var u=d.getComponent("configForm").getForm();var b=u.findField("componentCombo");
var o=u.findField("testCombo");var l=u.findField("componentTypeCombo");var q=u.findField("measureCombo");var a=l.getValue();var k=b.getValue();var c=q.getValue();var w=o.getValue();var r=u.findField("descriptorCombo");var t="";if(r!=null&&!Ext.isEmpty(r)){t=r.getValue();}if(a!=null&&a=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:compTypAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return false;}else{if(k!=null&&(k==""||k=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:componentAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return false;}else{if(w!=null&&w=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:testAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return false;}else{if(c!=null&&(c==""||c=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:measureAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return false;}}}}if(g=="ddTable"){var p=u.findField("ddColumnsCombo");if(p!=null&&p==""||p=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:noDDColSelectedAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return false;}}else{if(t!=null&&t==""||t=="chooseDescriptors"){Ext.Msg.show({title:myDashboardAlertLbl,msg:descriptorAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return false;}}}else{if(g!=null&&g!="servicehealth"){var f=this.getComparisontable();var j=f.getStore();var s="";var i="";var n="";
var e="";var x="";var h=f.getStore().getCount();if(h==0){Ext.Msg.show({title:myDashboardAlertLbl,msg:measureAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return false;}}}}},showWidgetPreview:function(b){var d=Ext.getCmp(b+"_previewImage");if(!Ext.isEmpty(d)){var c=b;if(c!=null&&c.indexOf("_")>0){c=c.substring(0,b.indexOf("_"));
}var a=this.getWidgetOptionsWindow();if(a.isExternalDataSourceWidget){this.saveAddExternalMetrics(true,d);}else{if(!Ext.isEmpty(c)){if(c=="ddTable"){this.addDDMeasures(true,d);}else{if(c=="TopologyWidget"){this.saveTopologyConfig(true,d);}else{if(c=="vmAlarmsWidget"){this.updateVMBlockConfig(true,d);
}else{if(c=="health"){this.updateHealthBlockConfig(true,d);}else{if(c=="TopNAnalysis"){this.updateTopNConfig(true,d);}else{if(c=="dialChart"||c=="digitalChart"||c=="liveMeasuresBox"){this.updateDialConfig(true,d);}else{if(c=="ScatterPlot"){this.updateScatterPlotConfig(true,d);}else{if(c=="servicehealth"){this.updateInfrastructureHealth(true,d);
}else{this.updateBlockConfig(true,d);}}}}}}}}}}}},updateWidget:function(){var c=this.getWidgetOptionsWindow();var d=c.widgetID;var f=d.substr(0,d.indexOf("_"));if(c.isKpi==true){f="Kpi";}if(!Ext.isEmpty(f)){var e=Ext.getCmp("useExternalData");var a=false;if(!Ext.isEmpty(e)){a=e.getValue();}if(a){if(f=="Kpi"){if(c.isKpi==true){var b=c.Kpicount;
}this.saveAddExternalMetricsForKPI(false,b);}else{this.saveAddExternalMetrics();}}else{if(f=="ddTable"){this.addDDMeasures();}else{if(f=="TopologyWidget"){this.saveTopologyConfig();}else{if(f=="vmAlarmsWidget"){this.updateVMBlockConfig();}else{if(f=="health"){this.updateHealthBlockConfig();}else{if(f=="TopNAnalysis"){this.updateTopNConfig();
}else{if(f=="dialChart"||f=="digitalChart"||f=="liveMeasuresBox"){this.updateDialConfig();}else{if(f=="ScatterPlot"){this.updateScatterPlotConfig();}else{if(f=="Kpi"){var g="";if(c.isKpi==true){var b=c.Kpicount;}this.updateKpiDialDigitalConfig(false,b);}else{if(f=="servicehealth"){this.updateInfrastructureHealth();
}else{this.updateBlockConfig();}}}}}}}}}}}},testsOnChange:function(c){var a=this.getWidgetOptionsWindow();var b=a.widgetID;var d=b.substr(0,b.indexOf("_"));if(d!=null&&(d=="dialChart"||d=="digitalChart"||d=="liveMeasuresBox"||d=="ScatterPlot")){this.loadHealthMeasures(c);}else{if(d!=null&&d=="ddTable"){this.loadDDMeasures(c);
}else{this.loadMeasures(c);}}},componentOnChange:function(d){var a=this.getWidgetOptionsWindow();var b=a.widgetID;var c=b.substr(0,b.indexOf("_"));if(c!=null&&(c=="dialChart"||c=="digitalChart"||c=="liveMeasuresBox"||c=="ddTable"||c=="ScatterPlot")){this.loadTestsForComp(d);}else{if(c!=null&&c=="vmAlarmsWidget"){this.loadDescriptorsForVmAlarmsCompName(d);
}else{this.loadDescriptors(d);}}},loadDescriptorsForVmAlarmsCompName:function(c){var a=Ext.getCmp("configForm").getForm();var d=a.findField("componentTypeCombo");var f=d.getValue();var i=c.getValue();if(i!="-1"&&f!="-1"){var j=Ext.getCmp("dashboardLayoutObj");var b=j.profileName;var h="C=true&F=getVmsForHyperVisor&P0={"+f+"}&P1={"+i+"}&calljson=true";
this.callRemoteScriptingMethod(h,"loadVmDescriptors","vmPopup","",true);}else{var g=a.findField("vmListCombo");var e=g.getStore();e.removeAll();e.insert(0,{displayField:notApplicable,valueField:"-1"});g.setValue("-1");}},loadHealthMeasures:function(e){var a=this.getWidgetOptionsWindow();var b=a.getComponent("configForm").getForm();
var j=b.findField("componentCombo").getValue();var d=b.findField("componentTypeCombo").getValue();var k=e.getValue();if(k!="-1"){var i="C=true&calljson=true";i=i+"&F=getMeasuresAndDesriptorsForTest&P0={"+d+"}&P1={"+j+"}&P2={"+k+"}";this.callRemoteScriptingMethod(i,"loadHealthMeasures","healthPopup","",true);
}else{var f=b.findField("measureCombo");var h=f.getStore();h.removeAll();h.insert(0,{displayField:notApplicable,valueField:"-1"});f.setValue("-1");var c=b.findField("descriptorCombo");var g=c.getStore();g.removeAll();g.insert(0,{displayField:notApplicable,valueField:"-1"});c.setValue("-1");}},getSettingValue:function(d){var a=null;
switch(d.ControlType){case"combo":a+="&"+d.id+"="+encodeURIComponent(Ext.getCmp(d.id).getValue());break;case"Checkbox":var e=d["options"]["optsArr"];for(var c in e){var b=e[c];a+="&"+b+"="+encodeURIComponent(Ext.getCmp(b).getValue());}break;case"ColorCombo":a+="&"+d.id+"="+encodeURIComponent(Ext.getCmp(d.id).getValue());
break;case"Switch":a+="&"+d.id+"="+encodeURIComponent(Ext.getCmp(d.id).getValue());break;case"TextBox":a+="&"+d.id+"="+encodeURIComponent(Ext.getCmp(d.id).getValue());break;}return a;},addDDMeasures:function(){return addDDMeasures(false,"");},addDDMeasures:function(K,u){var W=this.getWidgetOptionsWindow();
var i=W.getComponent("configForm").getForm();var z=i.findField("measureCombo");var O=i.findField("componentCombo");var E=Ext.getCmp("ddColumnsComboLbl");var y=i.findField("ddColumnsCombo");var V=i.findField("testCombo");var P=i.findField("componentTypeCombo");var p=i.findField("chartTypeCombo");var a=p.getValue();
var o=V.getValue();var s=P.getValue();var j=z.getValue();var T=O.getValue();var D=y.getValue();var b=Ext.getCmp("dashboardLayoutObj");if(s!=null&&s=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:compTypAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation",minWidth:280});return;}else{if(T!=null&&(T==""||T=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:componentAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}else{if(o!=null&&o=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:testAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}else{if(j!=null&&(j==""||j=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:measureAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;
}else{if(D!=null&&D=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:ddColsnotApplicableAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}else{if(D!=null&&D==""){Ext.Msg.show({title:myDashboardAlertLbl,msg:noDDColSelectedAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}}}}}}var q=y.getStore();var k="";for(var Q in D){var w=D[Q];var f=q.findRecord(y.valueField,w,0,false,true,true);var r=q.indexOf(f);var d=q.getAt(r).get("displayField");k=k+","+w+":"+d;}if(k!=null&&k.indexOf(",")==0){k=k.substr(1);}if(a!=null&&(a=="Bar Chart"||a=="Time Line"||a=="Area")){var C=i.findField("summarizeDDColumnCombo");
var N=C.getValue();if(N!=null&&N=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:noSummarizeDDColSelectedAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}else{if(N!=null&&N==""){Ext.Msg.show({title:myDashboardAlertLbl,msg:noSummarizeDDColSelectedAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}}var A=C.getRawValue();N=N+":"+A;var e=k.split(",");for(var g in e){var L=e[g];if(L==N){Ext.Msg.show({title:myDashboardAlertLbl,msg:alreadyExistLbl,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}}}var R=encodeURIComponent(o+":"+j);var H=this;var x=W.widgetID;var l=null;if(K){l=u;}else{l=Ext.getCmp(x);
}if(!Ext.isEmpty(publicJson["myDashboardConfigDetails"])){if(publicJson["myDashboardConfigDetails"]["configIds"].indexOf(x)==-1){publicJson["myDashboardConfigDetails"]["configIds"].push(x);}if(publicJson["myDashboardConfigDetails"].hasOwnProperty("configuredWidgetsID")&&publicJson["myDashboardConfigDetails"]["configuredWidgetsID"].indexOf(x)==-1){publicJson["myDashboardConfigDetails"]["configuredWidgetsID"].push(x);
}}if(x.indexOf("ddTable")>-1){}if(!K){W.close();}k=H.filterEncode(k);var X=b.profileName;if(!Ext.isEmpty(X)){X=this.filterEncode(X);}var G="action=saveDDConfig&profileName="+encodeURIComponent(X)+"&blockId="+x+"&component="+encodeURIComponent(T)+"&measure="+R+"&ddColumns="+encodeURIComponent(k);if(a!=null&&a=="Bar Chart"){G=G+"&summarizeDDColumns="+encodeURIComponent(N);
var h=i.findField("ViewType").getValue();if(h!=null){G=G+"&viewTypeOpt="+h;}if(K){if(!Ext.isEmpty(E)&&!Ext.isEmpty(C)){if(h!=null&&h=="Vertical"){C.setFieldLabel("Summarize DD Data By (X axis)");E.setText("DD Columns (Y axis)");}else{if(h!=null&&h=="Horizontal"){C.setFieldLabel("Summarize DD Data By (Y axis)");
E.setText("DD Columns (X axis)");}}}}}else{if(a!=null&&(a=="Table"||a=="Time Line"||a=="Area")){var v=i.findField("showChartSummary");if(v!=null&&!Ext.isEmpty(v)){var U=v.getValue();var n="no";if(U!=null&&U==true){n="yes";}G=G+"&showChartSummary="+n;}G=G+"&summarizeDDColumns="+encodeURIComponent(N);var t=i.findField("Timeline").getValue();
G=G+"&saveTimeline=true&time_line="+t+"&timelineKey="+x;}}var S=i.findField("excludeDesc").getValue();if(S!=null&&(S.indexOf("*")==0&&S.length==1)){Ext.Msg.show({title:myDashboardAlertLbl,msg:descriptorExcludeAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}if(a!=null&&a!=""){G=G+"&selectedChartType="+encodeURIComponent(a);
}S=this.filterEncode(S);G=G+"&excludedDescriptors="+encodeURIComponent(S);if(x!=null&&x.indexOf("ddTable")>-1){var I=i.findField("drillDown");if(I!=null&&!Ext.isEmpty(I)&&I!=undefined){var B=I.getValue();B=this.filterEncode(B);G=G+"&selectedDrillDownOpt="+encodeURIComponent(B);}}var c=this.getGridstackpanel();
var M=c._serializationStr();if(M!=null&&M!=""){G=G+"&layoutConfig="+encodeURIComponent(M);}if(K){G=G+"&widgetPreviewMode=yes";l.setLoading(true,true);l.showLoadingMsg=true;}var J="false";if(preSelectedTestForDD!=null&&(preSelectedTestForDD!=o)){var m=Ext.getCmp(blockId+"dd_combo");var F=m.getStore();
F.removeAll();m.setValue("");J="true";}J=this.filterEncode(J);G=G+"&removeSelectedDesc="+encodeURIComponent(J);c=null;delete c;iAjax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:G+"&screenWidth="+(l.getWidth()-2)+"&screenHeight="+(l.getHeight()-20),scope:this,success:function(Y){var Z=x;
if(K){Z=x+"_previewImage";}else{H.getPortlet().setRefresh(l);}var ab=Y.responseText;if(ab!=null&&ab!=""){var aa=Ext.decode(ab);l.isInitialResizeCompleted=false;l.isConfigured=true;myDashApp.getController("Main").showLiveDataForBlock(aa,l,Z);}},failure:function(Y,Z){if(Y.timedout){l.removeAll();l.add({xtype:"panel",html:'<div><table border="0" cellspacing="0" cellpadding="0" width="98%" height="'+(l.getHeight()-20)+'"><tr><td  align="center" valign="middle" class="msgFont"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></td></tr></table></div>"});
l.setLoading(false);l.showLoadingMsg=false;l.doLayout();}}});},loadDDMeasures:function(c){var i=c.getValue();if(i!="-1"){var g="C=true&F=getDDMeasuresJSON&P0={"+i+"}&calljson=true";this.callRemoteScriptingMethod(g,"loadDDMeasures","ddPopup","",true);}else{var f=this.getWidgetOptionsWindow();var b=f.getComponent("configForm").getForm();
var e=b.findField("measureCombo");var a=e.getStore();a.removeAll();a.insert(0,{displayField:notApplicable,valueField:"-1"});e.setValue("-1");var d=b.findField("ddMeasureCols");var h=d.getStore();h.removeAll();h.insert(0,{displayField:notApplicable,valueField:"-1"});d.setValue("-1");}},loadDDColumns:function(c){var h=this.getWidgetOptionsWindow();
var a=h.getComponent("configForm").getForm();var l=a.findField("testCombo").getValue();var b=a.findField("componentTypeCombo").getValue();var g=a.findField("componentCombo").getValue();var e=c.getValue();if(e!="-1"){var i="C=true&F=getDDColumnsJSON&P0={"+l+"}&P1={"+e+"}&P2={"+b+"}&P3={"+g+"}&P4={true}&calljson=true";
this.callRemoteScriptingMethod(i,"loadDDColumns","ddPopup","",true);}else{var d=a.findField("ddColumnsCombo");var j=d.getStore();j.removeAll();j.insert(0,{displayField:notApplicable,valueField:"-1"});d.setValue("-1");var k=a.findField("summarizeDDColumnCombo");var f=k.getStore();f.removeAll();f.insert(0,{displayField:notApplicable,valueField:"-1"});
k.setValue("-1");}},updateTopNConfig:function(){return updateTopNConfig(false,"");},updateTopNConfig:function(H,u){var J=this.getWidgetOptionsWindow();var w=J.widgetID;var G=w.substr(0,w.indexOf("_"));var L=J.autoAssociateComponents;var c=J.getComponent("configForm").getForm();var z=c.findField("measureCombo").getValue();
var n=c.findField("testCombo").getValue();var p=c.findField("componentCombo");var A=c.findField("componentTypeCombo");var v=p.getValue();if(n!=null&&n=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:testAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}if(z!=null&&(z==""||z=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:measureAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}z=n+":"+z;var r=A.getValue();if(r!=null&&(r==""||r=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:compTypAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}if(!L&&(Ext.isEmpty(v)||(v!=null&&(v==""||v=="-1")))||v=="undefined"){Ext.Msg.show({title:myDashboardAlertLbl,msg:componentAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}var C="";var f=p.getStore();if(L!=null&&L==true){v=[];v.push("allServers");}for(var b in v){var h=v[b];var N=f.findRecord(p.valueField,h,0,false,true,true);var l=f.indexOf(N);var D="";if(l!=null&&l<=-1){continue;}if(h!=null&&h=="allServers"){h=r+":"+h;var x=A.getRawValue();D=x+" All Servers";
}else{D=f.getAt(l).get("displayField");}C=C+","+D+"$"+h;}if(C!=null&&C.indexOf(",")==0){C=C.substr(1);}var E=w;var M=c.findField("displayType").getValue();var m=M.chartType;if(m!=null&&m=="-1"){m="none";}var o=Ext.getCmp("Priority").getValue();var q=Ext.getCmp("dashboardLayoutObj").profileName;var T=q;
if(!Ext.isEmpty(T)){T=this.filterEncode(T);}var B="action=saveConfig&profileName="+encodeURIComponent(T)+"&blockId="+w+"&isTopNComputation=true&configuredMeasures="+encodeURIComponent(z)+"&configuredComponents="+encodeURIComponent(C)+"&displayType="+m+"&topNPriority="+encodeURIComponent(o);var F=c.findField("descriptorCombo");
var y=F.getValue();if(y!=null&&y==""){Ext.Msg.show({title:myDashboardAlertLbl,msg:descriptorAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}var a="";if(y!=null&&y=="allDescriptors"){a="AllInfos";}else{for(var I in y){var S=y[I];if(S!=null&&S=="allDescriptors"){a="AllInfos";break;}else{a=a+","+S;
}}if(a!=null&&a.indexOf(",")==0){a=a.substring(1);}}if(a!=null&&a=="-1"){a="AllInfos";}a=this.filterEncode(a);B=B+"&configuredDescriptors="+encodeURIComponent(a);var t=c.findField("Timeline").getValue();B=B+"&saveTimeline=true&time_line="+t+"&timelineKey="+w;var j="No";var e=c.findField("WeightedAverage").getValue();
if(e==true){j="yes";}B=B+"&weightedAverage="+j;var O=Ext.get("PaletteId").getValue();B=B+"&palette="+encodeURIComponent(O);var s=c.findField("DescriptorschkBxOpt");var R="no";if(!Ext.isEmpty(s)&&s.getValue()==true){R="yes";}var Q=c.findField("ServerschkBxOpt");var i="no";if(!Ext.isEmpty(Q)&&Q.getValue()==true){i="yes";
}if((s!=null&&s==false)&&(Q!=null&&Q==false)){Ext.Msg.show({title:myDashboardAlertLbl,msg:displayTypeAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}B=B+"&showDescriptors="+R+"&showServers="+i;var g=c.findField("ViewType").getValue();if(g!=null){B=B+"&viewTypeOpt="+g;}var P=c.findField("excludeDesc").getValue();
if(P!=null&&(P.indexOf("*")==0&&P.length==1)){Ext.Msg.show({title:myDashboardAlertLbl,msg:descriptorExcludeAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}B=B+"&excludedDescriptors="+encodeURIComponent(P);if(!H){J.close();}var d=this.getGridstackpanel();var K=d._serializationStr();
if(K!=null&&K!=""){B=B+"&layoutConfig="+encodeURIComponent(K);}d=null;delete d;var k=Ext.getCmp(E);if(!Ext.isEmpty(publicJson["myDashboardConfigDetails"])){if(publicJson["myDashboardConfigDetails"]["configIds"].indexOf(w)==-1){publicJson["myDashboardConfigDetails"]["configIds"].push(w);}if(publicJson["myDashboardConfigDetails"].hasOwnProperty("configuredWidgetsID")&&publicJson["myDashboardConfigDetails"]["configuredWidgetsID"].indexOf(w)==-1){publicJson["myDashboardConfigDetails"]["configuredWidgetsID"].push(w);
}}if(H){k=u;B=B+"&widgetPreviewMode=yes";k.setLoading(true,true);k.showLoadingMsg=true;}iAjax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:B+"&screenWidth="+(k.getWidth()-2)+"&screenHeight="+(k.getHeight()-20),scope:this,success:function(U){var X=U.responseText;if(X!=null&&X!=""){if(!H){myDashApp.getController("Main").getPortlet().setRefresh(k);
}var W=Ext.decode(X);k.isInitialResizeCompleted=false;k.isHighChartUpdate=false;var V=E;if(H){V=E+"_previewImage";}k.isConfigured=true;myDashApp.getController("Main").showLiveDataForBlock(W,k,V);W=null;delete W;}X=null;delete X;},failure:function(U,V){if(U.timedout){if(G!=null&&G=="TimelineChart"||G=="areaChart"||G=="combinationChart"||G=="TrendGraph"){k.update('<table width="100%" height="'+(k.getHeight()-20)+'"><tr><td align="center" valign="middle"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></div></td></tr></table>");
}else{k.removeAll();k.add({xtype:"panel",html:'<div><table border="0" cellspacing="0" cellpadding="0" width="98%" height="'+(k.getHeight()-20)+'"><tr><td  align="center" valign="middle" class="msgFont"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></td></tr></table></div>"});
}k.setLoading(false);k.showLoadingMsg=false;k.doLayout();}}});},saveAddExternalMetrics:function(){return saveAddExternalMetrics(false,"");},saveAddExternalMetrics:function(a,b){return myDashApp.getController("ExternalIntegrationController").saveAddExternalMetrics(a,b);},saveAddExternalMetricsForKPI:function(){return saveAddExternalMetricsForKPI(false,"");
},saveAddExternalMetricsForKPI:function(a,b){return myDashApp.getController("ExternalIntegrationController").saveAddExternalMetricsForKPI(a,b);},updateBlockConfig:function(){return updateBlockConfig(false,"");},updateDialConfig:function(Q,x){var L=Ext.getCmp("digitalChartImgCont");var S=this.getWidgetOptionsWindow();
var B=S.widgetID;var N=B.substr(0,B.indexOf("_"));var j=S.getComponent("configForm").getForm();var D=j.findField("componentCombo");var f=j.findField("descriptorCombo");var aa=j.findField("testCombo");var C=j.findField("componentTypeCombo");var a=Ext.getCmp("UseStateColorForFonts");var t=Ext.getCmp("ShowGaugeCircle");
var b="";if(a!=null&&!Ext.isEmpty(a)&&a!=undefined){b=a.getValue();}var n="";if(b!=null&&b==true){n="yes";}else{n="no";}var z=Ext.getCmp("UseStateColorForBackground");var Z="";if(z!=null&&z!=""&&z!=undefined){Z=z.getValue();}var d="";if(Z!=null&&Z==true){d="yes";}else{d="no";}if(N!=null&&N=="dialChart"){var k=S.widgetID;
var p="";if(t!=null&&!Ext.isEmpty(t)&&t!=undefined){p=t.getValue();}if(p!=null&&p==true){p="yes";}else{p="no";}var J="";var h=Ext.getCmp("UseStateColorForGauge");if(h!=null&&!Ext.isEmpty(h)&&h!=undefined){J=h.getValue();}var ac="";if(J!=null&&J==true){ac="yes";}else{ac="no";}}var r=aa.getValue();var v=C.getValue();
var l="";if(N!=null&&N=="liveMeasuresBox"){var ab=j.findField("measureCombo");l=ab.getValue();}else{var u=j.findField("measureCombo");l=u.getValue();}var Y=D.getValue();var P=f.getValue();var c=Ext.getCmp("dashboardLayoutObj");if(!Q&&v!=null&&v=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:compTypAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}else{if(!Q&&Y!=null&&(Y==""||Y=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:componentAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}else{if(!Q&&r!=null&&r=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:testAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}else{if(!Q&&l!=null&&(l==""||l=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:measureAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}else{if(!Q&&P!=null&&P==""||P=="chooseDescriptors"){Ext.Msg.show({title:myDashboardAlertLbl,msg:descriptorAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}}}}}if(P!=null&&P=="-1"){P="None";}var W="";var I="vertical";if(N!=null&&N=="liveMeasuresBox"){var s=j.findField("measureCombo").boundList.getSelectionModel().getSelection();for(var y in s){var X=s[y].data["valueField"];var w=s[y].data["displayField"];W=W+","+(w+"$"+r+":"+X);}if(W!=null&&W.indexOf(",")==0){W=encodeURIComponent(W.substring(1));
}}else{W=encodeURIComponent(r+":"+l);}var K=this;var B=S.widgetID;var q=null;if(Q){q=x;}else{q=Ext.getCmp(B);}if(!Ext.isEmpty(publicJson["myDashboardConfigDetails"])){if(publicJson["myDashboardConfigDetails"]["configIds"].indexOf(B)==-1){publicJson["myDashboardConfigDetails"]["configIds"].push(B);}if(publicJson["myDashboardConfigDetails"].hasOwnProperty("configuredWidgetsID")&&publicJson["myDashboardConfigDetails"]["configuredWidgetsID"].indexOf(B)==-1){publicJson["myDashboardConfigDetails"]["configuredWidgetsID"].push(B);
}}var ae=c.profileName;if(!Ext.isEmpty(ae)){ae=this.filterEncode(ae);}if(!Ext.isEmpty(P)){P=this.filterEncode(P);}var H="action=saveDialConfig&profileName="+encodeURIComponent(ae)+"&blockId="+B+"&component="+encodeURIComponent(Y)+"&measure="+W+"&selectedDescriptor="+encodeURIComponent(P);if(N!=null&&N=="liveMeasuresBox"){H=H+"&viewType="+I+"&useStateColorForBackground="+d;
var V=Ext.getCmp("widgetType");if(!Ext.isEmpty(V)){var G=V.getValue();if(!Ext.isEmpty(G)){H=H+"&displayType="+G;}}}if(N!=null&&N=="dialChart"){H=H+"&showGaugeCircle="+p+"&useStateColorForGauge="+ac;var O=Ext.getCmp("ColorPicker").getValue();var m=O.ColorPickerOpt;if(m!=null&&m!=""){H=H+"&selectedColor="+m;
}}if(N!=null&&N=="digitalChart"){H=H+"&useStateColorForFonts="+n;}var g=this.getGridstackpanel();var T=g._serializationStr();if(T!=null&&T!=""){H=H+"&layoutConfig="+encodeURIComponent(T);}g=null;delete g;var U=Ext.getCmp("ChartSummaryEnabled");if(!Ext.isEmpty(U)){var R=U.getValue();if(R!=null&&R==true){var i=Ext.getCmp("SummaryGraphType").getValue();
var o=i.chartType;if(o!=null&&o=="-1"){o="none";}H=H+"&enableChartSummary=yes&summaryGraphType="+encodeURIComponent(o);var e=Ext.getCmp("ShowIcon").getValue();if(e!=null&&e==true){H=H+"&enableChartIcon=yes";}else{H=H+"&enableChartIcon=no";}var E=$("#dashboardImageIcon");if(!Ext.isEmpty(E)){var A=E[0].src;
var ad=null;if(A!=null&&A.lastIndexOf("/")>0){ad=A.substring(0,A.lastIndexOf("/"));A=A.substring(A.lastIndexOf("/")+1);}else{if(A!=null&&A.lastIndexOf("\\")>0){ad=A.substring(0,A.lastIndexOf("\\"));A=A.substring(A.lastIndexOf("\\")+1);}else{var L=Ext.getCmp("digitalChartImgCont");A=L.iconClass;}}if(A!=null){if(ad!=null&&!ad.endsWith("/final/images/"+strSkin)){A="Custom:"+A;
H=H+"&imgIcon="+encodeURIComponent(A);}else{if(ad==null){A="Default:"+A;H=H+"&imgIcon="+encodeURIComponent(A);}}}}}else{H=H+"&enableChartSummary=no&enableChartIcon=no";}}var M=Ext.getCmp("drillDown");if(M!=null&&!Ext.isEmpty(M)&&M!=undefined){var F=M.getValue();F=this.filterEncode(F);H=H+"&selectedDrillDownOpt="+encodeURIComponent(F);
}if(Q){if(S.isKpi){H=H+"&kpiPreview=yes";}H=H+"&widgetPreviewMode=yes";q.setLoading(true,true);q.showLoadingMsg=true;}else{S.close();}H=H+"&useExternalData=no";iAjax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:H+"&screenWidth="+(q.getWidth()-2)+"&screenHeight="+(q.getHeight()-20),scope:this,success:function(af){var ah=B;
if(Q){ah=B+"_previewImage";}else{K.getPortlet().setRefresh(q);}var aj=af.responseText;if(aj!=null&&aj!=""){var ai=Ext.decode(aj);q.isInitialResizeCompleted=false;q.isHighChartUpdate=false;q.isConfigured=true;var ag=[];if(publicJson["myDashboardConfigDetails"]!=null&&publicJson["myDashboardConfigDetails"].hasOwnProperty("configuredWidgetsID")){ag=publicJson["myDashboardConfigDetails"]["configuredWidgetsID"];
}q.isExternalDataSourceWidget=false;myDashApp.getController("Main").showLiveDataForBlock(ai,q,ah);}},failure:function(af,ag){if(af.timedout){q.removeAll();q.add({xtype:"panel",html:'<div><table border="0" cellspacing="0" cellpadding="0" width="98%" height="'+(q.getHeight()-20)+'"><tr><td  align="center" valign="middle" class="msgFont"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></td></tr></table></div>"});
q.setLoading(false);q.showLoadingMsg=false;q.doLayout();}}});},updateKpiDialDigitalConfig:function(P,x){if(P!=true){var K=Ext.getCmp("digitalChartImgCont");var R=this.getWidgetOptionsWindow();var A=R.widgetID;var j=R.Kpicount;var T=R.totalKpiCount;var M=A.substr(0,A.indexOf("_"));var l=R.getComponent("configForm").getForm();
var D=l.findField("componentCombo");var g=l.findField("descriptorCombo");var Y=l.findField("testCombo");var C=l.findField("componentTypeCombo");var a=Ext.getCmp("UseStateColorForFonts");var u=Ext.getCmp("ShowGaugeCircle");var c="";if(a!=null&&!Ext.isEmpty(a)&&a!=undefined){c=a.getValue();}var p="";if(c!=null&&c==true){p="yes";
}else{p="no";}var y=Ext.getCmp("UseStateColorForBackground");var X="";if(y!=null&&y!=""&&y!=undefined){X=y.getValue();}var e="";if(X!=null&&X==true){e="yes";}else{e="no";}if(M!=null&&M=="dialChart"){var m=R.widgetID;var r="";if(u!=null&&!Ext.isEmpty(u)&&u!=undefined){r=u.getValue();}if(r!=null&&r==true){r="yes";
}else{r="no";}var I="";var i=Ext.getCmp("UseStateColorForGauge");if(i!=null&&!Ext.isEmpty(i)&&i!=undefined){I=i.getValue();}var aa="";if(I!=null&&I==true){aa="yes";}else{aa="no";}}var t=Y.getValue();var w=C.getValue();var n="";if(M!=null&&M=="liveMeasuresBox"){var Z=l.findField("measureCombo");n=Z.getValue();
}else{var v=l.findField("measureCombo");n=v.getValue();}var W=D.getValue();var O=g.getValue();var d=Ext.getCmp("dashboardLayoutObj");if(!P&&w!=null&&w=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:compTypAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}else{if(!P&&W!=null&&(W==""||W=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:componentAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}else{if(!P&&t!=null&&t=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:testAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}else{if(!P&&n!=null&&(n==""||n=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:measureAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}else{if(!P&&O!=null&&O==""||O=="chooseDescriptors"){Ext.Msg.show({title:myDashboardAlertLbl,msg:descriptorAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}}}}}if(O!=null&&O=="-1"){O="None";}var V="";var H="vertical";V=encodeURIComponent(t+":"+n);var J=this;var A=R.widgetID;
var s=null;if(P){s=x;}var B="";var b="";if(R.isKpi==true){b=A;B=R.kpiBlckId;A=B+"_"+A;}O=this.filterEncode(O);var ac=d.profileName;if(!Ext.isEmpty(ac)){ac=this.filterEncode(ac);}var G="action=saveKPIConfig&profileName="+encodeURIComponent(ac)+"&blockId="+A+"&widgetNameId="+b+"&widgetType="+M+"&KpiWidgetCount="+T+"&component="+encodeURIComponent(W)+"&measure="+V+"&selectedDescriptor="+encodeURIComponent(O);
G=G+"&KpiWidgetCount="+T;if(M!=null&&M=="dialChart"){G=G+"&showGaugeCircle="+r+"&useStateColorForGauge="+aa;var N=Ext.getCmp("ColorPicker").getValue();var o=N.ColorPickerOpt;if(o==null||o==undefined||Ext.isEmpty(o)){o="88CFE7";}if(o!=null&&o!=""){G=G+"&selectedColor="+o;}}if(M!=null&&M=="digitalChart"){G=G+"&useStateColorForFonts="+p;
}var h=this.getGridstackpanel();var S=h._serializationStr();if(S!=null&&S!=""){G=G+"&layoutConfig="+encodeURIComponent(S);}h=null;delete h;var U=Ext.getCmp("ChartSummaryEnabled");if(!Ext.isEmpty(U)){var Q=U.getValue();if(Q!=null&&Q==true){var k=Ext.getCmp("SummaryGraphType").getValue();var q=k.chartType;
if(q!=null&&q=="-1"){q="none";}G=G+"&enableChartSummary=yes&summaryGraphType="+encodeURIComponent(q);var f=Ext.getCmp("ShowIcon").getValue();if(f!=null&&f==true){G=G+"&enableChartIcon=yes";}else{G=G+"&enableChartIcon=no";}var E=$("#dashboardImageIcon");if(!Ext.isEmpty(E)){var z=E[0].src;var ab=null;if(z!=null&&z.lastIndexOf("/")>0){ab=z.substring(0,z.lastIndexOf("/"));
z=z.substring(z.lastIndexOf("/")+1);}else{if(z!=null&&z.lastIndexOf("\\")>0){ab=z.substring(0,z.lastIndexOf("\\"));z=z.substring(z.lastIndexOf("\\")+1);}else{var K=Ext.getCmp("digitalChartImgCont");z=K.iconClass;}}if(z!=null){if(ab!=null&&!ab.endsWith("/final/images/"+strSkin)){z="Custom:"+z;G=G+"&imgIcon="+encodeURIComponent(z);
}else{if(ab==null){z="Default:"+z;G=G+"&imgIcon="+encodeURIComponent(z);}}}}}else{G=G+"&enableChartSummary=no&enableChartIcon=no";}}var L=Ext.getCmp("drillDown");if(L!=null&&!Ext.isEmpty(L)&&L!=undefined){var F=L.getValue();F=this.filterEncode(F);G=G+"&selectedDrillDownOpt="+encodeURIComponent(F);}if(P){G=G+"&widgetPreviewMode=yes";
}G=G+"&useExternalData=no";}iAjax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:G,scope:this,success:function(ad){var ae=A;var ag=ad.responseText;if(ag!=null&&ag!=""){var af=Ext.decode(ag);if(!P){var ah=Ext.widget("kpiConfigurationWindow",{blockId:B,blckType:"KpiWidget",isFluidWindowConfigPopup:true,isConfigured:true,count:j,});
if(ah!=null){ah.setTitle("KPI Configuration");ah.show();}}}},failure:function(ad,ae){if(ad.timedout){s.removeAll();s.add({xtype:"panel",html:'<div><table border="0" cellspacing="0" cellpadding="0" width="98%" height="'+(s.getHeight()-20)+'"><tr><td  align="center" valign="middle" class="msgFont"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></td></tr></table></div>"});
s.setLoading(false);s.showLoadingMsg=false;s.doLayout();}}});},updateScatterPlotConfig:function(){return updateScatterPlotConfig(false,"");},updateScatterPlotConfig:function(h,m){var y=this;var D=this.getWidgetOptionsWindow();var r=D.widgetID;var A=r.substr(0,r.indexOf("_"));var a=D.getComponent("configForm").getForm();
var p=Ext.getCmp("scatterTab");var u=p.xAxisConfigured;var j=p.xAxisCompType;var z=p.xAxisComp;var C=p.xAxisTest;var G=p.xAxisMeas;var v=p.xAxisDesc;var c=p.yAxisConfigured;var I=p.yAxisCompType;var q=p.yAxisComp;var s=p.yAxisTest;var l=p.yAxisMeas;var w=p.yAxisDesc;var k=Ext.getCmp("dashboardLayoutObj").profileName;
var K=k;if(!Ext.isEmpty(K)){K=this.filterEncode(K);}var x="action=saveCorrelationConfig&profileName="+encodeURIComponent(K)+"&blockId="+r;if(true){if((j!=null&&j=="-1")||j==undefined){Ext.Msg.show({title:myDashboardAlertLbl,msg:xAxisComponentTypeAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return false;}else{if(z!=null&&(z==""||z=="-1"||z==undefined)){Ext.Msg.show({title:myDashboardAlertLbl,msg:xAxisComponentAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return false;}else{if(C==undefined||(C!=null&&C=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:xAxisTestAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return false;}else{if(G!=null&&(G==""||G=="-1"||G==undefined)){Ext.Msg.show({title:myDashboardAlertLbl,msg:xAxisMeasureAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return false;}}}}if(v!=null&&v==""||v=="chooseDescriptors"||v==undefined){Ext.Msg.show({title:myDashboardAlertLbl,msg:xAxisDescriptorAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return false;}v=filterEncode(v);x=x+"&configuredXAxis=true&xAxisCompType="+encodeURIComponent(j)+"&xAxisComponent="+encodeURIComponent(z)+"&xAxisTest="+encodeURIComponent(C)+"&xAxisMeasure="+encodeURIComponent(G)+"&xAxisDescriptor="+encodeURIComponent(v);}var E=p.isYAxisTabLoaded;var t=p.isWidgetConfigured;
if(E){if((I!=null&&I=="-1")||I==undefined){Ext.Msg.show({title:myDashboardAlertLbl,msg:yAxisComponentTypeAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return false;}else{if(q!=null&&(q==""||q=="-1"||q==undefined)){Ext.Msg.show({title:myDashboardAlertLbl,msg:yAxisComponentAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return false;}else{if(s==undefined||(s==""||s!=null&&s=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:yAxisTestAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return false;}else{if(l!=null&&(l==""||l=="-1"|l==undefined)){Ext.Msg.show({title:myDashboardAlertLbl,msg:yAxisMeasureAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return false;}}}}if(w!=null&&w==""||w=="chooseDescriptors"||v==undefined){Ext.Msg.show({title:myDashboardAlertLbl,msg:yAxisDescriptorAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return false;}w=filterEncode(w);x=x+"&configuredYAxis=true&yAxisCompType="+encodeURIComponent(I)+"&yAxisComponent="+encodeURIComponent(q)+"&yAxisTest="+encodeURIComponent(s)+"&yAxisMeasure="+encodeURIComponent(l)+"&yAxisDescriptor="+encodeURIComponent(w);
}else{if(!t){if((I!=null&&I=="-1")||I==undefined){Ext.Msg.show({title:myDashboardAlertLbl,msg:yAxisComponentTypeAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return false;}else{if(q!=null&&(q==""||q=="-1"||q==undefined)){Ext.Msg.show({title:myDashboardAlertLbl,msg:yAxisComponentAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return false;}else{if(s==undefined||(s==""||s!=null&&s=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:yAxisTestAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return false;}else{if(l!=null&&(l==""||l=="-1"|l==undefined)){Ext.Msg.show({title:myDashboardAlertLbl,msg:yAxisMeasureAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return false;}}}}if(w!=null&&w==""||w=="chooseDescriptors"||v==undefined){Ext.Msg.show({title:myDashboardAlertLbl,msg:yAxisDescriptorAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return false;}w=filterEncode(w);x=x+"&configuredYAxis=true&yAxisCompType="+encodeURIComponent(I)+"&yAxisComponent="+encodeURIComponent(q)+"&yAxisTest="+encodeURIComponent(s)+"&yAxisMeasure="+encodeURIComponent(l)+"&yAxisDescriptor="+encodeURIComponent(w);
}}if(A!=null){var o=a.findField("Timeline").getValue();x=x+"&saveTimeline=true&time_line="+o+"&timelineKey="+r;}var B=Ext.getCmp("ColorPicker").getValue();var e=B.ColorPickerOpt;if(e!=null&&e!=""){x=x+"&selectedColor="+e;}var n=a.findField("DescriptorschkBxOpt");var J="no";if(!Ext.isEmpty(n)&&n.getValue()==true){J="yes";
}var H=a.findField("ServerschkBxOpt");var d="no";if(!Ext.isEmpty(H)&&H.getValue()==true){d="yes";}var f=a.findField("MetricschkBxOpt");var i="no";if(!Ext.isEmpty(f)&&f.getValue()==true){i="yes";}x=x+"&showDescriptors="+J+"&showServers="+d+"&showMetrics="+i;if(!h){D.close();}var b=this.getGridstackpanel();
var F=b._serializationStr();if(F!=null&&F!=""){x=x+"&layoutConfig="+encodeURIComponent(F);}b=null;delete b;var g=Ext.getCmp(r);if(!Ext.isEmpty(publicJson["myDashboardConfigDetails"])){if(publicJson["myDashboardConfigDetails"]["configIds"].indexOf(r)==-1){publicJson["myDashboardConfigDetails"]["configIds"].push(r);
}if(publicJson["myDashboardConfigDetails"].hasOwnProperty("configuredWidgetsID")&&publicJson["myDashboardConfigDetails"]["configuredWidgetsID"].indexOf(r)==-1){publicJson["myDashboardConfigDetails"]["configuredWidgetsID"].push(r);}}if(h){g=m;x=x+"&widgetPreviewMode=yes";g.setLoading(true,true);g.showLoadingMsg=true;
}iAjax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:x+"&screenWidth="+(g.getWidth()-2)+"&screenHeight="+(g.getHeight()-20),scope:this,success:function(L){var O=L.responseText;if(O!=null&&O!=""){if(!h){y.getPortlet().setRefresh(g);}var N=Ext.decode(O);g.isInitialResizeCompleted=false;
g.isHighChartUpdate=false;var M=r;if(h){M=r+"_previewImage";}g.isConfigured=true;myDashApp.getController("Main").showLiveDataForBlock(N,g,M);N=null;delete N;}O=null;delete O;},failure:function(L,M){if(L.timedout){if(A!=null&&A=="TimelineChart"||A=="areaChart"||A=="combinationChart"||A=="TrendGraph"){g.update('<table width="100%" height="'+(g.getHeight()-20)+'"><tr><td align="center" valign="middle"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></div></td></tr></table>");
}else{g.removeAll();g.add({xtype:"panel",html:'<div><table border="0" cellspacing="0" cellpadding="0" width="98%" height="'+(g.getHeight()-20)+'"><tr><td  align="center" valign="middle" class="msgFont"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></td></tr></table></div>"});
}g.setLoading(false);g.showLoadingMsg=false;g.doLayout();}}});},updateBlockConfig:function(ak,w){var aw=this;var z=this.getWidgetOptionsWindow();var at=z.widgetID;var g=at.substr(0,at.indexOf("_"));var au=z.getComponent("configForm").getForm();var v=false;var aa={};var F="";var G="";var P="No";if(g!=null&&g=="table"){P=au.findField("ShowValues").getValue();
if(P==true){P="yes";}else{P="no";}}var A=this.getComparisontable();var y=A.getStore();var aq="";var l="";var N="";var an="";var ah="";var q=A.getStore().getCount();if(q==0){Ext.Msg.show({title:myDashboardAlertLbl,msg:measureAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}var D=false;
var ao=false;var aC=false;if(g!=null&&g=="combinationChart"){D=true;}else{if(g!=null&&g=="BarChart"){var d=au.findField("Stacked").getValue();var W="no";if(d!=null&&d==true){W="yes";aC=true;}ao=true;}}var aL=z.autoAssociateComponents;var H="no";if(ak&&(aL!=null&&aL==true)){H="yes";}var aI=Ext.getCmp("dashboardLayoutObj").profileName;
var o=aI;if(!Ext.isEmpty(o)){o=aw.filterEncode(o);}var O=[];var X=[];var t=false;for(var R=0;R<q;R++){var m=A.getStore().getAt(R).get("measuresHidVal");var aG=A.getStore().getAt(R).get("componentsHidVal");var L=A.getStore().getAt(R).get("descriptorHidVal");var aJ=A.getStore().getAt(R).get("componentDisplayName");
var e=A.getStore().getAt(R).get("descriptorDisplayName");if(aq.indexOf(m)==-1){aq=aq+","+m;}if(l.indexOf(aG)==-1){l=l+","+aG;}N=N+","+L;if(!Ext.isEmpty(aJ)){if(X!=null&&!Ext.Array.contains(X,aJ)){an=an+","+aJ;X.push(aJ);}}if(!Ext.isEmpty(e)){if(O!=null&&!Ext.Array.contains(O,e)){ah=ah+","+e;O.push(e);
}}if(aC){if(L.indexOf("|HASH|")<0){t=true;break;}}}if(aC&&t){Ext.MessageBox.show({title:myDashboardAlertLbl,msg:aggEnableAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return false;}if(aq!=null&&aq.indexOf(",")==0){aq=aq.substring(1);}if(l!=null&&l.indexOf(",")==0){l=l.substring(1);}if(N!=null&&N.indexOf(",")==0){N=N.substring(1);
}if(an!=null&&an.indexOf(",")==0){an=an.substring(1);}if(ah!=null&&ah.indexOf(",")==0){ah=ah.substring(1);}aq=aw.filterEncode(aq);N=aw.filterEncode(N);F="action=saveConfig&profileName="+encodeURIComponent(o)+"&blockId="+at+"&configuredMeasures="+encodeURIComponent(aq)+"&configuredComponents="+encodeURIComponent(l)+"&configuredDescriptors="+encodeURIComponent(N);
if(!Ext.isEmpty(an)){F=F+"&ComponentDisplayNames="+encodeURIComponent(an);}if(!Ext.isEmpty(ah)){F=F+"&descriptorDisplayNames="+encodeURIComponent(ah);}if(g!=null){if(g=="CombinedTimelineChart"||g=="TimelineChart"||g=="areaChart"||g=="combinationChart"||v||g=="TrendGraph"){var au=z.getComponent("configForm").getForm();
var aK=au.findField("er_stdate").dataArray;var Q=au.findField("er_enddate").dataArray;var J=au.findField("er_sthr").dataArray;var h=au.findField("er_endhr").dataArray;var V=au.findField("er_stdate").getValue();var I=au.findField("er_enddate").getValue();V.setHours(au.findField("er_sthr").getValue());
I.setHours(au.findField("er_endhr").getValue());var p=au.findField("er_timeline").getValue();var ax=au.findField("er_stmin");var c=au.findField("er_endmin");var E=ax.getValue();var ai=c.getValue();V.setMinutes(E);I.setMinutes(ai);var af=formatDate(V,mgrDisplayDateFormat);var ap=formatDate(I,mgrDisplayDateFormat);
var ac=au.findField("er_sthr").getValue();var f=au.findField("er_endhr").getValue();var ab=new Date();var x=ab.getMonth()+"/"+ab.getDay()+"/"+ab.getYear();if(p!=null&&p.toLowerCase()=="any"){if(new Date(af)>new Date(ap)){Ext.MessageBox.show({title:myDashboardAlertLbl,msg:DateErrorMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return false;}if(new Date(af).valueOf()==new Date(ap).valueOf()){if(J>h){Ext.MessageBox.show({title:myDashboardAlertLbl,msg:DateErrorMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return false;}if(J==h){if(E>=ai){Ext.MessageBox.show({title:myDashboardAlertLbl,msg:DateErrorMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return false;}}}if(ab<new Date(af)){Ext.MessageBox.show({title:myDashboardAlertLbl,msg:timeErrorMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return false;}}aK=formatDate(new Date(getDateFromFormat(aK,mgrDisplayDateFormat)),"MM/dd/yyyy");Q=formatDate(new Date(getDateFromFormat(Q,mgrDisplayDateFormat)),"MM/dd/yyyy");
F=F+"&saveTimeline=true&time_line="+p+"&timelineKey="+at+"&starttime="+encodeURI(aK)+"&endtime="+encodeURI(Q)+"&starthr="+J+"&endhr="+h+"&stmin="+E+"&endmin="+ai;}if(g!=null&&g=="table"){if(!v){F=F+"&showValues="+P;var U="";var r=au.findField("SetStateColorOn").getValue();if(r!=null&&r=="None"){U="no";
}else{U="yes";}F=F+"&EnableMeasureStateColor="+encodeURIComponent(U);F=F+"&SetStateColorOn="+encodeURIComponent(r);var a=Ext.getCmp("enableChartSummary");var aE=au.findField("SummaryGraphType");if(!Ext.isEmpty(a)){var C=a.getValue();if(C!=null&&C==true){var Z=aE.getValue();var av=Z.chartType;if(av!=null&&av=="-1"){av="none";
}F=F+"&ChartSummaryEnabled=yes&SummaryGraphType="+encodeURIComponent(av);}else{F=F+"&ChartSummaryEnabled=no&SummaryGraphType=none";}}}}if(g!=null&&(g=="areaChart"||g=="BarChart")){var d=au.findField("Stacked").getValue();var W="no";if(!Ext.isEmpty(d)&&d==true){W="yes";}F=F+"&stackedChart="+W;}if(g!=null&&(g=="TimelineChart"||g=="TrendGraph")){var aF=au.findField("chartType").getValue();
chartSplineGraphType=aF.chartType;if(chartSplineGraphType!=null&&chartSplineGraphType=="line"){chartSplineGraphType="line";}F=F+"&splineGraphType="+encodeURIComponent(chartSplineGraphType);if(g=="TrendGraph"){var ag=au.findField("period").getValue();var K=au.findField("Statistics").getValue();F=F+"&period="+encodeURIComponent(ag)+"&trendGraphOpt="+encodeURIComponent(K);
}}}if(g=="CombinedTimelineChart"||g=="TimelineChart"||g=="areaChart"||g=="combinationChart"||g=="TrendGraph"||g=="pieChart"||g=="activityChart"||g=="BarChart"||g=="heatMapChart"){var S=Ext.get("PaletteId").getValue();F=F+"&palette="+encodeURIComponent(S);}var aA=au.findField("DescriptorschkBxOpt");var B="no";
if(!Ext.isEmpty(aA)&&aA.getValue()==true){B="yes";}var ae=au.findField("ServerschkBxOpt");var al="no";if(!Ext.isEmpty(ae)&&ae.getValue()==true){al="yes";}if(g!=null&&(g!="table"&&g!="BarChart")){var am=au.findField("MetricschkBxOpt");var Y="no";if(!Ext.isEmpty(am)&&am.getValue()==true){Y="yes";}}if(g!=null&&(g=="areaChart"||g=="TimelineChart"||g=="combinationChart"||g=="TrendGraph")){var j=au.findField("showChartSummary").getValue();
var aH="no";if(j!=null&&j==true){if(!ak&&((aA!=null&&aA.getValue()==false)&&(am!=null&&am.getValue()==false)&&(ae!=null&&ae.getValue()==false))){Ext.Msg.show({title:myDashboardAlertLbl,msg:legendTypeAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}aH="yes";if(B=="no"&&al=="no"){Y="yes";
}}F=F+"&showChartSummary="+aH;}else{if(g!=null&&(g=="table"||g=="BarChart")){if((aA!=null&&aA.getValue()==false)&&(ae!=null&&ae.getValue()==false)){Ext.Msg.show({title:myDashboardAlertLbl,msg:legendTypeAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}}}if(g!=null&&(g=="pieChart"||g=="activityChart")){if((aA!=null&&aA.getValue()==false)&&(am!=null&&am.getValue()==false)&&(ae!=null&&ae.getValue()==false)){Ext.Msg.show({title:myDashboardAlertLbl,msg:legendTypeAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}var aD="no";var u=au.findField("showDistprcnt");if(!u.isHidden()){var aM=u.getValue();if(aM){aD="yes";}}else{aD="yes";}}if(g!=null&&(g=="pieChart"||g=="activityChart")){var ad=z.modified;if(!ad){if(l!=null&&l.indexOf(",")>0){al="yes";}else{al="no";}if(aq!=null&&aq.indexOf(",")>0){Y="yes";}else{Y="no";
}}F=F+"&showDescriptors="+B+"&showServers="+al+"&showMetrics="+Y+"&showDistprcnt="+aD;}else{F=F+"&showDescriptors="+B+"&showServers="+al+"&showMetrics="+Y;}if(g=="BarChart"){var n=au.findField("ViewType").getValue();if(n!=null){F=F+"&viewTypeOpt="+n;}}if(g!=null&&(g=="combinationChart"||g=="TimelineChart"||g=="areaChart"||g=="table"||g=="CombinedTimelineChart"||g=="BarChart")||g=="TrendGraph"||g=="pieChart"||g=="activityChart"||g=="heatMapChart"){var az=au.findField("excludeDesc").getValue();
if(az!=null&&(az.indexOf("*")==0&&az.length==1)){Ext.Msg.show({title:myDashboardAlertLbl,msg:descriptorExcludeAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}az=filterEncode(az);F=F+"&excludedDescriptors="+encodeURIComponent(az);}if(g=="TimelineChart"||g=="areaChart"){var T=au.findField("yMax").getValue();
if(T!=null&&T!=""){if(!Ext.isNumeric(T)){Ext.Msg.show({title:myDashboardAlertLbl,msg:screenLabelsObj["yMaxLimit-Non-NumericAlertMsg"],buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}F=F+"&yMaxValue="+encodeURIComponent(T);}}F=F+"&useExternalData=no";if(g=="TimelineChart"||g=="areaChart"||g=="combinationChart"||g=="TrendGraph"){var aB=Ext.getCmp("SortByPriority");
if(!Ext.isEmpty(aB)){var ar=aB.getValue();if(!Ext.isEmpty(ar)&&ar==true){var aj=Ext.getCmp("Priority").getValue();F=F+"&sortByPriority=yes&topNPriority="+aj;}else{F=F+"&sortByPriority=no";}}}var b=Ext.getCmp("drillDown");if(b!=null&&!Ext.isEmpty(b)&&b!=undefined){var s=b.getValue();s=this.filterEncode(s);
F=F+"&selectedDrillDownOpt="+encodeURIComponent(s);}if(!ak){z.close();}var M=this.getGridstackpanel();var ay=M._serializationStr();if(ay!=null&&ay!=""){F=F+"&layoutConfig="+encodeURIComponent(ay);}M=null;delete M;var k=Ext.getCmp(at);if(!Ext.isEmpty(publicJson["myDashboardConfigDetails"])){if(publicJson["myDashboardConfigDetails"]["configIds"].indexOf(at)==-1){publicJson["myDashboardConfigDetails"]["configIds"].push(at);
}if(publicJson["myDashboardConfigDetails"].hasOwnProperty("configuredWidgetsID")&&publicJson["myDashboardConfigDetails"]["configuredWidgetsID"].indexOf(at)==-1){publicJson["myDashboardConfigDetails"]["configuredWidgetsID"].push(at);}}if(ak){k=w;F=F+"&widgetPreviewMode=yes";k.setLoading(true,true);k.showLoadingMsg=true;
}if(ak&&!Ext.isEmpty(H)){F=F+"&autoAssociateComponents="+H;}iAjax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:F+"&screenWidth="+(k.getWidth()-2)+"&screenHeight="+(k.getHeight()-20),scope:this,success:function(i){var aP=i.responseText;if(aP!=null&&aP!=""){if(!ak){aw.getPortlet().setRefresh(k);
}var aO=Ext.decode(aP);k.isInitialResizeCompleted=false;k.isHighChartUpdate=false;k.isExternalDataSourceWidget=false;var aN=at;if(ak){aN=at+"_previewImage";}k.isConfigured=true;myDashApp.getController("Main").showLiveDataForBlock(aO,k,aN);aO=null;delete aO;}aP=null;delete aP;},failure:function(i,aN){if(i.timedout){if(g!=null&&g=="TimelineChart"||g=="areaChart"||g=="combinationChart"||g=="TrendGraph"){k.update('<table width="100%" height="'+(k.getHeight()-20)+'"><tr><td align="center" valign="middle"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></div></td></tr></table>");
}else{k.removeAll();k.add({xtype:"panel",html:'<div><table border="0" cellspacing="0" cellpadding="0" width="98%" height="'+(k.getHeight()-20)+'"><tr><td  align="center" valign="middle" class="msgFont"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></td></tr></table></div>"});
}k.setLoading(false);k.showLoadingMsg=false;k.doLayout();}}});},filterEncode:function(i){var d=["[","]","(",")","=","%","'","&",";",'"'];var c=["|lsbr|","|rsbr|","|lbr|","|rbr|","|eq|","|per|","|squot|","|ampsnd|","|scol|","|dqt|"];try{if(i!=null&&i!=undefined&&!Ext.isEmpty(i)){for(var b in d){var f=d[b];
var g=c[b];do{i=i.replace(f,g);}while(i.indexOf(f)>-1);}}}catch(h){}return i;},loadTestsForComp:function(e){var k=e.getValue();if(k!="-1"){var j="C=true&F=getTestsAsJSONForComponent&P0={"+k+"}&calljson=true";this.callRemoteScriptingMethod(j,"loadHealthTests","healthPopup","",true);}else{var b=this.getWidgetOptionsWindow();
var c=b.getComponent("configForm").getForm();var a=c.findField("testCombo");var h=a.getStore();h.removeAll();h.insert(0,{displayField:notApplicable,valueField:"-1"});a.setValue("-1");var i=c.findField("measureCombo");var g=i.getStore();g.removeAll();g.insert(0,{displayField:notApplicable,valueField:"-1"});
i.setValue("-1");var d=c.findField("descriptorCombo");if(d!=null&&!Ext.isEmpty(d)){var f=d.getStore();f.removeAll();f.insert(0,{displayField:notApplicable,valueField:"-1"});d.setValue("-1");}}},descriptorsOnClick:function(m,h,o,i,j,k){var l=this.getWidgetOptionsWindow();var a=l.getComponent("configForm").getForm();
var b=a.findField("descriptorCombo");var f=m.getSelectionModel().getSelection();var c=false;var g=null;for(var d in f){var n=f[d].data["valueField"];if(n!=null&&n=="allDescriptors"){g=d;c=true;}else{c=false;}}if(c){b.setValue("allDescriptors");}else{if(g!=null){m.getSelectionModel().deselect(f[g]);}}},expandMe:function(c){var g="";
var b="";var h=c.getId();if(h=="componentExpandSelector"){g="componentCombo";b=componentAlertMsg;}else{if(h=="measureExpandSelector"){g="measureCombo";b=componentAlertMsg;}else{if(h=="descriptorExpandSelector"){g="descriptorCombo";b=descriptorAlertMsg;}else{if(h=="ddColumnsExpandSelector"){g="ddColumnsCombo";
b=noDDColSelectedAlertMsg;}else{if(h=="summarizeDDColumnExpandSelector"){g="summarizeDDColumnCombo";b=noDDColSelectedAlertMsg;}}}}}var a=Ext.getCmp(g);var f=Ext.clone(a.getStore());c.setDisabled(true);var d=this;var e=Ext.create("Ext.window.Window",{title:Ext.getCmp(g+"Lbl").text,ui:"eg-new-window",height:350,layout:{type:"vbox",align:"stretch",},padding:"0 10 010",width:260,frame:true,border:true,ghost:false,id:h+"View",closeAction:"destroy",buttonAlign:"center",btnObjId:h,comboBxId:g,modal:true,items:[{xtype:"container",flex:1,layout:{type:"vbox",align:"stretch",},margin:0,items:[{xype:"container",cls:"multisearchlist",style:{"top":"0px"},items:[{xtype:"customtrigger",width:225,id:"compSearch",listeners:{"change":function(m,l,i,j){if(!Ext.isEmpty(f)){if(l=="*"){f.clearFilter();
}else{if(l.lastIndexOf("*")==(l.length-1)){l=l.substr(0,(l.length-1));}f.clearFilter();if(l){var k=new RegExp(Ext.String.escapeRegex(l),"i");f.filter({filterFn:function(n){return k.test(n.get("displayField"));}});}m.focus();}}}}}]},{xtype:"multiselect",width:240,flex:1,border:0,autoScroll:true,scroll:true,labelAlign:"left",baseCls:"egmultiselect",multiSelect:true,id:g+"_Clone",name:g+"_Clone",store:f,value:a.getValue(),displayField:"displayField",valueField:"valueField",queryMode:"local",listConfig:{simpleSelect:true,id:g+"_maximize",name:g+"_maximize"}}]}],buttons:[{text:"Select",id:"expand",margin:"0 0 10 0",padding:"0 4 0 4",cls:"quickMenuWhiteButton",name:"expand",handler:function(){var l=Ext.getCmp(this.up("window").comboBxId+"_Clone");
if(l.getValue()!=""){var n=Ext.getCmp(this.up("window").btnObjId);if(n!=null){n.setDisabled(false);}if(g!=null&&g=="componentCombo"){var j=[];for(var k=0;k<l.getStore().getCount();k++){var m=l.getStore().getAt(k);j.push(m);}a.getStore().loadData(j,false);a.setValue(l.getValue());d.loadDescriptors();}else{a.setValue(l.getValue());
}e.destroy();}else{Ext.MessageBox.show({title:myDashboardAlertLbl,msg:b,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}}}],listeners:{"destroy":function(){if(h=="oneClickCompExpand"){f.clearFilter();}var i=Ext.getCmp(this.btnObjId);if(i!=null){i.setDisabled(false);}}}}).show();},showAggOptions:function(b){var d=this.getWidgetOptionsWindow();
var a=d.getComponent("configForm").getForm();var c=b.getValue();if(c!=null&&c==true){a.findField("aggOptions").show();Ext.getCmp("descriptorMultiSelectOuterBox").setDisabled(true);}else{a.findField("aggOptions").hide();Ext.getCmp("descriptorMultiSelectOuterBox").setDisabled(false);Ext.getCmp("descriptorExpandSelector").setDisabled(false);
}},loadComponents:function(e){var h=e.getValue();var k=this.getWidgetOptionsWindow();var a=k.getComponent("configForm").getForm();if(h!="-1"){var d=Ext.getCmp("dashboardLayoutObj").profileName;var l="C=true&F=getComponentsJSONForType&P0={"+h+"}&calljson=true";var m=k.widgetID;var c="";if(m!=null&&m.indexOf("_")>0){c=m.substr(0,m.indexOf("_"));
}if(c=="BarChart"||c=="table"||c=="TimelineChart"||c=="areaChart"||c=="TrendGraph"||c=="CombinedTimelineChart"||c=="combinationChart"||c=="TopNAnalysis"){if(!Ext.isEmpty(k)&&k.autoAssociateComponents==true){return;}}if(c!=null&&(c=="BarChart"||c=="table"||c=="TopNAnalysis")){if(c=="TopNAnalysis"){var j=a.findField("testCombo").getValue();
l=l+"&P1={true}&P2={"+j+"}&P3={"+d+"}";}else{l=l+"&P1={"+d+"}&P2={"+m+"}";}}else{l=l+"&P1={"+d+"}";}this.callRemoteScriptingMethod(l,"loadComponents","","",true);}else{var g=a.findField("componentCombo");var i=g.getStore();i.removeAll();i.insert(0,{displayField:notApplicable,valueField:"-1"});g.setValue("-1");
var b=a.findField("descriptorCombo");var f=b.getStore();f.removeAll();f.insert(0,{displayField:notApplicable,valueField:"-1"});b.setValue("-1");}if(c!=null&&c=="ScatterPlot"){this.saveSelection("compType");}},loadMeasures:function(e){var p=e.getValue();var k=this.getWidgetOptionsWindow();var a=k.getComponent("configForm").getForm();
if(p!="-1"){var m=k.widgetID;var c="";if(m!=null&&m.indexOf("_")>0){c=m.substr(0,m.indexOf("_"));}var l="C=true&P0={"+p+"}&calljson=true";var d=Ext.getCmp("dashboardLayoutObj").profileName;if(c!=null&&c=="TopNAnalysis"){l=l+"&F=getCompTypeAndMeasuresJSONForTest&P1={true}&P2={"+encodeURIComponent(d)+"}";
}else{l=l+"&F=getCompTypeAndMeasuresJSONForTest&P1={false}&P2={"+encodeURIComponent(d)+"}&P3={"+encodeURIComponent(m)+"}";}this.callRemoteScriptingMethod(l,"loadMeasures","","",true);}else{var f=a.findField("measureCombo");var j=f.getStore();j.removeAll();j.insert(0,{displayField:notApplicable,valueField:"-1"});
f.setValue("-1");var o="componentTypeCombo";var n="componentCombo";var h=a.findField(n);var i=h.getStore();i.removeAll();i.insert(0,{displayField:notApplicable,valueField:"-1"});h.setValue("-1");var b=a.findField("descriptorCombo");var g=b.getStore();g.removeAll();g.insert(0,{displayField:notApplicable,valueField:"-1"});
b.setValue("-1");}},loadDescriptors:function(){var i=this.getWidgetOptionsWindow();var a=i.getComponent("configForm").getForm();var m=a.findField("componentCombo");var l=m.getValue();if(l!="-1"){var c="";var k=i.widgetID;if(k!=null&&k.indexOf("_")>0){c=k.substr(0,k.indexOf("_"));}var d="";d=a.findField("componentTypeCombo").getValue();
var h=a.findField("testCombo").getValue();var e=Ext.getCmp("dashboardLayoutObj");var g=e.profileName;var j="C=true&F=getDescriptorsForServersJSON&P0={"+d+"}&P1={"+l+"}&P2={"+h+"}&P3={"+encodeURIComponent(g)+"}&P4={"+encodeURIComponent(k)+"}&calljson=true";this.callRemoteScriptingMethod(j,"loadDescriptors","","",true);
}else{var b=a.findField("descriptorCombo");var f=b.getStore();f.removeAll();f.insert(0,{displayField:notApplicable,valueField:"-1"});b.setValue("-1");}},callRemoteScriptingMethod:function(e,h,f,c,g){var d=this;var a="";var b="";b=this.getWidgetOptionsWindow();a=b.getComponent("configForm").getForm();
iAjax.request({url:"/final/servlet/com.eg.EgMonRemoteScriptingServlet",method:"POST",params:e+"&screenWidth="+(Ext.getBody().getViewSize().width)+"&screenHeight="+(Ext.getBody().getViewSize().height),scope:this,async:g,success:function(o){var s=o.responseText;if(s!=null&&s!=""){var Q=Ext.decode(s);if(h!=null&&h=="loadMeasures"){var Y="";
var L=b.widgetID;if(L!=null&&L.indexOf("_")>0){Y=L.substr(0,L.indexOf("_"));}if(b.isTopNWidget){var H=a.findField("measureCombo");d.setValueWithOptionInList(H,Q["measureOpts"],"-1",measureAlertMsg);var r=a.findField("componentTypeCombo");d.setValueWithOptionInList(r,Q["compTypeOpts"],"-1","");var I=a.findField("componentCombo");
var T=I.getStore();T.removeAll();T.insert(0,{displayField:notApplicable,valueField:"-1"});I.setValue("-1");var z=a.findField("componentSearchTextBox");z.componentStore=null;z.setValue("");}else{var r=a.findField("componentTypeCombo");d.setValueWithOptionInList(r,Q["compTypeOpts"],"-1","");var an=a.findField("measureCombo");
d.setValueWithMultiSelectOptionInList(an,Q["measureOpts"],"","","");var I=a.findField("componentCombo");var T=I.getStore();T.removeAll();T.insert(0,{displayField:notApplicable,valueField:"-1"});I.setValue("-1");if(Y!=null&&Y!="pieChart"&&Y!="activityChart"){var z=a.findField("componentSearchTextBox");
z.componentStore=null;z.setValue("");}var E="descriptorCombo";var W=a.findField(E);var ak=W.getStore();ak.removeAll();ak.insert(0,{displayField:notApplicable,valueField:"-1"});W.setValue("-1");if(Y!=null&&(Y!="pieChart"&&Y!="activityChart")){var i=a.findField("descriptorSearchTextBox");i.descriptorStore=null;
i.setValue("");}}}else{if(h!=null&&h=="loadOneClickDashboardTemplates"){var v=a.findField("dashTemplatesList");if(c!=null&&c==""){c="-1";}var X=Q["selectedDashboardTemplate"];if(X!=null&&(X!=""&&X!="null")){c=X;}var m=a.findField("oneClickComponentCombo");var T=m.getStore();T.removeAll();T.insert(0,{displayField:notApplicable,valueField:"-1"});
m.setValue("-1");d.setValueWithOptionInList(v,Q["templateList"],c,templateAlertMsg);if(X!=null&&(X!=""&&X!="null")){v.fireEvent("select",v);}}else{if(h!=null&&h=="loadDescriptorsForOneClickDashboard"){var W=a.findField("oneClickDescriptorCombo");var D=Q["descriptorsList"];if(D!=null&&!Ext.isEmpty(D)){if(D.length==1&&D[0].valueField=="-1"){var ak=W.getStore();
ak.removeAll();W.suspendEvents(false);ak.loadRawData(D);W.setValue("-1");W.resumeEvents();}else{var V=W.getStore();V.removeAll();W.suspendEvents(false);V.loadRawData(D);V.insert(0,{displayField:descriptorAlertMsg,valueField:"chooseDescriptors"});W.setValue("chooseDescriptors");W.resumeEvents();}var Z=Q["selectedDescriptor"];
if(!Ext.isEmpty(Z)&&Z!="undefined"){W.setValue(Z);}}else{var W=a.findField("oneClickDescriptorCombo");var ak=W.getStore();ak.removeAll();ak.insert(0,{displayField:notApplicable,valueField:"-1"});W.setValue("-1");}W.show();}else{if(h!=null&&h=="loadCompsForOneClickDashboardTemplate"){if(c!=null&&c==""){c="-1";
}var x=Q["selectedComponent"];var q=Q["compsSelection"];if(x!=null&&(x!=""&&x!="null")){c=x;}var m=null;if(q!=null&&q=="multi"){var I=a.findField("oneClickInfraElementsCombo");m=a.findField("oneClickComponentCombo");d.setValueWithMultiSelectOptionInList(I,Q["compOptsJson"],"allServers",allServers);m.hide();
I.show();}else{var I=a.findField("oneClickInfraElementsCombo");m=a.findField("oneClickComponentCombo");d.setValueWithOptionInList(m,Q["compOptsJson"],c,componentAlertMsg);I.hide();m.show();}if(Q!=null&&Q.hasOwnProperty("showDescriptorsCombo")){var K=a.findField("oneClickDescriptorCombo");m.loadDescriptors=true;
var ak=K.getStore();ak.removeAll();ak.insert(0,{displayField:notApplicable+"_1111",valueField:"-1"});K.setValue("-1");K.show();if(c!=null&&(c!=""&&c!="null")){m.fireEvent("select",m);}}else{m.loadDescriptors=false;var K=a.findField("oneClickDescriptorCombo");var ak=K.getStore();ak.removeAll();ak.insert(0,{displayField:notApplicable,valueField:"-1"});
K.setValue("-1");K.hide();}}else{if(h!=null&&h=="loadComponents"){var Y="";var L=b.widgetID;if(L!=null&&L.indexOf("_")>0){Y=L.substr(0,L.indexOf("_"));}var ag=false;var m=a.findField("componentCombo");var ao="";var U="";if(Y!=null&&(Y=="dialChart"||Y=="digitalChart"||Y=="pieChart"||Y=="activityChart"||Y=="liveMeasuresBox"||Y=="ddTable"||Y=="vmAlarmsWidget")){ao=componentAlertMsg;
U="-1";}d.setValueWithMultiSelectOptionInList(m,Q["compOptsJson"],U,ao,"");if(Y!=null&&(Y!="pieChart"&&Y!="activityChart")){var z=a.findField("componentSearchTextBox");if(!Ext.isEmpty(z)){z.componentStore=null;z.setValue("");}}if(Y!=null&&(Y!="ddTable"&&Y!="vmAlarmsWidget")){var E="descriptorCombo";var W=a.findField(E);
var ak=W.getStore();ak.removeAll();ak.insert(0,{displayField:notApplicable,valueField:"-1"});W.setValue("-1");if(Y!=null&&(Y!="pieChart"&&Y!="activityChart"&&Y!="dialChart"&&Y=="digitalChart"&&Y=="liveMeasuresBox")){var i=a.findField("descriptorSearchTextBox");i.descriptorStore=null;i.setValue("");}}if(Y!=null&&Y=="ScatterPlot"){var ai=a.findField("testCombo");
var l=ai.getStore();l.removeAll();l.insert(0,{displayField:notApplicable,valueField:"-1"});ai.setValue("-1");var ae=a.findField("measureCombo");var ac=ae.getStore();ac.removeAll();ac.insert(0,{displayField:notApplicable,valueField:"-1"});ae.setValue("-1");}}else{if(h!=null&&h=="loadDescriptors"){var Y="";
var L=b.widgetID;if(L!=null&&L.indexOf("_")>0){Y=L.substr(0,L.indexOf("_"));}var W=a.findField("descriptorCombo");var D=Q["descriptorsList"];if(D!=null&&D[0]["valueField"]!="-1"){var al=false;if(Y!=null&&(Y=="table"||Y=="BarChart"||Y=="heatMapChart"||Y=="pieChart"||Y=="activityChart")){var w=false;var F="";
if(Y!=null&&(Y=="BarChart"||Y=="table")){}if(w){a.findField("showAggOpt").hide();a.findField("aggOptions").show();a.findField("descriptorCombo").hide();Ext.getCmp("descExpandSelector").hide();Ext.getCmp("descriptorComboLbl").hide();Ext.getCmp("descriptorSearchTextBox").hide();Ext.getCmp("descriptormainCont").hide();
}else{a.findField("descriptorCombo").show();}}if(Y!=null&&Y=="heatMapChart"){d.setValueWithMultiSelectOptionInList(W,D,"","","");}else{if(al){var af=b.configPopupJson;if(!Ext.isEmpty(af)&&af.hasOwnProperty("configuredDetails")){var M=af["configuredDetails"];var u=M["selectedDescriptors"];if(u!=null&&(u=="allDescriptors"||u=="")){d.setValueWithMultiSelectOptionInList(W,D,"allDescriptors",allDescriptors,"");
}else{if(u!=null&&u=="AllInfos"){u="allDescriptors";}d.setValueWithMultiSelectOptionInList(W,D,u,allDescriptors,"allDescriptors");}}else{d.setValueWithMultiSelectOptionInList(W,D,"allDescriptors",allDescriptors,"");}}else{d.setValueWithMultiSelectOptionInList(W,D,"allDescriptors",allDescriptors,"");}}}else{if(!Ext.isEmpty(D)){W.setValue(D[0].valueField);
d.setValueWithMultiSelectOptionInList(W,D,D[0].valueField,"","");if(Y=="BarChart"){var B=a.findField("Stacked").getValue();var ad="no";var w=false;if(B!=null&&B==true){ad="yes";w=true;}if(w){a.findField("showAggOpt").hide();a.findField("aggOptions").show();a.findField("descriptorCombo").hide();Ext.getCmp("descriptorExpandSelector").hide();
Ext.getCmp("descriptorComboLbl").hide();Ext.getCmp("descriptorSearchTextBox").hide();Ext.getCmp("descriptorMultiSelectOuterBox").hide();}else{a.findField("descriptorCombo").show();Ext.getCmp("descriptorExpandSelector").show();Ext.getCmp("descriptorComboLbl").show();Ext.getCmp("descriptorSearchTextBox").show();
Ext.getCmp("descriptorMultiSelectOuterBox").show();}}}}var i=a.findField("descriptorSearchTextBox");i.descriptorStore=null;i.setValue("");}else{if(h!=null&&h=="loadVmDescriptors"){if(f!=null&&f=="healthCenterPopup"){var W=a.findField("vmListCombo");var D=Q["descriptorsList"];if(D!=null&&D[0]["valueField"]!="-1"&&c!=null){d.setValueWithMultiSelectOptionInList(W,D,"allVms",allVms,"");
W.setValue(c);}else{if(!Ext.isEmpty(D)){W.setValue(D[0].valueField);d.setValueWithMultiSelectOptionInList(W,D,D[0].valueField,"","");}}}else{var W=a.findField("vmListCombo");var D=Q["descriptorsList"];if(D!=null&&D[0]["valueField"]!="-1"){d.setValueWithMultiSelectOptionInList(W,D,"allVms",allVms,"");
}else{if(!Ext.isEmpty(D)){W.setValue(D[0].valueField);d.setValueWithMultiSelectOptionInList(W,D,D[0].valueField,"","");}}}}else{if(h!=null&&h=="loadComponentTypesForPie"){var O=a.findField("dialCompTypeCombo");d.setValueWithOptionInList(O,Q["compTypeOpts"],"-1","");}else{if(h!=null&&h=="loadComponentsForDial"){var m=a.findField("dialComponentCombo");
if(c!=null&&c==""){c="-1";}d.setValueWithOptionInList(m,Q["compOptsJson"],c,componentAlertMsg);var Y="";var L=b.widgetID;if(L!=null&&L.indexOf("_")>0){Y=L.substr(0,L.indexOf("_"));}if(Y!=null&&Y=="liveMeasuresBox"){var aj=a.findField("measureMultiCombo");var ah=aj.getStore();ah.removeAll();ah.insert(0,{displayField:notApplicable,valueField:"-1"});
aj.setValue("-1");}else{if(Y!=null&&(Y!="pieChart"&&Y!="activityChart")){var ai=a.findField("testCombo");var l=ai.getStore();l.removeAll();l.insert(0,{displayField:notApplicable,valueField:"-1"});ai.setValue("-1");var H=a.findField("measureSingleCombo");var aa=H.getStore();aa.removeAll();aa.insert(0,{displayField:notApplicable,valueField:"-1"});
H.setValue("-1");}}var n=a.findField("dialDescriptorCombo");var t=n.getStore();t.removeAll();t.insert(0,{displayField:notApplicable,valueField:"-1"});n.setValue("-1");}else{if(h!=null&&h=="loadDDComponents"){var m=a.findField("ddcompCombo");if(c!=null&&c==""){c="-1";}d.setValueWithOptionInList(m,Q["compOptsJson"],c,componentAlertMsg);
var ai=a.findField("testCombo");var l=ai.getStore();l.removeAll();l.insert(0,{displayField:notApplicable,valueField:"-1"});ai.setValue("-1");var N=a.findField("ddMeasuresCombo");var G=N.getStore();G.removeAll();G.insert(0,{displayField:notApplicable,valueField:"-1"});N.setValue("-1");var P=a.findField("ddMeasureCols");
var J=P.getStore();J.removeAll();J.insert(0,{displayField:notApplicable,valueField:"-1"});P.setValue("-1");}else{if(h!=null&&h=="loadHealthCenterComponents"){var ab=a.findField("healthCenterCompTypeCombo");if(c!=null&&c==""){c="-1";}if(ab.selectedOption!=null&&ab.selectedOption=="Servers"){var m=a.findField("healthCenterComponentCombo");
d.setValueWithMultiSelectOptionInList(m,Q["compOptsJson"],c,"","");if(c!=null&&c=="-1"){m.getStore().insert(0,{displayField:"All servers",valueField:"allServers"});m.setValue("allServers");}}else{if(ab.selectedOption!=null&&ab.selectedOption=="Descriptors"){var m=a.findField("healthCenterCompScrollCombo");
m.show();d.setValueWithOptionInList(m,Q["compOptsJson"],c,componentAlertMsg);}else{if(ab.selectedOption!=null&&ab.selectedOption=="vms"){var m=a.findField("healthCenterComponentCombo");d.setValueWithMultiSelectOptionInList(m,Q["compOptsJson"],c,"","");}}}}else{if(h!=null&&h=="loadHealthCenterComponentsTests"){var ai=a.findField("healthCenterTestScrollCombo");
if(c!=null&&c==""){c="-1";}d.setValueWithOptionInList(ai,Q["runningTestsForServer"],c,testAlertMsg);}else{if(h!=null&&h=="loadVmComponents"){var m=a.findField("vmcompCombo");if(c!=null&&c==""){c="-1";}d.setValueWithOptionInList(m,Q["compOptsJson"],c,componentAlertMsg);}else{if(h!=null&&h=="loadTestsForDial"){var ai=a.findField("testCombo");
if(c!=null&&c==""){c="-1";}d.setValueWithOptionInList(ai,Q["runningTestsForServer"],c,testAlertMsg);var Y="";var L=b.widgetID;if(L!=null&&L.indexOf("_")>0){Y=L.substr(0,L.indexOf("_"));}if(Y!=null&&Y=="liveMeasuresBox"){var aj=a.findField("measureMultiCombo");var ah=aj.getStore();ah.removeAll();ah.insert(0,{displayField:notApplicable,valueField:"-1"});
aj.setValue("-1");}else{var H=a.findField("measureSingleCombo");var aa=H.getStore();aa.removeAll();aa.insert(0,{displayField:notApplicable,valueField:"-1"});H.setValue("-1");}var n=a.findField("dialDescriptorCombo");var t=n.getStore();t.removeAll();t.insert(0,{displayField:notApplicable,valueField:"-1"});
n.setValue("-1");}else{if(h!=null&&h=="loadDDTests"){var ai=a.findField("testCombo");if(c!=null&&c==""){c="-1";}d.setValueWithOptionInList(ai,Q["runningTestsForServer"],c,testAlertMsg);var N=a.findField("ddMeasuresCombo");var G=N.getStore();G.removeAll();G.insert(0,{displayField:notApplicable,valueField:"-1"});
N.setValue("-1");var P=a.findField("ddMeasureCols");var J=P.getStore();J.removeAll();J.insert(0,{displayField:notApplicable,valueField:"-1"});P.setValue("-1");}else{if(h!=null&&h=="loadMeasuresForDial"){if(c!=null&&c==""){c="-1";}var Y="";var L=b.widgetID;if(L!=null&&L.indexOf("_")>0){Y=L.substr(0,L.indexOf("_"));
}if(Y!=null&&Y=="liveMeasuresBox"){var aj=a.findField("measureMultiCombo");d.setValueWithMultiSelectOptionInList(aj,Q["measuresOpts"],c,"");var n=a.findField("dialDescriptorCombo");var p=Q["descpritorList"];if(p!=null&&!Ext.isEmpty(p)){if(p.length==1&&p[0].valueField=="-1"){var t=n.getStore();t.removeAll();
t.loadRawData(p);n.setValue("-1");}else{var V=n.getStore();V.removeAll();n.suspendEvents(false);V.loadRawData(p);V.insert(0,{displayField:descriptorAlertMsg,valueField:"chooseDescriptors"});n.setValue("chooseDescriptors");n.resumeEvents();}}else{var n=a.findField("dialDescriptorCombo");var t=n.getStore();
t.removeAll();t.insert(0,{displayField:notApplicable,valueField:"-1"});n.setValue("-1");}}else{var H=a.findField("measureSingleCombo");d.setValueWithOptionInList(H,Q["measureOpts"],c,measureAlertMsg);var n=a.findField("dialDescriptorCombo");var t=n.getStore();t.removeAll();t.insert(0,{displayField:notApplicable,valueField:"-1"});
n.setValue("-1");}}else{if(h!=null&&h=="loadDescriptorsForDial"){var n=a.findField("dialDescriptorCombo");var p=Q["descriptorsList"];if(p!=null&&!Ext.isEmpty(p)){if(p.length==1&&p[0].valueField=="-1"){var t=n.getStore();t.removeAll();t.loadRawData(p);n.setValue("-1");}else{var V=n.getStore();V.removeAll();
n.suspendEvents(false);V.loadRawData(p);V.insert(0,{displayField:descriptorAlertMsg,valueField:"chooseDescriptors"});n.setValue("chooseDescriptors");n.resumeEvents();}}else{var n=a.findField("dialDescriptorCombo");var t=n.getStore();t.removeAll();t.insert(0,{displayField:notApplicable,valueField:"-1"});
n.setValue("-1");}}else{if(h!=null&&h=="loadDescriptorsForHealthCenter"){var y=a.findField("healthCenterComponentCombo");if(c!=null&&c==""){c="-1";}var p=Q["descriptorsList"];if(p!=null&&!Ext.isEmpty(p)){if(p.length==1&&p[0].valueField=="-1"){var t=y.getStore();t.removeAll();t.loadRawData(p);y.setValue("-1");
}else{d.setValueWithMultiSelectOptionInList(y,p,"allDescriptors","All Descriptors","allDescriptors");}}else{var t=y.getStore();t.removeAll();t.insert(0,{displayField:notApplicable,valueField:"-1"});y.setValue("-1");}}else{if(h!=null&&h=="loadDDMeasures"){var N=a.findField("measureCombo");if(c!=null&&c==""){c="-1";
}d.setValueWithOptionInList(N,Q["ddMeasureOpts"],c,measureAlertMsg);var P=a.findField("ddColumnsCombo");var J=P.getStore();J.removeAll();J.insert(0,{displayField:notApplicable,valueField:"-1"});P.setValue("-1");}else{if(h!=null&&h=="loadDDColumns"){var P=a.findField("ddColumnsCombo");var J=P.getStore();
d.setValueWithMultiSelectOptionInList(P,Q["ddColumns"],c,"");var am=P.getValue();if(am!=null&&am=="-1"){J.insert(0,{displayField:notApplicable,valueField:"-1"});}if(c!=null&&c==""){c="-1";}var j=a.findField("summarizeDDColumnCombo");var A=j.getStore();d.setValueWithOptionInList(j,Q["ddColumns"],c,noDDColSelectedAlertMsg);
}else{if(h!=null&&h=="loadHealthDescriptors"){var Y="";var L=b.widgetID;if(L!=null&&L.indexOf("_")>0){Y=L.substr(0,L.indexOf("_"));}var W=a.findField("descriptorCombo");var D=Q["descriptorsList"];if(D!=null&&D[0]["valueField"]!="-1"){d.setValueWithMultiSelectOptionInList(W,D,"allDescriptors",allDescriptors);
}else{if(!Ext.isEmpty(D)){W.setValue(D[0].valueField);d.setValueWithMultiSelectOptionInList(W,D,D[0].valueField,"");}}}else{if(h!=null&&h=="loadHealthComponents"){var m=a.findField("componentCombo");if(c!=null&&c==""){c="-1";}d.setValueWithOptionInList(m,Q["compOptsJson"],c,componentAlertMsg);var ai=a.findField("testCombo");
var l=ai.getStore();l.removeAll();l.insert(0,{displayField:notApplicable,valueField:"-1"});ai.setValue("-1");var ae=a.findField("measureCombo");var ac=ae.getStore();ac.removeAll();ac.insert(0,{displayField:notApplicable,valueField:"-1"});ae.setValue("-1");var W=a.findField("descriptorCombo");var ak=W.getStore();
ak.removeAll();ak.insert(0,{displayField:notApplicable,valueField:"-1"});W.setValue("-1");}else{if(h!=null&&h=="loadHealthTests"){var ai=a.findField("testCombo");if(c!=null&&c==""){c="-1";}d.setValueWithOptionInList(ai,Q["runningTestsForServer"],c,testAlertMsg);var ae=a.findField("measureCombo");var ac=ae.getStore();
ac.removeAll();ac.insert(0,{displayField:notApplicable,valueField:"-1"});ae.setValue("-1");var Y="";var L=b.widgetID;if(L!=null&&L.indexOf("_")>0){Y=L.substr(0,L.indexOf("_"));}if(Y!=null&&Y=="ddTable"){var S=a.findField("ddColumnsCombo");var k=S.getStore();k.removeAll();k.insert(0,{displayField:notApplicable,valueField:"-1"});
var C=a.findField("summarizeDDColumnCombo");var R=C.getStore();R.removeAll();R.insert(0,{displayField:notApplicable,valueField:"-1"});C.setValue("-1");}else{var W=a.findField("descriptorCombo");var ak=W.getStore();ak.removeAll();ak.insert(0,{displayField:notApplicable,valueField:"-1"});W.setValue("-1");
}if(Y!=null&&Y=="ScatterPlot"){this.saveSelection("componentCombo");}}else{if(h!=null&&h=="loadHealthMeasures"){var Y="";var L=b.widgetID;if(L!=null&&L.indexOf("_")>0){Y=L.substr(0,L.indexOf("_"));}if(Y!=null&&Y=="health"){var ae=a.findField("measureCombo");if(c!=null&&c==""){c="-1";}d.setValueWithOptionInList(ae,Q["measuresOpts"],"","");
var W=a.findField("descriptorCombo");if(c!=null&&c==""){c="-1";}d.setValueWithOptionInList(W,Q["descpritorList"],"","");}else{var ae=a.findField("measureCombo");if(c!=null&&c==""){c="-1";}if(Y!=null&&Y=="liveMeasuresBox"){d.setValueWithOptionInList(ae,Q["measuresOpts"],"","");}else{d.setValueWithOptionInList(ae,Q["measuresOpts"],c,measureAlertMsg);
}var W=a.findField("descriptorCombo");if(c!=null&&c==""){c="-1";}if(!Ext.isEmpty(Q["descpritorList"])){if(Q["descpritorList"][0].valueField=="-1"){d.setValueWithOptionInList(W,Q["descpritorList"],c,"");}else{var V=W.getStore();V.removeAll();W.suspendEvents(false);V.loadRawData(Q["descpritorList"]);V.insert(0,{displayField:descriptorAlertMsg,valueField:"chooseDescriptors"});
W.setValue("chooseDescriptors");W.resumeEvents();}}}if(Y!=null&&Y=="ScatterPlot"){this.saveSelection("testCombo");}}}}}}}}}}}}}}}}}}}}}}}}}Q=null;delete Q;}s=null;delete s;},failure:function(){}});},setValueWithOptionInList:function(g,e,d,f){var c=g.getStore();if(!Ext.isEmpty(c)){c.removeAll();g.suspendEvents(false);
c.loadRawData(e);if(f!=null&&f!=""){c.insert(0,{displayField:f,valueField:"-1"});g.setValue(d);}else{var a=false;for(var b=0;b<e.length;b++){if(e[b].valueField==d&&d!=""&&d!=null){g.setValue(d);a=true;}}if(!a){g.setValue(e[0].valueField);}}g.resumeEvents();}},setValueWithMultiSelectOptionInList:function(f,d,c,e,a){var b=f.getStore();
b.removeAll();f.suspendLayout=true;f.suspendEvents(false);b.loadRawData(d);if(e!=null&&e!=""){if((c!=null&&c=="allDescriptors")||(a!=null&&a=="allDescriptors")){b.insert(0,{displayField:e,valueField:"allDescriptors"});}else{if(c!=null&&c=="allServers"){b.insert(0,{displayField:e,valueField:"allServers"});
}else{if((c!=null&&c=="allVms")||(a!=null&&a=="allVms")){b.insert(0,{displayField:e,valueField:"allVms"});}else{b.insert(0,{displayField:e,valueField:"-1"});}}}}f.setValue(c);f.resumeEvents();f.suspendLayout=false;},addHealthBlockConfig:function(){var I=this.getWidgetOptionsWindow();var h=I.getComponent("configForm").getForm();
var d=h.findField("componentTypeCombo");var b=h.findField("componentCombo");var G=h.findField("testCombo");var J=h.findField("measureCombo");var y=h.findField("descriptorCombo");var s=I.widgetID;var A="";if(s!=null&&s.indexOf("_")>0){A=s.substr(0,s.indexOf("_"));}var n=d.getValue();var w=d.getRawValue();
var r=b.getValue();var i=b.getRawValue();var j=G.getValue();var q=G.getRawValue();var a=J.getValue();var H=y.getValue();var o=y.getRawValue();var c=false;if(H!=null&&H=="allDescriptors"){c=true;}if(n!=null&&n=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:compTypAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}else{if(r!=null&&(r==""||r=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:componentAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}else{if(j!=null&&j=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:testAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;
}else{if(a!=null&&(a==""||a=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:measureAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}else{if(H!=null&&H==""){Ext.Msg.show({title:myDashboardAlertLbl,msg:descriptorAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}}}}}var B=J.getStore();
var e=this.getComparisontable();var p=e.getStore();var t=new Array();for(var f in a){var k=a[f];var z=B.findRecord(J.valueField,k,0,false,true,true);var m=B.indexOf(z);var E=B.getAt(m).get("displayField");var l=H;if(c){var g=r+":"+j+":"+k+":"+"AllInfos";var v=E+"$"+j+":"+k;var C=r+"$"+i+"|"+v+"$AllInfos";
var D=p.find("hidVal",g,0,false,true,true);if(D==-1){t.push({component:i,test:q,measure:E,descriptor:allDescriptors,measuresHidVal:v,descriptorHidVal:C,componentsHidVal:r,hidVal:g});}else{Ext.Msg.show({title:myDashboardAlertLbl,msg:"Your current selection has already been added",buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}}else{if(o!=null&&(o=="+"||o=="Not Applicable")){o="-";}if(l=="-1"||l==""){l="+";}var x="+";if(l!=null&&l!="+"&&l.indexOf("+")==0&&l.length>1){x=l.substring(1);}var g=r+":"+j+":"+k+":"+x;var F=i;if(l!=null&&(l!=""&&l!="+")){l=l.substr(1);F=F+"-"+o;}var v=E+"$"+j+":"+k;var C=r+"$"+F+"|"+v+"$"+l;
var D=p.find("hidVal",g,0,false,true,true);if(D==-1){t.push({component:i,test:q,measure:E,descriptor:o,measuresHidVal:v,descriptorHidVal:C,componentsHidVal:r,hidVal:g});}else{Ext.Msg.show({title:myDashboardAlertLbl,msg:"Your current selection has already been added",buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}}}p.add(t);e.doLayout();var u=Ext.getCmp("controllerSetting");if(!Ext.isEmpty(u)){u.setDisabled(false);}this.flashMsgBox(metricsConfiguredAlert);},updateHealthBlockConfig:function(){return updateHealthBlockConfig(false,"");},updateHealthBlockConfig:function(h,c){var g=this;var f=this.getWidgetOptionsWindow();
var m=f.getComponent("configForm").getForm();var v=f.widgetID;var n=v.substr(0,v.indexOf("_"));var q="";var l=this.getComparisontable();var u=l.getStore();var C="";var t="";var x="";var k="";var D="";var p=l.getStore().getCount();if(p==0){Ext.Msg.show({title:myDashboardAlertLbl,msg:measureAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}var r=Ext.getCmp("dashboardLayoutObj").profileName;var w=r;if(!Ext.isEmpty(w)){w=g.filterEncode(w);}var s=[];var a=[];for(var y=0;y<p;y++){var e=l.getStore().getAt(y).get("measuresHidVal");var B=l.getStore().getAt(y).get("componentsHidVal");var j=l.getStore().getAt(y).get("descriptorHidVal");
var b=l.getStore().getAt(y).get("componentDisplayName");var A=l.getStore().getAt(y).get("descriptorDisplayName");if(C.indexOf(e)==-1){C=C+","+e;}if(t.indexOf(B)==-1){t=t+","+B;}x=x+","+j;if(!Ext.isEmpty(b)){if(a!=null&&!Ext.Array.contains(a,b)){k=k+","+b;a.push(b);}}if(!Ext.isEmpty(A)){if(s!=null&&!Ext.Array.contains(s,A)){D=D+","+A;
s.push(A);}}}if(C!=null&&C.indexOf(",")==0){C=C.substring(1);}if(t!=null&&t.indexOf(",")==0){t=t.substring(1);}if(x!=null&&x.indexOf(",")==0){x=x.substring(1);}if(k!=null&&k.indexOf(",")==0){k=k.substring(1);}if(D!=null&&D.indexOf(",")==0){D=D.substring(1);}x=filterEncode(x);q="action=saveConfig&profileName="+encodeURIComponent(w)+"&blockId="+v+"&configuredMeasures="+encodeURIComponent(C)+"&configuredComponents="+encodeURIComponent(t)+"&configuredDescriptors="+encodeURIComponent(x);
if(!Ext.isEmpty(k)){q=q+"&ComponentDisplayNames="+encodeURIComponent(k);}if(!Ext.isEmpty(D)){q=q+"&descriptorDisplayNames="+encodeURIComponent(D);}var d=this.getGridstackpanel();var z=d._serializationStr();if(z!=null&&z!=""){q=q+"&layoutConfig="+encodeURIComponent(z);}d=null;delete d;var o=null;if(h){o=previewContObj;
q=q+"&widgetPreviewMode=yes";o.setLoading(true,true);o.showLoadingMsg=true;}else{o=Ext.getCmp(v);f.close();}Ext.Ajax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:q+"&screenWidth="+(o.getWidth()-2)+"&screenHeight="+(o.getHeight()-20),scope:this,success:function(i){var F=i.responseText;
if(F!=null&&F!=""){g.getPortlet().setRefresh(o);var E=Ext.decode(F);o.isConfigured=true;myDashApp.getController("Main").showLiveDataForBlock(E,o,v);E=null;delete E;}F=null;delete F;},failure:function(i,E){if(i.timedout){if(n!=null&&n=="TimelineChart"||n=="areaChart"||n=="TrendGraph"){o.update('<table width="100%" height="'+(o.getHeight()-20)+'"><tr><td align="center" valign="middle"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></div></td></tr></table>");
}else{o.removeAll();o.add({xtype:"panel",html:'<div><table border="0" cellspacing="0" cellpadding="0" width="98%" height="'+(o.getHeight()-20)+'"><tr><td  align="center" valign="middle" class="msgFont"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></td></tr></table></div>"});
}o.setLoading(false);o.showLoadingMsg=false;o.doLayout();}}});},showWidgetOptionsWindow:function(a,h,c,i,g,e,k,j,f){var o=this.getWidgetOptionsWindow();if(Ext.isEmpty(o)){var n=h;var p=n;if(!Ext.isEmpty(n)&&n.lastIndexOf("_")>0){p=n.substring(0,n.lastIndexOf("_"));}var b=false;var m=Ext.getCmp(n);if(!Ext.isEmpty(m)){b=m.isExternalDataSourceWidget;
}var l=false;if(publicJson!=null&&publicJson["myDashboardConfigDetails"].hasOwnProperty("autoAssociateComponents")){var d=publicJson["myDashboardConfigDetails"]["autoAssociateComponents"];if(d!=null&&d.toLowerCase()=="yes"){l=true;}}if(i){b=f;}o=Ext.widget("widgetOptionsWindow",{widgetID:h,widgetType:p,action:c,isExternalDataSourceWidget:b,isKpi:i,Kpicount:g,KpiDataArray:e,kpiBlckId:k,totalKpiCount:j,autoAssociateComponents:l});
o.show();o.loadSampleSnippet();}o=null;delete o;},flashMsgBox:function(a){Ext.create("Ext.window.Window",{floating:true,plain:true,ui:"flash-msg",resizable:false,frame:false,header:false,border:false,closeAction:"destroy",bodyPadding:10,html:'<div style="margin-top:10px;">'+a+"</div>",height:53,listeners:{show:function(b){b.getEl().setOpacity(0);
b.getEl().fadeIn({duration:1000,callback:function(){Ext.defer(function(){b.hide();},5000);}});b.hide();},hide:function(b){b.getEl().fadeOut({duration:1000,callback:function(){b.close();}});}}}).show();},addBlockConfig:function(){var f=this;var g=this.getWidgetOptionsWindow();var a=g.getComponent("configForm").getForm();
var h=g.widgetID;var b="";if(h!=null&&h.indexOf("_")>0){b=h.substr(0,h.indexOf("_"));}var e=false;if(b!=null&&b=="heatMapChart"){var c=this.getComparisontable();var d=c.getStore();var i=d.getCount();if(i!=null&&i>=5){Ext.Msg.show({title:"My Dashboard",msg:"Adding more metrics with a heat map will make the map cluttered. Do you want to add more?",buttons:Ext.Msg.YESNO,icon:"iconConfirmation",fn:function(j){if(j=="yes"){f.addConfig(b,e);
}else{return;}}});}else{f.addConfig(b,e);}}else{if(b!=null){f.addConfig(b,e);}}},addConfig:function(){var h=this;var g=this.getWidgetOptionsWindow();var F=g.getComponent("configForm").getForm();var C=F.findField("measureCombo");var f=F.findField("componentCombo");var m="descriptorCombo";var w=F.findField(m);
var B=F.findField("testCombo");var s=F.findField("componentTypeCombo");var G=B.getValue();var c=B.getRawValue();var b=s.getValue();var q=s.getRawValue();var z=C.getValue();var u=f.getValue();var H=w.getValue();var t=g.widgetID;var n="";if(t!=null&&t.indexOf("_")>0){n=t.substr(0,t.indexOf("_"));}var E=false;
var l=false;var v=false;var o="";var p="";var D="";var d=false;var y=false;if(n=="BarChart"||n=="table"||n=="TimelineChart"||n=="areaChart"||n=="TrendGraph"||n=="CombinedTimelineChart"||n=="combinationChart"||n=="TopNAnalysis"){y=true;d=g.autoAssociateComponents;}if(d){if(!Ext.isEmpty(f)){f.AutoAssociateServersEnabled=true;
u="allServers";H="allDescriptors";}}if(n!=null&&(n=="table"||n=="BarChart"||n=="heatMapChart"||n=="pieChart"||n=="activityChart")){l=true;var x=true;var j=false;if(n=="BarChart"){var A=F.findField("Stacked").getValue();var A="no";if(A!=null&&A=="yes"){D="Yes";o=F.findField("aggOptions").getRawValue();
p=F.findField("aggOptions").getValue();v=true;x=false;j=true;}}if(x){var a=F.findField("showAggOpt");if(!a.isHidden()){var D=a.getValue();if(D==true){D="Yes";o=F.findField("aggOptions").getRawValue();p=F.findField("aggOptions").getValue();v=true;}else{D="No";o="-";p="";}}else{D="No";o="-";p="";}}}var i=false;
if(H!=null&&H=="allDescriptors"){i=true;}if(G!=null&&G=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:testAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}else{if(z!=null&&(z==""||z=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:measureAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}else{if(b!=null&&b=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:compTypAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}else{if(!d&&(u!=null&&(u==""||u=="-1"))){Ext.Msg.show({title:myDashboardAlertLbl,msg:componentAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}else{if(!j&&(H!=null&&H=="")&&(D!=null&&D!="Yes")){Ext.Msg.show({title:myDashboardAlertLbl,msg:descriptorAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}}}}}var k=this.getComparisontable();var r=k.getStore();if(n!=null&&n=="heatMapChart"){var e=z.length;if(r.getCount()==0&&e>=6){Ext.Msg.show({title:"My Dashboard",msg:"Adding more metrics with a heat map will make the map cluttered.Do you want to add more?",buttons:Ext.Msg.YESNO,icon:"iconConfirmation",fn:function(I){if(I=="yes"){h.addRecordsToGrid(E,l,v,o,p,D,n);
}else{return;}}});}else{h.addRecordsToGrid(E,l,v,o,p,D,n);}}else{h.addRecordsToGrid(E,l,v,o,p,D,n);}},addRecordsToGrid:function(R,d,Y,e,w,Q,J){var W=this.getWidgetOptionsWindow();var m=W.getComponent("configForm").getForm();var X=m.findField("measureCombo");var c=m.findField("componentCombo");var p="descriptorCombo";
if(!R){var H=m.findField(p);var T=m.findField("testCombo");var g=m.findField("componentTypeCombo");var q=T.getValue();var x=T.getRawValue();var t=g.getValue();var C=g.getRawValue();var a=X.getValue();var y=c.getValue();var D=H.getValue();var f=false;if(D!=null&&D=="allDescriptors"){f=true;}var U=H.getStore();
var K=X.getStore();var j=c.getStore();var h=this.getComparisontable();var v=h.getStore();var z=[];if(c!=null&&(c.hasOwnProperty("AutoAssociateServersEnabled")&&c.AutoAssociateServersEnabled==true)){y=[];y.push(t+":allServers");if(!Y){D="allDescriptors";f=true;}}if(J!=null&&(J!="pieChart"&&J!="activityChart")){for(var b in y){var k="";
k=y[b];var P=j.findRecord(c.valueField,k,0,false,true,true);var o=j.indexOf(P);var G="";if(k!=null&&k.indexOf(":allServers")>-1){G=C+" All Servers";}else{G=j.getAt(o).get("editedFieldName");}for(var i in a){var r=a[i];var I=K.findRecord(X.valueField,r,0,false,true,true);var s=K.indexOf(I);var O=K.getAt(s).get("editedFieldName");
if(d){if(Y){var l=k+":"+q+":"+r+"|HASH|"+w+":-";var B=O+" ("+e+")$"+q+":"+r+"|HASH|"+w;var L=k+"$"+G+"|"+B+"$-";O=O;var N=v.find("hidVal",l,0,false,true,true);if(N==-1){z.push({component:G,test:x,measure:O,descriptor:"-",measuresHidVal:B,descriptorHidVal:L,componentsHidVal:k,isAggregationEnabled:Q,aggFunction:e,hidVal:l,chartType:"line"});
}else{Ext.Msg.show({title:myDashboardAlertLbl,msg:"Your current selection has already been added",buttons:Ext.MessageBox.OK,icon:"iconInformation"});return;}}else{if(f){var l=k+":"+q+":"+r+":"+"AllInfos";var B=O+"$"+q+":"+r;var L=k+"$"+G+"|"+B+"$AllInfos";var N=v.find("hidVal",l,0,false,true,true);if(N==-1){z.push({component:G,test:x,measure:O,descriptor:allDescriptors,measuresHidVal:B,descriptorHidVal:L,componentsHidVal:k,isAggregationEnabled:Q,aggFunction:e,hidVal:l,chartType:"line"});
}else{Ext.Msg.show({title:myDashboardAlertLbl,msg:"Your current selection has already been added",buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}}else{for(var M in D){var V=D[M];var n=U.findRecord(H.valueField,V,0,false,true,true);var F=U.indexOf(n);var u=U.getAt(F).get("editedFieldName");
if(u!=null&&(u=="+"||u=="Not Applicable"||u=="")){u="-";}if(V=="-1"||V==""){V="+";}var E="+";if(V!=null&&V!="+"&&V.indexOf("+")==0&&V.length>1){E=V.substring(1);}var l=k+":"+q+":"+r+":"+E;var S=G;if(V!=null&&(V!=""&&V!="+")){V=V.substr(1);S=S+"!HYPEN!"+u;}var B=O+"$"+q+":"+r;var L=k+"$"+S+"|"+B+"$"+V;
var N=v.find("hidVal",l,0,false,true,true);if(N==-1){z.push({component:G,test:x,measure:O,descriptor:u,measuresHidVal:B,descriptorHidVal:L,componentsHidVal:k,isAggregationEnabled:Q,aggFunction:e,hidVal:l,chartType:"line"});}else{Ext.Msg.show({title:myDashboardAlertLbl,msg:"Your current selection has already been added",buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}}}}}else{if(f){var l=k+":"+q+":"+r+":"+"AllInfos";var B=O+"$"+q+":"+r;var L=k+"$"+G+"|"+B+"$AllInfos";var N=v.find("hidVal",l,0,false,true,true);if(N==-1){z.push({component:G,test:x,measure:O,descriptor:allDescriptors,measuresHidVal:B,descriptorHidVal:L,componentsHidVal:k,hidVal:l,chartType:"line"});
}else{Ext.Msg.show({title:myDashboardAlertLbl,msg:"Your current selection has already been added",buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}}else{for(var M in D){var V=D[M];var n=U.findRecord(H.valueField,V,0,false,true,true);var F=U.indexOf(n);var u=U.getAt(F).get("editedFieldName");
if(u!=null&&(u=="+"||u=="Not Applicable"||u=="")){u="-";}if(V=="-1"||V==""){V="+";}var E="+";if(V!=null&&V!="+"&&V.indexOf("+")==0&&V.length>1){E=V.substring(1);}var l=k+":"+q+":"+r+":"+E;var S=G;if(V!=null&&(V!=""&&V!="+")){V=V.substr(1);S=S+"!HYPEN!"+u;}var B=O+"$"+q+":"+r;var L=k+"$"+S+"|"+B+"$"+V;
var N=v.find("hidVal",l,0,false,true,true);if(N==-1){z.push({component:G,test:x,measure:O,descriptor:u,measuresHidVal:B,descriptorHidVal:L,componentsHidVal:k,hidVal:l,chartType:"line"});}else{Ext.Msg.show({title:myDashboardAlertLbl,msg:"Your current selection has already been added",buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}}}}}}}else{k=y;var P=j.findRecord(c.valueField,k,0,false,true,true);var o=j.indexOf(P);var G=j.getAt(o).get("displayField");for(var i in a){var r=a[i];var I=K.findRecord(X.valueField,r,0,false,true,true);var s=K.indexOf(I);var O=K.getAt(s).get("editedFieldName");if(d){if(Y){var l=k+":"+q+":"+r+"|HASH|"+w+":-";
var B=O+" ("+e+")$"+q+":"+r+"|HASH|"+w;var L=k+"$"+G+"|"+B+"$-";O=O;var N=v.find("hidVal",l,0,false,true,true);if(N==-1){z.push({component:G,test:x,measure:O,descriptor:"-",measuresHidVal:B,descriptorHidVal:L,componentsHidVal:k,isAggregationEnabled:Q,aggFunction:e,hidVal:l,chartType:"line"});}else{Ext.Msg.show({title:myDashboardAlertLbl,msg:"Your current selection has already been added",buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}}else{if(f){var l=k+":"+q+":"+r+":"+"AllInfos";var B=O+"$"+q+":"+r;var L=k+"$"+G+"|"+B+"$AllInfos";var N=v.find("hidVal",l,0,false,true,true);if(N==-1){z.push({component:G,test:x,measure:O,descriptor:allDescriptors,measuresHidVal:B,descriptorHidVal:L,componentsHidVal:k,isAggregationEnabled:Q,aggFunction:e,hidVal:l,chartType:"line"});
}else{Ext.Msg.show({title:myDashboardAlertLbl,msg:"Your current selection has already been added",buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}}else{for(var M in D){var V=D[M];var n=U.findRecord(H.valueField,V,0,false,true,true);var F=U.indexOf(n);var u=U.getAt(F).get("editedFieldName");
if(u!=null&&(u=="+"||u=="Not Applicable"||u=="")){u="-";}if(V=="-1"||V==""){V="+";}var E="+";if(V!=null&&V!="+"&&V.indexOf("+")==0&&V.length>1){E=V.substring(1);}var l=k+":"+q+":"+r+":"+E;var S=G;if(V!=null&&(V!=""&&V!="+")){V=V.substr(1);S=S+"!HYPEN!"+u;}var B=O+"$"+q+":"+r;var L=k+"$"+S+"|"+B+"$"+V;
var N=v.find("hidVal",l,0,false,true,true);if(N==-1){z.push({component:G,test:x,measure:O,descriptor:u,measuresHidVal:B,descriptorHidVal:L,componentsHidVal:k,isAggregationEnabled:Q,aggFunction:e,hidVal:l,chartType:"line"});}else{Ext.Msg.show({title:myDashboardAlertLbl,msg:"Your current selection has already been added",buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}}}}}else{if(f){var l=k+":"+q+":"+r+":"+"AllInfos";var B=O+"$"+q+":"+r;var L=k+"$"+G+"|"+B+"$AllInfos";var N=v.find("hidVal",l,0,false,true,true);if(N==-1){z.push({component:G,test:x,measure:O,descriptor:allDescriptors,measuresHidVal:B,descriptorHidVal:L,componentsHidVal:k,hidVal:l,chartType:"line"});
}else{Ext.Msg.show({title:myDashboardAlertLbl,msg:"Your current selection has already been added",buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}}else{for(var M in D){var V=D[M];var n=U.findRecord(H.valueField,V,0,false,true,true);var F=U.indexOf(n);var u=U.getAt(F).get("editedFieldName");
if(u!=null&&(u=="+"||u=="Not Applicable"||u=="")){u="-";}if(V=="-1"||V==""){V="+";}var E="+";if(V!=null&&V!="+"&&V.indexOf("+")==0&&V.length>1){E=V.substring(1);}var l=k+":"+q+":"+r+":"+E;var S=G;if(V!=null&&(V!=""&&V!="+")){V=V.substr(1);S=S+"!HYPEN!"+u;}var B=O+"$"+q+":"+r;var L=k+"$"+S+"|"+B+"$"+V;
var N=v.find("hidVal",l,0,false,true,true);if(N==-1){z.push({component:G,test:x,measure:O,descriptor:u,measuresHidVal:B,descriptorHidVal:L,componentsHidVal:k,hidVal:l,chartType:"line"});}else{Ext.Msg.show({title:myDashboardAlertLbl,msg:"Your current selection has already been added",buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}}}}}}v.add(z);h.doLayout();var A=Ext.getCmp("controllerSetting");if(!Ext.isEmpty(A)){A.setDisabled(false);}this.flashMsgBox(metricsConfiguredAlert);}},updateVMBlockConfig:function(){return updateVMBlockConfig(false,"");},updateVMBlockConfig:function(f,a){var d=this;var o=this.getWidgetOptionsWindow();
var n=o.widgetID;var h=n.substr(0,n.indexOf("_"));var m=Ext.getCmp("dashboardLayoutObj").profileName;var q=m;if(!Ext.isEmpty(q)){q=d.filterEncode(q);}var g=this.getGridcomparisontable();var t="";var k=g.getStore().getCount();if(k==0){Ext.Msg.show({title:myDashboardAlertLbl,msg:addVMs,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}for(var r=0;r<k;r++){var b=g.getStore().getAt(r).get("hiddenVal");t=t+b+",";}var e=t.lastIndexOf(",");var p=t.substring(0,e);p=filterEncode(p);var l="action=saveVMConfig&profileName="+encodeURIComponent(q)+"&blockId="+n+"&configuredVMAlarmDetails="+encodeURIComponent(p);var c=this.getGridstackpanel();
var s=c._serializationStr();if(s!=null&&s!=""){l=l+"&layoutConfig="+encodeURIComponent(s);}c=null;delete c;var j=null;if(f){j=a;l=l+"&widgetPreviewMode=yes";j.setLoading(true,true);j.showLoadingMsg=true;}else{j=Ext.getCmp(n);o.close();}iAjax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:l+"&screenWidth="+(j.getWidth()-2)+"&screenHeight="+(j.getHeight()-20),scope:this,success:function(i){var v=i.responseText;
if(v!=null&&v!=""){var u=Ext.decode(v);j.isInitialResizeCompleted=false;j.isHighChartUpdate=false;j.isConfigured=true;myDashApp.getController("Main").showLiveDataForBlock(u,j,n);u=null;delete u;}v=null;delete v;},failure:function(i,u){if(i.timedout){j.removeAll();j.add({xtype:"panel",html:'<div><table border="0" cellspacing="0" cellpadding="0" width="98%" height="'+(j.getHeight()-20)+'"><tr><td  align="center" valign="middle" class="msgFont"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></td></tr></table></div>"});
j.setLoading(false);j.showLoadingMsg=false;j.doLayout();}}});},getWidgetConfigurationWindowObj:function(){return this.getWidgetOptionsWindow();},getGSPanel:function(){return this.getGridstackpanel();},saveSelection:function(e){var k=Ext.getCmp("scatterTab");var n=k.activeTab.itemId;var l=Ext.getCmp("componentTypeCombo");
var o=Ext.getCmp("componentCombo");var a=Ext.getCmp("testCombo");var f=Ext.getCmp("measureCombo");var d=Ext.getCmp("descriptorCombo");var g=l.getValue();var j=o.getValue();var m=a.getValue();var c=f.getValue();var i=d.getValue();if(n=="x_Axis"){var h=Ext.getCmp("x_Axis");var b=Ext.getCmp("y_Axis");k.xAxisConfigured=true;
if(e=="compType"){k.xAxisCompType=g;k.xAxisComp="";k.xAxisTest="";k.xAxisMeas="";k.xAxisDesc="";h.setIconCls("");h.setTitle("Configure X Axis");}else{if(e=="componentCombo"){k.xAxisComp=j;k.xAxisTest="";k.xAxisMeas="";k.xAxisDesc="";h.setIconCls("");h.setTitle("Configure X Axis");}else{if(e=="testCombo"){k.xAxisTest=m;
k.xAxisMeas="";k.xAxisDesc="";h.setIconCls("");h.setTitle("Configure X Axis");}else{if(e=="measureCombo"){k.xAxisMeas=c;k.xAxisDesc=i;if(i!="chooseDescriptors"&&i!=""&&i!=""&&i!=null){h.setIconCls("checkBoxTick");h.setTitle("X Axis Configured");}}else{if(e=="descCombo"){k.xAxisDesc=i;if(i!="chooseDescriptors"&&i!=""&&i!="-1"&&i!=null){h.setIconCls("checkBoxTick");
h.setTitle("X Axis Configured");}}}}}}}else{if(n=="y_Axis"){var h=Ext.getCmp("x_Axis");var b=Ext.getCmp("y_Axis");k.yAxisConfigured=true;if(e=="compType"){k.yAxisCompType=g;k.yAxisComp="";k.yAxisTest="";k.yAxisMeas="";k.yAxisDesc="";b.setIconCls("");b.setTitle("Configure Y Axis");}else{if(e=="componentCombo"){k.yAxisComp=j;
k.yAxisTest="";k.yAxisMeas="";k.yAxisDesc="";b.setIconCls("");b.setTitle("Configure Y Axis");}else{if(e=="testCombo"){k.yAxisTest=m;k.yAxisMeas="";k.yAxisDesc="";b.setIconCls("");b.setTitle("Configure Y Axis");}else{if(e=="measureCombo"){k.yAxisMeas=c;k.yAxisDesc=i;if(i!="chooseDescriptors"&&i!=""&&i!=""&&i!=null){b.setIconCls("checkBoxTick");
b.setTitle("Y Axis Configured");}}else{if(e=="descCombo"){k.yAxisDesc=i;if(i!="chooseDescriptors"&&i!=""&&i!="-1"&&i!=null){b.setIconCls("checkBoxTick");b.setTitle("Y Axis Configured");}}}}}}}}},mapWindowModifyClick:function(i){var e=false;var k=[];if(publicJson!=null&&publicJson["myDashboardConfigDetails"].hasOwnProperty("IsOneClickDashboard")){k=publicJson["myDashboardConfigDetails"]["oneClickWidgets"];
}var a=Ext.getCmp(i);var f=a.id;var j=a.title;var b=a.selectedCategory;var d=f;if(f!=null&&f.indexOf("_")>0){d=f.substr(0,f.indexOf("_"));}if(Ext.isEmpty(j)){j="GeoMap";}var c=j+" - "+mapConfigurationMsg;var g=publicJson["action"];var h=Ext.widget("mapwidgetconfiguration",{blockId:f,blckType:d,isFluidWindowConfigPopup:true,id:f+"_mapconfigwindow",selectedCategory:b});
if(h!=null){h.setTitle(c);h.show();}},updateKpiWidget:function(){var m=this;var o=Ext.getCmp("kpiConfigurationWindow");var i="";var b="";var h="";var l="";var j=0;var f=false;if(!Ext.isEmpty(o)){i=o.blockId;l=o.chartCount;j=o.configuredChartsCount;}var n=Ext.getCmp("dashboardLayoutObj");if(!Ext.isEmpty(n)){b=n.profileName;
}var g=Ext.getCmp("kpiNumberSelection");if(!Ext.isEmpty(g)){h=g.getValue();}if(h<l){f=true;}var k=5;if(!Ext.isEmpty(j)&&j<3){var a=o.add(new Ext.window.MessageBox({cls:"x-message-box adminAlert",bodyPadding:"10 0",listeners:{show:function(q){if(this.modal){var r=Ext.dom.Query.select(".x-mask");var p=Ext.fly(r[r.length-1]);
p.addCls("background_modal");}},hide:function(q){if(this.modal){var r=Ext.dom.Query.select(".x-mask");var p=Ext.fly(r[r.length-1]);p.removeCls("background_modal");}}}}));var d=Ext.getCmp("kpiDoneButton");d.setDisabled(true);a.show({title:myDashboardAlertLbl,msg:"Configure least 3 widgets",buttons:Ext.MessageBox.OK,icon:"iconExclamation",fn:function(p){d.setDisabled(false);
}});return;}var e=b;if(!Ext.isEmpty(e)){e=m.filterEncode(e);}var c="&action=saveKpiWidget&profileName="+encodeURIComponent(e)+"&blockId="+i+"&KpiWidgetCount="+h+"&isNeedToDeleteWidget="+f+"&maxWidgetCount="+k;iAjax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:c,scope:this,success:function(p){var r=p.responseText;
if(r!=null&&r!=""){var q=Ext.decode(r);if(!Ext.isEmpty(o)){o.close();}var s=Ext.getCmp(i);myDashApp.getController("Main").showLiveDataForBlock(q,s,i);}}});},changeCategoryOptionCombo:function(w){var h=this;var c=Ext.getCmp("dashboardLayoutObj");var n=c.profileName;var t=n;if(!Ext.isEmpty(t)){t=h.filterEncode(t);
}var u=w.getValue();var v=Ext.getCmp("addHealthCenter");var y=Ext.getCmp("healthCenterCompTypeCombo");var d=Ext.getCmp("gridContainer");var i=Ext.getCmp("healthCenterCompContiner");var l=Ext.getCmp("healthCenterComponentCombo");var j=Ext.getCmp("healthCenterComponentSearchTextBox");var b=Ext.getCmp("healthCenterComponentComboLbl");
if(u=="Components"){var r=Ext.getCmp("enableLegendOpt");r.show();var q=Ext.getCmp("compVmBOX");q.hide();var a=Ext.getCmp("healthCenterVMComboLbl");a.hide();d.hide();var x=Ext.getCmp("legandCheckBox");x.hide();Ext.getCmp("configTableGrid").hide();v.hide();this.loadHealthCenterCompType(u);if(!Ext.isEmpty(y)){y.show();
}var s=Ext.getCmp("healthCenterCompScrollCombo");s.hide();var m=Ext.getCmp("healthCenterTestScrollCombo");m.hide();if(!Ext.isEmpty(i)&&!Ext.isEmpty(l)&&!Ext.isEmpty(j)){i.hide();l.hide();j.hide();}}else{if(u=="vms|desktop|users"){var r=Ext.getCmp("enableLegendOpt");r.hide();var x=Ext.getCmp("legandCheckBox");
x.hide();Ext.getCmp("configTableGrid").hide();v.hide();this.loadHealthCenterCompType(u);if(!Ext.isEmpty(y)){y.show();}var s=Ext.getCmp("healthCenterCompScrollCombo");s.hide();var m=Ext.getCmp("healthCenterTestScrollCombo");m.hide();if(!Ext.isEmpty(l)){l.suspendEvents(true);var f=l.getStore();f.removeAll();
f.insert(0,{displayField:notApplicable,valueField:"-1"});l.setValue("-1");l.resumeEvents();}if(!Ext.isEmpty(i)&&!Ext.isEmpty(l)&&!Ext.isEmpty(j)){i.show();l.show();j.show();b.setText("Components:");}}else{if(u=="Zone"||u=="Segment"||u=="Service"){var r=Ext.getCmp("enableLegendOpt");r.show();var q=Ext.getCmp("compVmBOX");
q.hide();var a=Ext.getCmp("healthCenterVMComboLbl");a.hide();d.hide();var x=Ext.getCmp("legandCheckBox");x.hide();Ext.getCmp("configTableGrid").hide();v.hide();var e="C=true&P0={"+u+"}&P1={"+encodeURIComponent(t)+"}&calljson=true&F=getCategoryOptionsForTypeJSON";var h=this;iAjax.request({url:"/final/servlet/com.eg.EgMonRemoteScriptingServlet",method:"POST",params:e,scope:this,async:true,success:function(A){var D=A.responseText;
if(D!=null&&D!=""){var C=Ext.decode(D);h.setValueWithMultiSelectOptionInList(l,C["optionsForType"],"","","");if(!Ext.isEmpty(i)&&!Ext.isEmpty(l)&&!Ext.isEmpty(j)){i.show();l.show();j.show();b.setText(u+"s");}var z=Ext.getCmp("healthCenterCompScrollCombo");z.hide();var B=Ext.getCmp("healthCenterTestScrollCombo");
B.hide();C=null;delete C;}D=null;delete D;}});if(!Ext.isEmpty(y)){y.hide();}}else{if(u=="Descriptors"){var r=Ext.getCmp("enableLegendOpt");r.hide();var q=Ext.getCmp("compVmBOX");q.hide();var a=Ext.getCmp("healthCenterVMComboLbl");a.hide();d.show();var x=Ext.getCmp("legandCheckBox");x.show();v.show();
this.loadHealthCenterCompType(u);if(!Ext.isEmpty(y)){y.show();}if(!Ext.isEmpty(i)&&!Ext.isEmpty(l)&&!Ext.isEmpty(j)){i.show();l.show();j.show();b.setText("Descriptors");}var s=Ext.getCmp("healthCenterCompScrollCombo");if(!Ext.isEmpty(y)){s.suspendEvents(true);var p=s.getStore();p.removeAll();p.insert(0,{displayField:notApplicable,valueField:"-1"});
s.setValue("-1");s.resumeEvents();s.show();}var m=Ext.getCmp("healthCenterTestScrollCombo");if(!Ext.isEmpty(m)){m.suspendEvents(true);var k=m.getStore();k.removeAll();k.insert(0,{displayField:notApplicable,valueField:"-1"});m.setValue("-1");m.resumeEvents();m.show();}var l=Ext.getCmp("healthCenterComponentCombo");
if(!Ext.isEmpty(l)){l.suspendEvents(true);var f=l.getStore();f.removeAll();f.insert(0,{displayField:notApplicable,valueField:"-1"});l.setValue("-1");l.resumeEvents();}var g=Ext.getCmp("configTableGrid");g.suspendEvents(true);var o=g.getStore();o.removeAll();g.show();g.resumeEvents();g.doComponentLayout();
}}}}},loadComponentItems:function(l,g,k){var a=l.getValue();var m=Ext.getCmp("dashboardLayoutObj");var c=m.profileName;var f=c;if(!Ext.isEmpty(f)){f=this.filterEncode(f);}var d=Ext.getCmp("healthCenterCompContiner");var b=Ext.getCmp("healthCenterComponentSearchTextBox");var e=Ext.getCmp("healthCenterComponentCombo");
var j=Ext.getCmp("healthCenterComponentComboLbl");if(a!=null&&(a=="Components"||a=="vms|desktop|users")){var i="C=true&F=getComponentsJSONForType&P0={"+g+"}&P1={"+encodeURIComponent(f)+"}&calljson=true";var h=this;iAjax.request({url:"/final/servlet/com.eg.EgMonRemoteScriptingServlet",method:"POST",params:i,scope:this,async:true,success:function(n){var q=n.responseText;
if(q!=null&&q!=""){var p=Ext.decode(q);if(!Ext.isEmpty(e)){e.suspendEvents(true);var o=e.getStore();o.loadRawData(p["compOptsJson"]);if(a!=null&&a!="vms|desktop|users"){o.insert(0,{displayField:"All servers",valueField:"allServers"});}e.setValue(k);e.resumeEvents();}if(!Ext.isEmpty(d)&&!Ext.isEmpty(e)&&!Ext.isEmpty(b)){d.show();
e.show();b.show();if(a=="vms|desktop|users"){j.setText("Components:");}else{j.setText(a+":");}}p=null;delete p;}else{h.setValueWithMultiSelectOptionInList(e,"","",notApplicable,"");if(!Ext.isEmpty(d)&&!Ext.isEmpty(e)&&!Ext.isEmpty(b)){d.show();e.show();b.show();j.setText(a+"s");}}q=null;delete q;}});
}},loadGroupedItems:function(j,i){var a=j.getValue();var k=Ext.getCmp("dashboardLayoutObj");var c=k.profileName;var d=Ext.getCmp("healthCenterCompContiner");var b=Ext.getCmp("healthCenterComponentSearchTextBox");var e=Ext.getCmp("healthCenterComponentCombo");var h=Ext.getCmp("healthCenterComponentComboLbl");
if(a=="Zone"||a=="Segment"||a=="Service"){var g="C=true&P0={"+a+"}&P1={"+encodeURIComponent(c)+"}&calljson=true&F=getCategoryOptionsForTypeJSON";var f=this;iAjax.request({url:"/final/servlet/com.eg.EgMonRemoteScriptingServlet",method:"POST",params:g,scope:this,async:true,success:function(l){var n=l.responseText;
if(n!=null&&n!=""){var m=Ext.decode(n);f.setValueWithMultiSelectOptionInList(e,m["optionsForType"],i,"","");if(!Ext.isEmpty(d)&&!Ext.isEmpty(e)&&!Ext.isEmpty(b)){d.show();e.show();b.show();h.setText(a+"s");}m=null;delete m;}else{f.setValueWithMultiSelectOptionInList(e,"","",notApplicable,"");if(!Ext.isEmpty(d)&&!Ext.isEmpty(e)&&!Ext.isEmpty(b)){d.show();
e.show();b.show();h.setText(a+"s");}}n=null;delete n;}});}},changeHealthCenterCompTypeVal:function(){var a=Ext.getCmp("healthCenterCompTypeCombo");this.onChangeHealthCenterCompType(a);},onChangeHealthCenterCompType:function(a){this.changeHealthCenterCompType(a,"");},changeHealthCenterCompType:function(s,o){var p=Ext.getCmp("categoryOpts");
var r=p.getValue();if(r=="Descriptors"){var q=Ext.getCmp("healthCenterCompScrollCombo");q.show();var n=s.getValue();if(n!=null){var a=Ext.getCmp("healthCenterCompTypeCombo");a.selectedOption="Descriptors";if(n!="-1"){var d=Ext.getCmp("dashboardLayoutObj");var m=d.profileName;var e="C=true&F=getComponentsJSONForType&P0={"+n+"}&P1={"+m+"}&calljson=true";
this.callRemoteScriptingMethod(e,"loadHealthCenterComponents","healthCenterPopup","",true);}else{var c=q.getStore();c.removeAll();c.insert(0,{displayField:notApplicable,valueField:"-1"});q.setValue("-1");}}var l=Ext.getCmp("healthCenterTestScrollCombo");if(!Ext.isEmpty(l)){l.suspendEvents(true);var i=l.getStore();
i.removeAll();i.insert(0,{displayField:notApplicable,valueField:"-1"});l.setValue("-1");l.resumeEvents();l.show();}var k=Ext.getCmp("healthCenterComponentCombo");if(!Ext.isEmpty(k)){k.suspendEvents(true);var f=k.getStore();f.removeAll();f.insert(0,{displayField:notApplicable,valueField:"-1"});k.setValue("-1");
k.resumeEvents();}}else{if(r=="Components"||r=="vms|desktop|users"){var g=Ext.getCmp("healthCenterCompContiner");var h=Ext.getCmp("healthCenterComponentSearchTextBox");var k=Ext.getCmp("healthCenterComponentCombo");var b=Ext.getCmp("healthCenterComponentComboLbl");var n=s.getValue();if(n!=null){var a=Ext.getCmp("healthCenterCompTypeCombo");
if(r=="vms|desktop|users"){a.selectedOption="vms";}else{a.selectedOption="Servers";}if(n!="-1"){var d=Ext.getCmp("dashboardLayoutObj");var m=d.profileName;var e="C=true&F=getComponentsJSONForType&P0={"+n+"}&P1={"+m+"}&calljson=true";this.callRemoteScriptingMethod(e,"loadHealthCenterComponents","healthCenterPopup","",true);
if(!Ext.isEmpty(g)&&!Ext.isEmpty(k)&&!Ext.isEmpty(h)){g.show();k.show();h.show();b.setText("Components:");}}else{var j=k.getStore();j.removeAll();j.insert(0,{displayField:notApplicable,valueField:"-1"});k.setValue("-1");}}}}},loadHealthCenterCompType:function(d){var c=Ext.getCmp("dashboardLayoutObj");
var b=c.profileName;var a=b;if(!Ext.isEmpty(a)){a=this.filterEncode(a);}var e="comesFrom=myDashboard&action=loadComponentTypesForDataHealth&profileName="+encodeURIComponent(a)+"&selectedCategory="+encodeURIComponent(d);Ext.Ajax.request({url:"/final/servlet/com.eg.EgMonitorRequestDispatcher",params:e,scope:this,method:"POST",success:function(g){var l=g.responseText;
var i=Ext.decode(l);if(!Ext.isEmpty(i)){if(i.hasOwnProperty("comptypes")){var f=Ext.getCmp("healthCenterCompTypeCombo");f.suspendEvents(true);f.getStore().loadRawData(i["comptypes"]);var h=f.getStore();var k=Ext.getCmp("categoryOpts");var j=k.getValue();h.insert(0,{displayField:compTypAlertMsg,valueField:"-1"});
f.setValue("-1");f.resumeEvents();}else{var f=Ext.getCmp("healthCenterCompTypeCombo");f.suspendEvents(true);var h=f.getStore();h.removeAll();h.insert(0,{displayField:compTypAlertMsg,valueField:"-1"});f.setValue("-1");f.resumeEvents();}}}});},changeHealthCenterCompScrollCombo:function(d){var g=d.getValue();
var a=Ext.getCmp("healthCenterTestScrollCombo");var e=Ext.getCmp("healthCenterComponentCombo");if(!Ext.isEmpty(e)){e.suspendEvents(true);var c=e.getStore();c.removeAll();c.insert(0,{displayField:notApplicable,valueField:"-1"});e.setValue("-1");e.resumeEvents();}if(g!="-1"){var f="C=true&F=getTestsAsJSONForComponent&P0={"+g+"}&calljson=true";
this.callRemoteScriptingMethod(f,"loadHealthCenterComponentsTests","healthCenterPopup","",true);a.show();}else{if(!Ext.isEmpty(a)){a.suspendEvents(true);var b=a.getStore();b.removeAll();b.insert(0,{displayField:notApplicable,valueField:"-1"});a.setValue("-1");a.resumeEvents();a.show();}if(!Ext.isEmpty(e)){e.suspendEvents(true);
var c=e.getStore();c.removeAll();c.insert(0,{displayField:notApplicable,valueField:"-1"});e.setValue("-1");e.resumeEvents();}}},loadVms:function(c){var n=Ext.getCmp("categoryOpts");var d=n.getValue();if(d!=null&&d!="vms|desktop|users"){return;}var l=this.getWidgetOptionsWindow();var a=l.getComponent("configForm").getForm();
var o=a.findField("legandCheckBox");o.show();var e=a.findField("healthCenterCompTypeCombo");var i=e.getValue();var p=c.getValue();var j=Ext.getCmp("compVmBOX");var k=a.findField("vmListCombo");if(p!="-1"&&i!="-1"){var q=Ext.getCmp("dashboardLayoutObj");var b=q.profileName;Ext.getCmp("healthCenterVMComboLbl").show();
j.show();var m="C=true&F=getVmsForHyperVisor&P0={"+i+"}&P1={"+p+"}&calljson=true";var g="";if(e!=null&&e.hasOwnProperty("vmData")){var f=e["vmData"];if(f!=null&&f.hasOwnProperty("selectedVMs")){g=f["selectedVMs"];}}if(g!=null&&g!=""){this.callRemoteScriptingMethod(m,"loadVmDescriptors","healthCenterPopup",g,true);
}else{this.callRemoteScriptingMethod(m,"loadVmDescriptors","healthCenterPopup","",true);}}else{var h=k.getStore();h.removeAll();h.insert(0,{displayField:notApplicable,valueField:"-1"});k.setValue("-1");}},changeHealthCenterTestScrollCombo:function(i){var c=i.getValue();var e=Ext.getCmp("healthCenterCompTypeCombo");
var l=Ext.getCmp("healthCenterCompScrollCombo");var f=Ext.getCmp("healthCenterCompContiner");var a=Ext.getCmp("healthCenterComponentSearchTextBox");var g=Ext.getCmp("healthCenterComponentCombo");var k=Ext.getCmp("healthCenterComponentComboLbl");var d=Ext.getCmp("dashboardLayoutObj");var h=d.profileName;
if(c!="-1"){var b=e.getValue();var m=l.getValue();var j="C=true&F=getDescriptorsForServersJSON&P0={"+b+"}&P1={"+m+"}&P2={"+c+"}&calljson=true";this.callRemoteScriptingMethod(j,"loadDescriptorsForHealthCenter","healthCenterPopup","",true);}else{g.suspendEvents(true);var n=g.getStore();n.removeAll();n.insert(0,{displayField:notApplicable,valueField:"-1"});
g.setValue("-1");g.resumeEvents();}if(!Ext.isEmpty(f)&&!Ext.isEmpty(g)&&!Ext.isEmpty(a)){f.show();g.show();a.show();k.setText("Descriptors");}},updateInfrastructureHealth:function(){return updateInfrastructureHealth(false,"");},updateInfrastructureHealth:function(b,f){var e=this;var d=this.getWidgetOptionsWindow();
var a=d.getComponent("configForm").getForm();var c=a.findField("categoryOpts").getValue();if(c=="Descriptors"){e.updateHealthCenterDescriptors(b,f);}else{e.updateHealthCenterServers(b,f);}},updateHealthCenterServers:function(j,s){var g=this;var f=this.getWidgetOptionsWindow();var C=f.getComponent("configForm").getForm();
var c=Ext.getCmp("dashboardLayoutObj");var m=c.profileName;var b=f.widgetID;var i=Ext.getCmp(b);var w=C.findField("categoryOpts").getValue();var x=C.findField("healthCenterComponentCombo").getValue();var u=c.profileName;if(!Ext.isEmpty(u)){u=g.filterEncode(u);}var l="action=saveHealthCenterDataServerConfig&profileName="+encodeURIComponent(u)+"&blockId="+b+"&category="+encodeURIComponent(w);
if(w=="Components"||w=="vms|desktop|users"){var y=C.findField("healthCenterCompTypeCombo").getValue();if(y!=null&&y=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:compTypAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}if(Ext.isEmpty(x)||x==""||x=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:"Please choose a component",buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}if(x.includes("allServers")&&x.length>1){Ext.Msg.show({title:myDashboardAlertLbl,msg:"Individual components cannot be choosen if All servers option selected",buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}x=g.filterEncode(x);l=l+"&compType="+encodeURIComponent(y)+"&components="+encodeURIComponent(x);
if(w=="vms|desktop|users"){var z=Ext.getCmp("vmListCombo").getValue();if(Ext.isEmpty(z)||z==""||z=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:addVMs,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}if(z.includes("allVms")&&z.length>1){Ext.Msg.show({title:myDashboardAlertLbl,msg:allVMsSelectonAlert,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}if(!Ext.isEmpty(z)){var t=z.length;var q="";for(var n=0;n<t;n++){var a=z[n];q=q+","+g.filterEncode(a);}l=l+"&vms="+encodeURIComponent(q);}var d=C.findField("showDescOpt").getValue();var p=C.findField("showServersOpt").getValue();var k="no";if(d!=null&&d==true){k="yes";}var o="no";if(p!=null&&p==true){o="yes";
}l=l+"&showDescriptors="+k+"&showServers="+o;}if(w=="Components"){var r=Ext.getCmp("enableLegendOpt");var h="";if(r!=null&&r!=""&&r!=undefined){h=r.getValue();}var B="";if(h!=null&&h==true){B="yes";}else{B="no";}l=l+"&showLegends="+encodeURIComponent(B);}}else{if(w=="Zone"||w=="Segment"||w=="Service"){if(Ext.isEmpty(x)||x==""||x=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:"Please choose a "+w,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}if(x.includes("ALL")&&x.length>1){Ext.Msg.show({title:myDashboardAlertLbl,msg:"Individual "+w+"s cannot be added if ALL option selected",buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}x=g.filterEncode(x);l=l+"&components="+encodeURIComponent(x);var r=Ext.getCmp("enableLegendOpt");
var h="";if(r!=null&&r!=""&&r!=undefined){h=r.getValue();}var B="";if(h!=null&&h==true){B="yes";}else{B="no";}l=l+"&showLegends="+encodeURIComponent(B);}}var e=this.getGridstackpanel();var A=e._serializationStr();if(A!=null&&A!=""){l=l+"&layoutConfig="+encodeURIComponent(A);}if(!j){f.close();}e=null;
delete e;if(j){i=s;l=l+"&widgetPreviewMode=yes";i.setLoading(true,true);i.showLoadingMsg=true;}iAjax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:l+"&screenWidth="+(i.getWidth()-2)+"&screenHeight="+(i.getHeight()-20),scope:this,success:function(v){g.getPortlet().setRefresh(i);
var F=v.responseText;if(F!=null&&F!=""){if(!j){g.getPortlet().setRefresh(i);}var E=Ext.decode(F);i.isInitialResizeCompleted=false;i.isHighChartUpdate=false;i.isExternalDataSourceWidget=false;var D=b;if(j){D=b+"_previewImage";}i.isConfigured=true;myDashApp.getController("Main").showLiveDataForBlock(E,i,D);
}},failure:function(v,D){if(v.timedout){i.removeAll();i.add({xtype:"panel",html:'<div><table border="0" cellspacing="0" cellpadding="0" width="98%" height="'+(i.getHeight()-20)+'"><tr><td  align="center" valign="middle" class="msgFont"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></td></tr></table></div>"});
i.doLayout();}}});},addHealthCenterDescriptors:function(f){var g=this;var e=this.getWidgetOptionsWindow();var a=e.getComponent("configForm").getForm();var b=a.findField("healthCenterCompTypeCombo").getValue();if(b!=null&&b=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:compTypAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}var d=a.findField("healthCenterCompScrollCombo").getValue();if(Ext.isEmpty(d)||d==""||d=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:componentAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}var c=a.findField("healthCenterTestScrollCombo").getValue();if(Ext.isEmpty(c)||c==""||c=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:testAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}var h=a.findField("healthCenterComponentCombo").getValue();if((h!=null&&h=="")||(h=="-1")){Ext.Msg.show({title:myDashboardAlertLbl,msg:descriptorAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}this.addGridForHealth();},addGridForHealth:function(){var d=this.getWidgetOptionsWindow();
var p=d.getComponent("configForm").getForm();var k=p.findField("healthCenterCompTypeCombo").getValue();var a=p.findField("healthCenterCompScrollCombo").getValue();var s=p.findField("healthCenterCompScrollCombo").getRawValue();var q=p.findField("healthCenterTestScrollCombo").getValue();var c=p.findField("healthCenterTestScrollCombo").getRawValue();
var r=p.findField("healthCenterComponentCombo").getValue();var g=this.getComparisontable();var h=g.getStore();var e=[];var j=false;for(var l in r){var o=r[l];var f=false;if(o!=null&&o=="allDescriptors"){f=true;j=true;}if(o=="-1"||o==""){o="+";}var m="+";var n="+";if(o!=null&&o!="+"&&o.indexOf("+")==0&&o.length>1){m=o.substring(1);
}if(f){m="AllInfos";n=allDescriptors;}else{n=m;}if(j&&!f){Ext.Msg.show({title:myDashboardAlertLbl,msg:allDescriptorsAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}var i=a+"|$|"+s+"!@!"+q+"|$|"+c+"!@!"+m;var b=h.find("hidVal",i,0,false,true,true);if(b==-1){e.push({component:s,test:c,descriptor:n,hidVal:i});
}else{Ext.Msg.show({title:myDashboardAlertLbl,msg:"selection already exists",buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}}h.add(e);g.doLayout();},updateHealthCenterDescriptors:function(k,r){var e=this;var u=this.getWidgetOptionsWindow();var B=u.getComponent("configForm").getForm();var w=B.findField("categoryOpts").getValue();
var g=this.getComparisontable();var o=g.getStore();var s="";var A="";var n="";var x="";var f="";var C="";var j=g.getStore().getCount();if(j==0){Ext.Msg.show({title:myDashboardAlertLbl,msg:measureAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}for(var y=0;y<j;y++){var v=g.getStore().getAt(y).get("hidVal");
if(s.indexOf(v)==-1){s=s+","+v;}if(s!=null&&s.indexOf(",")==0){s=s.substring(1);}}var b=Ext.getCmp("dashboardLayoutObj");var m=b.profileName;var a=u.widgetID;var h=Ext.getCmp(a);s=e.filterEncode(s);var t=m;if(!Ext.isEmpty(t)){t=e.filterEncode(t);}paramsForSave="action=saveHealthCenterDataServerConfig&profileName="+encodeURIComponent(t)+"&blockId="+a+"&category="+encodeURIComponent(w)+"&configuredValues="+encodeURIComponent(s);
var c=B.findField("showDescOpt").getValue();var q=B.findField("showServersOpt").getValue();var l="no";if(c!=null&&c==true){l="yes";}var p="no";if(q!=null&&q==true){p="yes";}paramsForSave=paramsForSave+"&showDescriptors="+l+"&showServers="+p;var d=this.getGridstackpanel();var z=d._serializationStr();if(z!=null&&z!=""){paramsForSave=paramsForSave+"&layoutConfig="+encodeURIComponent(z);
}if(!k){u.close();}if(k){h=r;paramsForSave=paramsForSave+"&widgetPreviewMode=yes";h.setLoading(true,true);h.showLoadingMsg=true;}iAjax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:paramsForSave+"&screenWidth="+(h.getWidth()-2)+"&screenHeight="+(h.getHeight()-20),scope:this,success:function(i){var F=i.responseText;
if(F!=null&&F!=""){if(!k){e.getPortlet().setRefresh(h);}e.getPortlet().setRefresh(h);var E=Ext.decode(F);h.isInitialResizeCompleted=false;h.isHighChartUpdate=false;h.isExternalDataSourceWidget=false;var D=a;if(k){D=a+"_previewImage";}h.isConfigured=true;myDashApp.getController("Main").showLiveDataForBlock(E,h,D);
E=null;delete E;}F=null;delete F;},failure:function(i,D){if(i.timedout){if(blockType!=null&&blockType=="TimelineChart"||blockType=="areaChart"||blockType=="combinationChart"||blockType=="TrendGraph"){h.update('<table width="100%" height="'+(h.getHeight()-20)+'"><tr><td align="center" valign="middle"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></div></td></tr></table>");
}else{h.removeAll();h.add({xtype:"panel",html:'<div><table border="0" cellspacing="0" cellpadding="0" width="98%" height="'+(h.getHeight()-20)+'"><tr><td  align="center" valign="middle" class="msgFont"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></td></tr></table></div>"});
}h.doLayout();}}});},onChangeDDChartType:function(d){var g=d.getValue();var b=Ext.getCmp("summarizeDDColumnCombo");var l=Ext.getCmp("ddColumnsComboLbl");var k=Ext.getCmp("ViewType");var m=Ext.getCmp("Timeline");var n=Ext.getCmp("showChartSummary");if(g!=null&&g=="Bar Chart"){if(n!=null&&!Ext.isEmpty(n)){n.hide();
n.up("container").hide();}if(m!=null&&!Ext.isEmpty(m)){m.hide();m.up("container").hide();}if(!Ext.isEmpty(b)&&!Ext.isEmpty(k)){b.show();b.setValue("-1");b.up("container").show();k.show();k.up("container").show();if(l!=null&&!Ext.isEmpty(l)){var f=k.getValue();if(f!=null&&f=="Vertical"){b.setFieldLabel("Summarize DD Data By (X axis)");
l.setText("DD Columns (Y axis)");}else{if(f!=null&&f=="Horizontal"){b.setFieldLabel("Summarize DD Data By (Y axis)");l.setText("DD Columns (X axis)");}}}}}else{if(g!=null&&(g=="Time Line"||g=="Area")){if(n!=null&&!Ext.isEmpty(n)){n.show();n.up("container").show();}if(k!=null&&!Ext.isEmpty(k)){k.hide();
k.up("container").hide();}if(m!=null&&!Ext.isEmpty(m)){var c=m.getStore();c.removeAll();var i=m.timelineOpts;c.loadRawData(i);var h=m.selectedValue;if(Ext.isEmpty(h)){h="1 hour";}m.setValue(h);m.show();m.up("container").show();var e=m.up("container");Ext.defer(function(){$("#"+e.id).css({"border-width":"1px 0px 1px 0px"});
},500);}if(!Ext.isEmpty(l)&&!Ext.isEmpty(b)){b.setFieldLabel("Summarize DD Data By");l.setText("DD Columns");}if(!Ext.isEmpty(b)){b.show();b.setValue("-1");b.up("container").show();}}else{if(n!=null&&!Ext.isEmpty(n)){n.hide();n.up("container").hide();}if(m!=null&&!Ext.isEmpty(m)){var c=m.getStore();var a=c.findRecord(m.valueField,"recent",0,false,true,true);
var j=c.indexOf(a);if(j==-1){var i=m.timelineOpts;var h=m.selectedValue;var p=[];p.push({displayField:"Latest",valueField:"recent"});if(!Ext.isEmpty(i)){for(var o in i){p.push(i[o]);}}c.loadRawData(p);if(Ext.isEmpty(h)){h="recent";}m.setValue(h);}m.show();m.up("container").show();}if(!Ext.isEmpty(b)&&!Ext.isEmpty(k)){b.hide();
k.hide();b.up("container").show();k.up("container").hide();}var l=Ext.getCmp("ddColumnsComboLbl");if(l!=null&&!Ext.isEmpty(l)){l.setText("DD Columns");}}}},onSearchTriggerclick:function(e){var c=e.widgetID;var g=Ext.getCmp(c);var b=Ext.getCmp("dashboardLayoutObj");var d=b.profileName;if(!Ext.isEmpty(d)){d=this.filterEncode(d);
}var i="&action=loadBlockData&profileName="+encodeURIComponent(d)+"&blockId="+c;var f=this;if(isAnonymousUserAccess){i=i+"&anonymousUser=true";}var a="none";var h=e.getValue();if(!Ext.isEmpty(h)){a=h;}if(!Ext.isEmpty(a)){a=this.filterEncode(a);}g.setLoading(true,true);i=i+"&searchString="+encodeURIComponent(a);
iAjax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:i+"&screenWidth="+(g.getWidth()-2)+"&screenHeight="+(g.getHeight()-20),scope:this,success:function(j){var l=j.responseText;if(l!=null&&l!=""){var k=Ext.decode(l);g.isInitialResizeCompleted=false;g.isHighChartUpdate=false;
myDashApp.getController("Main").showLiveDataForBlock(k,g,c);k=null;delete k;}l=null;delete l;},failure:function(j,k){if(j.timedout){g.removeAll();g.add({xtype:"panel",html:'<div><table border="0" cellspacing="0" cellpadding="0" width="98%" height="'+(g.getHeight()-20)+'"><tr><td  align="center" valign="middle" class="msgFont"><div class="requestTimeOut" style="z-index:19001;left:45%;top:35%;width:180px"><div style="position:relative">'+requestTimeoutMsg+"</div></td></tr></table></div>"});
g.doLayout();}}});},showAlarmFilterPopup:function(b){try{var a=Ext.getCmp("dashboardLayoutObj").profileName;var d=a;if(!Ext.isEmpty(d)){d=this.filterEncode(d);}var e="action=getAlarmsFilterOptions&comesFrom=myDashboard&profileName="+encodeURIComponent(d);if(isAnonymousUserAccess){e=e+"&anonymousUser=true";
}Ext.Ajax.request({url:"/final/servlet/com.eg.EgMonitorRequestDispatcher",method:"POST",params:e,scope:this,success:function(f){var k=f.responseText;if(k!=null&&k!=""){var j=Ext.decode(k);var h=[];var g=[];var l=[];h=j["alarmFilterOptions"]["filterOptsJson"];g=j["alarmFilterOptions"]["prioirtyFilterOpt"];
l=j["alarmFilterOptions"]["selectedTyps"];var i=Ext.create("Ext.window.Window",{resizable:false,ui:"newPopupWindow widgetOptionsWindowHeader",cls:"myDashboardwindow",width:"420px",draggable:false,title:screenLabelsObj["AlarmFilterSettingsLbl"],id:"AlarmFilterPopup",closeAction:"destroy",modal:true,renderTo:Ext.getBody(),bodyPadding:"10",items:[{xtype:"container",layout:{type:"hbox",align:"stretch"},items:[{xtype:"container",margin:"10",items:[{xtype:"scrollcombo",fieldLabel:screenLabelsObj["FilterBy"],labelAlign:"top",emptyText:"",labelSeparator:"",displayField:"displayField",valueField:"valueField",queryMode:"local",id:"alarmFilterOpts",width:140,store:new Ext.data.Store({fields:["valueField","displayField"],data:h}),editable:true,forceSelection:true,listeners:{"select":function(o){var n=o.getValue();
if(n!=null&&n=="filterByPriority"){var m=Ext.getCmp("alarmSubFilterMultiSelectCont");if(!Ext.isEmpty(m)){m.hide();}var p=Ext.getCmp("alarmSubFilterOpts");if(!Ext.isEmpty(p)){var q=p.getValue();if(Ext.isEmpty(q)){p.setValue("all");}p.show();}}else{if(n!=null&&n=="filterByComponentType"){var p=Ext.getCmp("alarmSubFilterOpts");
if(!Ext.isEmpty(p)){p.hide();}var m=Ext.getCmp("alarmSubFilterMultiSelectCont");if(!Ext.isEmpty(m)){m.show();}}}}}}]},{xtype:"container",margin:"10",items:[{xtype:"scrollcombo",fieldLabel:screenLabelsObj["PriorityLbl"],labelAlign:"top",emptyText:"",labelSeparator:"",displayField:"displayField",valueField:"valueField",queryMode:"local",id:"alarmSubFilterOpts",name:"alarmSubFilterOpts",width:140,store:new Ext.data.Store({fields:["valueField","displayField"],data:g}),editable:true,forceSelection:true,}]},{xtype:"container",id:"alarmSubFilterMultiSelectCont",margin:"10",layout:{type:"vbox",align:"stretch"},hidden:true,items:[{xtype:"label",id:"alarmCompTypesLbl",name:"alarmCompTypesLbl",text:componentTypeLbl,width:200},{xtype:"container",layout:{type:"vbox",align:"stretch"},width:200,cls:"darkbox",height:145,items:[{xtype:"trigger",margin:"5",id:"alarmCompTypesSearchTextBox",name:"alarmCompTypesSearchTextBox",width:178,cls:"whitedropdown_search",emptyText:"Search",componentStore:null,listeners:{"change":function(s,r,n,o){var p=this;
var m=p.componentStore;if(m==null){p.componentStore=Ext.getCmp("alarmSubFilterMultiSelectOpts").getStore();m=p.componentStore;}if(r=="*"){m.clearFilter();}else{if(r.lastIndexOf("*")==(r.length-1)){r=r.substr(0,(r.length-1));}m.clearFilter();if(r){var q=new RegExp(Ext.String.escapeRegex(r),"i");m.filter({filterFn:function(t){return q.test(t.get("displayField"));
}});}s.focus();}}}},{xtype:"multiselect",id:"alarmSubFilterMultiSelectOpts",baseCls:"egmultiselect",name:"alarmSubFilterMultiSelectOpts",multiSelect:true,height:106,store:Ext.create("Ext.data.Store",{fields:["displayField","valueField","editedCompName"],data:l}),fieldLabel:"",labelAlign:"top",editable:false,displayField:"displayField",valueField:"valueField",queryMode:"local",listConfig:{id:"alarmSubFilterMultiSelectOptsC",name:"alarmSubFilterMultiSelectOptsC",simpleSelect:true}}]}]}]},{xtype:"button",id:"applyButton",text:"Apply",width:70,margin:"0 20 0 180",padding:"0",cls:"buttonNewBig",handler:function(){var n=Ext.getCmp("dashboardLayoutObj").profileName;
var m=Ext.getCmp(b);var o=Ext.getCmp("alarmFilterOpts").getValue();Ext.state.Manager.set(n+"_"+b+"_filterby",o);if(o!=null&&o=="filterByPriority"){var p=Ext.getCmp("alarmSubFilterOpts").getValue();Ext.state.Manager.set(n+"_"+b+"_selectedSubFilterOpt",p);}else{if(o!=null&&o=="filterByComponentType"){var p=Ext.getCmp("alarmSubFilterMultiSelectOpts").getValue();
if(Ext.isEmpty(p)||p=="-1"){Ext.Msg.show({title:myDashboardAlertLbl,msg:compTypAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});return;}if(p!=null&&(p.length>1)&&p.indexOf("allTypes")>-1){Ext.Msg.show({title:myDashboardAlertLbl,msg:individualCompTypsCannotAdd,buttons:Ext.MessageBox.OK,icon:"iconExclamation"});
return;}Ext.state.Manager.set(n+"_"+b+"_selectedSubFilterOpt",p);}}Ext.getCmp("AlarmFilterPopup").close();myDashApp.getController("Main").loadDataForBlock(m,n,b,true);}}],listeners:{"afterrender":function(m){var n=Ext.getCmp("dashboardLayoutObj").profileName;var s=Ext.getCmp(b);var q=Ext.state.Manager.get(n+"_"+b+"_filterby");
var p=Ext.state.Manager.get(n+"_"+b+"_selectedSubFilterOpt");if(Ext.isEmpty(q)){q=s.selectedFilterOption;}if(Ext.isEmpty(p)){p=s.selectedSubFilterOption;}var t=Ext.getCmp("alarmFilterOpts");if(!Ext.isEmpty(t)){t.setValue(q);}if(q!=null&&q=="filterByPriority"){var o=Ext.getCmp("alarmSubFilterMultiSelectCont");
if(!Ext.isEmpty(o)){o.hide();}var u=Ext.getCmp("alarmSubFilterOpts");if(!Ext.isEmpty(u)){u.setValue(p);u.show();}}else{if(q!=null&&q=="filterByComponentType"){var u=Ext.getCmp("alarmSubFilterOpts");if(!Ext.isEmpty(u)){u.hide();}var o=Ext.getCmp("alarmSubFilterMultiSelectCont");if(!Ext.isEmpty(o)){var r=Ext.getCmp("alarmSubFilterMultiSelectOpts");
r.setValue(p);o.show();}}}}}});i.show();}}});}catch(c){console.log("error ",c);}}});