Ext.define("VLiveGraph.controller.VirtualMain",{extend:"Ext.app.Controller",commonUrl:null,gType:null,views:["Main","GraphContainer","VirtualLGHeader","FullViewGraph"],requires:["utilities.ZoomGraphPanel","VLiveGraph.view.FullViewGraph"],refs:[{selector:"main",ref:"main"},{selectior:"virtuallgheader",ref:"virtuallgheader"},{selectior:"graphcontainer",ref:"graphcontainer"},{selectior:"fullviewgraph",ref:"fullviewgraph"},{ref:"zoomGraphComboMode",selector:'zoomgraphpanel  combo[itemId= "mode"]'},{ref:"zoomGraphComboTimeline",selector:'zoomgraphpanel  combo[itemId= "timeline"]'},{ref:"zoomGraphComboFromhr",selector:'zoomgraphpanel combo[itemId= "fromhr"]'},{ref:"zoomGraphComboTohr",selector:'zoomgraphpanel combo[itemId= "tohr"]'},{ref:"zoomGraphFromDate",selector:'zoomgraphpanel datefield[itemId= "from"]'},{ref:"zoomGraphToDate",selector:'zoomgraphpanel datefield[itemId= "to"]'},{ref:"zoomGraphComboShow",selector:'zoomgraphpanel combo[itemId= "priority"]'},{ref:"zoomGraphPanel",selector:"zoomgraphpanel"},{ref:"comptype",selector:'graphcontainer combo[id="comptype"]'},{ref:"compName",selector:'graphcontainer combo[id="compName"]'},{ref:"graphMode",selector:'graphcontainer combo[id="graphMode"]'},{ref:"graphType",selector:'graphcontainer combo[id="graphType"]'},],init:function(){this.control({"main":{"afterrender":this.afterMainRender},'graphcontainer combo[id="comptype"]':{select:this.changeForResultType},'graphcontainer combo[id="compName"]':{select:this.changeForResult},'graphcontainer combo[id="graphMode"]':{select:this.changeForResult},'graphcontainer combo[id="graphType"]':{select:this.changeForResult},'zoomgraphpanel combo[itemId= "mode"]':{select:this.displayZoomGraph},'zoomgraphpanel combo[itemId= "timeline"]':{select:this.timelineChangeHandler},'zoomgraphpanel combo[itemId= "priority"]':{select:this.displayZoomGraph},'zoomgraphpanel button[itemId="timelineAny"]':{render:function(a){var b=this;
a.getEl().on("click",function(c){b.displayZoomGraph();});}},"zoomgraphpanel tool[itemId=minimizePanelDiv]":{click:this.bigGraphOnClick},'zoomgraphpanel button[id="ddIcon"]':{"click":this.displayBigDDData}});},changeForResultType:function(d,f){var h=this.getZoomGraphPanel();if(!Ext.isEmpty(h)){this.bigGraphOnClick();
}var l=this;var j=Ext.getCmp("comptype");var c=Ext.getCmp("compName");var b=Ext.getCmp("graphMode");var e=Ext.getCmp("graphType");var a=defaultVLUrl;if(!Ext.isEmpty(j)){var k=j.getValue();if(Ext.isEmpty(k)){k=f[0].get("valueField");}var m="-1";var i=b.getValue();if(Ext.isEmpty(i)){i=f[0].get("valueField");
}if(Ext.isEmpty(i)){i="3D";}var g=e.getValue();if(Ext.isEmpty(g)){g=f[0].get("valueField");}a="/final/monitor/livegraph/EgVmwareLiveGraphDisplay.jsp?comptype="+encodeURI(k)+"&er_component="+encodeURI(m)+"&mode="+encodeURI(i)+"&er_view="+g;}if(!Ext.isEmpty(isVirtualLV)&&isVirtualLV==true&&!Ext.isEmpty(a)){Ext.Ajax.request({url:a,method:"POST",success:function(n){if(n.status==200&&!Ext.isEmpty(n.responseText)){var p=n.responseText;
var o=null;if(!Ext.isEmpty(p)){o=Ext.decode(p);if(o.jsonData!=undefined&&o.jsonData.ComponentNameData!=undefined&&o.jsonData.ComponentNameData.length>1){sel_CompName=o.jsonData.ComponentNameData[1].valueField;}else{l.openVLGraphView(o);}temp_url="/final/monitor/livegraph/EgVmwareLiveGraphDisplay.jsp?comptype="+encodeURI(k)+"&er_component="+encodeURI(sel_CompName)+"&mode="+encodeURI(i)+"&er_view="+g;
Ext.Ajax.request({url:temp_url,method:"POST",success:function(q){var s=q.responseText;var r=null;if(!Ext.isEmpty(s)){r=Ext.decode(s);l.openVLGraphView(r);}else{l.openVLGraphView(r);}}});}else{l.openVLGraphView(o);}}},failure:function(){alert("Failure");}});}},changeForResult:function(d,f){var h=this.getZoomGraphPanel();
if(!Ext.isEmpty(h)){this.bigGraphOnClick();}var l=this;var j=Ext.getCmp("comptype");var c=Ext.getCmp("compName");var b=Ext.getCmp("graphMode");var e=Ext.getCmp("graphType");var a=defaultVLUrl;if(!Ext.isEmpty(j)&&!Ext.isEmpty(c)){var k=j.getValue();if(Ext.isEmpty(k)){k=f[0].get("valueField");}var m=c.getValue();
if(Ext.isEmpty(m)){m=f[0].get("valueField");}var i=b.getValue();if(Ext.isEmpty(i)){i=f[0].get("valueField");}if(Ext.isEmpty(i)){i="3D";}var g=e.getValue();if(Ext.isEmpty(g)){g=f[0].get("valueField");}a="/final/monitor/livegraph/EgVmwareLiveGraphDisplay.jsp?comptype="+encodeURI(k)+"&er_component="+encodeURI(m)+"&mode="+encodeURI(i)+"&er_view="+g;
}if(!Ext.isEmpty(isVirtualLV)&&isVirtualLV==true&&!Ext.isEmpty(a)){Ext.Ajax.request({url:a,method:"POST",success:function(n){if(n.status==200&&!Ext.isEmpty(n.responseText)){var p=n.responseText;var o=null;if(!Ext.isEmpty(p)){o=Ext.decode(p);l.openVLGraphView(o);}else{l.openVLGraphView(o);}}else{window.opener.location.href="/final/servlet/com.egurkha.Logout?errmsg=1";
self.close();}}});}},afterMainRender:function(){var a=this;if(!Ext.isEmpty(isVirtualLV)&&isVirtualLV==true&&!Ext.isEmpty(defaultVLUrl)){Ext.Ajax.request({url:defaultVLUrl,method:"POST",success:function(b){if(b.status==200&&!Ext.isEmpty(b.responseText)){var d=b.responseText;var c=null;if(!Ext.isEmpty(d)){c=Ext.decode(d);
a.openVLGraphView(c);}else{a.openVLGraphView(c);}}}});}},openVLGraphView:function(w){var y=w.LegendInChart;y=y.toLowerCase();var h=(y=="false"||y=="no")?0:1;var c=w.showLegendChk;if(Ext.isEmpty(w)||(!Ext.isEmpty(w.noData))){var q=ndf;if(!Ext.isEmpty(w.noData)){q=w.noData;}var A='<div style="margin:auto;text-align:center;border:0px solid red"><div class="iconInformation" style="margin:auto;text-align:center"></div><div style="text-align:center" >'+q+"</div></div>";
var g=({xtype:"container",layout:"fit",items:[{html:A}]});this.getMain().add(g);}else{if(!Ext.isEmpty(w.view)){var k=Ext.getCmp("vgh");if(!Ext.isEmpty(k)){k.remove("comptype");k.remove("compName");if(!Ext.isEmpty(w.jsonData.Mode)){k.remove("graphMode");}k.remove("graphType");k.remove("showLegend");}var b=new Ext.form.field.ComboBox({xtype:"scrollcombo",fieldLabel:w.jsonData.ComponentType,id:"comptype",editable:false,name:"comptype",cls:"dropdown",labelAlign:"left",labelSeparator:"",labelWidth:100,width:270,displayField:"displayField",valueField:"valueField",store:new Ext.data.Store({fields:["displayField","valueField"],data:w.jsonData.ComponentTypeData}),queryMode:"local",value:w.jsonData.selectedCompType});
k.add(b);var b=new Ext.form.field.ComboBox({xtype:"scrollcombo",fieldLabel:w.jsonData.ComponentName,id:"compName",editable:false,name:"compName",labelSeparator:"",cls:"dropdown",labelWidth:100,width:300,labelAlign:"left",store:Ext.create("Ext.data.Store",{fields:["state",{name:"displayField",convert:function(C,i){return decodeURI(C);
}},"valueField"],data:w.jsonData.ComponentNameData}),displayField:"displayField",valueField:"valueField",queryMode:"local",value:w.jsonData.selectedCompName,margin:"2 15 0 10",tpl:Ext.create("Ext.XTemplate",'<ul style="white-space:nowrap">','<tpl for=".">','<li class="x-boundlist-item"><img src="/final/images/spacer.gif" style="padding-left:18px;vertical-align:middle" class="state_{state}"/>{displayField}</li>',"</tpl>","</ul>")});
$("#compName-inputEl").removeClass("state_"+w.jsonData.selectedCompState);k.add(b);$("#compName-inputEl").addClass("state_"+w.jsonData.selectedCompState);if(!Ext.isEmpty(w.jsonData.Mode)){var b=new Ext.form.field.ComboBox({xtype:"scrollcombo",fieldLabel:w.jsonData.Mode,id:"graphMode",name:"graphMode",editable:false,labelWidth:45,labelSeparator:"",cls:"dropdown",labelAlign:"left",store:new Ext.data.Store({fields:["displayField","valueField"],data:"2D"}),displayField:"displayField",valueField:"valueField",queryMode:"local",hidden:true,value:"2D"});
k.add(b);}var b=new Ext.form.field.ComboBox({xtype:"scrollcombo",fieldLabel:w.jsonData.GraphType,id:"graphType",name:"graphType",editable:false,cls:"dropdown",margin:"0 0 0 0",labelSeparator:"",labelWidth:45,labelAlign:"left",store:new Ext.data.Store({fields:["displayField","valueField"],data:w.jsonData.GraphTypeData}),displayField:"displayField",valueField:"valueField",queryMode:"local",value:w.jsonData.selectedGraphType});
k.add(b);var p=new Ext.form.field.Checkbox({xtype:"checkboxgroup",id:"er_chart_checkbox",margin:"2 0 0 30",boxLabel:"Show Legends",inputValue:"true",itemId:"showLegend",cls:"showLegend checkbt",checked:h,hidden:c});k.add(p);var j=w.jsonData.selectedGraphType;var t=Ext.getCmp("graphMode");var o=Ext.getCmp("showLegend");
if(j=="TopN/LastN"){t.hide();}else{t.hide();}if(!Ext.isEmpty(w.view)&&w.view=="TopN/LastN"){var a=Ext.getCmp("graphContainer");var x=Ext.getCmp("mHeaderId");if(!Ext.isEmpty(a)){a.removeAll();}if(!Ext.isEmpty(x)){x.removeAll();x.hide();}var l=w.jsonData.TopNData;if(!Ext.isEmpty(l)){barRefresh=setInterval("executeBarRefresh()",refreshRate);
if(!Ext.isEmpty(lineRefresh)){for(var v=0;v<lineRefresh.length;v++){clearInterval(lineRefresh[v]);}lineRefresh=[];}for(var z=0;z<l.length;z++){var r=l[z];A='<div style="float:left;width:100%;height:100%">';if(!Ext.isEmpty(r.errData)){A=A+'<div style="margin:12% 0 1% 6%;;text-align:center;border:0px solid red"><div class="iconInformation" style="margin:auto;text-align:center"></div><div style="text-align:center" >'+r.errData+"</div></div>";
}else{if(!Ext.isEmpty(r.measureTitle)){if(!Ext.isEmpty(r.measureErrData)){A=A+'<div style="padding:5px;border:0px solid red"><b>'+r.measureTitle+'</b></div><div style="text-align:center;border:0px solid red;padding:12% 0 1% 6%;width:100%"><center><div class="iconInformation" style="text-align:center;"></div><div style="text-align:center" >'+r.measureErrData+"</div></center></div>";
}else{if(!Ext.isEmpty(r.chartCId)){A=A+'<div style="border:0px solid red;width:100%;margin:auto;padding:3;display:inline-block;"><div style="text-align:center;"><b>'+r.measureTitle+'</b></div><div id="'+r.divId+'" style="height:100%;"></div></div>';}}}}A=A+"</div>";var f="";var n='<center><div style="margin:12% 0 auto 0"><img class="iconInformation" src="/final/images/spacer.gif"/><div >No measures available</div></div></center>';
if(!Ext.isEmpty(r.fullViewURL)){f=r.fullViewURL;}if(isFusionChartValue){var g=new Ext.Panel({id:r.chartCId,layout:"fit",cls:"block1",border:true,frame:true,margin:5,padding:"5 0 0 0",height:200,clickUrl:f,html:A});a.add(g);if(!Ext.isEmpty(r.chartCId)){var m=r.fcId;var s=r.divId;if(FusionCharts(m)){FusionCharts(m).dispose();
}var e=new FusionCharts(r.movie,m,"100%","160","0","1");e.setXMLData(r.dataXML);e.setTransparent(true);e.render(s);}}else{var B=(strSkin=="Light")?"#ffffff":"#404040";var g=new Ext.Panel({id:r.chartCId,border:true,frame:false,margin:5,height:275,bodyStyle:{"background":B+" !important;"},title:r["title"],clickUrl:f,chartData:r,measTitle:r.measureTitle,listeners:{"boxready":function(F){try{var H=($(window).width()/2)-100;
try{var D=Ext.getCmp(F.id+"-body").getHeight();}catch(C){var D=235;}F.chartData["fromPage"]="vlive";F.chartData["measureTitle"]=F.measTitle;F.chartData["tick"]=false;F.chartData["isStateBar"]=false;F.chartData["title"]="";if(!Ext.isEmpty(F.chartData.measureErrData)){var i='<div style="height:100%;width:100%;display:flex;"><div style="margin:auto auto;display:flex;flex-direction:column"><div style="margin:auto auto ;" class="iconInformation"></div><div style="margin: auto auto;">'+F.chartData.measureErrData+"</div></div></div>";
F.setTitle(F.measTitle);F.update(i);}else{try{getHighChartForBar(F.id+"-body",F.chartData,H,D,F.chartData.fullViewURL);}catch(G){console.log("=-=-=-=+++>:",G);}}}catch(E){Ext.getCmp(r.chartCId).update(n);}}}});a.add(g);}if(!Ext.isEmpty(r.chartCId)){var m=r.fcId;var s=r.divId;}}}}else{if(!Ext.isEmpty(w.view)&&w.view=="Live Data"){var a=Ext.getCmp("graphContainer");
var u=Ext.getCmp("graphContainerErr");var x=Ext.getCmp("mHeaderId");if(!Ext.isEmpty(a)){a.removeAll();}if(!Ext.isEmpty(x)){x.show();x.removeAll();}var l=w.jsonData.LiveData;if(!Ext.isEmpty(l)){var r=l[0];if(!Ext.isEmpty(r.errData)){a.hide();A='<div style="float:left;">';if(!Ext.isEmpty(r.lgHeader)){A=A+'<div style="margin:auto;padding:3 3 3 10;display:inline-block;"><div style="text-align:center;"><b>'+r.lgHeader+"</b></div></div>";
}A=A+"</div>";A='<div style="float:left;width:100%;height:100%;">';A=A+'<div style="margin:20% 0 auto 0;text-align:center;border:0px solid red"><div class="iconInformation" style="margin:auto;text-align:center"></div><div style="text-align:center" >'+r.errData+"</div></div>";A=A+"</div>";var g=({xtype:"container",style:{"border":"0px solid green"},layout:"fit",cls:"block1",height:"100%",html:A});
u.show();u.add(g);}else{if(!Ext.isEmpty(r.lgHeader)){u.hide();a.show();A='<div style="float:left;">';if(!Ext.isEmpty(r.lgHeader)){}A=A+"</div>";var d=({xtype:"container",layout:"fit",height:200,html:A});if(!Ext.isEmpty(x)){x.add(d);}if(!Ext.isEmpty(lineRefresh)){for(var v=0;v<lineRefresh.length;v++){clearInterval(lineRefresh[v]);
}lineRefresh=[];}for(var z=1;z<l.length;z++){r=l[z];if(!Ext.isEmpty(r.gDataUrl)){A='<div style="float:left;">';A=A+"</div>";var B=(strSkin=="Light")?"#ffffff":"#404040";var g=new Ext.Panel({id:r.chId,chartUrl:r.gDataUrl,layout:"fit",ui:"newGraphPanel",border:true,frame:false,margin:5,style:{"background":B+" !important"},height:355,html:A,listeners:{"afterrender":function(D){var i=($("#"+r.chId).width())-50;
var C=($("#"+r.chId).height());lineRefresh.push(setInterval("execute('"+D.chartUrl+"','"+i+"','"+C+"','"+D.id+"')",refreshRate));clearInterval(barRefresh);Ext.Ajax.request({url:D.chartUrl,method:"POST",async:true,success:function(E){if(E.status==200){var H=E.responseText;var G=null;if(!Ext.isEmpty(H)){G=Ext.decode(H);
if(!Ext.isEmpty(G.DataSet)){G["enableTitle"]=true;G["useHtml"]=true;var I=($("#"+D.id).width())-50;var F=($("#"+D.id).height());if(!Ext.isEmpty(G["title"])){}getHighChartForTimeLine(D.id,G,I,F,D.chartUrl);}else{A='<div style="height:100%;width:100%;display:flex;flex-direction:column;background:'+B+' !important"><div class="f12-bold" style="margin:15px auto">'+G.title+'</div><div style="margin:auto auto;display:flex;flex-direction:column"><div style="margin:auto auto ;" class="iconInformation"></div><div style="margin: auto auto;">'+ndf+"</div></div></div>";
D.update(A);}}else{A='<div style="height:100%;width:100%;display:flex;flex-direction:column;background:'+B+' !important"><div class="f12-bold" style="margin:15px auto">'+G.title+'</div><div style="margin:auto auto;display:flex;flex-direction:column"><div style="margin:auto auto ;" class="iconInformation"></div><div style="margin: auto auto;">'+ndf+"</div></div></div>";
D.update(A);}}else{A='<div style="height:100%;width:100%;display:flex;flex-direction:column;background:'+B+' !important"><div class="f12-bold" style="margin:15px auto">'+G.title+'</div><div style="margin:auto auto;display:flex;flex-direction:column"><div style="margin:auto auto ;" class="iconInformation"></div><div style="margin: auto auto;">'+ndf+"</div></div></div>";
D.update(A);}}});}}});a.remove(g);a.add(g);}}}}}}}}}},zoomLoaded:function(){var a=this.getZoomGraphImgPanel();if(!Ext.isEmpty(a)){a.handleScrollBars(a);}},zoomClose:function(){this.bigGraphOnClick();},bigGraphOnClick:function(){var a=this.getZoomGraphPanel();if(!Ext.isEmpty(a)){a.destroy();}var b=Ext.getCmp("graphContainer");
b.show();var c=Ext.getCmp("fvId");c.removeAll();c.hide();},timelineChangeHandler:function(d){var g=d.getValue();if(g=="Any"){this.enableDisableDateFields(true);}else{this.enableDisableDateFields(false);}var j=currentDateFormat_js;var k="";var a=this.getZoomGraphFromDate();if(!Ext.isEmpty(a)&&!Ext.isEmpty(a.getValue())){k=Ext.Date.format(a.getValue(),mgr_dateFormat);
}var c="";var i=this.getZoomGraphToDate();if(!Ext.isEmpty(i)&&!Ext.isEmpty(i.getValue())){c=Ext.Date.format(i.getValue(),mgr_dateFormat);}var b="";var f=this.getZoomGraphComboFromhr();if(!Ext.isEmpty(f)&&!Ext.isEmpty(f.getValue())){b=f.getValue();}var e="";var l=this.getZoomGraphComboTohr();if(!Ext.isEmpty(l)&&!Ext.isEmpty(l.getValue())){e=l.getValue();
}var h="F=getTimeJSON&P0=["+g+"]&P1=["+k+"]&P2=["+c+"]&P3=["+b+"]&P4=["+e+"]&P5=["+j+"]&C=1&calljson=true";Ext.Ajax.request({url:remoteURL,scope:this,method:"POST",params:h,success:function(m){if(m.status==200&&!Ext.isEmpty(m.responseText)){var o=m.responseText;var n=Ext.decode(o);this.setTime(n.getTime);
}}});},enableDisableDateFields:function(b){var c=this.getZoomGraphFromDate();var e=this.getZoomGraphToDate();var d=this.getZoomGraphComboFromhr();var a=this.getZoomGraphComboTohr();if(b){c.setDisabled(false);e.setDisabled(false);d.setDisabled(false);a.setDisabled(false);}else{c.setDisabled(true);e.setDisabled(true);
d.setDisabled(true);a.setDisabled(true);}},setTime:function(d){var c=this.getZoomGraphFromDate();var f=this.getZoomGraphToDate();var e=this.getZoomGraphComboFromhr();var b=this.getZoomGraphComboTohr();var a=d.split("\t");time_line_obj=new Object();time_line_obj.starttime=a[0];c.setValue(a[0]);time_line_obj.endtime=a[1];
f.setValue(a[1]);if(!Ext.isEmpty(a[2])&&a[2].length==1){time_line_obj.starthr="0"+a[2];e.setValue("0"+a[2]);}else{time_line_obj.starthr=a[2];e.setValue(a[2]);}if(!Ext.isEmpty(a[2])&&a[3].length==1){time_line_obj.endhr="0"+a[3];b.setValue("0"+a[3]);}else{time_line_obj.endhr=a[3];b.setValue(a[3]);}this.displayZoomGraph();
},displayZoomGraph:function(){var D=this.getZoomGraphPanel();if(!Ext.isEmpty(D)&&!Ext.isEmpty(D.jsonData)){var h=D.jsonData;var n="";var A="";var j="";var E="";var y="";var e="";var p="";var z="";var x=this.getZoomGraphComboMode();if(!Ext.isEmpty(x)&&!Ext.isEmpty(x.getValue())){n=x.getValue();}var l=this.getZoomGraphComboShow();
if(!Ext.isEmpty(l)&&!Ext.isEmpty(l.getValue())){A=l.getValue();}var u=this.getZoomGraphFromDate();if(!Ext.isEmpty(u)){if(!Ext.isEmpty(u.getValue())){j=Ext.Date.format(u.getValue(),mgr_dateFormat);}else{if(!Ext.isEmpty(time_line_obj)){j=time_line_obj.starttime;}else{j=Ext.Date.format(u.getValue(),mgr_dateFormat);
}}}var w=this.getZoomGraphToDate();if(!Ext.isEmpty(w)){if(!Ext.isEmpty(w.getValue())){E=Ext.Date.format(w.getValue(),mgr_dateFormat);}else{if(!Ext.isEmpty(time_line_obj)){E=time_line_obj.endtime;}else{E=Ext.Date.format(w.getValue(),mgr_dateFormat);}}}var v=this.getZoomGraphComboFromhr();if(!Ext.isEmpty(v)){if(!Ext.isEmpty(v.getValue())){y=v.getValue();
}else{if(!Ext.isEmpty(time_line_obj)){y=time_line_obj.starthr;}else{y=v.getValue();}}}var i=this.getZoomGraphComboTohr();if(!Ext.isEmpty(i)){if(!Ext.isEmpty(i.getValue())){e=i.getValue();}else{if(!Ext.isEmpty(time_line_obj)){e=time_line_obj.endhr;}else{e=i.getValue();}}}var z=u.getName();if(j>E){Ext.Msg.alert("Error",z);
return;}if(j==E){if(y>=e){Ext.Msg.alert("Error",z);return;}}var f=this.getZoomGraphComboTimeline();if(!Ext.isEmpty(f)&&!Ext.isEmpty(f.getValue())){p=f.getValue();}var a="";var b="";if(!Ext.isEmpty(this.commonUrl)){a=this.commonUrl;b=this.gType;}else{if(!Ext.isEmpty(main_commonUrl)){a=main_commonUrl;b=main_gType;
}}var C=this;var m=a.substring(0,a.indexOf("?"));var d=a.substring(a.indexOf("?")+1,a.length);if(d.indexOf("&priority=")<0){d=d+"&priority="+A;}var c=d.split("&");var o="";for(var s=0;s<c.length;s++){var r=c[s];if(!Ext.isEmpty(r)){var q=r.split("=");if(!Ext.isEmpty(q)&&q[0]=="mode"){o=o+"&mode="+n;}else{if(!Ext.isEmpty(q)&&q[0]=="starttime"){o=o+"&starttime="+j;
}else{if(!Ext.isEmpty(q)&&q[0]=="endtime"){o=o+"&endtime="+E;}else{if(!Ext.isEmpty(q)&&q[0]=="starthr"){o=o+"&starthr="+y;}else{if(!Ext.isEmpty(q)&&q[0]=="endhr"){o=o+"&endhr="+e;}else{if(!Ext.isEmpty(q)&&(q[0]=="time_line"||q[0]=="timeLine")){o=o+"&time_line="+p;}else{if(!Ext.isEmpty(q)&&q[0]=="priority"){o=o+"&priority="+A;
}else{o=o+"&"+r;}}}}}}}}}var t=timelineEncodedURL+"&graphType="+b+"&"+o+"&isZoomGraph=true&come_from=vmwareLiveGraph&graphId="+this.graphId;var B=documentView.getWidth();var g=documentView.getHeight();t=t+"&screenWidth="+B+"&screenHeight="+g;Ext.Ajax.request({url:t,scope:this,success:function(k){var G=k.responseText;
if(!Ext.isEmpty(G)){var F=Ext.decode(G);D.removeAll();D.createItems(F);}},failure:function(){}});}},displayBigGraph:function(b,a){var e="";if(!Ext.isEmpty(b)&&!Ext.isEmpty(b.clickUrl)){e=b.clickUrl;this.commonUrl=e;this.gType=a;main_commonUrl=e;main_gType=a;}else{if(!Ext.isEmpty(b)){e=b;this.commonUrl=b;
this.gType=a;main_commonUrl=e;main_gType=a;}}var g=this;var f=e.substring(0,e.indexOf("?"));var i=e.substring(e.indexOf("?")+1,e.length);var d=Ext.create("utilities.ZoomGraphPanel",{title:"Graph",style:{"box-shadow":"none","-webkit-box-shadow":"none","-moz-box-shadow":"none"},cls:"block1",border:true,frame:true,region:"center",monitorResize:true,autoScroll:false,margin:10,});
var c=timelineEncodedURL+"&graphType="+a+"&"+i+"&isZoomGraph=true&come_from=vmwareLiveGraph&graphId="+this.graphId;var j=documentView.getWidth();var h=documentView.getHeight();c=c+"&screenWidth="+j+"&screenHeight="+h;Ext.Ajax.request({url:c,scope:this,success:function(k){var n=k.responseText;if(!Ext.isEmpty(n)){var l=Ext.decode(n);
d.createItems(l);var m=Ext.getCmp("graphContainer");m.hide();var o=Ext.getCmp("fvId");o.show();o.add(d);}},failure:function(){}});},showFullview:function(a,b){var c=Ext.getCmp("vLGFC"+a);if(Ext.isEmpty(c)){c=Ext.getCmp("chartIdInx"+a);}this.displayBigGraph(c,b);},enlargeTheGraph:function(b){if(!Ext.isEmpty(b)){var c=Ext.getCmp("graphContainer");
c.hide();var d=Ext.getCmp("fvId");d.show();var a=Ext.create("utilities.ZoomGraphPanel",{title:vlzoomheader,cls:"block1",region:"center",border:true,frame:true,style:{"box-shadow":"none","-webkit-box-shadow":"none","-moz-box-shadow":"none"},monitorResize:true,margin:10,height:"100%",bgUrl:b,html:"",listeners:{"afterrender":function(e){Ext.Ajax.request({url:e.bgUrl,scope:this,success:function(f){var g=f.responseText;
if(!Ext.isEmpty(g)){jsonData=Ext.decode(g);if(!Ext.isEmpty(jsonData)){a.createGraphItems(jsonData);}else{temp='<div style="float:left;">';temp=temp+'<div style="margin:auto;text-align:center;border:0px solid red"><div class="iconInformation" style="margin:auto;text-align:center"></div><div style="text-align:center" >'+ndf+"</div></div>";
temp=temp+"</div>";e.update(temp);}}else{temp='<div style="float:left;">';temp=temp+'<div style="margin:auto;text-align:center;border:0px solid red"><div class="iconInformation" style="margin:auto;text-align:center"></div><div style="text-align:center" >'+ndf+"</div></div>";temp=temp+"</div>";e.update(temp);
}},failure:function(){alert("---problem---");}});}}});d.add(a);}},refreshBar:function(){var c=Ext.getCmp("comptype");var a=Ext.getCmp("compName");var d=Ext.getCmp("graphMode");var e=Ext.getCmp("graphType");var b="/final/monitor/livegraph/EgVmwareLiveGraphDisplay.jsp?comptype="+c.getValue()+"&er_component="+a.getValue()+"&mode="+d.getValue()+"&er_view="+e.getValue();
this.refreshBarInterval(b);},refreshBarInterval:function(a){var b=this;Ext.Ajax.request({url:a,method:"POST",scope:this,success:function(l,f){var h=l.responseText;if(!Ext.isEmpty(h)){var q=Ext.getCmp("graphContainer");if(!Ext.isEmpty(q)){var m=q.items.items;try{var s=Ext.decode(h);var g=s.jsonData.TopNData;
if(!Ext.isEmpty(g)){for(var n=0;n<g.length;n++){var d=m[n];var r=g[n];var k=r.chartCId;if(d!=null&&d.id==k){try{if(jQuery("#"+d.id+"-body")!=null&&jQuery("#"+d.id+"-body")!=undefined){jQuery("#"+d.id+"-body").highcharts().destroy();}}catch(o){}if(!Ext.isEmpty(r.measureErrData)){temp='<div style="height:100%;width:100%;display:flex;"><div style="margin:auto auto;display:flex;flex-direction:column"><div style="margin:auto auto ;" class="iconInformation"></div><div style="margin: auto auto;">'+ndf+"</div></div></div>";
d.setTitle(r.measureTitle);d.update(temp);}else{if(!Ext.isEmpty(r)){var c=($(window).width()/2)-100;try{var p=Ext.getCmp(r.chartCId+"-body").getHeight();}catch(j){var p=235;}r["fromPage"]="vlive";r["measureTitle"]=r.measureTitle;r["tick"]=false;r["isStateBar"]=false;getHighChartForBar(k+"-body",r,c,p,r.fullViewURL);
}else{temp='<div style="height:100%;width:100%;display:flex;"><div style="margin:auto auto;display:flex;flex-direction:column"><div style="margin:auto auto ;" class="iconInformation"></div><div style="margin: auto auto;">'+ndf+"</div></div></div>";d.update(temp);}}}}}}catch(o){temp='<div style="height:100%;width:100%;display:flex;"><div style="margin:auto auto;display:flex;flex-direction:column"><div style="margin:auto auto ;" class="iconInformation"></div><div style="margin: auto auto;">'+ndf+"</div></div></div>";
d.update(temp);}}}},failure:function(){if(!Ext.isEmpty(this)){this.showResult(null);}else{window.location.href="/final/servlet/com.eg.EgMonitorController?monCmd=serviceList&from=MainDashboard&action=service&isServiceBusiDash=true&isFromMenu=true";}}});},refresh:function(i,f,h,d){var g=Ext.getCmp("comptype");
var b=Ext.getCmp("compName");var a=Ext.getCmp("graphMode");var c=Ext.getCmp("graphType");var e="/final/monitor/livegraph/EgVmwareLiveGraphDisplay.jsp?comptype="+g.getValue()+"&er_component="+b.getValue()+"&mode="+a.getValue()+"&er_view="+c.getValue();this.refreshPageInterval(i,f,h,d);},refreshPageInterval:function(a,e,d,b){var c=this;
Ext.Ajax.request({url:a,method:"POST",async:false,scope:this,success:function(f,q){var r=f.responseText;if(!Ext.isEmpty(r)){var l=Ext.decode(r);var h=Ext.getCmp("graphContainer");if(!Ext.isEmpty(h)){var m=h.items.items;for(var s=0;s<m.length;s++){var j=m[s];if(j!=null&&j.id==b){try{if(jQuery("#"+j.id)!=undefined&&jQuery("#"+j.id)!=null){var g="#"+j.id;
var y=jQuery(g).highcharts();if(y!=undefined&&y!=null){var w=y.series.length;for(var p=w-1;p>-1;p--){try{y.series[p].remove();}catch(u){}}if(j!=null){if(!Ext.isEmpty(l.DataSet)){l["enableTitle"]=true;l["useHtml"]=true;try{var v=Ext.getCmp("er_chart_checkbox");v.setValue(true);}catch(x){}if(!Ext.isEmpty(l["title"])){}var k=$(window).width();
var n=$(window).height()-300;k=k/2;var o=l["DataSet"];for(var p=0;p<o.length;p++){y.addSeries(o[p]);}$(y.series).each(function(){this.legendSymbol.attr("x",10);this.legendSymbol.attr("y",7);this.legendSymbol.attr("width",6);this.legendSymbol.attr("height",6);});y.redraw();}else{temp='<div style="height:100%;width:100%;display:flex;flex-direction:column;background:'+skinColor+' !important"><div class="f12-bold" style="margin:10px auto">'+l.title+'</div><div style="margin:auto auto;display:flex;flex-direction:column"><div style="margin:auto auto ;" class="iconInformation"></div><div style="margin: auto auto;">'+ndf+"</div></div></div>";
j.update(temp);}}}else{if(j!=null){if(!Ext.isEmpty(l.DataSet)){l["enableTitle"]=true;l["useHtml"]=true;try{var v=Ext.getCmp("er_chart_checkbox");v.setValue(true);}catch(x){}if(!Ext.isEmpty(l["title"])){}var k=$(window).width();var n=$(window).height()-300;k=k/2;getHighChartForTimeLine(j.id,l,k-100,n,a);
}else{temp='<div style="height:100%;width:100%;display:flex;flex-direction:column;background:'+skinColor+' !important"><div class="f12-bold" style="margin:15px auto">'+l.title+'</div><div style="margin:auto auto;display:flex;flex-direction:column"><div style="margin:auto auto ;" class="iconInformation"></div><div style="margin: auto auto;">'+ndf+"</div></div></div>";
j.update(temp);}}}}}catch(u){}}}}}},failure:function(){if(!Ext.isEmpty(this)){this.showResult(null);}else{window.location.href="/final/servlet/com.eg.EgMonitorController?monCmd=serviceList&from=MainDashboard&action=service&isServiceBusiDash=true&isFromMenu=true";}}});}});