var rootComponentArray=null;var compLength="";var splitLen=50;var startcount="";Ext.define("zones.controller.Main",{extend:"Ext.app.Controller",views:["zones.view.Main","zones.view.ZonesDashboard","zones.view.ListPanel","zones.view.ZoneUsers","zones.view.ListComponent"],stores:["zones.store.ZoneUsers","zones.store.ProblemAnalysisProblems","zones.store.ProblemAnalysisComponents"],refs:[{ref:"main",selector:"main"},{ref:"problemAnalysis",selector:"problemanalysis"},{ref:"infrastructureHealthView",selector:"infrastructurehealthview"},{ref:"listPanel",selector:"listpanel"},{ref:"listPanelToolbar",selector:"listpanel>toolbar"},{ref:"optionalListPanel",selector:"optionallistpanel"},{ref:"optionalListPanelToolbar",selector:"optionallistpanel>toolbar"},{ref:"zonesDashboard",selector:"zonesdashboard"},{ref:"zoneTreePanel",selector:"zonestreepanel"},{ref:"zoneTree",selector:"zonestreepanel > panel"},{ref:"measures",selector:"measures"},{ref:"measureAndAnalysis",selector:"measureandanalysis"},{ref:"listComponent",selector:"listcomponent"},{ref:"optionalListComponent",selector:"optionallistcomponent"},{ref:"zoneUsers",selector:"zoneusers"},{ref:"listPanelTrigger",selector:"listpanel trigger"},{ref:"optionalListPanelTrigger",selector:"optionallistpanel trigger"},{ref:"configWindow",selector:"configwindow"},{ref:"componentsPanelCombo",selector:'dashboardgeneralmeasuresgridpanel[itemId="components"] combo'},{ref:"aggregatesPanelCombo",selector:'dashboardgeneralmeasuresaggregatepanel[itemId="aggregates"] combo'},{ref:"healthViewData",selector:"infrastructurehealthviewdata"}],init:function(){setInterval("execute()",refreshFrequency);
this.control({"listpanel trigger":{specialkey:this.zonesSearchKeyPress,click:this.zonesSearch},"listpanel button[action=association]":{click:this.displayListPanelAssociations},"optionallistpanel trigger":{specialkey:this.zonesSearchKeyPress,click:this.zonesSearch},"optionallistpanel button[action=association]":{click:this.displayOptionalListAssociations},"measuresgrid":{render:this.onMeasuresRender},"problemanalysiscomponents":{render:this.problemAnalysisComponentsRender},"listcomponent button[action=zonedetail]":{click:this.displayZoneDetails},"optionallistcomponent button[action=zonedetail]":{click:this.displayZoneDetails},"listpanel button[action=back]":{click:this.backButtonHandler},"optionallistpanel button[action=back]":{click:this.backButtonHandler},"zonestreepanel":{beforerender:function(){if(requestParams.refresh!==true){Ext.state.Manager.clear("zones-tree-panel-stateId");
}},expand:function(){window.parent.zonetreeOpenval=true;},collapse:function(){window.parent.zonetreeOpenval=false;}},"zonestreepanel > panel":{afterrender:this.treeLoad,itemclick:this.treeItemClick},"measureandanalysis":{beforerender:function(){if(requestParams.refresh===true){this.getMeasureAndAnalysis().setActiveTab(requestParams.insideTab);
}}},"configwindow":{"render":this.itemset},"infrastructurehealthview trigger":{specialkey:this.searchKeyPress,click:this.searchData}});},searchKeyPress:function(b,a){if(a.getKey()==a.ENTER){if(!Ext.isEmpty(sortKey)&&sortKey!=null&&sortKey!=undefined){sortKey="";sortState="";}this.searchData(b);}},searchData:function(h){if(h==null||h==undefined||h.value==null||h.value==undefined){return;
}var e=h.value;if(!Ext.isEmpty(e)&&e!=null&&e!=undefined){if(e=="("||e==")"||e=="\\"||e=="?"||e=="["){Ext.MessageBox.show({title:"Alert",msg:"Please enter the valid search pattern",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return;}else{var g=this.getController("ZonesDashboard").jsonData;
var b="";if(!Ext.isEmpty(zonelasInfrastructureMenuSelection)&&zonelasInfrastructureMenuSelection!=null&&zonelasInfrastructureMenuSelection!=undefined){b=zonelasInfrastructureMenuSelection;}else{b=g["selectedInfraStructure"];}if(!Ext.isEmpty(b)){var f=null;if(b=="components"){f=g.healthView.components;
}else{if(b=="aggregates"){f=g.healthView.aggregates;}else{if(b=="segments"){f=g.healthView.segments;}else{if(b=="serviceGroups"){f=g.healthView.serviceGroups;}else{if(b=="services"){f=g.healthView.services;}else{if(b=="zones"){f=g.healthView.zones;}}}}}}if(!Ext.isEmpty(f)&&f!=null&&f!=undefined){var d=new Array();
var c=null;for(var a=0;a<f.length;a++){if(b=="components"||b=="aggregates"){c=f[a].compType;}else{c=f[a].displayName;}c=c.toLowerCase();if((c==e.toLowerCase())||(c.indexOf(e.toLowerCase())>=0)){d.push(f[a]);}}if(!Ext.isEmpty(d)&&d!=null){this.getHealthViewData().createMenuItems(b,d,g.screenLabels);}else{Ext.MessageBox.show({title:"Alert",msg:"No "+b+" Found for the search text - "+e,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
h.setValue("");}}}}}else{var g=this.getController("ZonesDashboard").jsonData;var b="";if(!Ext.isEmpty(zonelasInfrastructureMenuSelection)&&zonelasInfrastructureMenuSelection!=null&&zonelasInfrastructureMenuSelection!=undefined){b=zonelasInfrastructureMenuSelection;}else{b=g["selectedInfraStructure"];
}if(!Ext.isEmpty(b)){var f=null;if(b=="components"){f=g.healthView.components;}else{if(b=="aggregates"){f=g.healthView.aggregates;}else{if(b=="segments"){f=g.healthView.segments;}else{if(b=="serviceGroups"){f=g.healthView.serviceGroups;}else{if(b=="services"){f=g.healthView.services;}else{if(b=="zones"){f=g.healthView.zones;
}}}}}}if(!Ext.isEmpty(f)&&f!=null&&f!=undefined){this.getHealthViewData().createMenuItems(b,f,g.screenLabels);}}}},zonesSearchKeyPress:function(c,b){if(b.getKey()==b.ENTER){zoneSearchText=c.getValue();var a="/final/servlet/com.eg.EgMonitorController?from=zoneList&monCmd=zoneList&action=search&treeFlag=false&Go.x=0&Go.y=0&searchString="+encodeURIComponent(filterEncode(c.getValue()))+"&treeOpen="+!this.getZoneTreePanel().getCollapsed();
this.showResultData(a);}},zonesSearch:function(b){zoneSearchText=b.getValue();var a="/final/servlet/com.eg.EgMonitorController?from=zoneList&monCmd=zoneList&action=search&treeFlag=false&Go.x=0&Go.y=0&searchString="+encodeURIComponent(filterEncode(b.getValue()))+"&treeOpen="+!this.getZoneTreePanel().getCollapsed();
this.showResultData(a);},treeItemClick:function(b,a,f,d,e){if(!Ext.isEmpty(a.raw.link)){var c=a.raw.link;if(!Ext.isEmpty(c)&&c.indexOf("monCmd=zoneList")>-1){this.showResultData(c);}else{if(c.indexOf("outsideZone=true")>-1){this.getZoneTreePanel().currentNode=a.data.text;this.getZoneTree().expandNode(a);
this.displayZoneDetails(b,a);}else{document.location=c;}}}else{this.getZoneTreePanel().currentNode=a.data.text;this.getZoneTree().expandNode(a);this.displayZoneDetails(b,a);}},treeLoad:function(f){var h=this.getZoneTreePanel().currentNode;if(!Ext.isEmpty(requestParams)&&requestParams.refresh=="true"){h=requestParams.selectedTreeNode;
this.getZoneTreePanel().currentNode=requestParams.selectedTreeNode;}if(!Ext.isEmpty(h)){var e;var b=f.getRootNode();if(b.raw.text===h){e=b;f.getSelectionModel().select(e);}else{e=b.findChild("text",h);if(!Ext.isEmpty(e)&&e!=null&&e!=undefined){f.getSelectionModel().select(e);}}if(!Ext.isEmpty(e)&&e!=null&&e!=undefined){var a=e.getDepth();
var d=e;for(var c=0;c<a;c++){if(d.isLeaf()){d.parentNode.expand();}else{d.expand();}d=d.parentNode;}}}if(!Ext.isEmpty(openNodes)&&openNodes!=null&&openNodes!=undefined){var e;var b=f.getRootNode();for(c=0;c<openNodes.length;c++){var g=openNodes[c];if(!Ext.isEmpty(g)&&g!=null&&g!=undefined){if(b.raw.text===g){e=b;
}else{e=b.findChild("text",g);}if(!Ext.isEmpty(e)&&e!=null&&e!=undefined){e.expand();}}}}},itemset:function(a,b){this.getConfigWindow().controllername=this.self.getName();},backButtonHandler:function(a){var b=requestParams.treeSession;var c="";b=(!Ext.isEmpty(b))?b:"";if(fromPage!=null&&fromPage.toLowerCase()=="mydashboard"){document.location=myDashboardBackUrl;
}else{if(b.indexOf("showDashboard")>0){c=b;}if(this.getZoneUsers()){window.history.go(0);return;}if(c.length>0){document.location=c;}else{if(!Ext.isEmpty(requestParams.refresh)&&requestParams.refresh=="true"){window.history.go(-2);}else{window.history.go(-1);}}}},displayListPanelAssociations:function(){this.getListPanel().removeAll();
Ext.Ajax.request({url:"/final/servlet/com.eg.EgMonitorController?monCmd=userZones&selectNode=zone&selectedParam=zone&openNode=null&treeFlag=false&currentTab=association&setAssociate=&frompage=egTreeUserServices",scope:this,timeout:1280000,success:function(a){var c=a.responseText;var b=Ext.decode(c);Ext.getCmp("zonelistpanelsearch").hide();
if(Ext.getCmp("assSeparatorId")!=null){Ext.getCmp("assSeparatorId").hide();}if(Ext.getCmp("zoneAssociationId")!=null){Ext.getCmp("zoneAssociationId").hide();}Ext.getCmp("zonelistpanelbackbtn").show();if(!Ext.isEmpty(b.error)){tempContPanel.add({xtype:"errorpanel",cls:"error-panel",margin:"10",flex:1,frame:true,imageCls:"iconInformation",padding:"0",style:{"text-align":"center"},errorMsg:b.error});
}else{this.getListPanel().setTitle(zoneAssociationsTxt);if(!Ext.isEmpty(this.getListPanelToolbar())){this.getListPanelToolbar().hide();}this.getListPanel().add({xtype:"zoneusers",screenLabels:b.screenLabels,data:b});}},failure:function(){}});},displayOptionalListAssociations:function(){this.getOptionalListPanel().removeAll();
Ext.Ajax.request({url:"/final/servlet/com.eg.EgMonitorController?monCmd=userZones&selectNode=zone&selectedParam=zone&openNode=null&treeFlag=false&currentTab=association&setAssociate=&frompage=egTreeUserServices",scope:this,timeout:1280000,success:function(a){var c=a.responseText;var b=Ext.decode(c);Ext.getCmp("zonelistpanelsearch").hide();
if(Ext.getCmp("assSeparatorId")!=null){Ext.getCmp("assSeparatorId").hide();}if(Ext.getCmp("zoneAssociationId")!=null){Ext.getCmp("zoneAssociationId").hide();}Ext.getCmp("zonelistpanelbackbtn").show();if(!Ext.isEmpty(b.error)){tempContPanel.add({xtype:"errorpanel",cls:"error-panel",margin:"10",flex:1,frame:true,imageCls:"iconInformation",padding:"0",style:{"text-align":"center"},errorMsg:b.error});
}else{this.getOptionalListPanel().setTitle(zoneAssociationsTxt);this.getOptionalListPanel().add({xtype:"zoneusers",screenLabels:b.screenLabels,data:b});}},failure:function(){}});},displayZoneDetails:function(d,f){var h=null;var b=null;var j=false;var c="";var g=this.getCurrentListPanel();if(Ext.isEmpty(d)||d.getXType()=="treeview"){h=f.raw.text;
b="system";j=f.raw.aggregateTab;c=f.raw.iconCls;c=c.substring(c.indexOf("_")+1);}else{if(d.getXType()=="button"){h=d.name;b="details";j=d.aggregateTab;c=d.state;}}var e=this.getZoneTreePanel();var l=!e.getCollapsed();var a="&treeOpen="+l;if(!Ext.isEmpty(e.currentNode)){a+="&openNode="+e.currentNode;}if(!Ext.isEmpty(g)){g.removeAll();
var k=g.getDockedItems();if(!Ext.isEmpty(k)){for(i=0;i<k.length;i++){k[i].hide();}}g.hide();if(!Ext.isEmpty(g.up("main").down("zonesdashboard[id=zoneDashboardId]"))){g.up("main").down("zonesdashboard[id=zoneDashboardId]").destroy();}g.up("main").add({xtype:"zonesdashboard",aggregateTab:j,currentTab:b,currentZone:h,zoneState:c,treeUrl:a,region:"center",flex:4});
}},displayZoneDetailsFromAssociation:function(d){var c=this.getZoneTreePanel();var b=!c.getCollapsed();var a=d.get("link")+"&treeOpen="+b;return a;},problemAnalysisComponentsRender:function(a){a.on("hourComboChange",this.problemAnalysisHourChange,this);},problemAnalysisHourChange:function(b){var a=b.newValue;
if(!Ext.isEmpty(this.getProblemAnalysis())){this.getProblemAnalysis().refreshData(false,a);}},onMeasuresRender:function(a){a.getStore().on("load",this.measuresStoreLoadHandler,this);},measuresStoreLoadHandler:function(c,b){var e=this.getMeasureAndAnalysis();if(c.getCount()==0){var a=e.items.getAt(0);
if(a.xtype!="errorpanel"){var f=this.getMeasures();var g=f.screenLabels["zones.zonehome.Measure At-A-Glance"];var d=f.screenLabels["zones.segments.noDataMsg"]?f.screenLabels["zones.segments.noDataMsg"]:"No measures for the configured Metrics";e.child("#measures").tab.hide();e.insert(0,{xtype:"errorpanel",cls:"error-panel",margin:"10",flex:1,frame:true,imageCls:"iconInformation",padding:"0",style:{"text-align":"center"},title:g,errorMsg:d});
e.setActiveTab(0);}}else{var a=e.items.getAt(0);if(a.xtype=="errorpanel"){e.remove(a);e.child("#measures").tab.show();e.setActiveTab(0);}}},refresh:function(m){if(Ext.isEmpty(this.getConfigWindow())){var p=this.getCurrentListPanel();var h=this.getZonesDashboard();var k=this.getZoneTreePanel();var c=!k.getCollapsed();
var f=null;var q=null;if(!Ext.isEmpty(h)){q=h.aggregateTab;var d=h.getActiveTab();var b=0;var e=null;var n="",l="";var j="";switch(d.itemId){case"system":b=0;e="system";break;case"components":b=1;e="components";n=this.getComponentsPanelCombo().value;break;case"aggregates":b=2;e="aggregates";break;case"details":b=3;
e="details";j=this.getMeasureAndAnalysis().getActiveTab().getItemId();break;}var g;if(!Ext.isEmpty(this.getZoneTreePanel().currentNode)){g=this.getZoneTreePanel().currentNode;}else{g="";}compSelectedValue=n;var o=this;var a="/final/servlet/com.eg.EgMonitorController?from=MainDashboard&monCmd=zoneList&action=zone";
Ext.Ajax.request({url:a,timeout:1280000,success:function(u){var z=u.responseText;var y="";if(!Ext.isEmpty(h)&&!Ext.isEmpty(h.currentZone)){y=h.currentZone;}var s=e;var A=A;var t="";var x=o.getCurrentListPanel();var v=o.getZoneTreePanel();var C=!v.getCollapsed();var r="&treeOpen="+C;if(!Ext.isEmpty(v.currentNode)){r+="&openNode="+v.currentNode;
}if(!Ext.isEmpty(x)){x.removeAll();var B=x.getDockedItems();if(!Ext.isEmpty(B)){for(i=0;i<B.length;i++){B[i].hide();}}if(!Ext.isEmpty(s)&&s=="details"){var w=Ext.getCmp("zonesdetails");if(!Ext.isEmpty(w)){urlForRefresh=urlForRefresh1;if(!Ext.isEmpty(urlForRefresh)&&urlForRefresh.indexOf("Refreshing=true")<0){urlForRefresh=urlForRefresh+"&Refreshing=true";
}o.refreshDetails(urlForRefresh);}}else{if(!Ext.isEmpty(urlForRefresh)&&urlForRefresh.indexOf("Refreshing=true")<0){urlForRefresh=urlForRefresh+"&Refreshing=true";}if(!Ext.isEmpty(s)&&s=="aggregates"){x.up("main").down("zonesdashboard[id=zoneDashboardId]").down("dashboardgeneralmeasuresaggregatepanel[itemId="+s+"]").loadTab(urlForRefresh,"zonesAgg");
}else{if(!Ext.isEmpty(s)&&s=="system"){x.up("main").down("zonesdashboard[id=zoneDashboardId]").down("dashboardgeneralmeasuresgridpanel[itemId="+s+"]").loadTab(urlForRefresh,"zonesSys",Reftot,RefpageVal,ReftotalPageno);}else{if(!Ext.isEmpty(s)&&s=="components"){x.up("main").down("zonesdashboard[id=zoneDashboardId]").down("dashboardgeneralmeasuresgridpanel[itemId="+s+"]").loadTab(urlForRefresh,"zonesComp",Reftot,RefpageVal,ReftotalPageno);
}}}}o.refreshTree();}},failure:function(){}});}else{if(!Ext.isEmpty(p)){if(p.getXType()=="listpanel"){f=this.getListPanelTrigger();}else{f=this.getOptionalListPanelTrigger();}this.refreshListPanel(m,p,f);}}p=null;delete p;h=null;delete h;k=null;delete k;c=null;delete c;f=null;delete f;q=null;delete aggregateTabb;
}},refreshDetails:function(a){var b;var c=this;if(autoRefreshURL!=null&&autoRefreshURL!=undefined&&autoRefreshURL!=""){a=autoRefreshURL;}if(!Ext.isEmpty(sortKey)&&sortKey!=null&&sortKey!=undefined&&sortKey!="null"){a+="&sortKey="+sortKey+"&sortState="+sortState;}Ext.Ajax.request({url:a,timeout:1280000,success:function(d){if(!Ext.isEmpty(c.getMeasures())){c.getMeasures().refreshData(true);
}if(!Ext.isEmpty(c.getProblemAnalysis())){c.getProblemAnalysis().refreshData(true);}var f=Ext.getCmp("searchBox");if(!Ext.isEmpty(f.getValue())){c.searchData(f);}else{var e=c.getController("ZonesDashboard");e.infrastructureHealthViewRender(a);}if(!Ext.isEmpty(c.getMain().down("dashboardsummary"))){c.getMain().down("dashboardsummary").refreshData();
}if(!Ext.isEmpty(c.getMain().down("dashboardsummarychart"))){c.getMain().down("dashboardsummarychart").refreshData();}},failure:function(){}});},load:function(p){if(Ext.isEmpty(this.getConfigWindow())){var o=this.getCurrentListPanel();var h=this.getZonesDashboard();var k=this.getZoneTreePanel();var c=!k.getCollapsed();
var f=null;var q=null;if(!Ext.isEmpty(h)){q=h.aggregateTab;var d=h.getActiveTab();var b=0;var e=null;var m="",l="";var j="";switch(d.itemId){case"system":b=0;e="system";break;case"components":b=1;e="components";m=this.getComponentsPanelCombo().value;break;case"aggregates":b=2;e="aggregates";break;case"details":b=3;
e="details";j=this.getMeasureAndAnalysis().getActiveTab().getItemId();break;}var g;if(!Ext.isEmpty(this.getZoneTreePanel().currentNode)){g=this.getZoneTreePanel().currentNode;}else{g="";}compSelectedValue=m;var n=this;var a="/final/servlet/com.eg.EgMonitorController?from=MainDashboard&monCmd=zoneList&action=zone";
Ext.Ajax.request({url:a,timeout:1280000,success:function(u){var z=u.responseText;var y="";if(!Ext.isEmpty(h)&&!Ext.isEmpty(h.currentZone)){y=h.currentZone;}var s=e;var A=A;var t="";var x=n.getCurrentListPanel();var v=n.getZoneTreePanel();var C=!v.getCollapsed();var r="&treeOpen="+C;if(!Ext.isEmpty(v.currentNode)){r+="&openNode="+v.currentNode;
}if(!Ext.isEmpty(x)){x.removeAll();var B=x.getDockedItems();if(!Ext.isEmpty(B)){for(i=0;i<B.length;i++){B[i].hide();}}if(!Ext.isEmpty(s)&&s=="details"){var w=Ext.getCmp("zonesdetails");if(!Ext.isEmpty(w)){n.loadDetails(p);}}else{if(!Ext.isEmpty(urlForRefresh)&&urlForRefresh.indexOf("Refreshing=true")<0){urlForRefresh=urlForRefresh+"&Refreshing=true";
}if(!Ext.isEmpty(s)&&s=="aggregates"){x.up("main").down("zonesdashboard[id=zoneDashboardId]").down("dashboardgeneralmeasuresaggregatepanel[itemId="+s+"]").loadTab(urlForRefresh,"zonesAgg");}else{if(!Ext.isEmpty(s)&&s=="system"){x.up("main").down("zonesdashboard[id=zoneDashboardId]").down("dashboardgeneralmeasuresgridpanel[itemId="+s+"]").loadTab(urlForRefresh,"zonesSys");
}else{if(!Ext.isEmpty(s)&&s=="components"){x.up("main").down("zonesdashboard[id=zoneDashboardId]").down("dashboardgeneralmeasuresgridpanel[itemId="+s+"]").loadTab(urlForRefresh,"zonesComp");}}}}n.refreshTree();}},failure:function(){}});}else{if(!Ext.isEmpty(o)){if(o.getXType()=="listpanel"){f=this.getListPanelTrigger();
}else{f=this.getOptionalListPanelTrigger();}this.refreshListPanel(refreshURL,o,f);}}o=null;delete o;h=null;delete h;k=null;delete k;c=null;delete c;f=null;delete f;q=null;delete aggregateTabb;}},loadDetails:function(d){var b;var c=this;var a="/final/servlet/com.eg.EgMonitorController?from=MainDashboard&monCmd=zoneList&action=zone";
Ext.Ajax.request({url:a,timeout:1280000,success:function(e){var f=c.getController("ZonesDashboard");f.infrastructureHealthViewload(a);},failure:function(){}});},reload:function(m){if(Ext.isEmpty(this.getConfigWindow())){var p=this.getCurrentListPanel();var h=this.getZonesDashboard();var k=this.getZoneTreePanel();
var c=!k.getCollapsed();var f=null;var q=null;if(!Ext.isEmpty(h)){q=h.aggregateTab;var d=h.getActiveTab();var b=0;var e=null;var n="",l="";var j="";switch(d.itemId){case"system":b=0;e="system";break;case"components":b=1;e="components";n=this.getComponentsPanelCombo().value;break;case"aggregates":b=2;
e="aggregates";break;case"details":b=3;e="details";j=this.getMeasureAndAnalysis().getActiveTab().getItemId();break;}var g;if(!Ext.isEmpty(this.getZoneTreePanel().currentNode)){g=this.getZoneTreePanel().currentNode;}else{g="";}compSelectedValue=n;var o=this;var a="/final/servlet/com.eg.EgMonitorController?from=MainDashboard&monCmd=zoneList&action=zone";
Ext.Ajax.request({url:a,timeout:1280000,success:function(u){var z=u.responseText;var y="";if(!Ext.isEmpty(h)&&!Ext.isEmpty(h.currentZone)){y=h.currentZone;}var s=e;var A=A;var t="";var x=o.getCurrentListPanel();var v=o.getZoneTreePanel();var C=!v.getCollapsed();var r="&treeOpen="+C;if(!Ext.isEmpty(v.currentNode)){r+="&openNode="+v.currentNode;
}if(!Ext.isEmpty(x)){x.removeAll();var B=x.getDockedItems();if(!Ext.isEmpty(B)){for(i=0;i<B.length;i++){B[i].hide();}}if(!Ext.isEmpty(s)&&s=="details"){var w=Ext.getCmp("zonesdetails");if(!Ext.isEmpty(w)){o.reloadDetails(m);}}else{if(!Ext.isEmpty(urlForRefresh)&&urlForRefresh.indexOf("Refreshing=true")<0){urlForRefresh=urlForRefresh+"&Refreshing=true";
}if(!Ext.isEmpty(s)&&s=="aggregates"){x.up("main").down("zonesdashboard[id=zoneDashboardId]").down("dashboardgeneralmeasuresaggregatepanel[itemId="+s+"]").loadTab(urlForRefresh);}else{if(!Ext.isEmpty(s)&&s=="system"){x.up("main").down("zonesdashboard[id=zoneDashboardId]").down("dashboardgeneralmeasuresgridpanel[itemId="+s+"]").loadTab(urlForRefresh,"zonesSys",Reftot,RefpageVal,ReftotalPageno);
}else{if(!Ext.isEmpty(s)&&s=="components"){x.up("main").down("zonesdashboard[id=zoneDashboardId]").down("dashboardgeneralmeasuresgridpanel[itemId="+s+"]").loadTab(urlForRefresh,"zonesComp");}}}}o.refreshTree();}},failure:function(){}});}else{if(!Ext.isEmpty(p)){if(p.getXType()=="listpanel"){f=this.getListPanelTrigger();
}else{f=this.getOptionalListPanelTrigger();}this.refreshListPanel(refreshURL,p,f);}}p=null;delete p;h=null;delete h;k=null;delete k;c=null;delete c;f=null;delete f;q=null;delete aggregateTabb;}},reloadDetails:function(b){var c;var d=this;var a=b;if(b==null||b==undefined||b==""){a="/final/servlet/com.eg.EgMonitorController?from=MainDashboard&monCmd=zoneList&action=zone";
}Ext.Ajax.request({url:a,timeout:1280000,success:function(e){var f=d.getController("ZonesDashboard");f.infrastructureHealthViewReload(a);},failure:function(){}});},refreshListPanel:function(d,a,c){var e=this.getZoneTreePanel();var g=!e.getCollapsed();if(a.child("zoneusers")){if(a===this.getListPanel()){this.displayListPanelAssociations();
}else{if(a===this.getOptionalListPanel()){this.displayOptionalListAssociations();}}this.refreshTree();}else{var f=c.value;if(requestParams.action==="search"){document.location="/final/servlet/com.eg.EgMonitorController?from=zoneList&monCmd=zoneList&action=search&treeFlag=false&Go.x=0&Go.y=0&searchString="+f+"&treeOpen="+g+"&refresh=true";
}else{var b=d+"&searchString="+f+"&treeOpen="+g+"&refresh=true";this.showResultData(b);b=null;delete b;}}e=null;delete e;g=null;delete g;},showResultData:function(b){var c=this.getListPanel();if(Ext.isEmpty(c)){c=this.getOptionalListPanel();}var l=c;c=c.xtype;var d=this.getZonesDashboard();var j=Ext.getCmp("listPanelContents");
var m=Ext.getCmp("zonestreepanel");var o="zones.view.ListComponent";if(!Ext.isEmpty(c)&&c=="optionallistpanel"){o="zones.view.OptionalListComponent";j=Ext.getCmp("componentPanel");}var p=Ext.getCmp("zoneDashboardId");if(!Ext.isEmpty(p)){p.destroy();}if(Ext.isEmpty(j)){Ext.Ajax.request({url:b,timeout:1280000,success:function(r){var t=Ext.getCmp("zoneMain");
var q=Ext.getCmp("listpanel");if(!Ext.isEmpty(q)){t.remove(q);}var s=Ext.getCmp("optionallistpanel");if(!Ext.isEmpty(s)){t.remove(s);}showDashboard=false;var u={xtype:"listpanel",id:"listpanel",region:"center",flex:4,url:"/final/monitor/zones.jsp"};t.add(u);},failure:function(){}});}else{if(!Ext.isEmpty(b)&&b.indexOf("searchString")<0){Ext.getCmp("zonelistpanelsearch").setValue("");
}else{var e=b.split("&");var f="";for(var g=0;g<e.length;g++){var a=e[g]+"&";if(!Ext.isEmpty(a)&&a.indexOf("action")>-1){var h=a.substring(0,a.indexOf("="));var n=a.substring(a.indexOf("=")+1,a.length);a=h+"=search&";}f=f+a;}if(!Ext.isEmpty(f)){b=f;}}var k=this;Ext.Ajax.request({url:b,timeout:1280000,success:function(q){var r=q.responseText;
Ext.Ajax.request({url:"/final/monitor/zones.jsp",timeout:1280000,success:function(t){var x=t.responseText;var y=Ext.decode(x);rootComponentArray=y["RootItem"];if(!Ext.isEmpty(rootComponentArray)){compLength=rootComponentArray.length;j.removeAll();k.refreshTree();var w=k.getCurrentListPanel().getXType();
var C=null;if(w=="listpanel"){C=k.getListPanel().getDockedItems();if(!Ext.isEmpty(C)){for(g=0;g<C.length;g++){if(g==1){C[g].show();}}}}Ext.suspendLayouts();if(compLength>splitLen){for(var B=0;B<splitLen;B++){var s=Ext.create(o,{rootComponent:rootComponentArray[B]});j.add(s);}k.getMain().doLayout();isScroll=true;
}else{for(var B=0;B<rootComponentArray.length;B++){var s=Ext.create(o,{rootComponent:rootComponentArray[B]});j.add(s);k.getMain().doLayout();s=null;delete s;}}Ext.resumeLayouts(true);A=null;delete A;}else{var w=k.getCurrentListPanel().getXType();var C=null;if(!Ext.isEmpty(w)){if(w=="listpanel"){C=k.getListPanel().getDockedItems();
if(!Ext.isEmpty(C)){for(g=0;g<C.length;g++){if(g==1){C[g].hide();}}}}var A=j.items.items;for(var z=A.length-1;z>-1;z--){A[z].destroy();}j.removeAll();}var v="";if(strSkin=="Dark"){var v="#252525";}var u=Ext.create("utilities.ErrorPanel",{cls:"error-panel",margin:"20% 0 auto 0",layout:"fit",width:"100%",height:Ext.getBody().getViewSize().height-80,scroll:false,autoScroll:false,border:false,frame:false,imageCls:"iconInformation",padding:"0",style:{"text-align":"center","background-color":v+"!important"},errorMsg:y.SearchNoListFoundText});
j.add(u);w=null;delete w;C=null;delete C;}x=null;Ext.destroy(x);y=null;Ext.destroy(y);}});r=null;Ext.destroy(r);},failure:function(){}});}c=null;delete c;l=null;delete l;d=null;delete d;m=null;delete m;p=null;delete p;},refreshTree:function(){var a=Ext.getCmp("zonestreepanel");Ext.Ajax.request({url:"/final/monitor/zoneTree.jsp?tree=ZoneTreeModel&width=208&str=sessionID&node=Zone&treeTitle=Zones Navigation",method:"POST",timeout:1280000,success:function(b,f){var g=b.responseText;
var d=Ext.decode(g);d["expanded"]=true;d["cls"]="list-tree-root-expand-collapse";var c=Ext.create("Ext.data.TreeStore",{id:"treestore",root:d});var e=Ext.create("utilities.TreeScrollPanel",{store:c,cls:"treePanelDesign",margin:"8 0 0 8",border:true,frame:true,scroll:false,autoScroll:true,iconCls:"zone22_GRAY",title:Zones,stateId:"zones-tree-panel-stateId",rootVisible:true,useArrows:true,id:"select",listeners:{beforeItemExpand:function(j){var k=j.raw.text;
if(openNodes!=null&&openNodes.indexOf(k)==-1){openNodes.push(k);}},afterItemCollapse:function(k){var l=k.raw.text;if(openNodes!=null&&openNodes.length>0){var j=openNodes.indexOf(l);openNodes.splice(j,1);}}}});var h=Ext.getCmp("id");a.remove(h,true);a.add(e);c=null;delete c;g=null;delete g;d=null;delete d;
e=null;Ext.destroy(e);h=null;delete h;},failure:function(){}});},getCurrentListPanel:function(){var a=null;if(!Ext.isEmpty(this.getListPanel())){a=this.getListPanel();}else{if(!Ext.isEmpty(this.getOptionalListPanel())){a=this.getOptionalListPanel();}}return a;},bulkDataLoad:function(b,d,g){var c=rootComponentArray;
isScroll=false;var e="",f="";if(g!=null&&g!=""&&g=="zones.view.ListComponent"){e=Ext.getCmp("listpanel");f=Ext.getCmp("listPanelContents");}else{e=Ext.getCmp("optionallistpanel");f=Ext.getCmp("componentPanel");}Ext.suspendLayouts();for(var j=b;j<d;j++){var a=Ext.create(g,{rootComponent:c[j]});try{f.add(a);
}catch(h){}}e.add(f);Ext.resumeLayouts(true);if(d!=compLength&&d<compLength){isScroll=true;startcount=d;}else{rootComponentArray=null;delete rootComponentArray;compLength=null;startcount=null;}}});