Ext.define("citrixDashboard.view.OverviewPanel",{extend:"Ext.container.Container",alias:"widget.overviewpanel",requires:[],layout:{type:"hbox",align:"stretch"},height:140,title:"",key:"old",padding:"0 0 0 0",margin:0,jsonData:null,items:[],listeners:{afterrender:function(){var a=this;this.renderHostData(this.jsonData);
}},updateData:function(v){var u=this;try{if(v!=undefined&&v!=null&&v.length>0){var c=1;for(var t in v){var m=v[t];if(m.length==2){var g="Avg Logon Time";if(m[0][0].title!=null&&m[0][0].title.indexOf("~")>-1){g=m[0][0].title;m[0][0].title=g.substring(0,g.indexOf("~"));m[0][0].maintitle=g.substring(g.indexOf("~")+1);
}if(Ext.isEmpty(m[0][0].graphData)){m[0][0].graphData={"DataSet":[{"data":[{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"}],"showInLegend":false}]};
}if(Ext.isEmpty(m[1][0].graphData)){m[1][0].graphData={"DataSet":[{"data":[{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"}],"showInLegend":false}]};
}m={"chart":"GroupTextFooterGraph","title":m[0][0].maintitle,"isUserTitle":false,"test_org":"CtxXcXDLogonTest","measure_org":"Avg_logon","test":m[0][0].test,"measure":m[0][0].measure,"fun":"Avg","valueArr":[{"test_org":"CtxXcXDLogonTest","measure_org":"Avg_logon","changeTabView":m[0][0].changeTabView,"linkurl":m[0][0].linkurl,"title":m[0][0].title,"value":m[0][0].value,"footer":m[0][0].unitText},{"test_org":"CtxXcXDLogonTest","measure_org":"Avg_logon","changeTabView":m[1][0].changeTabView,"linkurl":m[1][0].linkurl,"title":m[1][0].title,"value":m[1][0].value,"footer":m[1][0].unitText}],"graphData":{"DataSetCount":2,"DataSetArr":[{"DataSet":m[0][0].graphData.DataSet},{"DataSet":m[1][0].graphData.DataSet}],"styles":{"legendStyle":{"FAMILY":"Arial","WEIGHT":"Normal","SIZE":"10px","color":"#F7A492"}},"max":null},"graphType":"Area","unitText":"s","changeTabView":m[0][0].changeTabView,"handSymbol":m[0][0].handSymbol,"linkurl":m[0][0].fullLinkUrl,"toolTip":m[0][0].toolTip};
}try{var o=m["chart"];if(o==undefined){o=m["type"];}}catch(h){}if(o!=undefined&&o.toLowerCase()=="textdonutlegend"){var n=o+"_"+t;var l=Ext.getCmp(n);Ext.getCmp(n).updateData(m);}else{if(o!=undefined&&o.toLowerCase()=="textdonutalert"){var k=parseInt(t);if(k+1<v.length){if(!v[k+1].hasOwnProperty("Error")){var d=(v[k+1].hasOwnProperty("type"))?v[k+1]["type"]:v[k+1]["chart"];
var q=v[k+1]["heading"];if(d.toLowerCase()=="textdonutalert"&&(q.indexOf("Session")>-1||q.indexOf("Logon")>-1)){if(m.value=="0"||m.value=="-"){continue;}else{v.splice(k+1,1);}}}}var n=o+"_"+t;var l=Ext.getCmp(n);Ext.getCmp(n).updateData(m);}else{if(o!=undefined&&o.toLowerCase()=="textheatalert"){var n=o+"_"+t;
var l=Ext.getCmp(n);Ext.getCmp(n).updateData(m);}else{if(o!=undefined&&o.toLowerCase()=="textfootergraph"){var k=parseInt(t);if(k+1<v.length){if(!v[k+1].hasOwnProperty("Error")){var d=(v[k+1].hasOwnProperty("type"))?v[k+1]["type"]:v[k+1]["chart"];if(d.toLowerCase()=="textfootergraph"){if(m.value=="0"||m.value=="-"){continue;
}else{v.splice(k+1,1);}}}}var n=o+"_"+t;Ext.getCmp(n).updateData(m);}else{if(o!=undefined&&o.toLowerCase()=="grouptextfootergraph"){var n=o+"_"+t;Ext.getCmp(n).updateData(m);}else{if(o!=undefined&&o.toLowerCase()=="text"){var n=o+"_"+t;var l=Ext.getCmp(n);Ext.getCmp(n).updateData(m);}else{if(o!=undefined&&o.toLowerCase()=="tierhealth"){var n=o+"_"+t;
var l=Ext.getCmp(n);Ext.getCmp(n).updateData(m);}else{if(o!=undefined&&o.toLowerCase()=="heatmap"){}else{if(o!=undefined&&o.toLowerCase()=="grouptext"){var k=parseInt(t);if(k+1<v.length){if(!v[k+1].hasOwnProperty("Error")){var p=v[k+1];var d=(p.hasOwnProperty("type"))?v[k+1]["type"]:v[k+1]["chart"];var q=v[k+1]["heading"];
if(!Ext.isEmpty(d)&&d.toLowerCase()=="grouptext"&&p.hasOwnProperty("groupTitle1")&&p.hasOwnProperty("groupTitle2")){if(m.hasOwnProperty("groupTitle1")&&m.hasOwnProperty("groupTitle2")&&(m.groupArr[0].value=="-"||m.groupArr[0].value=="0")&&(m.groupArr[1].value=="-"||m.groupArr[1].value=="0")){continue;
}else{v.splice(k+1,1);}}}}var n=o+"_"+t;Ext.getCmp(n).updateData(m);}else{if(o!=undefined&&o.toLowerCase()=="pie"){}else{if(o!=undefined&&o.toLowerCase()=="donut"){var n=o+"_"+t;Ext.getCmp(n).updateData(m);}else{if(o!=undefined&&o=="Gauge"){var n=o+"_"+t;Ext.getCmp(n).updateData(m);}else{if(o!=undefined&&o=="GraphText"){var f=m.data;
if(f!=undefined&&f!=null){for(var s in f){var j=f[s]["chart"];if(j!=undefined&&j=="GraphText"){var n=j+"_GraphText_"+s;Ext.getCmp(n).updateData(f[s]);}}}}}}}}}}}}}}}}c++;}}else{}}catch(r){console.log("e-----@@@@-->",r);}},renderHostData:function(C){var z=this;try{if(C!=undefined&&C!=null&&C.length>0){var c=1;
for(var y in C){var m=C[y];if(m.length==2){var g="Avg Logon Time";if(m[0][0].title!=null&&m[0][0].title.indexOf("~")>-1){g=m[0][0].title;m[0][0].title=g.substring(0,g.indexOf("~"));m[0][0].maintitle=g.substring(g.indexOf("~")+1);}if(Ext.isEmpty(m[0][0].graphData)){m[0][0].graphData={"DataSet":[{"data":[{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"}],"showInLegend":false}]};
}if(Ext.isEmpty(m[1][0].graphData)){m[1][0].graphData={"DataSet":[{"data":[{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"},{"name":"","y":1,"color":"#cdcdcd"}],"showInLegend":false}]};
}m={"chart":"GroupTextFooterGraph","title":m[0][0].maintitle,"isUserTitle":false,"test_org":"CtxXcXDLogonTest","measure_org":"Avg_logon","test":m[0][0].test,"measure":m[0][0].measure,"fun":"Avg","valueArr":[{"test_org":"CtxXcXDLogonTest","measure_org":"Avg_logon","changeTabView":m[0][0].changeTabView,"linkurl":m[0][0].linkurl,"title":m[0][0].title,"value":m[0][0].value,"footer":m[0][0].unitText},{"test_org":"CtxXcXDLogonTest","measure_org":"Avg_logon","changeTabView":m[1][0].changeTabView,"linkurl":m[1][0].linkurl,"title":m[1][0].title,"value":m[1][0].value,"footer":m[1][0].unitText}],"graphData":{"DataSetCount":2,"DataSetArr":[{"DataSet":m[0][0].graphData.DataSet},{"DataSet":m[1][0].graphData.DataSet}],"styles":{"legendStyle":{"FAMILY":"Arial","WEIGHT":"Normal","SIZE":"10px","color":"#F7A492"}},"max":null},"graphType":"Area","unitText":"s","changeTabView":m[0][0].changeTabView,"handSymbol":m[0][0].handSymbol,"linkurl":m[0][0].fullLinkUrl,"toolTip":m[0][0].toolTip};
}var r=m["chart"];if(r==undefined){r=m["type"];}if(r!=undefined&&r.toLowerCase()=="textdonutlegend"){var o=r+"_"+y;var B=this.getTextDonutLegendPanel(m,o);z.add(B);}else{if(r!=undefined&&r.toLowerCase()=="textdonutalert"){var l=parseInt(y);if(l+1<C.length){if(!C[l+1].hasOwnProperty("Error")){var d=(C[l+1].hasOwnProperty("type"))?C[l+1]["type"]:C[l+1]["chart"];
var u=C[l+1]["heading"];if(d.toLowerCase()=="textdonutalert"&&(u.indexOf("Session")>-1||u.indexOf("Logon")>-1)){if(m.value=="0"||m.value=="-"){continue;}else{C.splice(l+1,1);}}}}var o=r+"_"+y;var B=this.getTextDonutAlertPanel(m,o);z.add(B);}else{if(r!=undefined&&r.toLowerCase()=="textheatalert"){var o=r+"_"+y;
var B=this.getTextHeatAlertPanel(m,o);z.add(B);}else{if(r!=undefined&&r.toLowerCase()=="textfootergraph"){var l=parseInt(y);if(l+1<C.length){if(!C[l+1].hasOwnProperty("Error")){var d=(C[l+1].hasOwnProperty("type"))?C[l+1]["type"]:C[l+1]["chart"];if(d.toLowerCase()=="textfootergraph"){if(m.value=="0"||m.value=="-"){continue;
}else{C.splice(l+1,1);}}}}var o=r+"_"+y;var B=this.getTextFooterGraphPanel(m,o);z.add(B);}else{if(r!=undefined&&r.toLowerCase()=="grouptextfootergraph"){var o=r+"_"+y;var B=this.getTextFooterGraphPanel(m,o);z.add(B);}else{if(r!=undefined&&r.toLowerCase()=="text"){var o=r+"_"+y;var B=this.getTextPanel(m,o);
z.add(B);}else{if(r!=undefined&&r.toLowerCase()=="heatmap"){var o=r+"_"+y;var A=this.getHeatMapPanel(m);z.add(A);}else{if(r!=undefined&&r.toLowerCase()=="grouptext"){var l=parseInt(y);if(l+1<C.length){if(!C[l+1].hasOwnProperty("Error")){var t=C[l+1];var d=(t.hasOwnProperty("type"))?C[l+1]["type"]:"";
var u=C[l+1]["heading"];if(!Ext.isEmpty(d)&&d.toLowerCase()=="grouptext"&&t.hasOwnProperty("groupTitle1")&&t.hasOwnProperty("groupTitle2")){if(m.hasOwnProperty("groupTitle1")&&m.hasOwnProperty("groupTitle2")&&(m.groupArr[0].value=="-"||m.groupArr[0].value=="0")&&(m.groupArr[1].value=="-"||m.groupArr[1].value=="0")){continue;
}else{C.splice(l+1,1);}}}}var o=r+"_"+y;var w=m["groupArr"];var s=this.getGroupTextPanel(m,o);z.add(s);}else{if(r!=undefined&&r.toLowerCase()=="pie"){var o=r+"_"+y;var k=this.getPiePanel(m,o);z.add(k);}else{if(r!=undefined&&r.toLowerCase()=="donut"){var o=r+"_"+y;try{var q=this.getDonutPanel(m,o);z.add(q);
}catch(j){console.log("eert-0=-=->"+j);}}else{if(r!=undefined&&r=="Gauge"){var o=r+"_"+y;var p=this.getGaugePanel(m,o,y);z.add(p);}else{if(r!=undefined&&r=="GraphText"){var f=m.data;if(f!=undefined&&f!=null){for(var x in f){var h=f[x]["chart"];if(h!=undefined&&h=="GraphText"){var o=h+"_GraphText_"+x;
var n=this.getGraphtextPanel(f[x],o,x);z.add(n);if(x==(f.length-1)){Ext.getCmp(o).removeCls("dividerGradient");}}}}}}}}}}}}}}}}c++;}}else{z.add([{xtype:"container",html:'<table align="center" style="margin:22% auto 0 auto;height:100%"><tr><td style="text-align:center"><img src="/final/images/spacer.gif" class="iconInformation"/></br>No Data Available now!</td></tr></table>'}]);
}}catch(v){console.log("e-----@@@@-->",v);z.add([{xtype:"container",html:'<table align="center" style="margin:22% auto 0 auto;height:100%"><tr><td style="text-align:center"><img src="/final/images/spacer.gif" class="iconInformation"/></br>No Data Available now!</td></tr></table>'}]);}},getGroupTextPanel:function(d,a){var j=false;
var g=false;var h=false;var f=false;var b=210;var e=1;try{if(!Ext.isEmpty(this.ifApp)&&this.ifApp){h=true;}if(!Ext.isEmpty(this.ifBroker)&&this.ifBroker){f=true;}if(!Ext.isEmpty(this.ifLogon)&&this.ifLogon){g=true;b=150;e=0.6;if(!Ext.isEmpty(d.greyBackgroundNeeded)&&d.greyBackgroundNeeded){g=true;b=210;
e=1;}}if(!Ext.isEmpty(d.greyBackgroundNeeded)&&d.greyBackgroundNeeded){j=true;}}catch(c){}var k={xtype:"panel",cls:"dividerGradient font_bold12",layout:{type:"hbox",align:"stretch"},flex:e,minWidth:b,padding:"0 10 0 10",items:[{xtype:"grouptext",data:d,id:a,ifLogon:g,ifApp:h,ifBroker:f,needBackgroundStyles:j}],};
return k;},getGaugePanel:function(f,g,c){var e="separator_measure";if(c==0){e="";}var d="#35c8c2";if(f.colorValue!=undefined){d=f.colorValue;}var b={xtype:"panel",cls:"dividerGradient font_bold12",baseCls:"panelHeader",autoScroll:false,padding:"0 10 0 10",flex:0.8,minWidth:165,items:[{xtype:"gauge",data:f,id:g,num:g+"_"+c,}],};
return b;},getGraphtextPanel:function(f,g,c){var e="separator_measure";if(c==0){e="";}var d="#35c8c2";if(f.colorValue!=undefined){d=f.colorValue;}var b={xtype:"panel",baseCls:"panelHeader",autoScroll:true,flex:0.7,minWidth:165,items:[{xtype:"graphtext",cls:"dividerGradient font_bold12",data:f,id:g,num:g+"_"+c,aid:c}],};
return b;},getStoreObj:function(b){var a=Ext.create("Ext.data.Store",{autoLoad:true,model:[{name:"color",type:"string"},{name:"name",type:"string"},{name:"y",type:"int"}],fields:["color","name","y"],data:b["DataSet"],proxy:{type:"memory",reader:{type:"json",}}});return a;},getDonutPanel:function(c,d){try{var a={xtype:"panel",padding:"0 10 0 10",margin:"0 0 0 0",layout:"fit",minWidth:210,cls:"dividerGradient",autoDestroy:true,items:[{xtype:"donutalert",padding:0,margin:0,ifSbox:true,data:c,id:d,num:d+"1"}]};
return a;}catch(b){}},getHeatMapPanel:function(e){try{var b=Ext.isEmpty(e.chartDispTitle)?"":e.chartDispTitle;var c=Ext.isEmpty(e.heatApdexTitle)?"":e.heatApdexTitle;var d="<table width='100%' style='font-size:12px;height:20px'><tr><td width='60%'>"+b+"</td></tr></table>";var f='<table style="float:left;border:0px solid blue"><tr><td style="width:80px;vertical-align:top"><div id="mainSquareDiv" class="mainSquareDiv" style="width:80px;border:0px solid green;"></div></td><td width="*" >'+e.tableLabel+"</td></tr></table>";
var g={xtype:"panel",style:{"padding":"0 0 0 0 !important","border":"0px solid yellow"},height:198,autoScroll:false,scroll:false,items:[{cls:"rumDataInnerpanel",width:248,id:"heat3",margin:"0 15 0 0",bodyPadding:"23 0 10 0",autoScroll:false,scroll:false,height:"auto",html:"<div style='float:left;border:0px solid green;padding-bottom:12px;height:34px !important;display:block !important'>"+c+"</div><div class='iconRumInfo' style='float:left;margin-left:3px;margin-top:5px' data-qclass='yellowTip' data-qtip='"+e.Info_Tip+"'></div><div class='crl'></div>"+f,loopData:e.loop,listeners:{"afterrender":function(p){var q=this.loopData;
var j=jQuery(".mainSquareDiv");if(Ext.isEmpty(q.notraffic)){if(!Ext.isEmpty(q.satisfied)){var l=q.satisfied;if(l>0){for(i=0;i<l;i++){var n=$("<div></div>").addClass("satisfiedDiv");j.append(n);}}}if(!Ext.isEmpty(q.Tolerated)){var h=q.Tolerated;if(h>0){for(i=0;i<h;i++){var s=$("<div></div>").addClass("toleratingDiv");
j.append(s);}}}if(!Ext.isEmpty(q.frustrated)){var m=q.frustrated;if(m>0){for(i=0;i<m;i++){var r=$("<div></div>").addClass("frustratedDiv");j.append(r);}}}if(!Ext.isEmpty(q.Desktop)){var l=q.Desktop;if(l>0){for(i=0;i<l;i++){var o=$("<div></div>").addClass("desktopDiv");j.append(o);}}}if(!Ext.isEmpty(q.Mobile)){var h=q.Mobile;
if(h>0){for(i=0;i<h;i++){var k=$("<div></div>").addClass("mobileDiv");j.append(k);}}}if(!Ext.isEmpty(q.Tablet)){var m=q.Tablet;if(m>0){for(i=0;i<m;i++){var u=$("<div></div>").addClass("tabletDiv");j.append(u);}}}}else{var v=q.notraffic;if(v>0){for(i=0;i<v;i++){var t=$("<div></div>").addClass("notrafficDiv");
j.append(t);}}}}}}]};return g;}catch(a){}},getPiePanel:function(b,c){var a={xtype:"panel",data:b,cls:"dividerGradient font_bold12",flex:1,margin:"0 10 0 10",items:[],listeners:{"afterrender":function(){this.data["customMsg"]="yes";this.data["formatTip"]="yes";this.data["rumPie"]="yes";this.data["dataLabels"]=false;
var d={};d=jQuery.extend(true,{},createPie(this.id,100,150),d);d.setData(this.data,"","","pie");a.chartObj=d;d.drawChart();}}};return a;},getTextDonutLegendPanel:function(c,d){try{var a={xtype:"container",padding:"0 10 0 10",margin:0,layout:"fit",flex:0.8,minWidth:210,cls:"dividerGradient",ui:"uniqueSessions",autoDestroy:true,items:[{xtype:"textdonutlegend",data:c,id:d,num:d,}]};
return a;}catch(b){}},getTextHeatAlertPanel:function(c,d){try{var a={xtype:"container",padding:"0 10 0 10",margin:0,layout:"fit",flex:0.8,minWidth:140,cls:"dividerGradient",ui:"uniqueSessions",autoDestroy:true,items:[{xtype:"textheatalert",data:c,id:d}]};return a;}catch(b){}},getTextDonutAlertPanel:function(c,d){try{var a={xtype:"container",padding:"0 10 0 10",margin:0,layout:"fit",flex:1,minWidth:210,cls:"dividerGradient",ui:"uniqueSessions",autoDestroy:true,items:[{xtype:"textdonutalert",data:c,id:d}]};
return a;}catch(b){}},getTextPanel:function(c,d){try{var a={xtype:"container",padding:"0 10 0 10",margin:0,flex:0.6,minWidth:130,cls:"dividerGradient",ui:"uniqueSessions",autoDestroy:true,items:[{xtype:"text",data:c,id:d}]};return a;}catch(b){}},getTextFooterGraphPanel:function(e,g){try{var d=0.7;var c=120;
var f=false;if(!Ext.isEmpty(e)&&!Ext.isEmpty(e.graphData)&&!Ext.isEmpty(e.graphData.DataSetCount)){d=1.4;c=220;f=true;}else{if(!Ext.isEmpty(e)&&!Ext.isEmpty(e.graphData)&&!Ext.isEmpty(e.graphData.DataSet)&&Ext.isEmpty(e.graphData.DataSet[0].ERROR)){d=0.8;c=150;}}var a={xtype:"container",padding:"0 10 0 10",margin:0,flex:d,minWidth:c,cls:"dividerGradient",ui:"uniqueSessions",autoDestroy:true,items:[{xtype:"textfootergraph",data:e,id:g,iftempDouble:f}]};
return a;}catch(b){}}});