Ext.define("MyDashBoard.view.WidgetOptionsWindow",{extend:"Ext.window.Window",alias:"widget.widgetOptionsWindow",title:"",requires:["Ext.ux.form.MultiSelect","utilities.Multiselector","MyDashBoard.view.ComparisonTable","MyDashBoard.view.Portlet","MyDashBoard.view.GridComparisonTable","MyDashBoard.view.GroupSelection","MyDashBoard.view.PreviewContainer"],width:990,maxHeight:Ext.getBody().getViewSize().height-10,height:544,ui:"newPopupWindow widgetOptionsWindowHeader",cls:"myDashboardwindow",id:"widgetOptionsWindow",header:{height:50,layout:"hbox",padding:"0 10",margin:0,cls:"",items:[{xtype:"label",id:"config-window-title",name:"config-window-title",cls:"x-window-header-text-newPopupWindow widgetOptionsWindowHeader",text:screenLabelsObj["WidgetConfigLbl"]}]},scroll:false,autoScroll:false,layout:{type:"vbox",align:"stretch"},widgetID:"",widgetType:"",showConfigurationTab:false,isAggregationDisabled:true,widgetSettingsJsonArr:null,tableGridDataObj:null,isTopNWidget:false,frame:true,padding:0,bodyPadding:"0",margin:0,resizable:false,border:false,modal:true,ghost:false,closeAction:"destroy",widgetPreviewDimensions:{},isExternalDataSourceWidget:false,isKpi:false,Kpicount:0,currentCount:0,needToUpdateCount:true,KpiDataArray:null,kpiBlckId:null,totalKpiCount:null,autoAssociateComponents:false,initComponent:function(){var a={};
a["activityChart"]=[343,248];a["areaChart"]=[343,248];a["BarChart"]=[343,248];a["combinationChart"]=[343,248];a["CombinedTimelineChart"]=[343,248];a["ddTable"]=[427,248];a["dialChart"]=[259,248];a["digitalChart"]=[280,238];a["geomap"]=[427,248];a["health"]=[343,248];a["heatMapChart"]=[343,248];a["liveMeasuresBox"]=[343,248];
a["networkhealth"]=[427,248];a["news"]=[427,248];a["pieChart"]=[343,248];a["servicehealth"]=[427,248];a["table"]=[343,228];a["tierhealth"]=[427,248];a["TimelineChart"]=[343,248];a["TopNAnalysis"]=[339,216];a["TopologyWidget"]=[427,248];a["TrendGraph"]=[343,248];a["vmAlarmsWidget"]=[427,248];a["weather"]=[343,248];
a["ScatterPlot"]=[327,205];this.widgetPreviewDimensions=a;this.createConfigLayout();this.callParent(this);},createConfigLayout:function(){return this.createConfigLayout(false);},createConfigLayout:function(b){var c=this;if(b){if(c.widgetType=="TopNAnalysis"){c.isTopNWidget=true;}if(c.widgetType!=null&&c.widgetType=="TopologyWidget"){c.add(createConfigurationForTopologyWidget());
}else{if(c.widgetType!=null&&c.widgetType=="vmAlarmsWidget"){c.add(c.createConfiguartionForVMAlertWidget());}else{if(c.widgetType!=null&&c.widgetType=="servicehealth"){c.add(c.createConfiguartionForServiceHealthWidget());}else{c.add(c.createConfigurationWindowLayout(b));}}}c.doLayout();}else{if(c.isExternalDataSourceWidget){var d=Ext.getCmp("doneButton");
if(!Ext.isEmpty(d)){d.show();}c.items={xtype:"addexternalmetrics",id:"widgetChartAttrs",name:"widgetChartAttrs",margin:"5 0 10 5",widgetID:c.widgetID,widgetType:c.widgetType,isKpi:c.isKpi,Kpicount:c.Kpicount,totalKpiCount:c.totalKpiCount,kpiBlckId:c.kpiBlckId};if(c.isKpi){Ext.defer(function(){var g=Ext.getCmp("prevButton");
var f=Ext.getCmp("nextButton");if(c.Kpicount==1){g.needToDisable=true;g.setDisabled(true);}if(c.Kpicount==c.totalKpiCount){f.needToDisable=true;f.setDisabled(true);}if(!g.needToDisable){g.setDisabled(false);}if(!f.needToDisable){f.setDisabled(false);}},800);}}else{var a=c.isKpi;if(c.widgetType=="TopNAnalysis"){c.isTopNWidget=true;
}if(c.widgetType!=null&&c.widgetType=="TopologyWidget"){c.items=c.createConfigurationForTopologyWidget();}else{if(c.widgetType!=null&&c.widgetType=="vmAlarmsWidget"){c.items=c.createConfiguartionForVMAlertWidget();}else{if(c.widgetType!=null&&c.widgetType=="servicehealth"){c.items=c.createConfiguartionForServiceHealthWidget();
}else{c.items=c.createConfigurationWindowLayout();}}}}var e=false;if(c.widgetType=="TopNAnalysis"||c.widgetType=="TopologyWidget"||c.widgetType=="vmAlarmsWidget"||c.widgetType=="combinationChart"||c.widgetType=="liveMeasuresBox"||c.widgetType=="health"||c.widgetType=="ddTable"||c.widgetType=="TrendGraph"||c.widgetType=="ScatterPlot"||c.widgetType=="servicehealth"){e=true;
}c.tools=[{xtype:"toolbar",dock:"top",items:[{xtype:"switchfield",fieldLabel:screenLabelsObj["UseExternalDS"],margin:"8 54 0 50",style:{"z-index":"9"},labelWidth:180,inputValue:"Yes",labelSeparator:"",labelAlign:"right",labelStyle:"line-height:13px;",uncheckedValue:"No",labelSeparator:"",id:"useExternalData",name:"useExternalData",isSwitchFieldLoaded:false,hidden:e,listeners:{"afterrender":function(){this.isSettingDefaultValue=true;
this.setValue(this.up("window").isExternalDataSourceWidget);this.isSettingDefaultValue=false;}}}]}];c.dockedItems=[{xtype:"toolbar",dock:"bottom",cls:"egFooterNewConfigWin",height:60,layout:{type:"hbox",pack:c.isKpi?"center":"end",},items:[{xtype:"button",buttonAlign:"right",id:"doneButton",align:"right",text:c.isKpi?"Finish":screenLabelsObj["DoneButtonLabel"],margin:"0 20 0 0",padding:"5 15 5 15",cls:"newConfigWinBtn newFont_normal14",disabled:true},]}];
}},setWidgetPopupTitle:function(b){var a=Ext.getCmp("config-window-title");if(!Ext.isEmpty(a)){a.setText(b);}},createConfiguartionForVMAlertWidget:function(){var g=this.widgetID;var e=false;var c=false;var a="";var f=Ext.getCmp(g);if(!Ext.isEmpty(f)){e=f.isChart;c=f.isTopNChart;a=f.title;}var h={xtype:"container",layout:{type:"vbox"},width:370,height:280,cls:"",margin:"0 0 0 0",padding:"0 0 0 0",items:[{xtype:"container",cls:"b-container",padding:0,defaults:{margin:"10 0 10 0 ",labelWidth:"auto",labelSeparator:"",labelStyle:"white-space: pre;"},items:[{xtype:"scrollcombo",id:"componentTypeCombo",name:"componentTypeCombo",cls:"dropdown",fieldLabel:"Component Type",labelWidth:150,width:360,store:Ext.create("Ext.data.Store",{fields:["displayField","valueField"],data:[]}),editable:true,forceSelection:true,displayField:"displayField",valueField:"valueField",queryMode:"local",value:notApplicable}]},{xtype:"container",cls:"b-container",padding:0,defaults:{margin:"10 0 10 0 ",labelWidth:"auto",labelSeparator:"",labelStyle:"white-space: pre;"},items:{xtype:"scrollcombo",cls:"dropdown",fieldLabel:"Component",id:"componentCombo",name:"componentCombo",labelWidth:150,width:360,store:Ext.create("Ext.data.Store",{fields:["displayField","valueField"],data:[]}),editable:true,forceSelection:true,displayField:"displayField",valueField:"valueField",queryMode:"local",value:notApplicable}},{xtype:"container",width:"100%",defaults:{labelAlign:"top",labelSeparator:""},padding:"5px 20px 5px 0",items:[{xtype:"label",id:"vmListLbl",name:"vmListLbl",margin:"0 10px 5px 0px",cls:"x-form-item-label"},{xtype:"multiselect",margin:"0px 0px 5px 0px",id:"vmListCombo",name:"vmListCombo",baseCls:"egmultiselect",multiSelect:true,height:110,width:360,store:Ext.create("Ext.data.Store",{fields:["displayField","valueField"],data:[]}),scroll:true,editable:false,displayField:"displayField",valueField:"valueField",queryMode:"local",value:notApplicable,listConfig:{id:"vmsList",name:"vmsList",simpleSelect:true,itemTpl:new Ext.XTemplate('<tpl for=".">','<div id="{valueField}"  style="text-align:left">{displayField}</div>',"</tpl>"),listeners:{itemdblclick:function(k,n,u,p,q,r){var s=this;
var t=k.getSelectionModel().getSelection();for(var m=0;m<t.length;m++){mySelectionHeaders=t[m].data.displayField;mySelectionHeadersd=t[m].data.valueField;var o=new Ext.Editor({updateEl:true,shadow:false,border:false,width:335,field:{xtype:"textfield",height:21,width:335},ignoreNoChange:true,listeners:{"beforecomplete":function(y,x,v,w){if(x==null||x==""||x=="-1"){y.setValue(v);
Ext.Msg.show({title:"Alert",msg:componentEmptyMsg,buttons:Ext.MessageBox.OK,icon:"iconInformation"});return false;}else{if(s.store.find("displayField",x,0,false,true,true)!=-1){y.cancelEdit(false);Ext.Msg.show({title:"Alert",msg:compNameAlreadyExists,buttons:Ext.MessageBox.OK,icon:"iconInformation"});
return false;}else{if(myDashApp.getController("Main").checkSpecialCharacter(x)){Ext.Msg.show({title:"Alert",msg:compnameSpecialCharacterAlert,buttons:Ext.MessageBox.OK,icon:"iconInformation"});return;}}}},"complete":function(y,x,v,w){s.store.suspendEvents();s.store.insert(p,{"displayField":this.getValue(),"valueField":mySelectionHeadersd});
s.store.remove(t[m],true);s.store.resumeEvents();}}});if(mySelectionHeadersd!="-1"){var l=Ext.get(mySelectionHeadersd);o.startEdit(l,l.getValue());}}}}}},{xtype:"container",layout:{type:"vbox"},width:360,padding:0,defaults:{margin:"5 0 10 280"},items:{xtype:"button",width:80,text:addDispBtn,id:"addVMBlockConfig",name:"addVMBlockConfig",cls:"button20"},}],},]};
var j=400;var b=250;var d=this.widgetPreviewDimensions[this.widgetType];if(!Ext.isEmpty(d)){j=d[0];b=d[1];}return{xtype:"form",id:"configForm",width:"100%",flex:1,modal:true,autoScroll:true,layout:{type:"vbox"},defaults:{labelAlign:"top",labelSeparator:""},bodyPadding:10,margin:"0 0 0 0",items:[{xtype:"panel",width:"100%",items:[{xtype:"container",width:"100%",layout:{type:"hbox"},items:[{xtype:"previewcontiner",margin:"4 20 4 10",width:j,height:b,items:[{xtype:"portlet",width:j-23,height:b-23,id:g+"_previewImage",title:a,ui:"newGraphPanel",cls:"previewImage",margin:"0 0 0 0",padding:"0",isChart:e,isTopNChart:c,showMoreDataOption:false,isPreviewMode:true}]},h]}]},{xtype:"gridcomparisontable",margin:"0 0 0 0",header:false,hidden:false}]};
},createConfigurationForTopologyWidget:function(){var a=this.widgetID;var h=false;var b=false;var c="";var d=Ext.getCmp(a);if(!Ext.isEmpty(d)){h=d.isChart;b=d.isTopNChart;c=d.title;}var g=400;var f=250;var e=this.widgetPreviewDimensions[this.widgetType];if(!Ext.isEmpty(e)){g=e[0];f=e[1];}return[{xtype:"panel",width:"100%",margin:10,layout:{type:"hbox"},items:[{xtype:"previewcontiner",margin:"4 20 4 10",width:g,height:f,items:[{xtype:"portlet",width:g-23,height:f-23,id:a+"_previewImage",title:c,ui:"newGraphPanel",cls:"previewImage",margin:"0 0 0 0",padding:"0",isChart:h,isTopNChart:b,showMoreDataOption:false,isPreviewMode:true}]},{xtype:"form",id:"topologyconfigform",buttonAlign:"center",defaults:{margin:"0 20 0 10"},layout:{type:"vbox",align:"stretch"},items:[{xtype:"container",cls:"b-container",padding:0,defaults:{margin:"10 20 10 0 ",labelWidth:"auto",labelStyle:"white-space: pre;"},items:{xtype:"scrollcombo",cls:"dropdown",fieldLabel:"Choose a Grouping",id:"viewTypeCombo",labelSeparator:"",name:"viewTypeCombo",labelWidth:120,margin:"10 0 10 0 ",emptyText:"Choose a Grouping",width:316,store:Ext.create("Ext.data.Store",{fields:["displayField","valueField"],data:[{"displayField":"Segment","valueField":"Segment"},{"displayField":"Service","valueField":"Service"}]}),editable:true,forceSelection:true,displayField:"displayField",valueField:"valueField",queryMode:"local"}},{xtype:"container",cls:"b-container",padding:0,defaults:{margin:"10 20 10 0 ",labelWidth:"auto",labelStyle:"white-space: pre;"},items:{xtype:"scrollcombo",cls:"dropdown",labelSeparator:"",fieldLabel:"Group Name",id:"viewTypeValueCombo",name:"viewTypeValueCombo",margin:"10 0 10 0 ",labelWidth:120,width:316,store:Ext.create("Ext.data.Store",{fields:["displayField","valueField"],data:[]}),editable:true,forceSelection:true,displayField:"displayField",valueField:"valueField",queryMode:"local",widgetID:a,listeners:{"select":function(j){Ext.getCmp("doneButton").enable();
myDashApp.getController("WidgetConfigurationController").showWidgetPreview(j.widgetID);}}}}]}]}];},loadDefaultDataForTopologyWidgetPopup:function(){var e=this;var f=Ext.getCmp("topologyconfigform");var d=f.getForm();var c=Ext.getCmp("dashboardLayoutObj").profileName;var a=new Ext.LoadMask(this.getEl(),{msg:"Loading .."});
a.show();var b=c;if(!Ext.isEmpty(b)){b=filterEncode(b);}Ext.Ajax.request({url:"/final/servlet/com.eg.EgMonitorRequestDispatcher",method:"POST",params:"comesFrom=myDashboard&action=loadTopologyConfigPopup&profileName="+encodeURIComponent(b)+"&blockId="+e.widgetID+"&screenWidth="+(Ext.getBody().getViewSize().width)+"&screenHeight="+(Ext.getBody().getViewSize().height),scope:this,success:function(h){var g=h.responseText;
if(g!=null&&g!=""){a.hide();var o=Ext.decode(g);var n=o["configuredDetails"];e.setWidgetPopupTitle(configTitle[e.widgetType]+" "+addMetricsTitle);this.suspendEvents(true);Ext.suspendLayouts();var q=d.findField("viewTypeCombo");var p=n["selectedViewType"];var r=Ext.getCmp("viewTypeCombo");if(!Ext.isEmpty(r)){r.setValue(p);
}else{r.setValue("-1");}var k=d.findField("viewTypeValueCombo");k.getStore().removeAll();var j=k.getStore();if(n["viewByType"]!=null){j.loadRawData(n["viewByType"]);}else{j.insert(0,{displayField:notApplicable,valueField:"-1"});k.setValue("-1");}var l=n["selectedTypeValue"];var m=Ext.getCmp("viewTypeValueCombo");
if(!Ext.isEmpty(m)&&l!=null&&l!=""){m.setFieldLabel(p);m.setValue(l);}else{m.setValue("-1");}this.resumeEvents();Ext.resumeLayouts(true);Ext.getCmp("doneButton").enable();}},failure:function(){}});},loadDefaultDataforVMAlertsWidget:function(){var f=this;var d=f.widgetID;var e=Ext.getCmp("configForm");
var g=e.getForm();var h="dashboardLayout2";if(this.isFluidWindowConfigPopup){h="fluidDashLayout";}var c=Ext.getCmp("dashboardLayoutObj").profileName;var a=new Ext.LoadMask(this.getEl(),{msg:"Loading .."});a.show();var b=c;if(!Ext.isEmpty(b)){b=filterEncode(b);}Ext.Ajax.request({url:"/final/servlet/com.eg.EgMonitorRequestDispatcher",method:"POST",params:"comesFrom=myDashboard&action=loadVMConfigPopup&profileName="+encodeURIComponent(b)+"&blockId="+d+"&screenWidth="+(Ext.getBody().getViewSize().width)+"&screenHeight="+(Ext.getBody().getViewSize().height),scope:this,success:function(k){var x=k.responseText;
if(x!=null&&x!=""){var o=Ext.decode(x);a.hide();f.setWidgetPopupTitle(configTitle[f.widgetType]+" "+addMetricsTitle);var v=g.findField("componentTypeCombo");var w=o["vmConfigDetails"];var l="";var j="";var C="";var q="";var n="";var r="";if(!Ext.isEmpty(w)){var z=w["gridData"];if(!Ext.isEmpty(z)){var p=Ext.getCmp("gconfigTableGrid");
p.suspendEvents(true);var u=p.getStore();u.add(z);p.show();p.resumeEvents();p.doComponentLayout();}}v.getStore().removeAll();v.setFieldLabel(o["screenLabels"]["monitor.common.Component Type"]);var A=v.getStore();A.loadRawData(o["comptypes"]);A.insert(0,{displayField:"Please choose a Component Type",valueField:"-1"});
if(l!=null&&l!=""){v.setValue(l);}else{v.setValue("-1");}var B=g.findField("componentCombo");B.setFieldLabel(o["screenLabels"]["monitor.common.Component"]);var m=B.getStore();m.removeAll();m.insert(0,{displayField:notApplicable,valueField:"-1"});B.setValue("-1");var t=Ext.getCmp("vmListLbl");t.setText(o["screenLabels"]["monitor.common.Vm(s)"]);
var y=g.findField("vmListCombo");var s=y.getStore();s.removeAll();s.insert(0,{displayField:notApplicable,valueField:"-1"});y.setValue("-1");}},failure:function(){}});},loadDefaultDataforServiceHealthWidget:function(){Ext.getCmp("doneButton").enable();var f=this;var d=Ext.getCmp("gridContainer");var h=this.getComponent("configForm");
var e=h.getForm();var g="dashboardLayoutObj";var c=Ext.getCmp("dashboardLayoutObj").profileName;var a=new Ext.LoadMask(this.getEl(),{msg:"Loading .."});a.show();var b=c;if(!Ext.isEmpty(b)){b=filterEncode(b);}Ext.Ajax.request({url:"/final/servlet/com.eg.EgMonitorRequestDispatcher",method:"POST",params:"comesFrom=myDashboard&action=loadDataHealthConfigPopup&profileName="+encodeURIComponent(b)+"&blockId="+f.widgetID+"&screenWidth="+(Ext.getBody().getViewSize().width)+"&screenHeight="+(Ext.getBody().getViewSize().height),scope:this,success:function(j){var x=j.responseText;
if(x!=null&&x!=""){a.hide();var n=Ext.decode(x);this.suspendEvents(true);Ext.suspendLayouts();var o=n["configuredDetails"];var w="";var r="";f.setWidgetPopupTitle(infrastructureHealthChartTitle+" "+addMetricsTitle);if(!Ext.isEmpty(o)&&o.hasOwnProperty("categoryCombo")&&o.hasOwnProperty("selectedCategory")){var t=e.findField("categoryOpts");
t.suspendEvents(true);t.getStore().loadRawData(o["categoryCombo"]);t.setValue(o["selectedCategory"]);t.resumeEvents();w=o["selectedCategory"];}if(w=="Components"){var u=e.findField("enableLegendOpt");u.isDefault=true;u.show();var y=o["showLegends"];if(y!=null&&y=="yes"){u.setValue(true);}else{u.setValue(false);
}u.isDefault=false;d.hide();var z=e.findField("legandCheckBox");var l=e.findField("showDescOpt");l.suspendEvents(false);l.setValue(true);l.resumeEvents();z.hide();if(!Ext.isEmpty(n)&&n.hasOwnProperty("comptypes")&&o.hasOwnProperty("selectedCompType")){var k=o["selectedCompType"];var C=e.findField("healthCenterCompTypeCombo");
C.suspendEvents(true);C.getStore().loadRawData(n["comptypes"]);if(k==null||k==""||k=="-1"){var A=C.getStore();A.insert(0,{displayField:compTypAlertMsg,valueField:"-1"});C.setValue("-1");}else{var A=C.getStore();A.insert(0,{displayField:compTypAlertMsg,valueField:"-1"});C.setValue(k);}C.resumeEvents();
C.show();}if(!Ext.isEmpty(o)&&o.hasOwnProperty("selectedComponents")&&o.hasOwnProperty("selectedCompType")){var p=myDashApp.getController("WidgetConfigurationController").loadComponentItems(t,o["selectedCompType"],o["selectedComponents"]);}}else{if(w=="vms|desktop|users"){var u=e.findField("enableLegendOpt");
u.hide();var z=e.findField("legandCheckBox");z.show();var s=e.findField("showServersOpt");s.suspendEvents(false);var B=o["showServers"];if(B!=null&&B=="yes"){s.setValue(true);}else{s.setValue(false);}s.resumeEvents();var l=e.findField("showDescOpt");l.suspendEvents(false);var v=o["showDescriptors"];if(v!=null&&v=="yes"){l.setValue(true);
}else{l.setValue(false);}l.resumeEvents();if(!Ext.isEmpty(n)&&n.hasOwnProperty("comptypes")&&o.hasOwnProperty("selectedCompType")){var k=o["selectedCompType"];var C=e.findField("healthCenterCompTypeCombo");C.suspendEvents(true);C.getStore().loadRawData(n["comptypes"]);if(k==null||k==""||k=="-1"){var A=C.getStore();
A.insert(0,{displayField:compTypAlertMsg,valueField:"-1"});C.setValue("-1");}else{var A=C.getStore();A.insert(0,{displayField:compTypAlertMsg,valueField:"-1"});C.setValue(k);}C.resumeEvents();C.show();if(!Ext.isEmpty(o)&&o.hasOwnProperty("selectedComponents")&&o.hasOwnProperty("selectedCompType")){C.vmData=o;
var p=myDashApp.getController("WidgetConfigurationController").loadComponentItems(t,o["selectedCompType"],o["selectedComponents"]);}}if(!Ext.isEmpty(o)&&o.hasOwnProperty("selectedComponents")&&o.hasOwnProperty("selectedCompType")){var p=myDashApp.getController("WidgetConfigurationController").loadComponentItems(t,o["selectedCompType"],o["selectedComponents"]);
}}else{if(w=="Descriptors"){var u=e.findField("enableLegendOpt");u.hide();d.show();var z=e.findField("legandCheckBox");z.show();var s=e.findField("showServersOpt");s.suspendEvents(false);var B=o["showServers"];if(B!=null&&B=="yes"){s.setValue(true);}else{s.setValue(false);}s.resumeEvents();var l=e.findField("showDescOpt");
l.suspendEvents(false);var v=o["showDescriptors"];if(v!=null&&v=="yes"){l.setValue(true);}else{l.setValue(false);}l.resumeEvents();var t=e.findField("categoryOpts");var p=myDashApp.getController("WidgetConfigurationController").changeCategoryOptionCombo(t);if(!Ext.isEmpty(o)&&o.hasOwnProperty("gridData")&&!Ext.isEmpty(o["gridData"])){var m=Ext.getCmp("configTableGrid");
m.suspendEvents(true);var q=m.getStore();q.add(o["gridData"]);m.show();m.resumeEvents();m.doComponentLayout();}else{var m=Ext.getCmp("configTableGrid");m.suspendEvents(true);var q=m.getStore();q.removeAll();m.show();m.resumeEvents();m.doComponentLayout();}}else{if(w=="Zone"||w=="Segment"||w=="Service"){var u=e.findField("enableLegendOpt");
u.isDefault=true;u.show();var y=o["showLegends"];if(y!=null&&y=="yes"){u.setValue(true);}else{u.setValue(false);}u.isDefault=false;d.hide();var z=e.findField("legandCheckBox");z.hide();if(!Ext.isEmpty(o)&&o.hasOwnProperty("selectedComponents")){var t=e.findField("categoryOpts");var p=myDashApp.getController("WidgetConfigurationController").loadGroupedItems(t,o["selectedComponents"]);
}else{var t=e.findField("categoryOpts");var p=myDashApp.getController("WidgetConfigurationController").loadGroupedItems(t,"-1");}}}}}this.resumeEvents();Ext.resumeLayouts(true);}},failure:function(){}});},loadSampleSnippet:function(){return loadSampleSnippet(false);},loadSampleSnippet:function(d){var e=this.widgetType;
var b=this.widgetID;var a=true;if(d){var c=Ext.getCmp("useExternalData");if(!Ext.isEmpty(c)){if(this.isExternalDataSourceWidget&&c.getValue()==false){a=false;}else{if(!this.isExternalDataSourceWidget&&c.getValue()==true){a=false;}}}}if(a&&(this.action=="editWidget"&&(e!=null&&(e!="TopologyWidget"&&e!="vmAlarmsWidget")))){myDashApp.getController("WidgetConfigurationController").showWidgetPreviewAtPopupStartUp(b,this.isExternalDataSourceWidget);
}else{if(e!=null&&e=="servicehealth"){e="serviceHealth";}this.setDefaultWidgetPreviewImage(e,b);}},setDefaultWidgetPreviewImage:function(b,a){if(b!=null&&b.indexOf("Widget")>0){b=b.substring(0,b.indexOf("Widget"));}Ext.getCmp(a+"_previewImage").add({xtype:"container",width:"100%",flex:1,layout:{type:"vbox",align:"stretch"},items:[{xtype:"imagecomponent",cls:"samplePreviewImage",autoEl:"div",flex:1,src:"../images/"+strSkin+"/widget_sample_images/widget_"+b+".png"}],style:{"text-align":"center"}});
},onRender:function(){this.loadPopupData();this.callParent();},loadPopupData:function(){return loadPopupData(false);},loadPopupData:function(a){if(this.isExternalDataSourceWidget&&!a){return;}if(a){this.loadSampleSnippet(a);}if(this.widgetType!=null&&this.widgetType=="TopologyWidget"){this.loadDefaultDataForTopologyWidgetPopup();
}else{if(this.widgetType!=null&&this.widgetType=="vmAlarmsWidget"){this.loadDefaultDataforVMAlertsWidget();}else{if(this.widgetType!=null&&this.widgetType=="servicehealth"){this.loadDefaultDataforServiceHealthWidget();}else{this.loadDefaultDataforWidgetConfigurationWindow();}}}},createSettingsCtrls:function(h){var a=[];
if(!Ext.isEmpty(h)){var d=false;if(!isHighchartForGauge&&this.widgetType=="dialChart"){d=true;}var c="10 20 5 0";var b="0 0 0 0";if(this.widgetType=="ddTable"){b="0 0 0 0";}else{if(this.widgetType=="liveMeasuresBox"){b="0 5 0 0";}}for(var f in h){var g=h[f];var e=this.createFilterItem(g);if(!Ext.isEmpty(e)){a.push({xtype:"container",cls:"b-container",padding:b,defaults:{margin:c,labelWidth:"auto",labelStyle:"white-space: pre;"},items:e,hidden:d});
}}}return a;},createFilterItem:function(a){var b=null;switch(a.ControlType){case"combo":b=this.createCombo(a);break;case"Checkbox":b=this.createCheckBoxfield(a);break;case"colorpalette":b=this.createColorPalette(a);break;case"ColorPicker":b=this.createColorCombo(a);break;case"Switch":b=this.createSwitchfield(a);
break;case"ImageIcon":b=this.createImageIconfield(a);break;case"ToggleBtnSelector":b=this.createToggleBtnSelector(a);break;case"TextArea":b=this.createTextArea(a);}return b;},createToggleBtnSelector:function(f){var h=this;var e=this.widgetID;var b=false;var g="";var d="10 20 5 0";var c=false;var a="white-space: pre;";
if(f.internalName!=null&&f.internalName=="SummaryGraphType"){g="icon";comboWidth=195;d="5 20 5 0";a="margin: 3px 5px 0 0px;white-space: pre;";if(f.selHistoricalView!=null&&f.selHistoricalView=="false"){b=true;}else{b=false;}}else{if(f.internalName!=null&&f.internalName=="ColorPicker"){g="color";if(!isHighchartForGauge&&this.widgetType=="dialChart"){c=true;
}}}if(f.internalName!=null&&(f.internalName=="displayType"||f.internalName=="chartType")){g="icon";}return{xtype:"groupselection",id:f.internalName,fieldLabel:f.displayName,name:f.internalName,widgetID:e,radioType:g,hidden:c,labelStyle:a,margin:d,labelAlign:"left",labelWidth:96,disabled:b,items:f["filOptions"],listeners:{"change":function(m){if(myDashApp.getController("WidgetConfigurationController").validateWidgetConfiguration(m.widgetID)==false){return false;
}else{Ext.getCmp("doneButton").enable();if(h.isTopNWidget&&f.internalName=="displayType"){var k=Ext.getCmp("displayType");if(!Ext.isEmpty(k)){var l=k.getValue();if(l!=null&&l.hasOwnProperty("chartType")){var j=l.chartType;if(j!=null&&j=="bar"){var o=Ext.getCmp("ViewType");if(!Ext.isEmpty(o)){o.up("container").show();
o.show();}var n=Ext.getCmp("ColorPalette");if(!Ext.isEmpty(o)){n.up("container").show();n.show();}}else{var o=Ext.getCmp("ViewType");if(!Ext.isEmpty(o)){o.up("container").hide();o.hide();}var n=Ext.getCmp("ColorPalette");if(!Ext.isEmpty(o)){n.up("container").hide();n.hide();}}}}}myDashApp.getController("WidgetConfigurationController").showWidgetPreview(m.widgetID);
}}}};},createColorPalette:function(b){var c=this;var a=c.widgetID;var d=Ext.create("Ext.data.Store",{fields:["displayColor","displayField","valueField"],data:b["filOptions"]});var e="auto";if(c.widgetID!=null&&!c.widgetID.startsWith("TrendGraph_")){e=100;}return{xtype:"combo",editable:false,flex:1,store:new Ext.data.Store({fields:["displayField","valueField","displayColor"],data:[]}),cls:"dropdown colorPalette",displayField:"displayField",valueField:"valueField",displayColor:"displayColor",labelAlign:"left",labelWidth:e,labelSeparator:"",margin:"10 20 10 0",typeAhead:false,fieldLabel:screenLabelsObj["ColorPalette"],queryMode:"local",id:b.internalName,name:b.internalName,widgetID:a,displayTpl:Ext.create("Ext.XTemplate",['<tpl for=".">',"<div>",'<tpl for="displayColor">','<tpl for="colorCode">','<span style="padding:4px 4px;background:{value};margin:3px 1px 0px 0px;border:1px solid #2c2c2c;"></span>',"</tpl>","</tpl>",'<input type="text" id="PaletteId" style="display:none" value={valueField} />',"</div>","</tpl>"]),listConfig:{cls:"colorpalette-view",itemTpl:new Ext.XTemplate('<tpl for=".">','<tpl for="displayColor">','<tpl for="colorCode">','<span style="padding:4px 4px;background:{value};margin:2px 1px 2px 0px;float:left;border:1px solid #2c2c2c"></span>',"</tpl>","</tpl>",'<div style="clear:both"></div>',"</tpl>")},fieldSubTpl:['<div class="{hiddenDataCls}" role="presentation"></div>','<ul><li id="{id}" type="{type}" ','<tpl if="size">size="{size}" </tpl>','<tpl if="tabIdx">tabIndex="{tabIdx}" </tpl>','<div class="{fieldCls} {typeCls}" autocomplete="off"></div>','<div class="{clearCls}" role="presentation"></div>',"</li></ul>",{compiled:true,disableFormats:true}],setRawValue:function(g){var f=this;
g=Ext.value(g,"");f.rawValue=g;if(f.inputEl){f.inputEl.dom.innerHTML=g;}return g;},listeners:{"afterrender":function(f){if(f.widgetID!=null&&f.widgetID!="TrendGraph"){f.labelWidth=100;}f.getStore().loadRawData(b["filOptions"]);f.setValue(b.selectedValue);f.setEditable(false);},"beforeselect":function(f){myDashApp.getController("WidgetConfigurationController").validateWidgetConfiguration(f.widgetID);
},"select":function(f){Ext.getCmp("doneButton").enable();myDashApp.getController("WidgetConfigurationController").showWidgetPreview(f.widgetID);}}};},createImageIconfield:function(f){var c=this;var d="";var e="";var b=false;if((f.showIconStatus!=null&&f.showIconStatus=="no")){b=true;}if(f.enableImg!=null&&f.enableImg=="false"){b=true;
}if(f.selectedImg!=null){d=f.selectedImg;}if(d!=null&&d!=""){if(d.indexOf(":")>0&&d.startsWith("Default")){d=d.substring(d.indexOf(":")+1);if(d.indexOf("_")>-1){d=d.substring(0,d.lastIndexOf("_")+1)+"32";}e='<div id="customUserDefinedImgDefault" class="userDefinedImgDefault" style="padding:5px"><div id="digitalChartImgIcon"  class= "'+d+'" width="32px" height="32px" border="0px"/><div class="settingOver"></div></div>';
}else{d="/final/images/icon-library/"+loginUser+"/"+d;e='<div id="customUserDefinedImgDefault" class="userDefinedImgDefault" style="padding:5px"><img id="digitalChartImgIcon"  src="'+d+'" width="100%" height="100%" border="0px"/><div class="settingOver"></div></div>';}}else{d="/final/images/"+strSkin+"/listViewWidgetDefaultSmall.png";
e='<div id="customUserDefinedImgDefault" class="userDefinedImgDefault" style="padding:5px"><img id="digitalChartImgIcon"  src= "'+d+'" width="32px" height="32px" border="0px"/><div id="settingOver" class="settingOver"></div></div>';}var a={xtype:"container",id:f.internalName,name:f.internalName,width:42,height:42,disabled:b,listeners:{afterrender:function(h){}},setImageTriggerEvents:function(h){Ext.get(h.el).select(".userDefinedImgDefault").on("mouseenter",function(){var j=Ext.getCmp("ShowIcon").getValue();
if(j!=null&&j==true){Ext.get(h.el).select(".settingOver").update('<div class="userDefinedImgDefaultOver" style="display:block;padding:5px;"><table border="0px" cellpadding="0px" cellspacing="0px" width="100%" height="100%"><tr><td align="center" valign="middle"><a href="javascript:void(0)" id="customChangeImg"><span style="width:20px;height:20px;display:inline-block" class="iconOneClickImgDefaultChange"></span><br/></a></td></tr></table></div>');
Ext.get(h.el).select("#customChangeImg").on("click",function(){var k=Ext.create("MyDashBoard.view.IconLibrary",{from:"digitialChartWidget",windowId:"windowId",custUploadPath:"manager/tomcat/webapps/final/images/icon-library/"+loginUser+"/",profileName:"",widgetID:c.widgetID,widgetType:c.widgetType}).show();
c.items.first().add(k);k.on("close",function(){k.destroy();k="closed";});},Ext.get("customChangeImg"));}});Ext.get(h.el).select(".settingOver").on("mouseleave",function(){Ext.get(h.el).select(".settingOver").update("");});}};var g={xtype:"container",margin:"10 20 10 0",layout:{type:"column"},items:[{xtype:"label",cls:"x-form-item-label",margin:"12 10 0 0",text:screenLabelsObj["ChooseIconLbl"]},a]};
return g;},createSwitchfield:function(a){var d="10 0 0 10";var g=400;var f=false;var j=false;var b=false;var h=this.widgetID;var e=this.widgetType;if(a.displayName!=null&&a.displayName=="ChartSummaryEnabled"){a.displayName="Enable History View";}else{if(a.displayName!=null&&a.displayName=="UseStateColorForFonts"){a.displayName="Apply State Color For Font";
}else{if(a.displayName!=null&&a.displayName=="UseStateColorForBackground"){a.displayName="Apply State Color For Background";}else{if(a.displayName!=null&&a.displayName=="enableChartSummary"){a.displayName="Enable History View";d="10 0 10 10";}else{if(a.displayName!=null&&(a.displayName=="ShowGaugeCircle"||a.displayName=="Enable Full Dial")){a.displayName="Enable Full Dial";
if(!isHighchartForGauge){b=true;}}else{if(a.displayName!=null&&(a.displayName=="UseStateColorForGauge"||a.displayName=="Apply State Color For Gauge")){a.displayName="Apply State Color For Gauge";if(!isHighchartForGauge){b=true;}}else{if(a.displayName!=null&&a.displayName=="ShowIcon"){a.displayName="Show Icon";
if(a.HistoricalSelValue!=null&&a.HistoricalSelValue=="false"){j=true;}}else{if(a.displayName!=null&&a.displayName=="showChartSummary"){g=220;d="10 10 5 10";}else{if(a.displayName!=null&&a.displayName=="EnableMeasureStateColor"){a.displayName="Apply State Color";g=220;d="10 0 5 0";}else{if(a.internalName!=null&&a.internalName=="SortByPriority"){a.displayName=a.displayName+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
}}}}}}}}}}if(a.selectedValue!=null&&a.selectedValue=="yes"){f=true;}if((e!=null&&e=="liveMeasuresBox")&&showHealthStatusInLiveBox){b=true;}var c={xtype:"switchfield",disabled:j,name:a.internalName,id:a.internalName,fieldLabel:a.displayName,inputValue:"Yes",uncheckedValue:"No",labelSeparator:"",flex:1,hidden:b,labelAlign:"left",vertical:false,checked:a.checked,widgetID:h,listeners:{"render":function(k){if(k.id!=null&&(k.id=="enableChartSummary"||k.id=="SortByPriority")){k.margin="10 0 10 10";
}},"change":function(n){if(myDashApp.getController("WidgetConfigurationController").validateWidgetConfiguration(n.widgetID)==false){return false;}else{if(n.id=="UseStateColorForGauge"){if(n.getValue()==true){var l=Ext.getCmp("ColorPicker");l.hide();l.up("container").hide();}else{var l=Ext.getCmp("ColorPicker");
l.show();l.up("container").show();}}else{if(n.id=="SortByPriority"){if(n.getValue()==true){var m=Ext.getCmp("Priority");m.show();m.up("container").show();}else{var m=Ext.getCmp("Priority");m.hide();m.up("container").hide();}}else{if(n.id=="Stacked"){myDashApp.getController("WidgetConfigurationController").showStackedChart(n);
}else{if(n.id=="ShowValues"){var p=Ext.getCmp("enableChartSummary");var k=Ext.getCmp("SummaryGraphType");var o=Ext.getCmp("SetStateColorOn").getValue();if(n.getValue()==true){if(!Ext.isEmpty(p)&&!Ext.isEmpty(k)){if(o=="none"){p.setDisabled(false);k.setDisabled(false);}}}else{if(!Ext.isEmpty(p)&&!Ext.isEmpty(k)){p.setDisabled(true);
k.setDisabled(true);}}}}}}Ext.getCmp("doneButton").enable();myDashApp.getController("WidgetConfigurationController").showWidgetPreview(n.widgetID);}}}};return c;},createColorCombo:function(d){var c=this.widgetID;if(d.selectedValue!=null&&d.selectedValue=="default"){d.selectedValue=d.filOptions[0].valueField;
}if(d.displayName!=null&&d.displayName=="ColorPalette"){d.displayName="Color Picker";}var a=Ext.create("Ext.data.Store",{fields:["displayColor","displayField","valueField"],proxy:{type:"memory",reader:{type:"json",root:"filOptions"}},data:d});var b={xtype:"combo",editable:false,flex:1,store:a,cls:"dropdown colorPalette",displayField:"displayField",valueField:"valueField",displayColor:"displayColor",trigerAction:"all",labelAlign:"left",labelSeparator:"",typeAhead:false,fieldLabel:d.displayName,queryMode:"local",id:"colorPlt",name:"colorPlt",widgetID:c,listeners:{afterrender:function(){this.setValue(d.selectedValue);
},"beforeselect":function(e){myDashApp.getController("WidgetConfigurationController").validateWidgetConfiguration(e.widgetID);},"select":function(e){Ext.getCmp("doneButton").enable();myDashApp.getController("WidgetConfigurationController").showWidgetPreview(e.widgetID);}},displayTpl:Ext.create("Ext.XTemplate",['<tpl for=".">',"<div>",'<tpl for="displayColor">','<tpl for="colorCode">','<span style="padding:4px 4px;background:{value};margin:3px 1px 0px 0px;border:1px solid #2c2c2c;"></span>',"</tpl>","</tpl>",'<input type="text" id="palleteID" style="display:none" value={valueField} />',"</div>","</tpl>"]),listConfig:{itemTpl:new Ext.XTemplate('<tpl for=".">','<tpl for="displayColor">','<tpl for="colorCode">','<span style="padding:4px 4px;background:{value};margin:3px 1px 0px 0px;float:left;border:1px solid #2c2c2c"></span>',"</tpl>","</tpl>","</tpl>")},fieldSubTpl:['<div class="{hiddenDataCls}" role="presentation"></div>','<ul><li id="{id}" type="{type}" ','<tpl if="size">size="{size}" </tpl>','<tpl if="tabIdx">tabIndex="{tabIdx}" </tpl>','<div class="{fieldCls} {typeCls}" autocomplete="off"></div>','<div class="{clearCls}" role="presentation"></div>',"</li></ul>",{compiled:true,disableFormats:true}],setRawValue:function(f){var e=this;
f=Ext.value(f,"");e.rawValue=f;if(e.inputEl){e.inputEl.dom.innerHTML=f;}return f;}};return b;},createCheckBoxfield:function(c){var b=this.widgetID;var a={xtype:"checkboxgroup",layout:"hbox",vertical:true,labelSeparator:"",margin:"5 15 5 -4",padding:0,border:0,name:c.internalName,id:c.internalName,width:280,labelAlign:"top",fieldLabel:c.displayName,defaults:{allowBlank:false,labelSeparator:"",cls:"checkbt"},items:c.filOptions,widgetID:b,listeners:{"change":function(d){if(myDashApp.getController("WidgetConfigurationController").validateWidgetConfiguration(d.widgetID)==false){return false;
}else{Ext.getCmp("doneButton").enable();myDashApp.getController("WidgetConfigurationController").showWidgetPreview(d.widgetID);}}}};return a;},createTextArea:function(d){var c=this.widgetID;var b="";var e="";var g="10 0 10 0 ";var a="100%";if(d.internalName!=null&&d.internalName=="drillDown"){e=screenLabelsObj["Drill_Down_URL"];
if(this.widgetType=="ddTable"){g="10 10 10 20 ";a=250;}else{if(this.widgetType=="liveMeasuresBox"){g="10 0 10 25 ";}}}else{if(d.internalName!=null&&d.internalName=="excludeDesc"){e=screenLabelsObj["ExcludeDescriptors"];}}var f={xtype:"textareafield",width:a,fieldLabel:e,cls:"excludeDesc text-area  min-height-textbox",labelSeparator:"",labelWidth:100,labelAlign:"top",id:d.internalName,emptyText:"",enableKeyEvents:true,minHeight:63,autoScroll:true,rows:1,isEnableDoneButton:false,listeners:{"keyup":function(h){if(!h.isEnableDoneButton){var j=Ext.getCmp("doneButton");
j.enable();}}}};return f;},createCombo:function(b){var h=this.widgetID;var e="10 10 10 10";var c=false;var a=195,f=100;if(b.selectedValue!=null&&b.selectedValue=="default"){b.selectedValue=b.filOptions[0].value;}var g=Ext.create("Ext.data.Store",{fields:["displayField","valueField"],proxy:{type:"memory",reader:{type:"json",root:"optsArr"}},data:b["filOptions"]});
if(b.internalName!=null&&b.internalName=="GraphicalType"){a=195;isTopNWidget=true;topNVal=b.selectedValue;}var j=false;if(b.internalName!=null&&b.internalName=="SummaryGraphType"){a=195;f=100;defaultMargin="6 20 0 0";if(b.selHistoricalView!=null&&b.selHistoricalView=="false"){j=true;}else{j=false;}}else{if(b.internalName!=null&&(b.internalName=="chartType"||b.internalName=="Statistics")){a=185;
f=100;}else{if(b.internalName!=null&&b.internalName=="Aggregation_Function"){a=150;}else{if(b.internalName!=null&&b.internalName=="SetStateColorOn"){a=195;e="10 0 10 0";if(b.ShowSetColorASValue!=null&&b.ShowSetColorASValue=="false"){c=true;j=true;}else{c=false;j=false;}}else{if(b.internalName!=null&&b.internalName=="ViewType"){a=160;
f=70;}else{if(b.internalName!=null&&b.internalName=="Priority"){if(h!=null&&(h.startsWith("TimelineChart")||h.startsWith("combinationChart")||h.startsWith("areaChart")||h.startsWith("TrendGraph"))){if(b.sortByPriorityEnabled!=null&&b.sortByPriorityEnabled=="yes"){c=false;}else{c=true;}}}}}}}}var d={xtype:"scrollcombo",editable:true,forceSelection:true,store:g,cls:"dropdown",displayField:"displayField",valueField:"valueField",trigerAction:"all",fieldLabel:b.displayName,value:b.selectedValue,itemId:b.internalName,labelAlign:"left",width:a,width:a,labelWidth:f,labelSeparator:"",margin:"10 20 10 0",queryMode:"local",id:b.internalName,name:b.internalName,disabled:j,hidden:c,widgetID:h,listeners:{"afterrender":function(l){if(b.internalName=="Priority"){if(l.hidden==true){l.up("container").hide();
}else{l.up("container").show();}}else{if(b.internalName=="widgetType"){var k=Ext.getCmp("UseStateColorForBackground");if(!Ext.isEmpty(k)){if(b.selectedValue=="tableview"){k.up("container").hide();}else{k.up("container").show();}}}}},"beforeselect":function(k){myDashApp.getController("WidgetConfigurationController").validateWidgetConfiguration(k.widgetID);
},"select":function(n){Ext.getCmp("doneButton").enable();myDashApp.getController("WidgetConfigurationController").showWidgetPreview(n.widgetID);if(n.id=="SetStateColorOn"){var p=Ext.getCmp("enableChartSummary");var l=Ext.getCmp("SummaryGraphType");var o=n.getValue();var k=Ext.getCmp("ShowValues").getValue();
if(o=="none"){if(!Ext.isEmpty(p)&&!Ext.isEmpty(l)){if(k==true){p.setDisabled(false);l.setDisabled(false);}}}else{if(!Ext.isEmpty(p)&&!Ext.isEmpty(l)){p.setDisabled(true);l.setDisabled(true);}}}else{if(n.id=="widgetType"){var m=Ext.getCmp("UseStateColorForBackground");if(!Ext.isEmpty(m)){if(n.getValue()=="tableview"){m.up("container").hide();
}else{m.up("container").show();}}}}}}};if(b.internalName!=null&&b.internalName=="Timeline"){d.timelineOpts=b["filOptions"];d.selectedValue=b.selectedValue;}return d;},createConfigurationWindowLayout:function(){return createConfigurationWindowLayout(false);},createConfigurationWindowLayout:function(K){var ad=this;
var T="";var n=[];var R=this.widgetID;var r=true;if(R!=null){T=R.substr(0,R.indexOf("_"));}var S=[];if(T!=null&&(T=="CombinedTimelineChart"||T=="TimelineChart"||T=="combinationChart"||T=="BarChart"||T=="table"||T=="areaChart"||T=="TrendGraph"||T=="pieChart"||T=="activityChart"||T=="heatMapChart"||T=="health")){ad.showConfigurationTab=true;
}var w=false;if(T=="BarChart"||T=="table"||T=="TimelineChart"||T=="areaChart"||T=="TrendGraph"||T=="CombinedTimelineChart"||T=="combinationChart"||T=="TopNAnalysis"){w=true;}var V=[];var p={};if(ad.showConfigurationTab){var N=true;var r=true;if(this.widgetType!=null&&(this.widgetType=="table"||this.widgetType=="BarChart"||this.widgetType=="pieChart"||this.widgetType=="activityChart")){N=false;
}else{if(this.widgetType!=null&&T=="combinationChart"){r=false;}}var B={};ad.configOptsMap={};ad.configOptsMap["test"]={id:"test",ctrlType:"dropdown",Label:"Test",emptyText:"Select a Test"};ad.configOptsMap["measure"]={id:"measure",ctrlType:"multiselect",Label:screenLabelsObj["Measures"],searchText:screenLabelsObj["SearchMeasures"]};
ad.configOptsMap["componentType"]={id:"componentType",ctrlType:"dropdown",Label:"Component Type",emptyText:"Select a Component Type"};if(T!=null&&(T=="pieChart"||T=="activityChart")){ad.configOptsMap["component"]={id:"component",ctrlType:"dropdown",Label:"Component",emptyText:"Please select a Component"};
}else{ad.configOptsMap["component"]={id:"component",ctrlType:"multiselect",Label:"Component",searchText:screenLabelsObj["SearchComponents"]};}ad.configOptsMap["descriptor"]={id:"descriptor",ctrlType:"multiselect",Label:"Descriptor",searchText:screenLabelsObj["SearchDescriptors"]};var O=[];var ac=false;
if(T=="CombinedTimelineChart"||T=="TimelineChart"||T=="combinationChart"||T=="areaChart"||T=="TrendGraph"){ac=true;}var aa=false;if(T!=null&&(T=="areaChart"||T=="TimelineChart")){aa=true;}var k=[];var A=false;if(T=="BarChart"||T=="table"||T=="pieChart"||T=="activityChart"||T=="heatMapChart"){var W=false;
k.push({xtype:"switchfield",name:"showAggOpt",id:"showAggOpt",fieldLabel:"Aggregate Descriptors",inputValue:"Yes",labelSeparator:"",uncheckedValue:"No",margin:"10 0 5 0",width:130,labelAlign:"top",labelWidth:80,vertical:false,checked:W});k.push({xtype:"scrollcombo",cls:"dropdown aggregate",fieldLabel:"Aggregate Function",id:"aggOptions",name:"aggOptions",labelAlign:"top",labelSeparator:"",hidden:true,labelStyle:"white-space: nowrap;",width:56,labelWidth:108,margin:"10 0 0 5",store:Ext.create("Ext.data.Store",{fields:["displayField","valueField"],data:[]}),editable:true,forceSelection:true,displayField:"displayField",valueField:"valueField",queryMode:"local"});
A=true;}if(ac){var c=[];if(aa){c.push({xtype:"textfield",id:"yMax",name:"name",fieldLabel:"Y Axis Maximum Limit",labelSeparator:"",cls:"textbox",width:150,labelWidth:55,emptyText:"",labelPad:0,margin:"5 15 0 0",allowBlank:true,layout:"hbox"});}c.push({xtype:"mydashboardtimeline",id:"timelineMyObj",name:"timelineMyObj",margin:"0 0 0 0",flex:1,addDurationCombo:T!=null&&(T=="TrendGraph")?true:false,gtype:T!=null&&(T=="TrendGraph")?"trend":"",hideMinutes:false,layout:"hbox"});
O.push({xtype:"container",layout:"hbox",width:"90%",defaults:{labelAlign:"top",},margin:"0 0 0 0",padding:"0 0 0 0",items:c});}var ab=[];ab=[{"columns":["test","measure"]},{"columns":["componentType","component"]},{"columns":["descriptor"]}];var x=[];for(var o in ab){var M=ab[o];var q=M["columns"];var a=10;
var G=[];if(q.length==1){if(A){G.push({xtype:"container",layout:"hbox",width:"90%",defaults:{labelAlign:"top",},margin:"0 0 1 0",padding:"0 0 0 0",items:k});a=10;}else{a=60;}}for(var H in q){var h=q[H];var ae=ad.configOptsMap[h];if(ae["ctrlType"]=="multiselect"){var C=[];C.push({xtype:"label",id:ae.id+"ComboLbl",name:ae.id+"ComboLbl",margin:"0px 0px 0px 0px",text:ae.Label,labelClsExtra:"icon-properties item-label-icon",});
C.push({xtype:"button",cls:"iconButtonClass iconMultiselectExpand",margin:"0 0 8 8",style:{"border":"none"},id:ae.id+"ExpandSelector",name:ae.id+"ExpandSelector",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:ae.Label});
}},});var t=false;if(w&&ad.autoAssociateComponents&&((h!=null&&h=="component")||(h!=null&&h=="descriptor"))){t=true;G.push({xtype:"container",layout:{type:"vbox",align:"stretch"},width:280,margin:a+"px 0px 0px 0px",items:[{xtype:"label",margin:"0px 0px 0px 0px",id:h+"LblObj",cls:"x-form-item-label",text:h},{xtype:"label",margin:"0px 0px 0px 0px",cls:"x-form-item-label",id:"all"+h+"LblObj",text:"All "+h+"s"}]});
}G.push({xtype:"container",layout:{type:"hbox",align:"stretch"},width:280,margin:a+"px 0px 0px 0px",hidden:t,id:ae.id+"_OuterContainer",defaults:{labelAlign:"top",labelSeparator:"",align:"top",},items:C});G.push(ad.createMultiSelectbox(ae.id,ae.searchText));}else{G.push(ad.createSingleSelectBox(ae.id,ae.Label,ae.emptyText));
}}x.push({xtype:"panel",flex:1,layout:{type:"vbox"},cls:"measureMultiSelectOuterBoxlisting",id:"",defaults:{labelAlign:"top",labelSeparator:""},items:G});}O.push({xtype:"container",layout:{type:"hbox",align:"stretch",pack:"center"},flex:1,width:"100%",cls:"editWidgetWindowInner",items:x});O.push({xtype:"toolbar",dock:"bottom",style:{"border-top":strSkin=="Light"?"#cdcdcd 1px solid !important":"#404040 1px solid !important",},height:47,width:"100%",layout:{align:"middle",pack:"center",type:"hbox"},margin:"0 10 4 0",items:[{xtype:"button",id:"addNewGridData",text:screenLabelsObj["AddBtnLbl"],margin:"0 10 0 0",padding:"4 15",cls:"editWidgetWinBtn"},{xtype:"button",text:screenLabelsObj["FinishBtnLbl"],id:"finishButton",margin:"0 0 0 0",padding:"4 15",cls:"editWidgetWinBtn",handler:function(){var af=Ext.getCmp("configureBtn");
if(af.pressed){Ext.getCmp("configFormFields").hide();Ext.getCmp("configSettings").show();af.pressed=false;}else{Ext.getCmp("configFormFields").show();Ext.getCmp("configSettings").hide();}var ag=Ext.getCmp("doneButton");ag.enable();ag.show();}}]});n.push({xtype:"panel",layout:{type:"vbox"},width:"100%",height:395,cls:"",modal:true,id:"configFormFields",cls:"editWidgetWindow",hidden:true,defaults:{labelAlign:"left",labelSeparator:""},margin:"0 10 0 10",padding:"10 0 0 10",items:O});
V.push({xtype:"container",layout:{type:"vbox"},width:"100%",id:"configureButtonId",cls:"",defaults:{labelAlign:"left",labelSeparator:""},margin:"0 10 0 10",padding:"0",items:[{xtype:"panel",cls:"configureBtnPanel",width:"100%",height:7,},{xtype:"button",text:screenLabelsObj["ConfigureBtnLbl"],id:"configureBtn",cls:"configureBtn",margin:"0 0 0 15",enableToggle:true,padding:"4 10",listeners:{toggle:function(ag,ah,af){if(ah){$("#configFormFields").slideDown(300);
Ext.getCmp("configFormFields").show();Ext.getCmp("configSettings").hide();$("#configFormFields").slideDown(300);Ext.getCmp("doneButton").hide();}else{Ext.getCmp("configFormFields").hide();$("#configFormFields").slideUp(300);Ext.getCmp("configSettings").show();Ext.getCmp("doneButton").show();}}}}]});p={xtype:"panel",width:"100%",id:"",cls:"",items:{xtype:"comparisontable",isAggregationDisabled:N,isCombinationChart:r,hidden:false}};
}else{var B={};ad.configOptsMap={};ad.configOptsMap["test"]={id:"test",ctrlType:"dropdown",Label:"Test",emptyText:"Select a Test"};var P=false;var Q=false;var Y=false;if(T!=null&&T=="liveMeasuresBox"){P=true;ad.configOptsMap["measure"]={id:"measure",ctrlType:"multiselect",Label:"Measures",searchText:screenLabelsObj["SearchMeasures"]};
}else{ad.configOptsMap["measure"]={id:"measure",ctrlType:"dropdown",Label:"Measures",searchText:"Please select a measure"};}ad.configOptsMap["componentType"]={id:"componentType",ctrlType:"dropdown",Label:"Component Type",emptyText:"Select a Component Type"};if(ad.isTopNWidget){ad.configOptsMap["component"]={id:"component",ctrlType:"multiselect",Label:"Component",searchText:screenLabelsObj["SearchComponents"]};
}else{ad.configOptsMap["component"]={id:"component",ctrlType:"dropdown",Label:"Component",emptyText:"Please select a component"};}if(T!=null&&T=="ddTable"){Y=true;P=true;ad.configOptsMap["ddColumns"]={id:"ddColumns",ctrlType:"multiselect",Label:"DD Columns",searchText:"search DD Column(s)"};ad.configOptsMap["chartType"]={id:"chartType",ctrlType:"dropdown",Label:"Graphical Type",emptyText:"Select a graphical type"};
ad.configOptsMap["summarizeDDColumn"]={id:"summarizeDDColumn",ctrlType:"dropdown",Label:"Summarize DD Data By (Y axis)",searchText:"search DD column(s)"};}else{if(ad.isTopNWidget){ad.configOptsMap["descriptor"]={id:"descriptor",ctrlType:"multiselect",Label:"Descriptor",searchText:screenLabelsObj["SearchDescriptors"]};
}else{ad.configOptsMap["descriptor"]={id:"descriptor",ctrlType:"dropdown",Label:"Descriptor",searchText:"Please select a descriptor"};}}var ab=[];if(T=="ddTable"){ab=[{"columns":["chartType"]},{"columns":["componentType"]},{"columns":["component"]},{"columns":["test"]},{"columns":["measure"]},{"columns":["summarizeDDColumn"]},{"columns":["ddColumns"]}];
}else{if(ad.isTopNWidget){ab=[{"columns":["test","measure","componentType"]},{"columns":["component"]},{"columns":["descriptor"]}];}else{if(T=="liveMeasuresBox"){ab=[{"columns":["componentType"]},{"columns":["component"]},{"columns":["test"]},{"columns":["measure"]},{"columns":["descriptor"]}];}else{ab=[{"columns":["componentType","measure"]},{"columns":["component","descriptor"]},{"columns":["test"]}];
}}}var x=[];var X=[];var U=[];for(var o in ab){var M=ab[o];var q=M["columns"];var G=[];for(var H in q){var h=q[H];var ae=ad.configOptsMap[h];if(ae["ctrlType"]=="multiselect"){var d=280;if(P){d=220;}if(P){if(ae.id!=null&&ae.id=="measure"||ae.id=="ddColumns"){var F={};F["labelAlign"]="top";F["width"]=d;
U.push({xtype:"container",layout:{type:"hbox",align:"stretch"},width:d,margin:"10px 0px 8px 0px",id:ae.id+"_OuterContainer",defaults:{labelAlign:"top",labelSeparator:"",align:"top",},items:[{xtype:"label",cls:"x-form-item",id:ae.id+"ComboLbl",name:ae.id+"ComboLbl",margin:"0px 0px 0px 0px",text:ae.Label,labelClsExtra:"icon-properties item-label-icon",},{xtype:"button",cls:"iconButtonClass iconMultiselectExpand",margin:"0 0 0 8",style:{"border":"none"},id:ae.id+"ExpandSelector",name:ae.id+"ExpandSelector",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:ae.Label});
}},}]});U.push(ad.createMultiSelectbox(ae.id,ae.searchText,F));}else{X.push(ad.createMultiSelectbox(ae.id,ae.searchText));}}else{var C=[];C.push({xtype:"label",cls:"x-form-item",id:ae.id+"ComboLbl",name:ae.id+"ComboLbl",margin:"0px 0px 0px 0px",text:ae.Label,labelClsExtra:"icon-properties item-label-icon",});
C.push({xtype:"button",cls:"iconButtonClass iconMultiselectExpand",margin:"0 0 8 8",style:{"border":"none"},id:ae.id+"ExpandSelector",name:ae.id+"ExpandSelector",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:ae.Label});
}},});var t=false;if(w&&ad.autoAssociateComponents&&((h!=null&&h=="component")||(h!=null&&h=="descriptor"))){t=true;G.push({xtype:"container",layout:{type:"hbox",align:"stretch"},width:d,margin:"10px 0px 0px 0px",items:[{xtype:"label",margin:"0px 0px 0px 0px",cls:"x-form-item-label",id:h+"LblObj",text:h},{xtype:"label",margin:"0px 0px 0px 0px",cls:"x-form-item-label",id:"all"+h+"LblObj",text:"All "+h+"s"}]});
}G.push({xtype:"container",layout:{type:"hbox",align:"stretch"},width:d,margin:"10px 0px 0px 0px",hidden:t,id:ae.id+"_OuterContainer",defaults:{labelAlign:"top",labelSeparator:"",align:"top",},items:C});G.push(ad.createMultiSelectbox(ae.id,ae.searchText));}}else{if(P){var F={};F["labelAlign"]="top";F["width"]=220;
if(ae.id!=null&&(ae.id!="descriptor"&&ae.id!="measure")){if(ae.id!=null&&ae.id=="summarizeDDColumn"){U.push(ad.createSingleSelectBox(ae.id,ae.Label,ae.emptyText,F));}else{X.push(ad.createSingleSelectBox(ae.id,ae.Label,ae.emptyText,F));}}else{if(Y){X.push(ad.createSingleSelectBox(ae.id,ae.Label,ae.emptyText,F));
}else{U.push(ad.createSingleSelectBox(ae.id,ae.Label,ae.emptyText,F));}}}else{G.push(ad.createSingleSelectBox(ae.id,ae.Label,ae.emptyText));}}}if(!P){x.push({xtype:"panel",layout:{type:"vbox",align:"stretch",pack:"start"},flex:1,padding:"0 0 0 0",margin:"0px 10px 0px 10px",defaults:{labelAlign:"top",labelSeparator:""},items:G});
}}if(this.widgetID.startsWith("ScatterPlot")){p={xtype:"tabpanel",id:"scatterTab",ui:"newTabPanel4",items:[{title:"Configure X Axis",itemId:"x_Axis",id:"x_Axis",style:{"box-shadow":"none","background":"none"},layout:{type:"hbox",align:"stretch"},padding:"7 10 26 10",bodyPadding:"0 0 0 0",margin:"0 0  0  0",defaults:{labelAlign:"top",labelSeparator:""},items:x},{title:"Configure Y Axis",itemId:"y_Axis",id:"y_Axis",style:{"box-shadow":"none","background":"none"},layout:{type:"hbox",align:"stretch"},padding:"7 10 26 10",bodyPadding:"0 0 0 0",margin:"0 0  0  0",defaults:{labelAlign:"top",labelSeparator:""},items:[]}],listeners:{"tabchange":function(aj,ai){if(ai.id=="y_Axis"){var ag=Ext.getCmp("scatterTab");
ag.isYAxisTabLoaded=true;var af=Ext.getCmp("x_Axis");af.removeAll();var ah=Ext.getCmp("y_Axis");ah.add(x);af.setDisabled(true);ad.loadDefaultDataforScatterPlotConfigurationTab("yAxis");}else{var ah=Ext.getCmp("y_Axis");ah.removeAll();var af=Ext.getCmp("x_Axis");af.add(x);ah.setDisabled(true);ad.loadDefaultDataforScatterPlotConfigurationTab("xAxis");
}}}};}else{if(!Ext.isEmpty(T)&&(T!="liveMeasuresBox"&&T!="ddTable")){var L="0 10 10 10";var j="0 0 0 0";if(T=="dialChart"||T=="digitalChart"){L="0 10 15 10";j="10 0 0 0";}p={xtype:"fieldset",title:"Configure Metrics",cls:"configWinFieldsetNew",ui:"newFieldSetHeader",collapsible:false,style:{"box-shadow":"none","background":"none"},layout:{type:"hbox",align:"stretch"},padding:L,bodyPadding:"0 0 0 0",margin:j,defaults:{labelAlign:"top",labelSeparator:""},items:x};
}else{var E="vbox";var L="0 10 10 15";if(!Ext.isEmpty(T)&&T=="ddTable"){E="column";I="7 10 0 0";}if(!Ext.isEmpty(T)&&T=="liveMeasuresBox"){E="column";columnWidth:0.5,I="7 10 0 0";}p={xtype:"container",width:380,cls:"widget_config_form",layout:{type:E},id:"settingsContObj",defaults:{labelAlign:"top",columnWidth:1,labelSeparator:""},margin:I,padding:"0 0 0 0"};
}}}var v=false;var D=false;var y="";var e=Ext.getCmp(R);if(!Ext.isEmpty(e)){v=e.isChart;D=e.isTopNChart;y=e.title;}if(this.isKpi){if(T!=null&&T=="digitalChart"){y="Digital Chart";}if(T!=null&&T=="dialChart"){y="Gauge Meter";}}var f=280;if(T!=null&&(T=="dialChart"||T=="digitalChart")){f=200;}var J=false;
if(ad!=null&&ad.action=="editWidget"){J=true;}var m=400;var Z=250;var l=this.widgetPreviewDimensions[T];if(!Ext.isEmpty(l)){m=l[0];Z=l[1];}var g={};if(Y){var z={xtype:"fieldset",title:"Metrics Configuration",cls:"configWinFieldsetNew",ui:"newFieldSetHeader",collapsible:false,style:{"box-shadow":"none","background":"none"},layout:{type:"column"},height:250,scroll:true,autoScroll:true,defaults:{labelAlign:"top",columnWidth:1,labelSeparator:""},bodyPadding:"0 0 10 0",margin:"10 0 0 0",padding:"0 0 10 10",items:[{xtype:"container",columnWidth:0.5,margin:"0 10 0 10",items:X},{xtype:"container",columnWidth:0.5,margin:"0 10 0 10",items:U}]};
g={xtype:"container",width:500,cls:"widget_config_form",layout:{type:"column"},id:"controllerSetting",defaults:{labelAlign:"top",columnWidth:1,labelSeparator:""},margin:"0 0 0 0",padding:"0 0 0 0",items:z};}else{if(P){var z={xtype:"fieldset",title:"Metrics Configuration",cls:"configWinFieldsetNew",ui:"newFieldSetHeader",collapsible:false,style:{"box-shadow":"none","background":"none"},layout:{type:"column"},defaults:{labelAlign:"top",columnWidth:1,labelSeparator:""},margin:"10 0 0 0",padding:"0 0 10 10",items:[{xtype:"container",columnWidth:0.5,margin:"0 10 0 10",items:X},{xtype:"container",columnWidth:0.5,margin:"0 10 0 10",items:U}]};
g={xtype:"container",width:500,cls:"widget_config_form",layout:{type:"column"},id:"controllerSetting",defaults:{labelAlign:"top",columnWidth:1,labelSeparator:""},margin:"0 0 0 0",padding:"0 0 0 0",items:z};}else{var I="0 0 0 0";if(D){I="7 10 5 10";}else{if(T!=null&&(T=="dialChart"||T=="digitalChart")){I="7 0 0 0";
}}g={xtype:"container",width:380,height:(D)?210:"100%",cls:"widget_config_form",layout:{type:"column"},id:"controllerSetting",disabledCls:"my-disabled-panel",disabled:(ad.action=="addWidget"?true:false),defaults:{labelAlign:"top",columnWidth:1,labelSeparator:""},margin:I,padding:"0 0 0 0"};}}var u="4 20 0 10";
var s="0 0 2 0";var b="1 0 5 0";if(D){u="7 10 0 10";s="0 0 2 0";b="1 0 0 0";}else{if(T!=null&&T=="activityChart"){u="0 20 7 0";s="3 0 0 0";b="0 0 8 0";}else{if(T!=null&&T=="areaChart"){u="0 20 5 0";s="0 0 0 0";b="3 0 5 0";}else{if(T!=null&&T=="BarChart"){u="0 20 5 0";s="0 0 0 0";b="5 0 5 0";}else{if(T!=null&&T=="combinationChart"){u="5 20 5 0";
s="0 0 0 0";b="0 0 0 0";}else{if(T!=null&&T=="digitalChart"){u="5 20 0 0";s="0 0 5 0";b="10 0 0 0";}else{if(T!=null&&T=="dialChart"){u="5 20 0 0";s="0 0 0 0";b="5 0 0 0";}else{if(T!=null&&T=="heatMapChart"){u="0 20 5 0";s="5 0 0 0";b="0 0 0 0";}else{if(T!=null&&T=="CombinedTimelineChart"){u="0 20 0 0";
s="5 0 5 0";b="0 0 0 0";}else{if(T!=null&&T=="pieChart"){u="0 20 5 0";s="5 0 0 0";b="0 0 0 0";}else{if(T!=null&&T=="table"){u="0 20 10 0";s="15 0 0 0";b="0 0 0 0";}else{if(T!=null&&T=="TimelineChart"){u="0 20 5 0";s="5 0 0 0";b="0 0 0 0";}else{if(T!=null&&T=="TrendGraph"){u="0 20 5 0";s="5 0 0 0";b="0 0 0 0";
}else{if(T!=null&&T=="ScatterPlot"){u="0 20 5 0";s="10 0 5 0";b="5 0 10 0";}else{if(T!=null&&T=="vmAlarmsWidget"){u="0 20 0 0";s="0 0 0 0";b="0 0 0 0";}else{if(T!=null&&(T=="dialChart"||T=="digitalChart")){u="7 20 0 0";s="0 0 2 0";}else{if(P){u="10 20 0 10";}}}}}}}}}}}}}}}}}V.push({xtype:"panel",id:"configSettings",cls:"configSettingsWindow",flex:1,border:true,padding:b,bodyPadding:"0 10 0 10",scroll:true,autoScroll:true,layout:{type:"vbox",align:"stretch"},defaults:{labelAlign:"top",labelSeparator:""},margin:"0 0 0 0",items:[{xtype:"panel",margin:"0 0 5 0",padding:s,layout:{type:"hbox",pack:"center",},items:[{xtype:"previewcontiner",margin:u,width:m,height:Z,isConfigured:J,items:[{xtype:"portlet",width:m-23,height:Z-23,id:R+"_previewImage",title:y,ui:"newGraphPanel",cls:"previewImage",margin:"0 0 0 0",isChart:v,isTopNChart:D,showMoreDataOption:false,isPreviewMode:true}]},g]},p]});
n.push({xtype:"panel",cls:"outer",flex:1,layout:{type:"vbox",align:"stretch"},border:false,padding:"0 0",items:V});return{xtype:"form",layout:{type:"vbox",align:"stretch"},id:"widgetConfigForm",name:"widgetConfigForm",itemId:"configForm",cls:"form",flex:1,fullscreen:true,scroll:true,autoScroll:true,border:false,padding:"0 0",items:n,listeners:{"afterrender":function(){if(K){ad.loadPopupData(true);
}}}};},createConfiguartionForServiceHealthWidget:function(){return createConfiguartionForServiceHealthWidget(false);},createConfiguartionForServiceHealthWidget:function(j){var m=this.widgetID;var g=false;var e=false;var b="";var h=Ext.getCmp(m);if(!Ext.isEmpty(h)){g=h.isChart;e=h.isTopNChart;b=h.title;
}var p=400;var d=250;var f=this.widgetPreviewDimensions[this.widgetType];if(!Ext.isEmpty(f)){p=f[0];d=f[1];}var a=new Array();var l={xtype:"label",id:"healthCenterComponentComboLbl",name:"healthCenterComponentComboLbl",margin:"0px 10px 0px 0px",style:{"font-family":"Roboto","padding":"0 0 4px 0"},text:"Components",};
var o={xtype:"container",layout:{type:"vbox",align:"stretch"},width:230,cls:"darkbox",height:125,id:"compTypeBOX",items:[{xtype:"trigger",margin:"10",id:"healthCenterComponentSearchTextBox",name:"healthCenterComponentSearchTextBox",width:178,cls:"whitedropdown_search",emptyText:"Search",componentStore:null,hidden:true,listeners:{"change":function(w,v,r,s){var t=this;
var q=t.componentStore;if(q==null){t.componentStore=this.up("form").getForm().findField("healthCenterComponentCombo").getStore();q=t.componentStore;}if(v=="*"){q.clearFilter();}else{if(v.lastIndexOf("*")==(v.length-1)){v=v.substr(0,(v.length-1));}q.clearFilter();if(v){var u=new RegExp(Ext.String.escapeRegex(v),"i");
q.filter({filterFn:function(x){return u.test(x.get("displayField"));}});}w.focus();}}}},{xtype:"multiselect",id:"healthCenterComponentCombo",baseCls:"egmultiselect",name:"healthCenterComponentCombo",multiSelect:true,height:82,hidden:true,store:Ext.create("Ext.data.Store",{fields:["displayField","valueField","editedCompName"],data:[]}),editable:false,displayField:"displayField",valueField:"valueField",queryMode:"local",listConfig:{id:"componentListC",itemTpl:new Ext.XTemplate('<tpl for=".">','<div id="{valueField}"  style="text-align:left">{displayField}</div>',"</tpl>"),listeners:{}}}]};
var k={xtype:"label",id:"healthCenterVMComboLbl",name:"healthCenterVMComboLbl",hidden:true,margin:"10px 10px 0px 0px",style:{"font-family":"Roboto","padding":"0 0 4px 0"},text:"VM:",};var c={xtype:"container",layout:{type:"vbox",align:"stretch"},width:230,cls:"darkbox",height:125,id:"compVmBOX",hidden:true,items:[{xtype:"trigger",margin:"10",id:"healthCenterVMSearchTextBox",name:"healthCenterVMSearchTextBox",width:178,cls:"whitedropdown_search",emptyText:"Search",componentStore:null,hidden:false,listeners:{"change":function(w,v,r,s){var t=this;
var q=t.componentStore;if(q==null){t.componentStore=this.up("form").getForm().findField("vmListCombo").getStore();q=t.componentStore;}if(v=="*"){q.clearFilter();}else{if(v.lastIndexOf("*")==(v.length-1)){v=v.substr(0,(v.length-1));}q.clearFilter();if(v){var u=new RegExp(Ext.String.escapeRegex(v),"i");
q.filter({filterFn:function(x){return u.test(x.get("displayField"));}});}w.focus();}}}},{xtype:"multiselect",id:"vmListCombo",baseCls:"egmultiselect",name:"vmListCombo",multiSelect:true,height:82,store:Ext.create("Ext.data.Store",{fields:["displayField","valueField","editedCompName"],data:[]}),editable:false,displayField:"displayField",valueField:"valueField",queryMode:"local",listConfig:{id:"vmsList",itemTpl:new Ext.XTemplate('<tpl for=".">','<div id="{valueField}"  style="text-align:left">{displayField}</div>',"</tpl>"),listeners:{}}}]};
a.push(l);a.push(o);a.push(k);a.push(c);var n={xtype:"container",layout:{type:"vbox",align:"stretch"},autoScroll:true,width:540,height:282,flex:1,cls:"",margin:"0 0 0 0",padding:"0 0 0 0",items:[{xtype:"container",layout:{type:"hbox"},padding:0,defaults:{margin:"10 0 10 20 ",labelWidth:"auto",labelSeparator:"",labelStyle:"white-space: pre;"},items:[{xtype:"container",padding:0,defaults:{margin:"0 10 10 20 ",labelWidth:"auto",labelSeparator:"",labelStyle:"white-space: pre;"},items:[{xtype:"scrollcombo",id:"categoryOpts",name:"categoryOpts",hidden:false,selectOnTab:true,editable:true,forceSelection:true,labelAlign:"top",width:220,margin:"-5 0 10 0",fieldLabel:"Category",displayField:"displayField",valueField:"valueField",store:Ext.create("Ext.data.Store",{fields:["displayField","valueField"],data:[]}),lazyRender:true,editable:true,forceSelection:true,queryMode:"local"},{xtype:"scrollcombo",cls:"dropdown",labelAlign:"top",fieldLabel:"Component Type",id:"healthCenterCompTypeCombo",name:"healthCenterCompTypeCombo",hidden:true,width:220,margin:"5 0 10 0",store:Ext.create("Ext.data.Store",{fields:["displayField","valueField"],data:[]}),editable:true,forceSelection:true,displayField:"displayField",valueField:"valueField",queryMode:"local"},{xtype:"scrollcombo",cls:"dropdown",fieldLabel:"Component",labelAlign:"top",id:"healthCenterCompScrollCombo",name:"healthCenterCompScrollCombo",hidden:true,width:220,margin:"5 0 10 0",store:Ext.create("Ext.data.Store",{fields:["displayField","valueField"],data:[]}),editable:true,forceSelection:true,displayField:"displayField",valueField:"valueField",queryMode:"local"},{xtype:"scrollcombo",cls:"dropdown",fieldLabel:"Test",labelAlign:"top",id:"healthCenterTestScrollCombo",name:"healthCenterTestScrollCombo",hidden:true,width:220,margin:"5 0 10 0",store:Ext.create("Ext.data.Store",{fields:["displayField","valueField"],data:[]}),editable:true,forceSelection:true,displayField:"displayField",valueField:"valueField",queryMode:"local"},{xtype:"checkboxgroup",width:220,id:"legandCheckBox",margin:"0 0 20 -4",defaults:{margin:"5 0 0 0",},labelWidth:220,labelAlign:"top",labelStyle:"margin: 4px 0 0 0px; padding: 0;",labelSeparator:"",fieldLabel:legendDisplayLbl,columns:2,widgetID:m,hidden:true,items:[{boxLabel:"Descriptors",id:"showDescOpt",name:"showDescOpt",hidden:false,inputValue:"yes",cls:"checkbt",},{boxLabel:"Servers",id:"showServersOpt",name:"showServersOpt",hidden:false,inputValue:"yes",cls:"checkbt",}],listeners:{"change":function(q){if(myDashApp.getController("WidgetConfigurationController").validateWidgetConfiguration(q.widgetID)==false){return false;
}else{Ext.getCmp("doneButton").enable();myDashApp.getController("WidgetConfigurationController").showWidgetPreview(q.widgetID);}}}},{xtype:"switchfield",name:"Enable Legend",id:"enableLegendOpt",widgetID:m,defaults:{margin:"5 0 20 10",},labelWidth:100,fieldLabel:"Enable Legend",inputValue:"Yes",uncheckedValue:"No",margin:"4 0 0 0",width:200,vertical:false,checked:false,listeners:{"change":function(q){if(!q.isDefault){q.isDefault=false;
Ext.getCmp("doneButton").enable();myDashApp.getController("WidgetConfigurationController").showWidgetPreview(q.widgetID);}}}}]},{xtype:"container",padding:0,margin:"5 0 10 20 ",defaults:{margin:"0 0 10 0 ",labelWidth:"auto",labelSeparator:"",labelStyle:"white-space: pre;"},items:[{xtype:"container",layout:{type:"column",align:"left"},width:260,flex:1,id:"healthCenterCompContiner",hidden:true,margin:"0 0 10 0",items:a},{xtype:"button",width:80,text:addDispBtn,hidden:true,margin:"5 0 0 0",id:"addHealthCenter",name:"addHealthCenter",cls:"button20"}]}]}]};
return{xtype:"form",id:"configForm",width:"100%",flex:1,modal:true,autoScroll:true,layout:{type:"vbox"},defaults:{labelAlign:"top",labelSeparator:""},bodyPadding:10,margin:"0 0 0 0",items:[{xtype:"panel",width:"100%",items:[{xtype:"container",width:"100%",layout:{type:"hbox"},items:[{xtype:"previewcontiner",margin:"4 20 4 10",width:p,height:d,items:[{xtype:"portlet",width:p-23,height:d-23,id:m+"_previewImage",title:b,ui:"newGraphPanel",cls:"previewImage",margin:"0 0 0 0",padding:"0",isChart:g,isTopNChart:e,showMoreDataOption:false,isPreviewMode:true}]},n]}]},{xtype:"panel",width:"100%",id:"gridContainer",cls:"",hidden:true,items:{xtype:"comparisontable",isAggregationDisabled:true,isCombinationChart:true,needToHideMeasure:true,hidden:false}}]};
},loadDefaultDataforWidgetConfigurationWindow:function(){var m=this;var a=Ext.getCmp("dashboardLayoutObj").profileName;var b=new Ext.LoadMask(this.getEl(),{msg:"Loading .."});b.show();var g=this.getComponent("configForm");var h=false;var c=false;var e=false;var j=false;var l=false;if(!Ext.isEmpty(this.widgetType)){if(this.widgetType=="dialChart"||this.widgetType=="digitalChart"||this.widgetType=="liveMeasuresBox"){l=true;
}else{if(this.widgetType=="TopNAnalysis"){j=true;}else{if(this.widgetType=="ddTable"){c=true;}else{if(this.widgetType=="ScatterPlot"){e=true;}}}}}var f=g.getForm();var k=m.widgetID;if(m.isKpi){k=m.kpiBlckId+"_"+k;}else{k=m.widgetID;}var d=a;if(!Ext.isEmpty(d)){d=filterEncode(d);}Ext.Ajax.request({url:"/final/servlet/com.eg.EgMonitorRequestDispatcher",method:"POST",params:"comesFrom=myDashboard&action=loadConfigPopup&profileName="+encodeURIComponent(d)+"&blockId="+k+"&screenWidth="+(Ext.getBody().getViewSize().width)+"&screenHeight="+(Ext.getBody().getViewSize().height),scope:this,success:function(O){var Z=O.responseText;
if(Z!=null&&Z!=""){b.hide();var aS=Ext.decode(Z);m.setWidgetPopupTitle(configTitle[m.widgetType]+" "+addMetricsTitle);this.suspendEvents(true);Ext.suspendLayouts();if(e){var G=false;if(aS["configuredDetails"]!=null&&aS["configuredDetails"].hasOwnProperty("isWidgetConfigured")){G=aS["configuredDetails"]["isWidgetConfigured"];
}var ax=Ext.getCmp("scatterTab");ax.isWidgetConfigured=G;ax.isYAxisTabLoaded=false;if(G){var E=Ext.getCmp("x_Axis");E.setIconCls("checkBoxTick");E.setTitle("Y Axis Configured");var aD=Ext.getCmp("y_Axis");aD.setIconCls("checkBoxTick");aD.setTitle("Y Axis Configured");}}var ap="controllerSetting";if(m.widgetType!=null&&(m.widgetType=="liveMeasuresBox"||m.widgetType=="ddTable")){ap="settingsContObj";
}var au=Ext.getCmp(ap);if(!Ext.isEmpty(au)){var t=false;if(aS["configuredDetails"]!=null&&aS["configuredDetails"].hasOwnProperty("isMultipleSettingsArr")){t=aS["configuredDetails"]["isMultipleSettingsArr"];}if(t){var al=aS["configuredDetails"]["settingsSubArr1"];var aj=aS["configuredDetails"]["settingsSubArr2"];
au.setWidth(590);var aB=[];aB.push({xtype:"container",columnWidth:0.5,flex:1,margin:"0 0 0 15",items:m.createSettingsCtrls(al)});aB.push({xtype:"container",columnWidth:0.5,margin:"0 0 0 15",flex:1,items:m.createSettingsCtrls(aj)});au.add(aB);au.doComponentLayout();}else{var aH=aS["configuredDetails"]["settingsArr"];
if(!Ext.isEmpty(aH)){m.widgetSettingsJsonArr=aH;au.add(m.createSettingsCtrls(aH));au.doComponentLayout();}}}var aE=aS["configuredDetails"];var aV="";var F="";var a2="";var A="";var ae="";var aA="";var az="";var aF="";var aM="";var I="";var ab="";var o="";var aJ=f.findField("componentTypeCombo");var aa=f.findField("testCombo");
var aT=f.findField("componentCombo");if(l||h||c||e){if(l&&!Ext.isEmpty(aE)){aV=aE["selectedCompType"];F=aE["selectedComp"];if((aV!=null&&aV!="undefined"&&aV!=""&&aV!="-1")&&(F!=null&&F!="undefined"&&F!=""&&F!="-1")){F=aV+":"+F;}a2=aE["selectedTest"];A=aE["selectedMeasure"];ae=aE["selectedDescriptor"];
aA=aE["selectedGraphType"];az=aE["useStateColorForFonts"];ab=aE["gaugeCircleEnabled"];o=aE["stateColorForGaugeEnabled"];}else{if(e){var K=aS["configuredDetails"]["xAxisConfigJson"];aV=K["selectedCompType"];F=K["selectedComp"];a2=K["selectedTest"];A=K["selectedMeasure"];ae=K["selectedDescriptor"];}else{if(c){if(!Ext.isEmpty(aE)){aV=aE["selectedCompType"];
F=aE["selectedComp"];if((aV!=null&&aV!="undefined"&&aV!=""&&aV!="-1")&&(F!=null&&F!="undefined"&&F!=""&&F!="-1")){F=aV+":"+F;}a2=aE["selectedTest"];A=aE["selectedMeasure"];aF=aE["ddColumns"];aM=aE["summarizeDdCols"];I=aE["selectedChartType"];}}}}aJ.suspendEvents(true);aJ.getStore().removeAll();aJ.getStore().loadRawData(aS["comptypes"]);
aJ.setFieldLabel(aS["screenLabels"]["monitor.common.Component Type"]);aJ.getStore().insert(0,{displayField:compTypAlertMsg,valueField:"-1"});aJ.setValue("-1");aJ.resumeEvents();if((l||c||e)&&(aV!=null&&aV!="")){aJ.setValue(aV);aJ.fireEvent("select",aJ);}else{aJ.setValue("-1");}aa.suspendEvents(true);
aa.getStore().removeAll();aa.setFieldLabel(aS["screenLabels"]["monitor.common.Test"]);if((l||c||e)&&(a2!=null&&a2!="")){aa.getStore().on("load",function(){m.fireComboSelection(aa,a2);},this,{single:true,delay:100});}else{aa.getStore().insert(0,{displayField:notApplicable,valueField:"-1"});aa.setValue("-1");
}aa.resumeEvents();var ar=f.findField("measureCombo");if(this.widgetType!="liveMeasuresBox"&&!h){ar.setFieldLabel(aS["screenLabels"]["monitor.measures.Measures"]);}if((l||c||e)&&(A!=null&&A!="")){ar.getStore().on("load",function(){m.fireComboSelection(ar,A);},this,{single:true,delay:100});}else{var a0=ar.getStore();
ar.suspendEvents(true);a0.removeAll();a0.insert(0,{displayField:notApplicable,valueField:"-1",editedFieldName:notApplicable});ar.setValue("-1");}aT.setFieldLabel(aS["screenLabels"]["monitor.common.Component"]);var aQ=aT.getStore();aT.suspendEvents(true);aQ.removeAll();if((l||c||e)&&(F!=null&&F!="")){aQ.on("load",function(){m.fireComboSelection(aT,F);
},this,{single:true,delay:100});}else{aQ.insert(0,{displayField:notApplicable,valueField:"-1",editedFieldName:notApplicable});aT.setValue("-1");}aT.resumeEvents();}else{if(j){aV=aE["selectedCompType"];F=aE["selectedComps"];ae=aE["selectedDescriptors"];a2=aE["selectedTest"];A=aE["selectedMeasure"];}aa.suspendEvents(true);
aa.getStore().loadRawData(aS["tests"]);aa.setFieldLabel(aS["screenLabels"]["monitor.common.Test"]);if(m.isTopNWidget){if(a2!=null&&a2!=""){aa.setValue(a2);}}else{aa.setValue("-1");}aa.resumeEvents();if(m.isTopNWidget){var ar=f.findField("measureCombo");ar.setFieldLabel(aS["screenLabels"]["monitor.measures.Measures"]);
if(A!=null&&A!=""){ar.getStore().loadRawData(aS["configuredDetails"]["measureListJson"]["measureOpts"]);ar.setValue(A);}else{var a0=ar.getStore();ar.suspendEvents(true);a0.removeAll();a0.insert(0,{displayField:notApplicable,valueField:"-1",editedFieldName:notApplicable});ar.setValue("-1");}if(aV!=null&&aV!=""){aJ.getStore().loadRawData(aS["configuredDetails"]["measureListJson"]["compTypeOpts"]);
aJ.setValue(aV);}else{aJ.suspendEvents(true);aJ.getStore().removeAll();aJ.setFieldLabel(aS["screenLabels"]["monitor.common.Component Type"]);aJ.getStore().insert(0,{displayField:notApplicable,valueField:"-1"});aJ.setValue("-1");aJ.resumeEvents();}}else{aJ.suspendEvents(true);aJ.getStore().removeAll();
aJ.setFieldLabel(aS["screenLabels"]["monitor.common.Component Type"]);aJ.getStore().insert(0,{displayField:notApplicable,valueField:"-1"});aJ.setValue("-1");aJ.resumeEvents();var ar=f.findField("measureCombo");var a0=ar.getStore();ar.suspendEvents(true);a0.removeAll();a0.insert(0,{displayField:notApplicable,valueField:"-1",editedFieldName:notApplicable});
ar.setValue("-1");ar.resumeEvents();}if(this.widgetType!=null&&(this.widgetType=="pieChart"||this.widgetType=="activityChart"||h)){aT.setFieldLabel(aS["screenLabels"]["monitor.common.Component"]);}else{Ext.getCmp("componentComboLbl").setText(aS["screenLabels"]["monitor.common.Component"]);}if(m.isTopNWidget){if(F!=null&&F!=""){aT.getStore().loadRawData(aS["configuredDetails"]["compsJson"]["compOptsJson"]);
aT.setValue(F);}else{var aQ=aT.getStore();aT.suspendEvents(true);aQ.removeAll();aQ.insert(0,{displayField:notApplicable,valueField:"-1",editedFieldName:notApplicable});aT.setValue("-1");aT.resumeEvents();}}else{var aQ=aT.getStore();aT.suspendEvents(true);aQ.removeAll();aQ.insert(0,{displayField:notApplicable,valueField:"-1",editedFieldName:notApplicable});
aT.setValue("-1");aT.resumeEvents();}}if(c){var q=f.findField("chartTypeCombo");q.suspendEvents(true);q.getStore().removeAll();q.getStore().loadRawData(aS["configuredDetails"]["chartDataCombo"]);q.setFieldLabel(aS["screenLabels"]["monitor.dashboard.Graphical Type"]);q.resumeEvents();if(I!=null&&I!=""){q.setValue(I);
q.fireEvent("select",q);}else{I="Table";q.setValue("Table");var Q=Ext.getCmp("Timeline");if(!Ext.isEmpty(Q)){var y=Q.timelineOpts;var P=[];P.push({displayField:"Latest",valueField:"recent"});if(!Ext.isEmpty(y)){for(var aI in y){P.push(y[aI]);}}Q.getStore().loadRawData(P);var R=Q.selectedValue;if(Ext.isEmpty(R)){R="recent";
}else{if(m!=null&&m.action!="editWidget"){R="recent";}}Q.setValue(R);}}var aU=f.findField("summarizeDDColumnCombo");var L=aU.getStore();L.removeAll();if(A!=null&&A!=""){aU.getStore().on("load",function(){m.fireComboSelection(aU,aM);},this,{single:true,delay:100});}else{L.insert(0,{displayField:notApplicable,valueField:"-1"});
aU.setValue("-1");}var aO=f.findField("summarizeDDColumnCombo");var s=Ext.getCmp("ddColumnsComboLbl");var C=f.findField("ViewType");var V="";if(C!=null&&!Ext.isEmpty(C)){if(I!=null&&I!="Bar Chart"){C.hide();C.up("container").hide();}else{C.show();C.up("container").show();}V=C.getValue();}if(!Ext.isEmpty(s)&&!Ext.isEmpty(aO)){if(I!=null&&I=="Bar Chart"){if(V!=null&&V=="Vertical"){aO.setFieldLabel("Summarize DD Data By (X axis)");
s.setText("DD Columns (Y axis)");}else{if(V!=null&&V=="Horizontal"){aO.setFieldLabel("Summarize DD Data By (Y axis)");s.setText("DD Columns (X axis)");}}}else{aO.setFieldLabel("Summarize DD Data By");s.setText("DD Columns");}}var Q=Ext.getCmp("Timeline");if(Q!=null&&!Ext.isEmpty(Q)){if(I!=null&&(I=="Table"||I=="Time Line"||I=="Area")){Q.show();
Q.up("container").show();}else{Q.hide();Q.up("container").hide();}}var v=Ext.getCmp("showChartSummary");if(v!=null&&!Ext.isEmpty(v)){if(I!=null&&(I=="Time Line"||I=="Area")){v.show();v.up("container").show();}else{v.hide();v.up("container").hide();}}var aZ=f.findField("ddColumnsCombo");var a3=aZ.getStore();
a3.removeAll();if(A!=null&&A!=""){aZ.getStore().on("load",function(){m.fireComboSelection(aZ,aF);},this,{single:true,delay:100});}else{a3.insert(0,{displayField:notApplicable,valueField:"-1"});aZ.setValue("-1");}var aZ=f.findField("ddColumnsCombo");aZ.setFieldLabel(aS["screenLabels"]["monitor.common.Measures"]);
var aN=aZ.getStore();aZ.suspendEvents(true);aN.removeAll();aN.insert(0,{displayField:notApplicable,valueField:"-1",editedFieldName:notApplicable});aZ.setValue("-1");aZ.resumeEvents();}else{var a4=f.findField("descriptorCombo");a4.suspendEvents(true);if(m.widgetType!=null&&(h||l||c||e)){a4.setFieldLabel(aS["screenLabels"]["monitor.dashboard.Descriptor"]);
}else{Ext.getCmp("descriptorComboLbl").setText(aS["screenLabels"]["monitor.dashboard.Descriptor"]);}if((l||c||e)&&(ae!=null&&ae!="")){a4.getStore().on("load",function(){m.fireComboSelection(a4,ae);},this,{single:true,delay:100});}else{if(m.isTopNWidget){if(ae!=null&&ae!=""&&ae!="AllInfos"){a4.setValue(ae);
a4.getStore().on("load",function(){m.fireComboSelection(a4,ae);},this,{single:true,delay:100});}else{var an=a4.getStore();a4.suspendEvents(true);an.removeAll();an.insert(0,{displayField:notApplicable,valueField:"-1",editedFieldName:notApplicable});a4.setValue("-1");a4.resumeEvents();}}else{var an=a4.getStore();
a4.suspendEvents(true);an.removeAll();an.insert(0,{displayField:notApplicable,valueField:"-1",editedFieldName:notApplicable});a4.setValue("-1");a4.resumeEvents();}}}if(m.showConfigurationTab){if(m.widgetType=="BarChart"||m.widgetType=="table"||m.widgetType=="pieChart"||m.widgetType=="activityChart"||m.widgetType=="heatMapChart"){var aW=f.findField("aggOptions");
aW.suspendEvents(true);f.findField("showAggOpt").setFieldLabel(aS["screenLabels"]["monitor.dashboard.Aggregate Descriptors"]);aW.setFieldLabel(aS["screenLabels"]["monitor.dashboard.Aggrgeate Function"]);aW.getStore().loadRawData(aS["configuredDetails"]["aggFunctionOptions"]);aW.setValue("avg");aW.resumeEvents();
}var at=aS["configuredDetails"]["gridData"];if(!Ext.isEmpty(at)){m.modified=true;var T=Ext.getCmp("configTableGrid");T.suspendEvents(true);if(m.widgetType=="table"){m.tableGridDataObj=at;}var H=T.getStore();H.add(at);T.show();T.resumeEvents();T.doComponentLayout();}else{Ext.getCmp("configTableGrid").show();
}}if(m.widgetType=="CombinedTimelineChart"||m.widgetType=="TimelineChart"||m.widgetType=="areaChart"||m.widgetType=="table"||m.widgetType=="combinationChart"||m.widgetType=="BarChart"||m.widgetType=="TrendGraph"||m.widgetType=="ddTable"||m.widgetType=="pieChart"||m.widgetType=="activityChart"||m.widgetType=="heatMapChart"||m.isTopNWidget){var Y="";
if(m.widgetType=="ddTable"){if(aE.hasOwnProperty("excludedDescriptors")){Y=aE["excludedDescriptors"];}}else{Y=aS["configuredDetails"]["excludedDescriptors"];}var J=f.findField("excludeDesc");if(!Ext.isEmpty(Y)){J.setValue(Y);}else{J.setValue("");}}if(l||this.widgetType=="heatMapChart"||this.widgetType=="areaChart"||this.widgetType=="activityChart"||this.widgetType=="BarChart"||this.widgetType=="combinationChart"||this.widgetType=="pieChart"||this.widgetType=="table"||this.widgetType=="TimelineChart"||this.widgetType=="TrendGraph"){var w=aS["configuredDetails"]["drildownUrl"];
var aP=f.findField("drillDown");if(w!=null&&w!=""&&w!="-"){aP.setValue(w);}else{aP.setValue("");}}if(m.widgetType=="CombinedTimelineChart"||m.widgetType=="TimelineChart"||m.widgetType=="combinationChart"||m.widgetType=="areaChart"||m.widgetType=="TrendGraph"){Ext.getCmp("er_mode").hide();var aw=f.findField("er_timeline");
if(m.widgetType=="TrendGraph"){aw.getStore().loadRawData(aS["timelinedetails"]["timeline"]);var ag=aS["configuredDetails"]["timeline"];aw.setValue(ag);var aL=aS["configuredDetails"]["trendGrpDuration"];if(aL!=null&&aL!=""&&!Ext.isEmpty(aL)){var am=aL["monitor.dashboard.Duration"];var X=aL["selectedDuration"];
var aK=Ext.getCmp("period");aK.setFieldLabel(am);aK.getStore().loadRawData(aS["timelinedetails"]["period"]);aK.setValue(X);}}else{aw.getStore().loadRawData(aS["timelineJson"]);var ag=aS["configuredDetails"]["timeline"];aw.setValue(ag);}var S=f.findField("er_stdate");var aC=f.findField("er_enddate");var av=f.findField("er_sthr");
var x=f.findField("er_endhr");var aR=f.findField("er_stmin");var p=f.findField("er_endmin");if(m.widgetType=="TimelineChart"||m.widgetType=="areaChart"){var N=Ext.getCmp("yMax");var ad=aS["configuredDetails"]["yMaxValue"];if(ad!=null&&ad!=""){N.setValue(ad);}}if(m.widgetType=="TrendGraph"){S.setValue(aS["timelinedetails"]["timelineSelections"]["selectedStartDate"]);
S.dataArray=aS["timelinedetails"]["timelineSelections"]["startDateInMgrDateFormat"];aC.setValue(aS["timelinedetails"]["timelineSelections"]["selectedEndDate"]);aC.dataArray=aS["timelinedetails"]["timelineSelections"]["endDateInMgrDateFormat"];av.setValue(aS["timelinedetails"]["timelineSelections"]["selectedStartHour"]);
av.dataArray=aS["timelinedetails"]["timelineSelections"]["startHrInMgrDate"];x.setValue(aS["timelinedetails"]["timelineSelections"]["selectedEndHour"]);x.dataArray=aS["timelinedetails"]["timelineSelections"]["endHourInMgrDate"];stmin=aS["timelinedetails"]["timelineSelections"].startMinInMgrDate;enmin=aS["timelinedetails"]["timelineSelections"].endMinInMgrDate;
aR.setValue(aS["timelinedetails"]["timelineSelections"]["selectedStartMin"]);p.setValue(aS["timelinedetails"]["timelineSelections"]["selectedEndMin"]);mgr_stmin=aS["timelinedetails"]["timelineSelections"].startMinInMgrDate;mgr_enmin=aS["timelinedetails"]["timelineSelections"].endMinInMgrDate;if(displayTimeline){var af=Ext.getCmp("timelineMyObj");
if(m.widgetType!="table"&&m.widgetType!="BarChart"){af.show();}else{if(isTopNChart){af.show();}}if(ag!=null&&ag=="Any"){af.selectedMgrStMin=mgr_stmin;af.selectedMgrEndMin=mgr_enmin;af.selectedStMinForDisplay=aS["timelinedetails"]["timelineSelections"]["selectedStartMin"];af.selectedEndminForDisplay=aS["timelinedetails"]["timelineSelections"]["selectedEndMin"];
aw.fireEvent("select",aw);}Ext.getCmp("er_stmin").show();Ext.getCmp("er_endmin").show();}}else{S.setValue(aS["configuredDetails"]["startDateForDisplay"]);S.dataArray=aS["configuredDetails"]["startDate"];aC.setValue(aS["configuredDetails"]["endDateForDisplay"]);aC.dataArray=aS["configuredDetails"]["endDate"];
av.setValue(aS["configuredDetails"]["startHourForDisplay"]);av.dataArray=aS["configuredDetails"]["startHour"];x.setValue(aS["configuredDetails"]["endHourForDisplay"]);x.dataArray=aS["configuredDetails"]["endHour"];stmin=aS["configuredDetails"].startMinForDisplay;enmin=aS["configuredDetails"].endMinForDisplay;
aR.setValue(aS["configuredDetails"]["startMinForDisplay"]);p.setValue(aS["configuredDetails"]["endMinForDisplay"]);mgr_stmin=aS["configuredDetails"].strMin;mgr_enmin=aS["configuredDetails"].endMin;if(displayTimeline){var af=Ext.getCmp("timelineMyObj");if(m.widgetType!="table"&&m.widgetType!="BarChart"){af.show();
}else{if(isTopNChart){af.show();}}if(ag!=null&&ag=="Any"){af.selectedMgrStMin=mgr_stmin;af.selectedMgrEndMin=mgr_enmin;af.selectedStMinForDisplay=aS["configuredDetails"]["startMinForDisplay"];af.selectedEndminForDisplay=aS["configuredDetails"]["endMinForDisplay"];aw.fireEvent("select",aw);}Ext.getCmp("er_stmin").show();
Ext.getCmp("er_endmin").show();}}}if(m.action=="editWidget"){}if(m.widgetType=="digitalChart"){var z="/final/images/"+strSkin+"/listViewWidgetDefault.png";var n=Ext.getCmp("ChartSummaryEnabled");if(!Ext.isEmpty(n)){var M=aE["ChartSummaryEnabled"];if(M!=null&&M=="yes"){n.setValue(true);var U=aE["summaryGraphType"];
var ai=Ext.getCmp("SummaryGraphType");if(Ext.isEmpty(U)||U=="none"){U="-1";}ai.setValue(U);var ak=aE["enableChartIcon"];if(ak!=null&&ak=="yes"){var ac=Ext.getCmp("ShowIcon");ac.setValue(true);z=aE["imgIcon"];if(Ext.isEmpty(z)){z="/final/images/"+strSkin+"/listViewWidgetDefault.png";}Ext.getCmp("ShowIcon").setDisabled(false);
}else{Ext.getCmp("ShowIcon").setDisabled(false);}}else{Ext.getCmp("ShowIcon").setDisabled(true);}}if(z!=null&&z!=""){if(z.indexOf(":")>0&&z.startsWith("Default")){z=z.substring(z.indexOf(":")+1);var aG=Ext.getCmp("digitalChartImgCont");aG.iconClass=z;if(z.indexOf("_")>-1){z=z.substring(0,z.lastIndexOf("_")+1)+"32";
}aG.update('<div id="customUserDefinedImgDefault" class="userDefinedImgDefault" style="padding:5px"><div id="dashboardImageIcon"  class= "'+z+'" width="32px" height="32px" border="0px"/><div class="settingOver"></div></div>');aG.doComponentLayout();Ext.defer(function(){aG.setImageTriggerEvents(aG);},100);
}else{var aG=Ext.getCmp("digitalChartImgCont");if(!Ext.isEmpty(aG)){aG.update('<div id="customUserDefinedImgDefault" class="userDefinedImgDefault" style="padding:5px"><img id="dashboardImageIcon"  src="'+z+'" width="100%" height="100%" border="0px"/><div class="settingOver"></div></div>');aG.doComponentLayout();
Ext.defer(function(){aG.setImageTriggerEvents(aG);},100);}}}}else{if(m.widgetType=="dialChart"){if(f.findField("UseStateColorForGauge").getValue()==true){Ext.getCmp("ColorPicker").hide();}else{if(isHighchartForGauge){Ext.getCmp("ColorPicker").show();}}}else{if(m.isTopNWidget){var aY=f.findField("displayType").getValue();
var a1=aY.chartType;if(a1=="bar"){f.findField("ViewType").show();f.findField("ColorPalette").show();}else{f.findField("ViewType").hide();f.findField("ColorPalette").hide();}}else{if(m.widgetType=="table"){var n=Ext.getCmp("enableChartSummary");var ai=Ext.getCmp("SummaryGraphType");if(!Ext.isEmpty(n)){var M=aE["enableChartSummary"];
if(M!=null&&M=="yes"){n.setValue(true);var U=aE["summaryGraphType"];if(Ext.isEmpty(U)||U=="none"){U="-1";}ai.setValue(U);ai.setValue(U);Ext.getCmp("SummaryGraphType").setDisabled(false);}}if(!Ext.isEmpty(aE)&&aE.hasOwnProperty("showValues")&&aE.hasOwnProperty("SetStateColorOn")){var W=aE["showValues"];
var D=aE["SetStateColorOn"];if(!Ext.isEmpty(n)&&!Ext.isEmpty(ai)){if(D=="none"&&W=="yes"){n.setDisabled(false);ai.setDisabled(false);}else{n.setDisabled(true);ai.setDisabled(true);}}}}}}}this.resumeEvents();Ext.resumeLayouts(true);}if(l||c||e){var r=Ext.getCmp("doneButton");r.enable();}if(m.isKpi){Ext.defer(function(){var a6=Ext.getCmp("useExternalData");
if(!Ext.isEmpty(a6)){a6.setValue(false);}var a7=Ext.getCmp("prevButton");var a5=Ext.getCmp("nextButton");if(m.Kpicount==1){a7.needToDisable=true;a7.setDisabled(true);}if(m.Kpicount==m.totalKpiCount){a5.needToDisable=true;a5.setDisabled(true);}if(!a7.needToDisable){a7.setDisabled(false);}if(!a5.needToDisable){a5.setDisabled(false);
}},1000);}if(m.widgetType=="CombinedTimelineChart"||m.widgetType=="TimelineChart"||m.widgetType=="areaChart"||m.widgetType=="table"||m.widgetType=="combinationChart"||m.widgetType=="BarChart"||m.widgetType=="TrendGraph"||m.isTopNWidget){if(aS["configuredDetails"]!=null&&aS["configuredDetails"].hasOwnProperty("autoAssociateComponents")){var ao=aS["configuredDetails"]["autoAssociateComponents"];
if(Ext.isEmpty(ao)){ao="no";}if(ao!=null&&ao.toLowerCase()=="yes"){m.autoAssociateComponents=true;var aq=Ext.getCmp("componentLblObj");aq.setText(aS["screenLabels"]["monitor.common.Component"]);var B=Ext.getCmp("allcomponentLblObj");B.setText(aS["screenLabels"]["monitor.common.All Components"]);var ah=Ext.getCmp("descriptorLblObj");
ah.setText(aS["screenLabels"]["monitor.dashboard.Descriptor"]);var u=Ext.getCmp("alldescriptorLblObj");u.setText(aS["screenLabels"]["monitor.common.All Descriptors"]);var aX=Ext.getCmp("descriptorMultiSelectOuterBox");var ay=Ext.getCmp("componentMultiSelectOuterBox");if(!Ext.isEmpty(ay)){ay.hide();}if(!Ext.isEmpty(aX)){aX.hide();
}}}}},failure:function(){}});},createSingleSelectBox:function(b,c,a){return createSingleSelectBox(b,c,comboEmptyTex,null);},createSingleSelectBox:function(e,g,c,b){var f=false;if(e!=null&&e=="summarizeDDColumn"){f=true;}var h={xtype:"scrollcombo",id:e+"Combo",name:e+"Combo",hidden:f,fieldLabel:g,emptyText:c,width:309,margin:"10 0 0 0",store:Ext.create("Ext.data.Store",{fields:["displayField","valueField"],data:[]}),editable:true,forceSelection:true,displayField:"displayField",valueField:"valueField",queryMode:"local"};
if(!Ext.isEmpty(b)){for(var d in b){var a=b[d];h[d]=a;}}return h;},createMultiSelectbox:function(b,a){return createMultiSelectbox(b,a,null);},createMultiSelectbox:function(d,c,h){var f=160;var a=190;if(!Ext.isEmpty(this.widgetType)&&(this.widgetType=="liveMeasuresBox"||this.widgetType=="ddTable"||this.widgetType=="TopNAnalysis")){f=95;
a=125;}var b={xtype:"multiselect",id:d+"Combo",baseCls:"egmultiselect",name:d+"Combo",multiSelect:true,height:f,store:Ext.create("Ext.data.Store",{fields:["displayField","valueField","editedFieldName"],data:[]}),listConfig:{id:d+"ListC1",simpleSelect:true},editable:false,displayField:"displayField",valueField:"valueField",queryMode:"local"};
var e=309;if(!Ext.isEmpty(h)){for(var g in h){var j=h[g];if(g!=null&&g=="width"){e=j;}b[g]=j;}}return{xtype:"container",layout:{type:"vbox",align:"stretch"},width:e,cls:"darkbox",margin:"-4 5 0 0",height:a,id:d+"MultiSelectOuterBox",items:[{xtype:"trigger",margin:"5",id:d+"SearchTextBox",name:d+"SearchTextBox",width:228,cls:"whitedropdown_search",emptyText:c,controltStoreObj:null,listeners:{"change":function(q,p,l,m){var n=this;
var k=n.controltStoreObj;if(k==null){n.controltStoreObj=this.up("form").getForm().findField(d+"Combo").getStore();k=n.controltStoreObj;}if(p=="*"){k.clearFilter();}else{if(p.lastIndexOf("*")==(p.length-1)){p=p.substr(0,(p.length-1));}k.clearFilter();if(p){var o=new RegExp(Ext.String.escapeRegex(p),"i");
k.filter({filterFn:function(r){return o.test(r.get("displayField"));}});}q.focus();}}}},b]};},fireComboSelection:function(b,a){b.setValue(a);b.fireEvent("select",b);},loadDefaultDataforScatterPlotConfigurationTab:function(a){var e=this;var c=Ext.getCmp("dashboardLayoutObj").profileName;var f=this.getComponent("configForm");
var d=f.getForm();var b=c;if(!Ext.isEmpty(b)){b=filterEncode(b);}Ext.Ajax.request({url:"/final/servlet/com.eg.EgMonitorRequestDispatcher",method:"POST",params:"comesFrom=myDashboard&action=loadConfigPopup&profileName="+encodeURIComponent(b)+"&blockId="+e.widgetID+"&screenWidth="+(Ext.getBody().getViewSize().width)+"&screenHeight="+(Ext.getBody().getViewSize().height),scope:this,success:function(h){var t=h.responseText;
if(t!=null&&t!=""){var l=Ext.decode(t);var o=l["configuredDetails"];var j="";var g="";var x="";var m="";var w="";var y=Ext.getCmp("scatterTab");if(a=="xAxis"){o=l["configuredDetails"]["xAxisConfigJson"];}else{if(a=="yAxis"){o=l["configuredDetails"]["yAxisConfigJson"];}}if(y.xAxisConfigured&&a=="xAxis"){j=y.xAxisCompType;
g=y.xAxisComp;x=y.xAxisTest;m=y.xAxisMeas;w=y.xAxisDesc;}else{if(y.yAxisConfigured&&a=="yAxis"){j=y.yAxisCompType;g=y.yAxisComp;x=y.yAxisTest;m=y.yAxisMeas;w=y.yAxisDesc;}else{j=o["selectedCompType"];g=o["selectedComp"];x=o["selectedTest"];m=o["selectedMeasure"];w=o["selectedDescriptor"];}}var n=d.findField("componentTypeCombo");
var s=d.findField("testCombo");var k=d.findField("componentCombo");n.suspendEvents(true);n.getStore().removeAll();n.getStore().loadRawData(l["comptypes"]);n.setFieldLabel(l["screenLabels"]["monitor.common.Component Type"]);n.resumeEvents();if(j!=null&&j!=""){n.setValue(j);n.fireEvent("select",n);}else{n.setValue("-1");
}k.setFieldLabel(l["screenLabels"]["monitor.common.Component"]);var q=k.getStore();k.suspendEvents(true);q.removeAll();if(g!=null&&g!=""){q.on("load",function(){e.fireComboSelection(k,g);},this,{single:true,delay:100});}else{q.insert(0,{displayField:notApplicable,valueField:"-1",editedFieldName:notApplicable});
k.setValue("-1");}k.resumeEvents();s.suspendEvents(true);s.getStore().removeAll();s.setFieldLabel(l["screenLabels"]["monitor.common.Test"]);if(x!=null&&x!=""){s.getStore().on("load",function(){e.fireComboSelection(s,x);},this,{single:true,delay:100});}else{s.getStore().insert(0,{displayField:notApplicable,valueField:"-1"});
s.setValue("-1");}s.resumeEvents();var u=d.findField("measureCombo");u.setFieldLabel(l["screenLabels"]["monitor.measures.Measures"]);if(m!=null&&m!=""){u.getStore().on("load",function(){e.fireComboSelection(u,m);},this,{single:true,delay:100});}else{var v=u.getStore();u.suspendEvents(true);v.removeAll();
v.insert(0,{displayField:notApplicable,valueField:"-1",editedFieldName:notApplicable});u.setValue("-1");}var p=d.findField("descriptorCombo");p.suspendEvents(true);p.setFieldLabel(l["screenLabels"]["monitor.dashboard.Descriptor"]);if(w!=null&&w!=""&&w!="-1"){p.getStore().on("load",function(){e.fireComboSelection(p,w);
},this,{single:true,delay:100});}else{var r=p.getStore();p.suspendEvents(true);r.removeAll();r.insert(0,{displayField:notApplicable,valueField:"-1",editedFieldName:notApplicable});p.setValue("-1");p.resumeEvents();}Ext.defer(function(){var z=Ext.getCmp("x_Axis");var A=Ext.getCmp("y_Axis");z.setDisabled(false);
A.setDisabled(false);},1000);}},failure:function(){}});},loadPrevNextScreen:function(h){var r=this;var c=null;var e="empty";var b="empty";if(r.needToUpdateCount){r.currentCount=r.Kpicount;r.needToUpdateCount=false;}var l=r.currentCount;var p=r.KpiDataArray;var d=p.length;for(i=0;i<d;i++){var a=p[i];if(a.innerWidgetId==l&&h=="Previous"){if(i>0){r.currentCount=i;
c=p[i-1];b=p[i-2];break;}}if(a.innerWidgetId==l&&h=="Next"){if(i<d-1){r.currentCount=l+1;c=p[i+1];e=p[i+2];break;}}}var o=Ext.getCmp("prevButton");var k=Ext.getCmp("nextButton");if(c.isConfigured==true){if(b==undefined){o.needToDisable=true;}else{if(b=="empty"){o.needToDisable=false;}else{o.needToDisable=false;
}}if(e==undefined){k.needToDisable=true;}else{if(k=="empty"){k.needToDisable=false;}else{k.needToDisable=false;}}}else{if(c.isConfigured==false){r.setWidgetPopupTitle(addMetricsTitle);if(b==undefined){o.setDisabled(true);}else{if(b=="empty"){o.setDisabled(false);}else{o.setDisabled(false);}}if(e==undefined){k.setDisabled(true);
}else{if(k=="empty"){k.setDisabled(false);}else{k.setDisabled(false);}}}}if(c!=null){var g=Ext.getCmp("configSettings");g.removeAll();var j=Ext.getCmp("doneButton");if(c.isConfigured==false){r.action="addWidget";g.add(c);j.setDisabled(true);}else{if(c.isConfigured==true){r.action="editWidget";var m=c.data.chartType;
var q=c.data.chartId;var n=c.innerWidgetId;var f=c.isExternalDataSourceWidget;var o=Ext.getCmp("prevButton");var k=Ext.getCmp("nextButton");o.setDisabled(true);k.setDisabled(true);r.reLoadConfigurationWindow(m,q,n,f);j.setDisabled(false);}}}},reLoadConfigurationWindow:function(b,g,a,e){var d=this;d.widgetID=g;
d.widgetType=b;d.Kpicount=a;d.isKpi=true;d.isExternalDataSourceWidget=e;if(e){var c=Ext.getCmp("useExternalData");d.removeAll();d.add({xtype:"addexternalmetrics",id:"widgetChartAttrs",name:"widgetChartAttrs",margin:"5 0 10 5",widgetID:d.widgetID,widgetType:d.widgetType,isKpi:d.isKpi,Kpicount:d.Kpicount,totalKpiCount:d.totalKpiCount,kpiBlckId:d.kpiBlckId});
if(!Ext.isEmpty(c)){var f=c.getValue();if(f){myDashApp.getController("WidgetConfigurationController").showWidgetPreviewAtPopupStartUp(g,e);}}if(d.isKpi){Ext.defer(function(){if(!Ext.isEmpty(c)){c.setValue(true);}var j=Ext.getCmp("prevButton");var h=Ext.getCmp("nextButton");if(d.Kpicount==1){j.needToDisable=true;
j.setDisabled(true);}if(d.Kpicount==d.totalKpiCount){h.needToDisable=true;h.setDisabled(true);}if(!j.needToDisable){j.setDisabled(false);}if(!h.needToDisable){h.setDisabled(false);}},1000);}d.doLayout();}else{d.removeAll();d.add(d.createConfigurationWindowLayout(false));d.loadDefaultDataforWidgetConfigurationWindow();
var c=Ext.getCmp("useExternalData");if(!Ext.isEmpty(c)){var f=c.getValue();if(!f){d.loadSampleSnippet(false);}}d.doLayout();}},listeners:{show:function(d){var a=true;if(d.isKpi){a=false;}var c=Ext.create("Ext.Button",{width:36,height:36,x:-18,y:-179,padding:0,margin:0,id:"prevButton",iconCls:"kpiWidgetPrevButton",renderTo:d.id,style:{"background":"none !important","border":"0px solid green !important"},hidden:a,listeners:{click:function(){d.loadPrevNextScreen("Previous");
}}});var b=Ext.create("Ext.Button",{width:36,height:36,padding:0,id:"nextButton",margin:0,x:Ext.get(d.id).getWidth()-55,y:-179,iconCls:"kpiWidgetNextButton",renderTo:d.id,hidden:a,style:{"background":"none !important","border":"0px solid green !important"},listeners:{click:function(){d.loadPrevNextScreen("Next");
}}});}}});