Ext.define("endUserLogonDetails.view.Main",{extend:"Ext.panel.Panel",alias:"widget.main",requires:["utilities.OuterPanel","utilities.CommonPanel"],bodyPadding:"0",cls:"balckouterpanel dashboard_title",bodyCls:"outerMainLayoutbody",baseCls:"egbaseLayout",id:"header",name:"header",border:false,layout:{type:"vbox",align:"stretch"},hideHeaders:true,frame:true,flex:1,items:[{xtype:"panel",autoScroll:true,scroll:true,height:235,layout:{type:"hbox",align:"stretch"},items:[{xtype:"panel",flex:0.42,margin:"0 10 0 0",items:[{xtype:"fieldset",cls:"UxFieldsetInner",id:"user_Panel_1",style:{"padding-right":"1px"},height:225,listeners:{"afterrender":function(a){a.body.setStyle({"overflow":"auto"});
}}}]},{xtype:"panel",cls:"UxFieldsetInner",flex:0.58,items:[{xtype:"fieldset",cls:"UxFieldsetInner",id:"user_Panel_2",height:225,}]}]},{xtype:"fieldset",height:250,cls:"UxFieldsetInner",id:"user_Panel_3",padding:"10 10 0 10",title:"",layout:{type:"hbox",align:"stretch"},items:[{xtype:"container",width:"100%",items:[{xtype:"container",id:"user_Panel_3_details",width:350,cls:"UxLogonSessionStartupBox",height:24,margin:"0 0 10 0",},{xtype:"container",layout:"hbox",margin:"10 0 0 0",items:[{xtype:"container",id:"user_Panel_4",margin:"0 40 0 0",height:180,width:"50%"},{xtype:"container",html:'<div class="logonDivider"></div>'},{xtype:"container",id:"user_Panel_5",autoScroll:false,scroll:false,height:110,width:"50%"}]}]}]}],initComponent:function(){var j=this;
var b=new Ext.LoadMask(Ext.getBody(),{msg:"Please wait..."});b.show();for(var d=0;d<panelOrder.length;d++){var c=panelOrder[d].PanelId;var g=c+"_container";var h=panelOrder[d].Metrics;try{panelMetrics_EN=parent.filterEncode(h);}catch(i){try{panelMetrics_EN=parent.parent.filterEncode(h);}catch(f){try{panelMetrics_EN=parent.parent.parent.filterEncode(h);
}catch(i){panelMetrics_EN=h;}}}var a="/final/servlet/com.eg.EgMonitorResultDispatcher";if(!Ext.isEmpty(a)){Ext.Ajax.request({url:a,scope:this,timeout:280000,params:parameters+"&panelId="+c+"&panelMetrics="+encodeURIComponent(panelMetrics_EN)+"&resultpage=globalsearch&isEndUserDashboard=true",panelId:c,containerId:g,panelMetrics:h,success:function(n){if(n.status==200&&!Ext.isEmpty(n.responseText)){var x=n.request.options.panelId;
var t=n.request.options.panelMetrics;var k=n.request.options.url;var m=n.request.options.params;var r=n.request.options.containerId;var u=Ext.decode(n.responseText);var p=u["RESULT"];var v=p["TITLE"];if(Ext.isEmpty(v)&&p["JSON_DATA"]!=null&&p["JSON_DATA"]["TITLE"]!=null&&p["JSON_DATA"]["TITLE"]!=undefined){v=p["JSON_DATA"]["TITLE"];
}if(n.responseText.indexOf(".png")>=0){if(!Ext.isEmpty(v)){Ext.getCmp("user_"+x).setTitle(v);}Ext.getCmp("user_"+x).update(p["JSON_DATA"]);}else{if(!Ext.isEmpty(p)&&p["JSON_DATA"]!=undefined&&p["JSON_DATA"]!="undefined"&&p["JSON_DATA"]!="NO_DATA"&&p["JSON_DATA"]!="RECONNECT_DATA"&&((p["JSON_DATA"]["Login_Info"]==undefined&&t.indexOf("UserDonutLoginInfo")==-1)||(t.indexOf("UserDonutLoginInfo")>-1&&p["JSON_DATA"]["Login_Info"]!=undefined&&p["JSON_DATA"]["Login_Info"]!="undefined"&&p["JSON_DATA"]["Login_Info"]!="RECONNECT_DATA"))){if(!Ext.isEmpty(v)){Ext.getCmp("user_"+x).setTitle(v);
}if(Ext.isEmpty(p["PANEL_TYPE"])){if(t.indexOf("UserSessionInfo")>-1){Ext.getCmp("user_"+x).update(p["JSON_DATA"]);}else{if(t.indexOf("UserDonutLoginInfo")>-1){var q=p["JSON_DATA"]["Login_Chart_Data"];var o=p["JSON_DATA"]["Login_Chart_Middle"];var w=p["JSON_DATA"]["Login_Info"];if(q!=null&&q!=undefined){q["customMsg"]="yes";
q["formatTip"]="yes";q["rumPie"]="yes";q["dataLabels"]=false;q["showMonitorHomeBottomPanel"]=false;q["logonDonut"]=true;q["useHtml"]=true;q["title"]=o;q["tooltipFontSize"]=10;var l={};Ext.getCmp("user_"+x).update(w);try{l=jQuery.extend(true,{},createPie("UserDonutLoginInfo_container",180,180),l);l.setData(q,"","","donut");
l.drawChart();}catch(s){console.log(s);}}else{Ext.getCmp("user_"+x).update('<table width="100%" height="100%" ><tr><td valign="middle" align="center"><div class="iconInformation" style="margin:3% 0 auto 0"></div><div style="font-size:12px">'+noMeasure+"! </div></td></tr></table>");}}else{if(t.indexOf("UserLoginInfo")>-1){Ext.getCmp("user_"+x).update(p["JSON_DATA"]);
}else{if(t.indexOf("UserSessionDuration")>-1){if(x=="Panel_3"){Ext.getCmp("user_"+x+"_details").update(p["JSON_DATA"]);}else{Ext.getCmp("user_"+x).update(p["JSON_DATA"]);}}else{if(t.indexOf("UserSessionMetricsDuration")>-1){Ext.getCmp("user_"+x).update(p["JSON_DATA"]);}else{if(t.indexOf("UserMetrics")>-1){Ext.getCmp("user_"+x).update(p["JSON_DATA"]);
}}}}}}}}else{if(!Ext.isEmpty(p)&&p["JSON_DATA"]!=undefined&&p["JSON_DATA"]!="undefined"&&(p["JSON_DATA"]=="RECONNECT_DATA"||p["JSON_DATA"]["Login_Info"]==undefined||(p["JSON_DATA"]["Login_Info"]!=undefined&&p["JSON_DATA"]["Login_Info"]!="undefined"&&p["JSON_DATA"]["Login_Info"]=="RECONNECT_DATA"))){if(!Ext.isEmpty(v)){Ext.getCmp("user_"+x).setTitle(v);
}Ext.getCmp("user_"+x).update('<table width="309" height="86" style="margin: 8% auto;" ><tr><td valign="middle" align="center" class="reconnectErrorMessage"><span><div class="reconnectErrorIcon"></div></span>No data is available for this session </br>from the Delivery Controller. </br></br>This may happen if the user has </br>reconnected to an existing session.</td></tr></table>');
}else{if(!Ext.isEmpty(v)){Ext.getCmp("user_"+x).setTitle(v);}Ext.getCmp("user_"+x).update('<table width="100%" height="100%" ><tr><td valign="middle" align="center"><div class="iconInformation" style="margin:3% 0 auto 0"></div><div style="font-size:12px">'+noMeasure+"! </div></td></tr></table>");}}}if(d!=panelOrder.length-1){b.hide();
}}}});}}this.callParent();}});