Ext.define("componentsList.controller.Main",{extend:"Ext.app.Controller",views:["componentsList.view.Main","componentsList.view.ComponentsListPanel","componentsList.view.ListComponent","componentsList.view.ConfigWindow"],refs:[{ref:"main",selector:"main"},{ref:"componentsListPanel",selector:"componentslistpanel"},{ref:"componentsListForm",selector:"componentslistpanel form"},{ref:"searchStateCombo",selector:"componentslistpanel form combo[action=searchState]"},{ref:"searchTypeCombo",selector:"componentslistpanel form combo[action=searchType]"},{ref:"nickNameField",selector:"componentslistpanel form textfield[action=nickname]"},{ref:"searchTypeField",selector:"componentslistpanel form textfield[action=searchtypefield]"},{ref:"submitSearch",selector:"componentslistpanel form button[action=submit]"},{ref:"searchComponentCheck",selector:"componentslistpanel form checkbox"},{ref:"treePanel",selector:"componentstreepanel treepanel"},{ref:"commonPanel",selector:'generalMeasuresGridPanel[id="perPanel"]'},{ref:"configWindowRadio",selector:"configwindow > form > radio"},{ref:"configWindow",selector:"configwindow"},{ref:"measuresAndAnalysis",selector:"measureandanalysis"},{ref:"configWindowForm",selector:"configwindow > form"}],refreshFlag:false,init:function(){setInterval("execute()",refreshFrequency);
this.control({"componentslistpanel":{resize:function(c,e,a,b,f,d){c.doLayout();}},"componentslistpanel form textfield[action=nickname]":{specialkey:function(b,a){if(a.getKey()==a.ENTER){this.SubmitButtonClicked();}}},"componentslistpanel form textfield[action=searchtypefield]":{specialkey:function(b,a){if(a.getKey()==a.ENTER){this.SubmitButtonClicked();
}}},"componentslistpanel form combo[action=searchState]":{select:function(){this.SubmitButtonClicked();}},"componentslistpanel form combo[action=searchType]":{select:function(){this.SubmitButtonClicked();}},"componentslistpanel > header > button[action=back]":{click:this.backButtonHandler},"componentslistpanel form button[action=submit]":{click:this.SubmitButtonClicked},'generalMeasuresGridPanel combo[id="filterByCombo"]':{"select":this.compFilterByComboOnChange},'generalMeasuresGridPanel combo[id="subFilterCombo"]':{change:this.compSubFilterComboOnChange},'generalMeasuresGridPanel combo[id="componentTypCombo"]':{change:this.componentTypeComboOnChange},'generalMeasuresGridPanel combo[id="sortByCombo"]':{"select":this.componentsmeasureComboChange},'generalMeasuresGridPanel textfield[id="nickName"]':{specialkey:function(b,a){if(a.getKey()==a.ENTER){this.compSubmitButtonClicked();
}}},"dashboardgeneralmeasuresgrid":{sortchange:this.getSortDetails,render:this.retainColumnSort},'componentslistpanel > header > button[action="configsetting"]':{scope:this,click:this.openConfigWindow},"configwindow":{"render":this.itemset,"close":this.refreshcall},"configwindow > form > combo":{"select":this.combo},"configwindow > form > radiogroup":{"change":this.radio},'configwindow > toolbar > button[action="submit"]':{click:this.buttonclick},"componentslistpanel form checkbox":{change:function(){var b=this.getSearchComponentCheck().getValue();
var c=true;var a="../servlet/com.eg.EgMonitorController?from=componentList&monCmd=componentList&action=search&searchStateString="+this.getSearchStateCombo().getValue()+"&searchNameString="+this.getNickNameField().getValue()+"&selTypeString="+this.getSearchTypeCombo().getValue()+"&searchTypeString="+this.getSearchTypeField().getValue()+"&treeOpen="+c;
if(b===true){a+="&searchIndComps=on";}if(this.getComponentsListPanel().aggregate){a+="&menuName=agg";}else{if(this.getComponentsListPanel().network){a+="&menuName=network";}}a=a+"&componentListRefresh=yes";this.showResult(a);}}});},openConfigWindow:function(f){var c=Ext.Element.getViewportWidth();try{var j=Ext.getCmp("back").hidden;
var a="417px";if(j!=undefined&&j!=null&&!j){a="356px";}}catch(h){a="417px";}function d(m,k,e){var o=m-Ext.getCmp(k).getPosition()[0],l=Ext.getCmp(k).getWidth()/2+1,n=(e+l)-o;return n;}var b=d(c,"settingIconId",490);if(this.getConfigWindow()){this.getConfigWindow().destroy();}if(!this.getConfigWindow()){var g=Ext.create("componentsList.view.ConfigWindow");
g.show();container=Ext.create("Ext.container.Container",{floating:true,frame:true,width:490,ui:"configOuterContainer",renderTo:Ext.getBody(),hidden:true,floatable:true,items:[{xtype:"container",cls:"configMode_popupArrow",style:{"top":"-14px","left":b+"px"}},{xtype:"container",cls:"configMode_header",margin:"0 10",padding:"10 0 5 0",html:'<div class="settingsfont" style="float:left;text-transform:uppercase;">Settings</div><div style="text-align:right;float:right;"><div class="iconCloseNew"></div></div>',},g]});
var i=c-(container.width+15);Ext.create("Ext.fx.Anim",{target:container,duration:500,from:{left:i,top:-500},to:{top:40,left:i}});container.showAt(i,5000);Ext.select(".iconCloseNew").on("click",function(){Ext.create("Ext.fx.Anim",{target:container,duration:500,from:{left:i,top:40},to:{top:-500,left:i},callback:function(){container.hide();
componentsList.app.getController("Main").metricRefresh();}});},this);Ext.getBody().on("click",function(k){var e=k.target.id;if(e!=undefined&&e!=null&&((e.toLowerCase().indexOf("gridview")!=-1)||(e.toLowerCase().indexOf("componentslistpanel")!=-1)||(e.toLowerCase().indexOf("toolbar")!=-1)||(e.toLowerCase().indexOf("filter")!=-1)||(e.toLowerCase().indexOf("listbutid")!=-1))){container.hide();
}});}else{if(container.isHidden()){var g=this.getConfigWindow();var i=c-(container.width+15);Ext.create("Ext.fx.Anim",{target:container,duration:500,from:{left:i,top:-500},to:{top:40,left:i}});container.showAt(i,5000);}else{container.hide();componentsList.app.getController("Main").metricRefresh();}}},compFilterByComboOnChange:function(d){var j=requestParams.userName;
var b="";if(Ext.getCmp("filterByCombo")!=null&&Ext.getCmp("filterByCombo")!=undefined&&Ext.getCmp("filterByCombo").getValue()!=null&&Ext.getCmp("filterByCombo").getValue()!="null"){b=Ext.getCmp("filterByCombo").getValue();}var e="";if(Ext.getCmp("subFilterCombo")!=null&&Ext.getCmp("subFilterCombo")!=undefined&&Ext.getCmp("subFilterCombo").getValue()!=null&&Ext.getCmp("subFilterCombo").getValue()!="null"){e=Ext.getCmp("subFilterCombo").getValue();
}var c="";if(Ext.getCmp("componentTypCombo")!=null&&Ext.getCmp("componentTypCombo")!=undefined&&Ext.getCmp("componentTypCombo").getValue()!=null&&Ext.getCmp("componentTypCombo").getValue()!="null"){c=Ext.getCmp("componentTypCombo").getValue();}var f="";if(Ext.getCmp("nickName")!=null&&Ext.getCmp("nickName")!=undefined&&Ext.getCmp("nickName").getValue()!=null&&Ext.getCmp("nickName").getValue()!="null"){f=Ext.getCmp("nickName").getValue();
}var a="";var h=this.getCommonPanel().itemId;if(h=="system"||h=="System"){a="/final/monitor/comparisonSystem.jsp?treeTitle=System";}else{if(h=="components"||h=="Components"){a="/final/monitor/comparisonComponent.jsp?treeTitle=Component";}else{if(h=="network"||h=="Network"){a="/final/monitor/comparisonComponent.jsp?treeTitle=Network";
}}}a=a+"&filterBy="+b+"&parentZone="+requestParams.parentZone;if(requestParams.fromPageView!=null&&requestParams.fromPageView=="CitrixDashboard"){a=a+"&timeline="+timeline;}var g=Ext.getCmp("subFilterCombo");var i=false;if(b=="Component"||b=="System"||b=="Network"){g.hide();i=true;}else{}sortState="";
DirProperty="";if(i){this.getCommonPanel().loadTab(a,"","","","","","componentList");Refurl=a;}else{Ext.Ajax.request({url:a,scope:this,timeout:280000,success:function(k){var m=k.responseText;var l=Ext.decode(m);g.getStore().loadRawData(l.subFilterOptions);g.setValue(l.pageParams.selectedSubFilterOption);
g.setFieldLabel(l.pageParams.subFilterLabel);g.show();}});}},compSubFilterComboOnChange:function(h){var g=requestParams.userName;var b="";if(Ext.getCmp("filterByCombo")!=null&&Ext.getCmp("filterByCombo")!=undefined&&Ext.getCmp("filterByCombo").getValue()!=null&&Ext.getCmp("filterByCombo").getValue()!="null"){b=Ext.getCmp("filterByCombo").getValue();
}var d="";if(Ext.getCmp("subFilterCombo")!=null&&Ext.getCmp("subFilterCombo")!=undefined&&Ext.getCmp("subFilterCombo").getValue()!=null&&Ext.getCmp("subFilterCombo").getValue()!="null"){d=Ext.getCmp("subFilterCombo").getValue();}var e="";if(Ext.getCmp("componentTypCombo")!=null&&Ext.getCmp("componentTypCombo")!=undefined&&Ext.getCmp("componentTypCombo").getValue()!=null&&Ext.getCmp("componentTypCombo").getValue()!="null"){e=Ext.getCmp("componentTypCombo").getValue();
}var a="";if(Ext.getCmp("nickName")!=null&&Ext.getCmp("nickName")!=undefined&&Ext.getCmp("nickName").getValue()!=null&&Ext.getCmp("nickName").getValue()!="null"){a=Ext.getCmp("nickName").getValue();}var c="";var f=this.getCommonPanel().itemId;sortState="";DirProperty="";if(f=="system"||f=="System"){c="/final/monitor/comparisonSystem.jsp?treeTitle=System";
c=c+"&filterBy="+b+"&subFilter="+encodeURIComponent(d)+"&componentNameSearch="+encodeURIComponent(a)+"&parentZone="+requestParams.parentZone;var c=c;Refurl=c;this.getCommonPanel().loadTab(c,"","","","","","componentList");}else{if(f=="components"||f=="Components"){c="/final/monitor/comparisonComponent.jsp?treeTitle=Component";
c=c+"&filterBy="+b+"&subFilter="+encodeURIComponent(d)+"&parentZone="+requestParams.parentZone;if(requestParams.fromPageView!=null&&requestParams.fromPageView=="CitrixDashboard"){c=c+"&timeline="+encodeURIComponent(timeline);}Ext.Ajax.request({url:c,scope:this,timeout:280000,success:function(j){var l=j.responseText;
var k=Ext.decode(l);var i=Ext.getCmp("componentTypCombo");i.getStore().loadRawData(k.componentTypeOptions);i.setValue(k.componentTypeOptions.selectedComponentType);i.setFieldLabel(k.componentTypeOptions.componentTypeLabel);}});}else{if(f=="network"||f=="Network"){c="/final/monitor/comparisonComponent.jsp?treeTitle=Network";
c=c+"&filterBy="+b+"&subFilter="+encodeURIComponent(d);if(requestParams.fromPageView!=null&&requestParams.fromPageView=="CitrixDashboard"){c=c+"&timeline="+encodeURIComponent(timeline);}Ext.Ajax.request({url:c,scope:this,timeout:280000,success:function(j){var l=j.responseText;var k=Ext.decode(l);var i=Ext.getCmp("componentTypCombo");
i.getStore().loadRawData(k.componentTypeOptions);i.setValue(k.componentTypeOptions.selectedComponentType);i.setFieldLabel(k.componentTypeOptions.componentTypeLabel);}});}}}},componentTypeComboOnChange:function(r){var o=requestParams.treeFlag_SBD;var a=requestParams.outsideService_SBD;var q=requestParams.titleText_SBD;
var p=requestParams.selectNode_SBD;var i=requestParams.isEmulTrans_SBD;var s=requestParams.serviceState_SBD;var h=requestParams.serviceName;var f=requestParams.serviceState;var d=requestParams.isServiceBusiDash;var g=requestParams.userName;var e=requestParams.stateName;e=(e==null||e==undefined||e=="null")?"":e;
var n=requestParams.fromPageView;var m=r.getValue();compListType=m;var j="";if(Ext.getCmp("filterByCombo")!=null&&Ext.getCmp("filterByCombo")!=undefined){j=Ext.getCmp("filterByCombo").getValue();}var b="";if(Ext.getCmp("subFilterCombo")!=null&&Ext.getCmp("subFilterCombo")!=undefined&&Ext.getCmp("subFilterCombo").getValue()!=null&&Ext.getCmp("subFilterCombo").getValue()!="null"){b=Ext.getCmp("subFilterCombo").getValue();
}var k="";if(Ext.getCmp("nickName")!=null&&Ext.getCmp("nickName")!=undefined){k=Ext.getCmp("nickName").getValue();}var c="";var l=this.getCommonPanel().itemId;if(l=="system"||l=="System"){c="/final/monitor/comparisonSystem.jsp?treeTitle=System";}else{if(l=="components"||l=="Components"){c="/final/monitor/comparisonComponent.jsp?treeTitle=Component";
}else{if(l=="network"||l=="Network"){c="/final/monitor/comparisonComponent.jsp?treeTitle=Network";}}}c=c+"&filterBy="+j+"&subFilter="+encodeURI(b)+"&componentType="+encodeURI(m)+"&componentNameSearch=&fromPageView="+n+"&userName="+encodeURI(g)+"&selectedState="+e+"&fromHomepage="+requestParams.isfromHomepage+"&parentZone="+requestParams.parentZone;
sortState="";DirProperty="";if(!Ext.isEmpty(requestParams.isServiceBusiDetails)&&requestParams.isServiceBusiDetails!=undefined&&requestParams.isServiceBusiDetails!=null){c=c+"&isServiceBusiViewMetrics="+requestParams.isServiceBusiDetails+"&treeFlag_SBD="+o+"&outsideService_SBD="+a+"&titleText_SBD="+q+"&selectNode_SBD="+p+"&serviceFromZone="+h+"&isEmulTrans_SBD="+i+"&serviceName="+h+"&serviceState_SBD="+s+"&isServiceBusiDash="+d;
}if(requestParams.fromPageView!=null&&requestParams.fromPageView=="CitrixDashboard"){c=c+"&timeline="+encodeURIComponent(timeline);}Refurl=c;this.getCommonPanel().loadTab(c,"","","","","","componentList");},compSubmitButtonClicked:function(){var f=requestParams.fromPageView;var l=requestParams.userName;
var m=requestParams.stateName;m=(m==null||m==undefined||m=="null")?"":m;if(m==null||m==undefined||m==""){m=requestParams.selectedState;}m=(m==null||m==undefined||m=="null")?"":m;var b="";if(Ext.getCmp("filterByCombo")!=null&&Ext.getCmp("filterByCombo")!=undefined){b=Ext.getCmp("filterByCombo").getValue();
}var d="";if(Ext.getCmp("subFilterCombo")!=null&&Ext.getCmp("subFilterCombo")!=undefined&&Ext.getCmp("subFilterCombo").getValue()!=null&&Ext.getCmp("subFilterCombo").getValue()!="null"){d=Ext.getCmp("subFilterCombo").getValue();}var c="";if(Ext.getCmp("componentTypCombo")!=null&&Ext.getCmp("componentTypCombo")!=undefined&&Ext.getCmp("componentTypCombo").getValue()!=null&&Ext.getCmp("componentTypCombo").getValue()!="null"){c=Ext.getCmp("componentTypCombo").getValue();
}var h="";if(Ext.getCmp("nickName")!=null&&Ext.getCmp("nickName")!=undefined&&Ext.getCmp("nickName").getValue()!=null&&Ext.getCmp("nickName").getValue()!="null"){h=Ext.getCmp("nickName").getValue();}var j="";if(Ext.getCmp("sortByCombo")!=null&&Ext.getCmp("sortByCombo")!=undefined&&Ext.getCmp("sortByCombo").getValue()!=null&&Ext.getCmp("sortByCombo").getValue()!="null"){j=Ext.getCmp("sortByCombo").getValue();
}var a="";var i=this.getCommonPanel().itemId;try{h=window.opener.filterEncode(h);}catch(k){try{h=parent.filterEncode(h);}catch(g){h=parent.parent.filterEncode(h);}}if(i=="system"||i=="System"){a="/final/monitor/comparisonSystem.jsp?treeTitle=System";a=a+"&filterBy="+b+"&subFilter="+encodeURIComponent(d)+"&componentNameSearch="+encodeURIComponent(h)+"&viewPageTitle="+encodeURIComponent(requestParams.viewPageTitle);
}else{if(i=="components"||i=="Components"){a="/final/monitor/comparisonComponent.jsp?treeTitle=Component";a=a+"&filterBy="+b+"&subFilter="+encodeURIComponent(d)+"&componentType="+encodeURIComponent(c)+"&componentNameSearch="+encodeURIComponent(h)+"&fromPageView="+f+"&userName="+encodeURIComponent(l)+"&selectedState="+m+"&viewPageTitle="+encodeURIComponent(requestParams.viewPageTitle);
}else{if(i=="network"||i=="Network"){a="/final/monitor/comparisonComponent.jsp?treeTitle=Network";a=a+"&filterBy="+b+"&subFilter="+encodeURIComponent(d)+"&componentType="+encodeURIComponent(c)+"&componentNameSearch="+encodeURIComponent(h)+"&fromPageView="+f+"&userName="+encodeURIComponent(l)+"&selectedState="+m+"&viewPageTitle="+encodeURIComponent(requestParams.viewPageTitle);
}}}if(!Ext.isEmpty(isServiceBusiViewMetrics)&&isServiceBusiViewMetrics!=null&&isServiceBusiViewMetrics!=undefined&&(isServiceBusiViewMetrics=="true"||isServiceBusiViewMetrics==true)){a=a+"&isServiceBusiViewMetrics="+isServiceBusiViewMetrics;}if(requestParams.fromPageView!=null&&requestParams.fromPageView=="CitrixDashboard"){a=a+"&timeline="+encodeURIComponent(timeline);
}var a=a+"&parentZone="+requestParams.parentZone;Refurl=a;this.getCommonPanel().loadTab(a,"","","","","","componentList");},loadMetricsView:function(l,b,e,i){var a=Ext.getCmp("componentslistpanel");if(a!=null&&a!=undefined&&a.items!=null&&a.items!=undefined){var j=a.items.items;for(var k=j.length-1;k>-1;
k--){j[k].destroy();}}var d=null;if(!Ext.isEmpty(a)){d=new Ext.LoadMask(a,{msg:"Please wait..."});d.show();}var g=Ext.getCmp("listButId");var f=Ext.getCmp("GridButId");if(f!=null&&f!=undefined){f.removeCls("iconCompGridviewSelect");f.removeCls("iconCompGridview");f.addCls("iconCompGridviewSelect");}if(g!=null&&g!=undefined){g.removeCls("iconCompListviewSelect");
g.removeCls("iconCompListview");g.addCls("iconCompListview");}if(!Ext.isEmpty(requestParams.isServiceBusiDetails)&&requestParams.isServiceBusiDetails!=undefined&&requestParams.isServiceBusiDetails!=null){l=l+"&isServiceBusiViewMetrics="+requestParams.isServiceBusiDetails;}l=l+"&parentZone="+requestParams.parentZone;
Refurl=l;var h="&selectNode_SBD="+encodeURIComponent(requestParams.selectNode_SBD,"UTF-8")+"&treeFlag_SBD="+requestParams.treeFlag_SBD+"&outsideService_SBD="+requestParams.outsideService_SBD+"&titleText_SBD="+requestParams.titleText_SBD+"&isEmulTrans_SBD="+requestParams.isEmulTrans_SBD+"&serviceState_SBD="+requestParams.serviceState_SBD+"&isServiceBusiDash="+requestParams.isServiceBusiDash+"&serviceName="+requestParams.serviceName;
Refurl=Refurl+h;Refid=e;Reftext=b;var c=false;if(requestParams.hasOwnProperty("fromPageView")&&!Ext.isEmpty(requestParams.fromPageView)&&requestParams.fromPageView=="zoneDashboard"){c=true;}if(requestParams.fromPageView!=null&&requestParams.fromPageView=="CitrixDashboard"){a.setTitle(i);}else{if(Reftext=="Components"){a.setTitle("Components in all states");
}else{a.setTitle(Reftext);}}a.header.addClass("panelTitle");a.add({xtype:"generalMeasuresGridPanel",itemId:Refid,margin:0,padding:0,frame:false,border:true,disableCombo:c,layout:{type:"vbox",align:"stretch"},flex:1,screenLabelPath:"monitor.Dashboard",url:Refurl,listeners:{"afterrender":function(m){this.loadTab(m.url,"","","","","","componentList");
d.hide();}}});},loadComponentList:function(a){var c=Ext.getCmp("componentslistpanel");var a=a;if(!Ext.isEmpty(requestParams.isAggregate)&&(requestParams.isAggregate=="agg"||requestParams.isAggregate=="Agg")){a+="&menuName=agg";c.aggregate=true;}else{if(!Ext.isEmpty(requestParams.isNetwork)&&(requestParams.isNetwork=="network"||requestParams.isNetwork=="network")){a+="&menuName=network";
c.network=true;}}var d=Ext.getCmp("componentslistpanel");var e=d.items.items;for(var b=e.length-1;b>-1;b--){e[b].destroy();}Ext.Ajax.request({url:a,success:function(g,n){var s=g.responseText;if(!Ext.isEmpty(s)){var i=Ext.decode(s);if(!Ext.isEmpty(i.HiddenFields.menuName)&&i.HiddenFields.menuName=="agg"){c.aggregate=true;
}else{if(!Ext.isEmpty(i.HiddenFields.menuName)&&i.HiddenFields.menuName=="network"){c.network=true;}}if(i.ListLabels["ListTitle"]!=undefined){c.setTitle(i.ListLabels["ListTitle"]?i.ListLabels["ListTitle"]:"");}else{c.setTitle(i.ScreenLabels["Title"]?i.ScreenLabels["Title"]:"");}if(!Ext.isEmpty(i.SearchLabels)){var f=Ext.create("Ext.form.Panel",{header:false,border:true,cls:"formOuter",layout:{type:"vbox",align:"stretch"},autoHeight:true,items:[{xtype:"panel",layout:{type:"column"},header:false,border:false,frame:false,defaults:{margin:0,padding:"10px 10px 10px 10px",labelSeparator:""},items:[{xtype:"scrollcombo",labelAlign:"top",columnWidth:".17",id:"searchState",minWidth:100,maxWidth:250,store:Ext.create("Ext.data.Store",{fields:["value","name"],proxy:{type:"memory",reader:{type:"json",root:"searchStateString"}},data:i.SearchLabels.searchStateString}),fieldLabel:i.SearchLabels["searchStateLabel"]?i.SearchLabels["searchStateLabel"]:"",displayField:"name",cls:"dropdown",valueField:"value",value:i.SearchLabels.searchStateStringSelected?i.SearchLabels.searchStateStringSelected:i.SearchLabels.searchStateString[0].value,editable:false,action:"searchState"},{xtype:"textfield",labelAlign:"top",columnWidth:".17",minWidth:150,maxWidth:300,id:"nickName",cls:"textbox",fieldLabel:i.SearchLabels["searchNameLabel"]?i.SearchLabels["searchNameLabel"]:"",value:i.SearchLabels["searchNameString"]?i.SearchLabels["searchNameString"]:"",action:"nickname"},{xtype:"scrollcombo",id:"Type",labelAlign:"top",columnWidth:".17",minWidth:100,maxWidth:250,store:Ext.create("Ext.data.Store",{fields:["value","name"],proxy:{type:"memory",reader:{type:"json",root:"selTypeString"}},data:i.SearchLabels.selTypeString}),fieldLabel:i.SearchLabels["searchTypeLabel"]?i.SearchLabels["searchTypeLabel"]:"",displayField:"name",valueField:"value",value:i.SearchLabels.selTypeStringSelected?i.SearchLabels.selTypeStringSelected:i.SearchLabels.selTypeString[0].value,editable:false,cls:"dropdown",action:"searchType"},{xtype:"textfield",id:"searchType",labelAlign:"top",columnWidth:".17",minWidth:150,maxWidth:300,cls:"textbox",fieldLabel:i.SearchLabels["typeLabel"]?i.SearchLabels["typeLabel"]:"",value:i.SearchLabels["typeString"]?i.SearchLabels["typeString"]:"",action:"searchtypefield"},{xtype:"checkbox",id:"searchComp",margin:"20px 0px 0px 0px",columnWidth:".13",minWidth:150,maxWidth:250,cls:"components-checkbox-field checkbt",boxLabel:i.SearchLabels["searchIndComps"]?i.SearchLabels["searchIndComps"]:"",checked:requestParams.searchIndComps==="on"||requestParams.searchIndComps==="checked"?true:false},{xtype:"button",cls:"button20",margin:"31 0 0 0",minWidth:80,maxWidth:120,text:i.SearchLabels["submitBtnText"]?i.SearchLabels["submitBtnText"]:"",action:"submit"}]}]});
c.add(f);}if(i["error"]){var A=Ext.create("utilities.ErrorPanel",{style:{"border":"0px solid orange"},errorMsg:'<div style="text-align:center;valign:middle;margin:15% auto;"><img src="/final/images/spacer.gif" class="iconInformation" /><div class="list-empty-text">'+i["error"]+"</div></div>"});c.add({xtype:"panel",id:"errorpanelId",border:false,frame:false,layout:"fit",margin:"10 10 10 10",flex:1,width:"100%",items:A});
}else{var r=Ext.create("Ext.panel.Panel",{suspendLayout:true,id:"commonpanel",padding:0,autoScroll:true,scroll:true,cls:"outerpanel",frame:true,layout:{type:"fit",align:"stretch",},border:true,flex:1,margin:"10 10 10 10",dockedItems:[{xtype:"toolbar",id:"titleTool",cls:"component-list-right-panel-header component-list-right-panel-header-right component-list-bottom-panel-header",layout:"hbox",margin:0,padding:0,flex:1,items:[{xtype:"label",text:i.ListLabels["ComponentTypeTitle"]?i.ListLabels["ComponentTypeTitle"]:"",width:200,padding:"2px 5px 2px 10px"},{xtype:"label",width:2,height:22,padding:0,cls:"service_header",style:"left:200px !important;"},{xtype:"label",text:i.ListLabels["AvaliableListTitle"]?i.ListLabels["AvaliableListTitle"]:"",padding:"2px 5px 2px 6px",flex:1}]}],});
Ext.suspendLayouts();var m=i.ListLabels["ComponentList"];var k="";for(var v=0;v<m.length;v++){var j="";j="<table class='table-list-layout' style='width:100%'><tr><td style='width:203px;text-align:center;"+stylefrLight+"'>";var h=m[v]["showImg"];var w=m[v]["TypeState"];if(!Ext.isEmpty(h)){j=j+'<div style="margin:5px auto 0px auto;display:inline-block;width:48px;height:48px;" align="left"><div style="position:relative;top:0px;left:0px;border:0px solid red;"><img src="'+m[v]["type"]+'"/><div style="position:absolute;top:28px;left:28px;" class="state20_'+w+'"></div></div></div><div style="margin:0px auto 5px auto;width:182px;" data-qclass="yellowTip" class="component-list-left-font" data-qtip="'+m[v].title+'">'+m[v].name+"</div>";
}else{j=j+'<div data-qclass="yellowTip" style="margin:0px auto 5px auto;width:182px;" class="component-list-left-font" data-qtip="'+m[v].title+'">'+m[v].name+"</div>";}j=j+"</td><td>";var x=m[v]["children"];var y="";y="<div>";var B=0;for(var u=0;u<x.length;u++){var p=x[u];if(!Ext.isEmpty(p["configChange"])||!Ext.isEmpty(p["MaintenanceTime"])||(!Ext.isEmpty(p["configChange"])&&!Ext.isEmpty(p["MaintenanceTime"]))){var t=getWidthOfText(p["name"],"f11-normal")+15;
if(t>160){t=160;}var z=t+35;if(z>200){z=200;t=160;}}else{t=200;z=200;}y=y+"<div style='width:240px;float:left;border:0px solid red'>";y=y+'<div style="float:left;display:inline-block;border:0px solid violet;width:'+z+'px"><div class="serviceSegmentComponentName"><img style="position:relative;" src="/final/images/clear.png" class="'+p["stateName"]+'"/><a style="width:90%;padding-left:0px" class="component-list-right-link" data-qclass="yellowTip" href="javascript:void(0)" onclick=\'javascript:componentListToDashboard("'+p["link"]+'","'+p["name"]+'")\' data-qtip="'+p["title"]+'" ><div id="innernId" style="overflow:hidden;text-overflow:ellipsis;width:'+t+'px;border:0px solid yellow">'+p["name"]+"</div></a></div></div>";
if(!Ext.isEmpty(p["MaintenanceTime"])){y=y+'<div style="float:left;margin-top:2px;margin-right:6px"><div class="iconMaintenance" data-qclass="yellowTip" style="margin:auto;text-align:center" data-qtip="'+p["MaintenanceTime"]+'"></div></div>';}if(!Ext.isEmpty(p["configChange"])){var l="/final/monitor/EgConfigChange.jsp?componentName="+p["configChange"];
y=y+'<div style="float:left;margin-top:2px;" id="configchange"><a href="javascript:void(0)" > <div onclick="configPop(\''+l+'\')" onmouseover="javascript:void(0)" class="iconConfigUser handSymbol"  data-qclass="yellowTip" style="margin:auto;text-align:center" data-qtip="Configuration"></div></a></div>';
}y=y+"</div>";}y=y+"</div>";j=j+y+"</td></tr></table>";k+=j;}Ext.resumeLayouts(true);r.update(k);c.add(r);}if(!Ext.isEmpty(c.mask)){c.mask.hide();}if(window.parent.globalsearch==true){if(f!=null&&!Ext.isEmpty(f)){if(requestParams.hasOwnProperty("fromPageView")&&requestParams.fromPageView=="Menu"){f.hide();
c.getHeader().hide();if(r!=null&&r!=undefined){r.setTitle(i.ScreenLabels["searchResultText"]+'  "'+window.parent.serverSearchval+'"');}}}}else{if(f!=null&&!Ext.isEmpty(f)){var q=i.action;var o=requestParams.fromPageView;if((q!=null&&q!=undefined&&q!=""&&(q=="componentType"||q=="componentTypeState"))||(!Ext.isEmpty(o)&&o!=null&&requestParams.fromPageView=="zoneDashboard")){f.hide();
}else{f.show();}c.getHeader().show();}}}}});},SubmitButtonClicked:function(){var c=false;url="../servlet/com.eg.EgMonitorController?from=componentList&monCmd=componentList&action=search&searchStateString="+this.getSearchStateCombo().getValue()+"&searchNameString="+this.getNickNameField().getValue()+"&selTypeString="+encodeURI(this.getSearchTypeCombo().getValue())+"&searchTypeString="+this.getSearchTypeField().getValue()+"&searchIndComps=on&treeOpen="+c;
if(!Ext.isEmpty(isServiceBusiViewMetrics)&&isServiceBusiViewMetrics!=null&&isServiceBusiViewMetrics!=undefined&&(isServiceBusiViewMetrics=="true"||isServiceBusiViewMetrics==true)){url=url+"&isServiceBusiViewMetrics="+isServiceBusiViewMetrics;}if(this.getComponentsListPanel().aggregate){url+="&menuName=agg";
}else{if(this.getComponentsListPanel().network){url+="&menuName=network";}}var b=this.getSearchComponentCheck().getValue();if(b===true){url+="&searchIndComps=on";}var a=requestParams.fromPageView;if(!Ext.isEmpty(a)&&a!=null){url+="&fromPageView="+a;}url=url+"&componentListRefresh=yes";if(requestParams.manyComponentTypes!=undefined&&requestParams.manyComponentTypes!=null&&requestParams.manyComponentTypes!=""){url=url+"&manyComponentTypes="+encodeURI(requestParams.manyComponentTypes)+"&manyComponentTitle="+encodeURI(requestParams.manyComponentTitle);
}this.showResult(url);},showResult:function(c){compRefUrl=c;var b=Ext.getCmp("errorpanelId");if(b==null||b==undefined){var d=Ext.getCmp("commonpanel");var a=null;if(!Ext.isEmpty(d)){a=new Ext.LoadMask(d,{msg:"Please wait..."});a.show();}Ext.Ajax.request({url:c,timeout:300000,success:function(f,n){var p=null;
p=f.responseText;var i=null;i=Ext.decode(p);delete p;Ext.destroy(p);var l=Ext.getCmp("componentslistpanel");l.setTitle(i.ListLabels["ListTitle"]?i.ListLabels["ListTitle"]:"Components in  all states");d=Ext.getCmp("commonpanel");var e=d.items.items;for(var v=e.length-1;v>-1;v--){e[v].destroy();}var h=Ext.getCmp("titleTool");
d.update("");if(i["error"]){h.hide();var y=Ext.create("utilities.ErrorPanel",{style:{"border":"0px solid orange"},errorMsg:'<div style="text-align:center;valign:middle;margin:15% auto;"><img src="/final/images/clear.png" class="iconInformation" /><br/><div class="list-empty-text">'+i["error"]+"</div></div>"});
d.add({xtype:"panel",border:false,frame:false,layout:"fit",flex:1,width:"100%",items:y});}else{h.show();var m=i.ListLabels["ComponentList"];Ext.suspendLayouts();var k="";for(var s=0;s<m.length;s++){var j="";j="<table class='table-list-layout' style='width:100%'><tr><td style='width:203px;text-align:center;"+stylefrLight+"'>";
var g=m[s]["showImg"];var t=m[s]["TypeState"];if(!Ext.isEmpty(g)){j=j+'<div style="margin:5px auto 0px auto;display:inline-block;width:48px;height:48px;" align="left"><div style="position:relative;top:0px;left:0px;border:0px solid red;"><img src="'+m[s]["type"]+'"/><div style="position:absolute;top:28px;left:28px;" class="state20_'+t+'"></div></div></div><div style="margin:0px auto 5px auto;width:182px;" data-qclass="yellowTip" class="component-list-left-font" data-qtip="'+m[s].title+'">'+m[s].name+"</div>";
}else{j=j+'<div data-qclass="yellowTip" style="margin:0px auto 5px auto;width:182px;" class="component-list-left-font" data-qtip="'+m[s].title+'">'+m[s].name+"</div>";}j=j+"</td><td>";var u=m[s]["children"];var w="";w="<div>";var z=0;for(var r=0;r<u.length;r++){var o=u[r];if(!Ext.isEmpty(o["configChange"])||!Ext.isEmpty(o["MaintenanceTime"])||(!Ext.isEmpty(o["configChange"])&&!Ext.isEmpty(o["MaintenanceTime"]))){var q=getWidthOfText(o["name"],"f11-normal")+15;
if(q>160){q=160;}var x=q+35;if(x>200){x=200;q=160;}}else{q=200;x=200;}w=w+"<div style='width:240px;float:left;border:0px solid red'>";w=w+'<div style="float:left;display:inline-block;width:'+x+'px"><div class="serviceSegmentComponentName"><img style="position:relative;" src="/final/images/clear.png" class="'+o["stateName"]+'"/><a style="width:90%;padding-left:0px" class="component-list-right-link" data-qclass="yellowTip" href="javascript:void(0)" onclick=\'javascript:componentListToDashboard("'+o["link"]+'","'+o["name"]+'")\' data-qtip="'+o["title"]+'" ><div style="overflow:hidden;text-overflow:ellipsis;width:'+q+'px;">'+o["name"]+"</div></a></div></div>";
if(!Ext.isEmpty(o["MaintenanceTime"])){w=w+'<div style="float:left;margin-top:2px;margin-right:6px"><div class="iconMaintenance" data-qclass="yellowTip" style="margin:auto;text-align:center" data-qtip="'+o["MaintenanceTime"]+'"></div></div>';}if(!Ext.isEmpty(o["configChange"])){w=w+'<div style="float:left;margin-top:2px;"><a href="/final/monitor/EgConfigChange.jsp?componentName='+o["configChange"]+'"> <div class="iconConfigUser handSymbol"  data-qclass="yellowTip" style="margin:auto;text-align:center" data-qtip="Configuration"></div></a></div>';
}w=w+"</div>";}w=w+"</div>";j=j+w+"</td></tr></table>";k+=j;}d.update(k);Ext.resumeLayouts(true);}l.add(d);a.hide();d=null;delete d;l=null;delete l;delete i;Ext.destroy(i);},failure:function(){}});}},backButtonHandler:function(i){var n=requestParams.treeSession;var f=requestParams.isServiceBusiDash;var k=requestParams.isServiceBusiDetails;
var t=requestParams.treeFlag_SBD;var c=requestParams.outsideService_SBD;var z=requestParams.titleText_SBD;var y=requestParams.selectNode_SBD;var p=requestParams.isEmulTrans_SBD;var A=requestParams.serviceState_SBD;var m=requestParams.serviceName;var b=requestParams.treeComeFrom;var d=requestParams.egQuickLaunch;
var s=requestParams.fromPageView;var w=requestParams.subFilter;var l=requestParams.isfromHomepage;var v="";n=(!Ext.isEmpty(n))?n:"";if(s!=null&&s=="simulator"){if(Ext.isEmpty(isFromZoneMenu)||isFromZoneMenu==null||isFromZoneMenu=="null"||isFromZoneMenu==undefined||isFromZoneMenu=="undefined"){isFromZoneMenu="";
}var g=requestParams.treeTitle;var o=requestParams.ltest;var j=requestParams.monitorsBy;var r=requestParams.isLogonType;var q=requestParams.isFromMenu;var h=requestParams.zoneName;var u=requestParams.parentZone;if(r!=null&&r!=undefined&&r!=""&&(r=="true"||r=="false")){document.location="/final/monitor/comparisonDashboard.jsp?treeTitle="+g+"&isFromMenu=true&isLogonType="+r+"&treeTitle="+g+"&monitorsBy="+j+"&ltest="+o;
}else{if(isFromZoneMenu!="true"&&requestParams.fromHomepage!="true"){document.location="/final/monitor/comparisonDashboard.jsp?treeTitle="+g+"&isFromMenu=true&isLogonType=false&treeTitle="+g+"&monitorsBy="+j+"&ltest="+o;}else{if(isFromZoneMenu!=null&&isFromZoneMenu=="true"){document.location="/final/monitor/comparisonDashboard.jsp?treeTitle="+g+"&monitorsBy="+j+"&ltest="+o+"&isFromMenu=false&zoneName="+h+"&parentZone="+u+"&isFromZoneInfra="+isFromZoneInfra+"&fromHomepage="+requestParams.fromHomepage+"&isFromZoneMenu="+isFromZoneMenu;
}else{document.location="/final/monitor/comparisonDashboard.jsp?treeTitle="+g+"&monitorsBy="+j+"&ltest="+o+"&isFromMenu="+q+"&zoneName="+h+"&parentZone="+u+"&isFromZoneInfra="+isFromZoneInfra+"&fromHomepage="+requestParams.fromHomepage;}}}}else{if(s!=null&&s=="zoneDashboard"){document.location="/final/monitor/zoneDash.jsp?&selectNode="+encodeURIComponent("Zone^"+w)+"&selectedParam="+w+"&currentTab=details&zoneName="+w+"&openNode=null&treeFlag=false&fromHomepage="+requestParams.isfromHomepage+"&parentZone="+requestParams.parentZone+"&fromPageView="+s+"&filterBy=zone&subFilter="+w+"&viewId=components&viewPageTitle=Components&viewTreeTitle=Component&componentType=";
}else{if(!Ext.isEmpty(requestParams.refresh)&&requestParams.refresh=="true"){if(fromHealth!=null&&fromHealth!=undefined&&fromHealth!=""&&fromHealth=="true"){document.location="/final/servlet/com.eg.EgMonitorController?monCmd=dashboard&healthView=yes";}else{window.history.go(-2);}}else{if(requestParams.manyComponentTypes!=undefined&&requestParams.manyComponentTypes!=null&&requestParams.manyComponentTypes!=""){document.location="/final/monitor/EgCitrixDashCloud.jsp?activeView=homePage";
}else{if(fromPage!=null&&fromPage=="MyDashboard"){document.location=myDashboardBackUrl;}else{if(requestParams.from=="ZoneDashboard"){if(!Ext.isEmpty(requestParams.iszoneName)&&requestParams.iszoneName!=""&&requestParams.iszoneName!="null"){document.location="/final/monitor/zoneDash.jsp?&selectNode="+encodeURIComponent("Zone^"+requestParams.iszoneName)+"&selectedParam="+requestParams.iszoneName+"&currentTab=details&zoneName="+requestParams.iszoneName+"&iszoneName="+requestParams.iszoneName+"&aggregateTab=false&openNode=null&treeFlag=false&fromHomepage="+requestParams.isfromHomepage+"&parentZone="+requestParams.parentZone+"&fromPageView="+s+"&parentZone="+requestParams.parentZone;
}else{if(fromHealth!=null&&fromHealth!=undefined&&fromHealth!=""&&fromHealth=="true"){document.location="/final/servlet/com.eg.EgMonitorController?monCmd=dashboard&healthView=yes";}else{document.location="/final/servlet/com.eg.EgMonitorController?monCmd=dashboard";}}}else{if(requestParams.from=="MainDashboard"){if(f=="true"){document.location="/final/servlet/com.eg.EgMonitorController?monCmd=serviceList&from=MainDashboard&action=service&isServiceBusiDash=true&isFromMenu=true";
}else{if(k=="true"){var a="/final/monitor/serviceBusinessDetailsMain.jsp?treeFlag="+t+"&outsideService="+c+"&titleText="+z+"&selectNode="+y+"&serviceFromZone="+m+"&isEmulTrans="+p+"&serviceName="+m+"&serviceState="+A+"&isServiceBusiDash="+f;if(!Ext.isEmpty(csrfToken)&&csrfToken!=null&&csrfToken!=undefined){a=a+"&com.eg.CSRF_NONCE="+csrfToken;
}document.location=a;}else{if(fromHealth!=null&&fromHealth!=undefined&&fromHealth!=""&&fromHealth=="true"){document.location="/final/servlet/com.eg.EgMonitorController?monCmd=dashboard&healthView=yes";}else{if(requestParams.isfromHomepage!=null&&requestParams.isfromHomepage!=undefined&&requestParams.isfromHomepage=="true"){document.location="/final/servlet/com.eg.EgMonitorController?monCmd=dashboard";
}else{if(n!=null&&n!=""){document.location=n;}else{document.location="/final/servlet/com.eg.EgMonitorController?monCmd=dashboard";}}}}}}else{if(d=="true"){if(fromHealth!=null&&fromHealth!=undefined&&fromHealth!=""&&fromHealth=="true"){document.location="/final/servlet/com.eg.EgMonitorController?monCmd=dashboard&healthView=yes";
}else{document.location="/final/servlet/com.eg.EgMonitorController?monCmd=dashboard";}}else{if(fromHealth!=null&&fromHealth!=undefined&&fromHealth!=""&&fromHealth=="true"){document.location="/final/servlet/com.eg.EgMonitorController?monCmd=dashboard&healthView=yes";}else{if(w==null||w=="null"||Ext.isEmpty(w)||w==undefined||w=="undefined"){w=requestParams.iszoneName;
}if(s!=null&&(s=="Zone"||s=="ZoneMap"||s=="HomeZone")){if(l!=null&&l!=undefined&&l!=""&&l=="true"){document.location="/final/monitor/zoneDash.jsp?&selectNode="+encodeURIComponent("Zone^"+w)+"&selectedParam="+w+"&currentTab=details&zoneName="+w+"&iszoneName="+w+"&aggregateTab=false&openNode=null&treeFlag=false&fromHomepage="+l+"&fromPageView="+s+"&parentZone="+requestParams.parentZone+"&isFromZoneMenu="+isFromZoneMenu;
}else{document.location="/final/monitor/zoneDash.jsp?&selectNode="+encodeURIComponent("Zone^"+w)+"&selectedParam="+w+"&currentTab=details&zoneName="+w+"&iszoneName="+w+"&aggregateTab=false&openNode=null&treeFlag=false&fromPageView="+s+"&parentZone="+requestParams.parentZone+"&isFromZoneMenu="+isFromZoneMenu;
}}else{if(s!=null&&s=="Home"){document.location="/final/servlet/com.eg.EgMonitorController?monCmd=dashboard";}else{if(!Ext.isEmpty(n)&&n!=null&&n!=undefined&&n.indexOf("isServiceBusiViewMetrics")!=-1){var a="/final/monitor/serviceBusinessDetailsMain.jsp?treeFlag="+t+"&outsideService="+c+"&titleText="+z+"&selectNode="+y+"&serviceFromZone="+m+"&isEmulTrans="+p+"&serviceName="+m+"&serviceState="+A+"&isServiceBusiDash="+f;
if(!Ext.isEmpty(csrfToken)&&csrfToken!=null&&csrfToken!=undefined){a=a+"&com.eg.CSRF_NONCE="+csrfToken;}try{if(requestParams.fromPageView=="Menu"){a+="&isFromMenu=true";}}catch(x){}document.location=a;}else{if(!Ext.isEmpty(n)&&n!=null&&n!=undefined&&n.indexOf("isServiceBusiDash")!=-1){var a="";if(y!="null"){a="/final/monitor/serviceBusinessDetailsMain.jsp?treeFlag="+t+"&outsideService="+c+"&titleText="+z+"&selectNode="+y+"&serviceFromZone="+m+"&isEmulTrans="+p+"&serviceName="+m+"&serviceState="+A+"&isServiceBusiDash="+f;
}else{a="/final/monitor/servicesBusinessDashMain.jsp?monCmd=serviceList&from=MainDashboard&action=service&isServiceBusiDash=true&showLegend=true&isServiceBusiDash=true";}try{if(requestParams.fromPageView=="Menu"){a+="&isFromMenu=true";}}catch(x){}document.location=a;}else{window.history.go(-1);}}}}}}}}}}}}}},metricRefresh:function(){var f=Ext.getCmp("listButId");
var e=Ext.getCmp("GridButId");if(e!=null&&e!=undefined){e.removeCls("iconCompGridviewSelect");e.removeCls("iconCompGridview");e.addCls("iconCompGridviewSelect");}if(f!=null&&f!=undefined){f.removeCls("iconCompListviewSelect");f.removeCls("iconCompListview");f.addCls("iconCompListview");}if(Refurl!=null){var a=Refurl;
}if(Refid=="system"||Refid=="component"||Refid=="components"||Refid=="network"){var d=Ext.getCmp("componentslistpanel");var g=d.items.items;for(var h=g.length-1;h>-1;h--){g[h].destroy();}var c=false;if(requestParams.hasOwnProperty("fromPageView")&&!Ext.isEmpty(requestParams.fromPageView)&&requestParams.fromPageView=="zoneDashboard"){c=true;
}d.add({xtype:"generalMeasuresGridPanel",itemId:Refid,margin:0,padding:0,frame:false,border:true,disableCombo:c,layout:{type:"vbox",align:"stretch"},flex:1,screenLabelPath:"monitor.Dashboard",url:a,listeners:{"afterrender":function(j){this.loadTab(j.url,Reftot,RefpageVal,"","","","componentList");}}});
}else{var i="Systems";var b="system";var d=Ext.getCmp("componentslistpanel");var g=d.items.items;for(var h=g.length-1;h>-1;h--){g[h].destroy();}if(a.indexOf("treeTitle=System")>-1){i="Systems";b="system";}else{if(a.indexOf("treeTitle=Component")>-1){i="Components";b="components";}else{i="Systems";b="system";
}}d.setTitle(i);d.header.addClass("panelTitle");d.add({xtype:"generalMeasuresGridPanel",itemId:b,margin:0,padding:0,frame:false,border:true,layout:{type:"vbox",align:"stretch"},flex:1,screenLabelPath:"monitor.Dashboard",url:a,listeners:{"afterrender":function(j){this.loadTab(j.url,Reftot,RefpageVal,"","","","componentList");
}}});}},refresh:function(l){var h=false;var n="../servlet/com.eg.EgMonitorController?";var x="";var b="search";var e="componentList";var E="";var z="";var A="";var s="";var u="";var g="";var D="";var i="";if(!Ext.isEmpty(l)&&l!=""){var t="";var d=true;if(l.indexOf("?")>-1){t=l.split("?");d=false;}else{t=l;
}if(!Ext.isEmpty(t)){var m=null;if(d){m=t.split("&");}else{if(!Ext.isEmpty(t[1])){m=t[1].split("&");}else{if(!Ext.isEmpty(t[0])){m=t[0].split("&");}}}if(!Ext.isEmpty(m)){for(var C=0;C<m.length;C++){if(!Ext.isEmpty(m[C])){var y=m[C].split("=");if((!Ext.isEmpty(y))&&y[0]=="componentType"){x=y[1];}if((!Ext.isEmpty(y))&&y[0]=="action"){b=y[1];
}if((!Ext.isEmpty(y))&&y[0]=="stateName"){E=y[1];}if((!Ext.isEmpty(y))&&y[0]=="service"){z=y[1];}if((!Ext.isEmpty(y))&&y[0]=="site"){A=y[1];}if((!Ext.isEmpty(y))&&y[0]=="segment"){s=y[1];}if((!Ext.isEmpty(y))&&y[0]=="zoneName"){u=y[1];}if((!Ext.isEmpty(y))&&y[0]=="userName"){g=y[1];}if((!Ext.isEmpty(y))&&y[0]=="fromPageView"){D=y[1];
}if((!Ext.isEmpty(y))&&y[0]=="selectedState"){i=y[1];}}}}}}var p=null;if(!Ext.isEmpty(this.getSearchStateCombo())){p=this.getSearchStateCombo().getValue();if(b!=null&&b!=undefined&&b=="globalsearch"){b="globalsearch";}else{b="search";}}else{if(!Ext.isEmpty(E)){p=E;}else{p="";}}var F=null;if(!Ext.isEmpty(this.getNickNameField())){F=this.getNickNameField().getValue();
if(b!=null&&b!=undefined&&b=="globalsearch"){b="globalsearch";}else{b="search";}}else{F="";}var q=null;if(!Ext.isEmpty(this.getSearchTypeCombo())){q=this.getSearchTypeCombo().getValue();if(b!=null&&b!=undefined&&b=="globalsearch"){b="globalsearch";}else{b="search";}}else{if(!Ext.isEmpty(x)){q=x;}else{q="";
}}var j=null;if(!Ext.isEmpty(this.getSearchTypeField())){j=this.getSearchTypeField().getValue();if(b!=null&&b!=undefined&&b=="globalsearch"){b="globalsearch";}else{b="search";}}else{if(!Ext.isEmpty(b)){j=b;}else{j="";}}if(requestParams.action==="search"){if(this.getComponentsListPanel().aggregate){n="../servlet/com.eg.EgMonitorController?from="+e+"&monCmd=componentList&action=search&searchStateString="+p+"&searchNameString="+F+"&selTypeString="+q+"&searchTypeString="+j+"&treeOpen="+h+"&refresh=true&menuName=agg&fromPage="+fromPage;
}else{if(this.getComponentsListPanel().network){n="../servlet/com.eg.EgMonitorController?from="+e+"&monCmd=componentList&action=search&searchStateString="+p+"&searchNameString="+F+"&selTypeString="+q+"&searchTypeString="+j+"&treeOpen="+h+"&refresh=true&menuName=network&fromPage="+fromPage;}else{n="../servlet/com.eg.EgMonitorController?from="+e+"&monCmd=componentList&action=search&searchStateString="+p+"&searchNameString="+F+"&selTypeString="+q+"&searchTypeString="+j+"&treeOpen="+h+"&refresh=true&fromPage="+fromPage;
}}}else{if(this.getComponentsListPanel().aggregate){n="../servlet/com.eg.EgMonitorController?from="+e+"&monCmd=componentList&action="+b+"&searchStateString="+p+"&searchNameString="+F+"&selTypeString="+q+"&searchTypeString="+j+"&treeOpen="+h+"&refresh=true&menuName=agg";}else{if(this.getComponentsListPanel().network){n="../servlet/com.eg.EgMonitorController?from="+e+"&monCmd=componentList&action="+b+"&searchStateString="+p+"&searchNameString="+F+"&selTypeString="+q+"&searchTypeString="+j+"&treeOpen="+h+"&refresh=true&menuName=network";
}else{if(b!=null&&b=="search"){var w=requestParams.action;w=(w==null||w==undefined||w=="null")?"":w;var v=requestParams.componentType;v=(v==null||v==undefined||v=="null")?"":v;var r=requestParams.fromPageView;r=(r==null||r==undefined||r=="null")?"":r;var B=requestParams.subFilter;B=(B==null||B==undefined||B=="null")?"":B;
var o=requestParams.userName;o=(o==null||o==undefined||o=="null")?"":o;var c=requestParams.selectedState;c=(c==null||c==undefined||c=="null")?"":c;if(B!=null&&B!=undefined&&B!=""&&v!=null&&v!=undefined&&v!=""){n="../servlet/com.eg.EgMonitorController?from="+e+"&monCmd=componentList&action="+w+"&searchStateString="+p+"&searchNameString="+F+"&selTypeString="+q+"&searchTypeString="+j+"&treeOpen="+h+"&partOf=yes&componentType="+v+"&fromPageView="+r+"&zoneName="+B+"&userName="+o+"&stateName="+c+"&selectedState="+c;
}else{if(v!=null&&v!=undefined&&v!=""){n="../servlet/com.eg.EgMonitorController?from="+e+"&monCmd=componentList&action="+w+"&searchStateString="+p+"&searchNameString="+F+"&selTypeString="+q+"&searchTypeString="+j+"&treeOpen="+h+"&componentType="+v+"&fromPageView="+r+"&userName="+o+"&stateName="+c+"&selectedState="+c;
}else{if((v==null&&v==undefined&&v=="")||(b!=null&&b=="search")){if((p!=null&&p!=undefined)||(F!=null&&F!=undefined)||(q!=null&&q!=undefined)||(j!=null&&j!=undefined)){n="../servlet/com.eg.EgMonitorController?from="+e+"&monCmd=componentList&action="+b+"&searchStateString="+p+"&searchNameString="+F+"&selTypeString="+q+"&searchTypeString="+j+"&treeOpen="+h;
}else{n="../servlet/com.eg.EgMonitorController?monCmd=componentList&from=componentList&action=component&isFromMenu=true";}}}}}else{if(u!=null&&u!=undefined&&u!=""){n="../servlet/com.eg.EgMonitorController?from="+e+"&monCmd=componentList&action="+b+"&searchStateString="+p+"&searchNameString="+F+"&selTypeString="+q+"&searchTypeString="+j+"&treeOpen="+h+"&partOf=yes";
}else{n="../servlet/com.eg.EgMonitorController?from="+e+"&monCmd=componentList&action="+b+"&searchStateString="+p+"&searchNameString="+F+"&selTypeString="+q+"&searchTypeString="+j+"&treeOpen="+h;}}}}}var a=true;if(!Ext.isEmpty(this.getSearchComponentCheck())){a=this.getSearchComponentCheck().getValue();
}if(a===true){n+="&searchIndComps=on";}n=n+"&componentListRefresh=yes";if((!Ext.isEmpty(E))&&E!=""){n=n+"&stateName="+E;}if((!Ext.isEmpty(x))&&x!=""){n=n+"&componentType="+x;}if(fromHealth!=null&&fromHealth!=undefined&&fromHealth!=""){n=n+"&fromHealth="+fromHealth;}if((!Ext.isEmpty(z))&&z!=""){n=n+"&service="+z;
}if((!Ext.isEmpty(A))&&A!=""){n=n+"&site="+A;}if((!Ext.isEmpty(s))&&s!=""){n=n+"&segment="+s;}if((!Ext.isEmpty(u))&&u!=""){n=n+"&zoneName="+u;}if((!Ext.isEmpty(g))&&g!=""){n=n+"&userName="+g;}if((!Ext.isEmpty(D))&&D!=""){n=n+"&fromPageView="+D;}if((!Ext.isEmpty(i))&&i!=""){n=n+"&selectedState="+i;}if(!Ext.isEmpty(requestParams)&&requestParams.fromPageView=="UserView"){var k=Ext.getCmp("componentslistpanel").url;
if(k!=null&&k!=undefined&&k!=""){this.updateRefresh(k);}}else{if(compRefUrl!=null&&compRefUrl!=undefined&&compRefUrl!=""){this.updateRefresh(compRefUrl);}else{this.updateRefresh(n);}}},updateRefresh:function(b){var a="";var c=Ext.getCmp("commonpanel");if(!Ext.isEmpty(c)){a=new Ext.LoadMask(c,{msg:"Please wait..."});
}if(!Ext.isEmpty(a)){a.show();}Ext.Ajax.request({url:b,scope:this,timeout:300000,success:function(e,q){var u=null;u=e.responseText;var j=null;j=Ext.decode(u);delete u;Ext.destroy(u);if(!Ext.isEmpty(j.HiddenFields.menuName)&&j.HiddenFields.menuName=="agg"){componentsList.app.aggregate=true;}else{if(!Ext.isEmpty(j.HiddenFields.menuName)&&j.HiddenFields.menuName=="network"){componentsList.app.network=true;
}}var x=Ext.getCmp("back");if(!Ext.isEmpty(x)){x.setText(j.ScreenLabels["backButtonText"]);}x=null;delete x;var l=Ext.getCmp("componentslistpanel");if(j.ListLabels["ListTitle"]!=undefined&&j.ListLabels["ListTitle"]!=null){l.setTitle(j.ListLabels["ListTitle"]?j.ListLabels["ListTitle"]:"");}else{l.setTitle(j.ScreenLabels["Title"]?j.ScreenLabels["Title"]:"");
}var B=Ext.getCmp("searchState");if(!Ext.isEmpty(B)){B.getStore().loadRawData(j.SearchLabels.searchStateString);B.value=j.SearchLabels.searchStateStringSelected?j.SearchLabels.searchStateStringSelected:j.SearchLabels.searchStateString[0].value;}B=null;delete B;var t=Ext.getCmp("nickName");if(!Ext.isEmpty(t)){t.value=j.SearchLabels["searchNameString"]?j.SearchLabels["searchNameString"]:"";
}t=null;delete t;var p=Ext.getCmp("Type");if(!Ext.isEmpty(p)){p.getStore().loadRawData(j.SearchLabels.selTypeString);p.value=j.SearchLabels.selTypeStringSelected?j.SearchLabels.selTypeStringSelected:j.SearchLabels.selTypeString[0].value;}p=null;delete p;var n=Ext.getCmp("searchType");if(!Ext.isEmpty(n)){n.value=j.SearchLabels["typeString"]?j.SearchLabels["typeString"]:"";
}n=null;delete n;var f=Ext.getCmp("searchComp");if(!Ext.isEmpty(f)){f.boxLabel=j.SearchLabels["searchIndComps"]?j.SearchLabels["searchIndComps"]:"";}f=null;delete f;c=Ext.getCmp("commonpanel");if(!Ext.isEmpty(c)){var h=Ext.getCmp("titleTool");var d=c.items.items;for(var D=d.length-1;D>-1;D--){d[D].destroy();
}if(j["error"]){h.hide();var F=Ext.create("utilities.ErrorPanel",{style:{"border":"0px solid orange"},errorMsg:'<div style="text-align:center;valign:middle;margin:15% auto;"><img src="/final/images/clear.png" class="iconInformation" /><br/><div class="list-empty-text">'+j["error"]+"</div></div>"});c.add({xtype:"panel",border:false,layout:"fit",flex:1,width:"100%",items:F});
}else{h.show();var o=j.ListLabels["ComponentList"];Ext.suspendLayouts();var k="";for(var z=0;z<o.length;z++){var i="";i="<table class='table-list-layout' style='width:100%'><tr><td style='width:203px;text-align:center;"+stylefrLight+"'>";var g=o[z]["showImg"];var y=o[z]["TypeState"];if(!Ext.isEmpty(g)){i=i+'<div style="margin:5px auto 0px auto;display:inline-block;width:48px;height:48px;" align="left"><div style="position:relative;top:0px;left:0px;border:0px solid red;"><img src="'+o[z]["type"]+'"/><div style="position:absolute;top:28px;left:28px;" class="state20_'+y+'"></div></div></div><div style="margin:0px auto 5px auto;width:182px;" data-qclass="yellowTip" class="component-list-left-font" data-qtip="'+o[z].title+'">'+o[z].name+"</div>";
}else{i=i+'<div data-qclass="yellowTip" style="margin:0px auto 5px auto;width:182px;" class="component-list-left-font" data-qtip="'+o[z].title+'">'+o[z].name+"</div>";}i=i+"</td><td>";var A=o[z]["children"];var C="";C="<div>";var G=0;for(var w=0;w<A.length;w++){var r=A[w];if(!Ext.isEmpty(r["configChange"])||!Ext.isEmpty(r["MaintenanceTime"])||(!Ext.isEmpty(r["configChange"])&&!Ext.isEmpty(r["MaintenanceTime"]))){var v=getWidthOfText(r["name"],"f11-normal")+15;
if(v>160){v=160;}var E=v+35;if(E>200){E=200;v=160;}}else{v=200;E=200;}C=C+"<div style='width:240px;float:left;border:0px solid red'>";C=C+'<div style="float:left;display:inline-block;width:'+E+'px"><div class="serviceSegmentComponentName"><img style="position:relative;" src="/final/images/clear.png" class="'+r["stateName"]+'"/><a style="width:90%;padding-left:0px" class="component-list-right-link" data-qclass="yellowTip" href="javascript:void(0)" onclick=\'javascript:componentListToDashboard("'+r["link"]+'","'+r["name"]+'")\' data-qtip="'+r["title"]+'" ><div style="overflow:hidden;text-overflow:ellipsis;width:'+v+'px;">'+r["name"]+"</div></a></div></div>";
if(!Ext.isEmpty(r["MaintenanceTime"])){C=C+'<div style="float:left;margin-top:2px;margin-right:6px"><div class="iconMaintenance" data-qclass="yellowTip" style="margin:auto;text-align:center" data-qtip="'+r["MaintenanceTime"]+'"></div></div>';}if(!Ext.isEmpty(r["configChange"])){var m="/final/monitor/EgConfigChange.jsp?componentName="+r["configChange"];
C=C+'<div style="float:left;margin-top:2px;" id="configchange"><a href="javascript:void(0)" > <div onclick="configPop(\''+m+'\')" onmouseover="javascript:void(0)" class="iconConfigUser handSymbol"  data-qclass="yellowTip" style="margin:auto;text-align:center" data-qtip="Configuration"></div></a></div>';
}C=C+"</div>";}C=C+"</div>";i=i+C+"</td></tr></table>";k+=i;}c.update(k);Ext.resumeLayouts(true);}l.add(c);a.hide();h=null;delete h;c=null;delete c;l=null;delete l;}delete j;Ext.destroy(j);var H=Ext.getCmp("listButId");var s=Ext.getCmp("GridButId");if(s!=null&&s!=undefined){s.removeCls("iconCompGridviewSelect");
s.removeCls("iconCompGridview");s.addCls("iconCompGridview");}if(H!=null&&H!=undefined){H.removeCls("iconCompListviewSelect");H.removeCls("iconCompListview");H.addCls("iconCompListviewSelect");}},failure:function(){}});},componentListToDashboard:function(l,b){var a=true;var o=requestParams.isAggregate;
var i=requestParams.isNetwork;var e=requestParams.isServiceBusiDash;var g=requestParams.isServiceBusiDetails;var d=requestParams.treeFlag_SBD;var c=requestParams.outsideService_SBD;var n=requestParams.titleText_SBD;var p=requestParams.selectNode_SBD;var k=requestParams.isEmulTrans_SBD;var h=requestParams.serviceState_SBD;
var f=requestParams.serviceName;var m=requestParams.stateName;var j=requestParams.from;l=l+"&ComponentTree="+a+"&selected="+b+"&PagesComesfrom="+PagesComesfrom+"&actionFrom="+requestParams.action+"&componentType="+componentType+"&isAggregate="+o+"&isNetwork="+i+"&isServiceBusiDash="+e+"&isServiceBusiDetails="+g+"&treeFlag_SBD="+d+"&outsideService_SBD="+c+"&titleText_SBD="+n+"&selectNode_SBD="+p+"&isEmulTrans_SBD="+k+"&serviceState_SBD="+h+"&serviceName="+f+"&compState="+m+"&fromUserView="+j+"&fromHealth="+fromHealth;
if(!Ext.isEmpty(csrfToken)&&csrfToken!=null&&csrfToken!=undefined){l=l+"&com.eg.CSRF_NONCE="+csrfToken;}document.location=l;},itemset:function(a,c){var b=this.getCommonPanel().itemId;a.add(a.setData("","",b));},combo:function(f,h,c){var k=this.getCommonPanel().itemId;var n=this.getConfigWindowForm().getForm().getValues()["selectedTab"];
var o=this.getConfigWindowForm().getForm().getValues()["perform"];var l=this.getConfigWindowForm().getForm().getValues()["descMeasureUnit"];var i="";i=this.getConfigWindowForm().getForm().getValues()["TestFunc"];var b=f.getName();var e=f.getValue();var g;if(n=="Component"||n=="Aggregate"){g=this.getConfigWindowForm().getForm().getValues()["serviceComp"];
}if(b=="serviceComp"){this.getConfigWindow().setData(n,o,k,g,"","","",l,i,"",b,e);}if(b=="compLayer"){var d=this.getConfigWindowForm().getForm().findField("compLayer").getValue();this.getConfigWindow().setData(n,o,k,g,d,"","",l,i,"",b,e);}else{if(b=="serviceTest"){var d;if(o=="Add"){d=this.getConfigWindowForm().getForm().findField("compLayer").getValue();
}else{d="";}var m=this.getConfigWindowForm().getForm().findField("serviceTest").getValue();this.getConfigWindow().setData(n,o,k,g,d,m,"",l,i,"",b,e);}else{if(b=="serviceMeasure"){var d;if(o=="Add"){d=this.getConfigWindowForm().getForm().findField("compLayer").getValue();}else{d="";}var m=this.getConfigWindowForm().getForm().findField("serviceTest").getValue();
var j=this.getConfigWindowForm().getForm().findField("serviceMeasure").getValue();var a=h[0].data.name;this.getConfigWindow().setData(n,o,k,g,d,m,j,l,i,a,b,e);}else{}}}},radio:function(e,h,f,a){var k=this.getCommonPanel().itemId;var c="";var g="";var d="";var m="";var j="";var b="";var n=this.getConfigWindowForm().getForm().getValues()["selectedTab"];
var o=this.getConfigWindowForm().getForm().getValues()["perform"];var l="";var i="";if(o=="Add"||o=="Modify"){i=this.getConfigWindowForm().getForm().getValues()["TestFunc"];}if(e.getName()=="Does the Test have Descriptors ?"||e.getName()=="Function"){if(o=="Add"){d=this.getConfigWindowForm().getForm().findField("compLayer").getValue();
}if(n=="Component"||n=="Aggregate"){g=this.getConfigWindowForm().getForm().findField("serviceComp").getValue();}m=this.getConfigWindowForm().getForm().findField("serviceTest").getValue();j=this.getConfigWindowForm().getForm().findField("serviceMeasure").getValue();b=this.getConfigWindowForm().getForm().findField("serviceDispName").getValue();
c=e.name;}if(e.getName()!="Function"){this.getConfigWindow().setData(n,o,k,g,d,m,j,l,i,b,c,"");}},buttonclick:function(j,m,a){var l=this.getCommonPanel().itemId;var n=false;var o=this;var f="/final/monitor/serviceDashboardConfigP.jsp";var p=this.getConfigWindowForm().getForm().getValues()["perform"];
var g="selectType=Update";var q=this.getConfigWindow().jsonData.Window.fields;var k=this.getConfigWindow().jsonData.Window.screenlabels[0];for(var h=0;h<q.length;h++){if(q[h].type=="combo"){var d=q[h].name;if(this.getConfigWindowForm().getForm().findField(d).getValue()==-1){Ext.Msg.show({title:"ALERT",cls:"msgtextalign",msg:k[d],buttons:Ext.Msg.OK});
n=true;break;}else{if(d=="serviceTest"){d="testName";}g+="&"+d+"="+q[h].selected;}}else{if(q[h].type=="textfield"){var c=this.getConfigWindowForm().getForm().findField("serviceDispName").getValue();n=true;while(true){if(c.indexOf("?")!=-1){c=c.replace("?","qqsstt");}if(c.indexOf("'")!=-1){c=c.replace("'","sinCour");
}if(c.indexOf("-")!=-1){c=c.replace("-","minSym");}if(c.indexOf("?")==-1&&c.indexOf("'")==-1&&c.indexOf("'")==-1){break;}}if(c.length<1){Ext.Msg.show({title:"ALERT",cls:"msgtextalign",msg:"Please enter display name",buttons:Ext.Msg.OK});}else{if(this.hasSpecialCharacters(c)){if(this.hasNumbers(c)){g+="&"+q[h].name+"="+c;
n=false;}else{Ext.Msg.show({title:"ALERT",cls:"msgtextalign",msg:"Please enter display name",buttons:Ext.Msg.OK});}}else{g+="&"+q[h].name+"="+c;n=false;}}}else{if(q[h].selected=="Component"){q[h].selected="Application";}g+="&"+q[h].name+"="+q[h].selected;}}}var b=this.getConfigWindowForm().getForm().getValues()["TestFunc"];
if(p=="Modify"){g+="&selectedfunc="+b;}if(n==false){Ext.Ajax.request({url:f,params:g,method:"POST",scope:this,timeout:300000,success:function(s){var x=this.getConfigWindowForm().getForm().getValues()["selectedTab"];var y=this.getConfigWindowForm().getForm().getValues()["perform"];var e="";var u=-1;var w=this.getConfigWindowForm().getForm().findField("serviceTest").getValue();
var i="";var r="";var v="";var t="";if(y=="Add"){v=this.getConfigWindowForm().getForm().getValues()["descMeasureUnit"];t=this.getConfigWindowForm().getForm().getValues()["TestFunc"];i=this.getConfigWindowForm().getForm().findField("compLayer").getValue();Ext.Msg.show({title:"STATUS",cls:"msgtextalign",msg:"Measure Added Successfully",buttons:Ext.Msg.OK});
}else{if(y=="Delete"){Ext.Msg.show({title:"STATUS",cls:"msgtextalign",msg:"Measure Deleted Successfully",buttons:Ext.Msg.OK});}else{if(y=="Modify"){t=this.getConfigWindowForm().getForm().getValues()["TestFunc"];Ext.Msg.show({title:"STATUS",cls:"msgtextalign",msg:"Measure Modified Successfully",buttons:Ext.Msg.OK});
}}}if(x=="Component"||x=="Aggregate"){r=this.getConfigWindowForm().getForm().findField("serviceComp").getValue();}this.getConfigWindow().setData(x,y,l,r,i,w,u,v,t,e,d,"");},failure:function(){}});}if(n==false){Ext.Function.defer(function(){o.setValues(n);},350);}},setValues:function(a){if(a==false){var c=this.getConfigWindow().jsonData.Window.fields;
var d=false;for(var b=0;b<c.length;b++){if(c[b].type=="combo"){if(c[b].selected!="Not Applicable!"){d=true;}if(!d&&(this.getConfigWindowForm().getForm().getValues()["perform"]=="Delete"||this.getConfigWindowForm().getForm().getValues()["perform"]=="Modify")){this.getConfigWindowForm().getForm().findField(c[b].name).setValue(-1);
}}d=false;}}},hasNumbers:function(a){var b=/\d/g;return b.test(a);},hasSpecialCharacters:function(b){var a=b.split("");if(a!=null&&a!=undefined&&a.length>0){for(var d=0;d<a.length;d++){var e=a[d];if(!(e==" "||e==")"||e=="("||e=="_"||e.match(/^[-'a-z\u4e00-\u9eff]{1,20}$/i))){return true;}}return false;
}},});