Ext.define("MyDashBoard.view.Portlet",{alias:"widget.portlet",extend:"utilities.BorderPanelLayout",xtype:"BorderPanel",padding:0,bodyPadding:10,margin:0,flex:1,ui:"newGraphPanel toshadow myDashWidgetPad",overlapHeader:false,border:false,frame:false,closeAction:"destroy",isPreview:false,action:"createWidget",isHighChartUpdate:"",isOneClickDashboard:"",isLegendAvail:"",isToggleHeader:false,isCurrentValAvail:false,isLastLoadedWidget:false,isLastWidget:false,isPreviewMode:false,showColorPicker:true,layout:{type:"vbox",align:"stretch"},porletSetTitle:function(b){var a=this;
if(a.rendered){Ext.defer(function(){a.setTitle(b);$("#"+a.id+" .x-panel-header-text").attr("data-qtip",b);},200);}else{console.log(a.id);}},panlCntr:0,nextRefreshTime:new Date().getTime(),lastRefreshedTime:new Date().getTime(),defaults:{flex:1},applyMasked:function(b){var a=this;if(!a.loading){b=true;
}else{b=false;}a.setLoading(b,a.body);},refreshData:function(){var a=this;myDashApp.getController("Main").loadDataForBlock(a,Ext.getCmp("dashboardLayoutObj").profileName,a.id,false);},popup:function(c,a,h){var d=this;var f=[];f.push({text:screenLabelsObj["Refresh"],handler:function(){d.refreshData();
}});var b=false;var e=d.id;if(d.isPreviewMode||isMonitorHome||isComponentDashboard||isConsolidatedDashboard||isTvMode){includeSettingsIcon=false;}else{if(!this.isOneClickDashboard&&(this.blockType!=null&&(this.blockType=="TopNGaugeChart"||this.blockType=="TopNDigitalChart"))){includeSettingsIcon=false;
}else{if(e!=null&&e.indexOf("_")==-1){if(e=="weather"||e=="news"||e=="userExperience"){includeSettingsIcon=true;}else{includeSettingsIcon=false;}}else{includeSettingsIcon=true;}}}if(this.isOneClickDashboard&&this.blockType!=null&&(this.blockType=="vmAlarmsWidget"||this.blockType=="servicehealth")){includeSettingsIcon=false;
}if(includeSettingsIcon){f.push({text:screenLabelsObj["Edit"],scale:"small",handler:function(){var j="addWidget";if(d.isConfigured){j="editWidget";}var l=d.id;var i=Ext.getCmp("dashboardLayoutObj").isPredefinedLayout;if(i&&!d.isConfigured&&l.indexOf("Widget_")==0){var k=myDashApp.getController("Main").getAddwidgetwindow();
if(Ext.isEmpty(k)){k=Ext.widget("addwidgetwindownew");}k.configureNewWidget=true;k.widgetID=l;k.show();k=null;delete k;}else{myDashApp.getController("WidgetConfigurationController").openWidgetConfigurationWindow(this,l,j);}}});}if(this.blockType!=null&&this.blockType=="currentalarms"){f.push({text:screenLabelsObj["Edit"],scale:"small",blockId:e,handler:function(){myDashApp.getController("WidgetConfigurationController").showAlarmFilterPopup(this.blockId);
}});}if(!isPublishedDashboard){f.push({text:screenLabelsObj["Remove from dashboard"],scale:"small",handler:function(){Ext.Msg.show({title:myDashboardAlertLbl,msg:deleteBlockMsg+"?",buttons:Ext.Msg.YESNO,width:300,icon:"iconConfirmation",fn:function(p){if(p=="yes"){var k=myDashApp.getController("Main").getGridstackpanel();
k._removeWidget(d.relationTo);var i=d.title;var l=d.id;var o=Ext.getCmp("dashboardLayoutObj").profileName;if(!Ext.isEmpty(o)){o=filterEncode(o);}var n="action=deleteTable&profileName="+encodeURIComponent(o)+"&key="+l;if(l=="news"){var j=Ext.getCmp("news");if(!Ext.isEmpty(j)){j.hide();}j=null;delete j;
}else{if(l=="weather"){var m=Ext.getCmp("weather");if(!Ext.isEmpty(m)){m.hide();}m=null;delete m;}}Ext.defer(function(){var r=Ext.getCmp("gridstackpanelObj");var q=r._serializationStr();n=n+"&layoutConfig="+encodeURIComponent(q);Ext.Ajax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:n,scope:this,success:function(u){d.close();
var w=publicJson["myDashboardConfigDetails"]["configIds"];if(w!=null&&w.indexOf(l)>-1){var s=new Array();for(var v=0;v<w.length;v++){var x=w[v];if(x!=null&&x!=l){s.push(x);}}var y=refreshIntervalTaskObj[l];refreshIntervalTaskObj[l]=window.clearInterval(y);y=null;delete y;publicJson["myDashboardConfigDetails"]["configIds"]=s;
Ext.destroy(Ext.getCmp(l));}}});},600);}}});}});}var g=Ext.create("Ext.menu.Menu",{width:165,margin:"0 0 10 0",cls:"iconDropDownMenu",floatable:true,floating:true,renderTo:d.id+"_outer",plain:true,shadow:false,listeners:{hide:function(i){i.destroy();}},items:f}).showAt([a,h]);return g;},isSharedDashboard:false,isTopNComboInProgress:false,isAllowedToChangeTitle:false,blockType:"",showMoreDataOption:false,isOneClickDashboard:false,showCombo:false,isHighChartUpdate:false,mapLastLoadedURL:null,isWidgetResizeInProgress:false,initComponent:function(){var i=this;
var b=this.isPreviewMode;var e=this.id;var g="";if(e.indexOf("_")>-1){g=e.substring(0,e.indexOf("_"));}else{g=e;}this.blockType=g;i.toolsArr=[];var k=false;this.suspendEvents(false);var j=publicJson["action"];if(j!=null&&j=="showMyDashboard"){this.isPreview=true;}else{this.isPreview=false;}var a=false;
if(publicJson["myDashboardConfigDetails"]["IsOneClickDashboard"]!=null&&publicJson["myDashboardConfigDetails"]["IsOneClickDashboard"]=="yes"){a=true;this.isOneClickDashboard=true;}var d=false;if(publicJson["myDashboardConfigDetails"]["isAllowedToEditSharedDashboard"]==true){d=true;}$("#"+g+"_header_hd").width("100%");
if(e!=null&&e.indexOf("_")>0||(g=="currentalarms"||g=="tierhealth"||g=="proactivealerts"||g=="incidentssummary")){if(isPublishedDashboard&&showTimelineForPublishedDashboard||(g=="incidentssummary")){if(g!=null&&(g=="TimelineChart"||g=="areaChart"||g=="incidentssummary")){i.toolsArr.push(Ext.create("Ext.form.ComboBox",{fieldLabel:timelineLbl,itemId:e+"_timecombo",id:e+"TimeLine_combo",style:{"display":"none"},height:24,labelStyle:"margin:-3px 0px 0px 0px",cls:"dropdown",labelSeparator:"",labelWidth:50,padding:0,width:140,margin:"0 10 0 0",store:Ext.create("Ext.data.Store",{fields:["displayField","valueField"],data:[]}),listConfig:{listeners:{"itemclick":function(){this.up("panel").header.tools.forEach(function(m,n){var o=m.id;
});i.isTopNComboInProgress=false;},"show":function(){i.isTopNComboInProgress=true;},"hide":function(){}}},editable:false,displayField:"displayField",valueField:"valueField",queryMode:"local",listeners:{"select":function(m){i.isTopNComboInProgress=false;myDashApp.getController("Main").showGraphForTimelinechange(m.getValue(),m.up("panel"));
}}}));}}if(g!=null&&(g=="BarChart"||g=="table")){if(i.isTopNChart||!a){i.toolsArr.push(Ext.create("Ext.form.ComboBox",{fieldLabel:showLbl,itemId:e+"_combo",id:e+"Barchart_combo",style:{"display":"none"},height:24,labelStyle:"margin:-3px 0px 0px 0px",cls:"dropdown",labelSeparator:"",labelWidth:35,width:120,margin:"0 10 0 0",store:Ext.create("Ext.data.Store",{fields:["displayField","valueField"],data:[]}),listConfig:{listeners:{"itemclick":function(){this.up("panel").header.tools.forEach(function(m,n){var o=m.id;
});i.isTopNComboInProgress=false;},"show":function(){i.isTopNComboInProgress=true;},"hide":function(){}}},editable:true,forceSelection:true,displayField:"displayField",valueField:"valueField",queryMode:"local",listeners:{"select":function(m){i.isTopNComboInProgress=false;myDashApp.getController("Main").showTopNGraph(m.getValue(),m.up("panel"));
}}}));}if(!b&&g=="table"){this.bodyPadding="0 10px 10px 10px";i.toolsArr.push({xtype:"trigger",id:"searchTable_"+e,name:"searchTable_"+e,flex:0.5,height:23,margin:"4 10 0 0",fieldLabel:"",hidden:false,cls:"whitedropdown_search",emptyText:"Search",enableKeyEvents:true,widgetID:e,onTriggerClick:function(m){this.fireEvent("ontriggerclick",this,m);
},listeners:{"onTriggerClick":function(m){myDashApp.getController("Main").ontriggerclick(m);},"keypress":function(n,m){if(m.getCharCode()==Ext.EventObject.ENTER){myDashApp.getController("Main").ontriggerclick(n);}}},listConfig:{listeners:{"itemclick":function(){this.up("panel").header.tools.forEach(function(m,n){var o=m.id;
Ext.getCmp(o).hide();});i.isTopNComboInProgress=false;},"show":function(){i.isTopNComboInProgress=true;},"hide":function(){}}}});}}else{if(!b&&(g!=null&&(g=="heatMapChart"||g=="activityChart"||g=="pieChart"||g=="TopNGaugeChart"||g=="TopNDigitalChart"||g=="ddTable"||g=="liveMeasuresBox"))){if(g!=null&&(g=="ddTable"||g=="liveMeasuresBox")){i.toolsArr.push(Ext.create("Ext.form.ComboBox",{fieldLabel:"",itemId:e+"_combo",id:e+"dd_combo",cls:"dropdown",labelSeparator:"",labelWidth:65,margin:"0 10 0 10",labelStyle:"margin:3px 0px 0px 0px",store:Ext.create("Ext.data.Store",{fields:["displayField","valueField"],data:[]}),listConfig:{listeners:{"itemclick":function(){i.isTopNComboInProgress=true;
},"show":function(){i.isTopNComboInProgress=true;},"hide":function(){},"containermouseover":function(){i.isTopNComboInProgress=true;},"containermouseout":function(){i.isTopNComboInProgress=false;},}},emptyText:descLbl,editable:true,forceSelection:true,displayField:"displayField",valueField:"valueField",queryMode:"local",emptyText:"Descriptors",listeners:{"select":function(m){i.isTopNComboInProgress=false;
myDashApp.getController("Main").showDDForSelectedDescptr(m.getValue(),m.up("panel"));}}}));}if(g!=null&&g=="ddTable"){i.toolsArr.push({xtype:"trigger",id:"dd_search_"+e,name:"dd_search_"+e,labelWidth:40,margin:"0 10 0 0",fieldLabel:"",cls:"whitedropdown_search",emptyText:searchDispLbl,listeners:{change:{fn:this.onTextFieldChangeForDDWidget,scope:this,buffer:100}}});
}var c=Ext.getCmp("dashboardLayoutObj");var h=c.profileName;if(!Ext.isEmpty(h)){h=filterEncode(h);}var l="action=loadBlockData&profileName="+encodeURIComponent(h)+"&blockId="+e+"&moreData=true";i.toolsArr.push({xtype:"container",width:16,height:18,id:"drilldownIcon_"+e,name:"drilldownIcon_"+e,html:"<span class='iconMaximizeGray' style=\"float:right;cursor:pointer;margin-right:5px;margin-top:0px\" onclick=\"javascript:openTopNMoreOptionsPopup('"+l+"','"+e+"');\" data-qtip="+screenLabelsObj["More"]+"&nbsp"+screenLabelsObj["Options"]+"></span>"});
}else{if(!b&&(g!=null&&g=="TopologyWidget")){i.toolsArr.push(Ext.create("Ext.form.ComboBox",{fieldLabel:segmentLbl,itemId:e+"_segmentcombo",id:e+"_segmentcombo",cls:"dropdown",labelSeparator:"",labelWidth:65,margin:"0 10 0 10",labelStyle:"margin:3px 0px 0px 0px",store:Ext.create("Ext.data.Store",{fields:["displayField","valueField"],data:[]}),listConfig:{listeners:{"itemclick":function(){i.isTopNComboInProgress=false;
},"show":function(){i.isTopNComboInProgress=true;},"hide":function(){}}},emptyText:descLbl,editable:true,forceSelection:true,displayField:"displayField",valueField:"valueField",queryMode:"local",emptyText:"Descriptors",topologyWidgetId:e,listeners:{"select":function(m){myDashApp.getController("WidgetConfigurationController").changeTopology(m);
}}}));}else{if(!b&&(g!=null&&g=="vmAlarmsWidget")){i.toolsArr.push({xtype:"trigger",id:"searchVms_"+e,name:"searchVms_"+e,labelWidth:40,margin:"0 10 0 0",fieldLabel:"",cls:"whitedropdown_search",emptyText:searchDispLbl,listeners:{change:{fn:this.onTextFieldChange,scope:this,buffer:100}}});}else{if(g!=null&&g=="currentalarms"||g=="tierhealth"){if(g=="currentalarms"&&showAlarmSummary){this.bodyPadding="0 10px 10px 10px";
}if(g!=null&&g=="tierhealth"){this.bodyPadding="0 0px 10px 10px";}var f=Ext.getCmp("dashboardLayoutObj").profileName;if(showComponentTypeFilter){i.toolsArr.push({fieldLabel:"",labelAlign:"left",xtype:"checkcombobox",width:220,id:e+"_Filter",name:e+"_Filter",blockId:e,margin:"0 0 0 0",editable:false,multiSelect:true,labelWidth:100,baseCls:"emptyCls",queryMode:"local",labelSeparator:"",valueField:"valueField",displayField:"displayField",cls:"dropdown",emptyText:"Filter By Component Type",allText:"All",stateId:f+"_"+e+"_stful",stateful:true,isComponentTypeFilterChanged:false,store:new Ext.data.Store({fields:["valueField","displayField"],data:[]}),addAllSelector:true,isDropDownloaded:false,listeners:{"select":function(m){Ext.defer(function(){myDashApp.getController("Main").loadDataForCompTypeFilter(m);
},500);},"beforedeselect":function(m){if(m.lastSelection.length==1){m.fireEvent("select",m,[]);}}},isLastRecord1:function(){Ext.Msg.show({title:myDashboardAlertLbl,msg:compTypAlertMsg,buttons:Ext.MessageBox.OK,icon:"iconInformation"});return;}});}else{if(g=="currentalarms"){if(alertDistributionByServer){i.toolsArr.push({xtype:"trigger",id:"searchAlarms_"+e,name:"searchAlarms_"+e,labelWidth:40,fieldLabel:"",cls:"whitedropdown_search",emptyText:searchDispLbl,hidden:false,listeners:{change:{fn:this.onTextFieldChangeForAlert,scope:this,buffer:100}}});
}else{i.toolsArr.push({xtype:"trigger",id:"searchAlarms_"+e,name:"searchAlarms_"+e,labelWidth:40,fieldLabel:"",cls:"whitedropdown_search",emptyText:searchDispLbl,hidden:false,widgetID:e,enableKeyEvents:true,onTriggerClick:function(m){this.fireEvent("ontriggerclick",this,m);},listeners:{"onTriggerClick":function(m){myDashApp.getController("WidgetConfigurationController").onSearchTriggerclick(m);
},"keypress":function(n,m){if(m.getCharCode()==Ext.EventObject.ENTER){myDashApp.getController("WidgetConfigurationController").onSearchTriggerclick(n);}}}});if(isPublishedDashboard){i.toolsArr.push({xtype:"button",cls:"iconbuttonclass",margin:"0 0 0 3",style:{"background":"none","border":"none"},icon:"../images/"+strSkin+"/menuIcon_active.png",id:e+"menubutton",handler:function(m){i.popup(m,m.el.getX(),m.el.getY());
}});}}}}}}}}}}else{if(g!=null&&g=="servicehealth"){this.bodyPadding=0;}if(g!=null&&g=="networkhealth"){this.bodyPadding=0;i.toolsArr.push({xtype:"trigger",id:"searchComps_"+e,name:"searchComps_"+e,labelWidth:40,fieldLabel:"",cls:"whitedropdown_search",emptyText:searchDispLbl,hidden:false,listeners:{change:{fn:this.onTextFieldChangeForNWHealth,scope:this,buffer:100}}});
}}if(!this.isSharedDashboard||d){if((!b&&!isPublishedDashboard&&!isTvMode&&!isComponentDashboard&&!isConsolidatedDashboard&&!isMonitorHome)&&e!=null&&e.indexOf("_")>0){var g=e.substr(0,e.indexOf("_"));if(g!=null&&showLegandPanelForWidgetsVal&&(g=="BarChart"||g=="TimelineChart"||g=="TrendGraph"||g=="CombinedTimelineChart"||g=="areaChart"||g=="combinationChart"||g=="activityChart"||g=="pieChart")){i.toolsArr.push({xtype:"button",cls:e+"colorPalette dragTools",height:16,width:16,margin:"2 5 0 6",id:"mybutton_"+e,blockId:e,iconCls:"iconSpilitOnWidget",enableToggle:true,tooltip:legendPnlTootltip,handler:function(m){if(m.pressed==true){Ext.getCmp("border_"+e).expand(false);
m.setTooltip(legendPnlHideTootltip);if(g=="BarChart"){Ext.getCmp("ChartArea_"+e).removeCls("HorzBar_panel");}}else{Ext.getCmp("border_"+e).collapse();$("#border_"+e+"-splitter").addClass("x-splitter-collapsed");if(g=="BarChart"){Ext.getCmp("ChartArea_"+e).addCls("HorzBar_panel");}m.setTooltip(legendPnlTootltip);
}}});}if(g!=null&&(g=="BarChart"||g=="TrendGraph"||g=="TimelineChart"||g=="CombinedTimelineChart"||g=="areaChart"||g=="combinationChart"||g=="activityChart"||g=="pieChart"||g=="heatMapChart")){i.toolsArr.push({xtype:"button",cls:"dragTools",height:17,id:e+"colorPalette",width:16,margin:"0 3 0 0",iconCls:"colorTool",tooltip:changeGraphColorPaletteLbl,blockId:e,handler:function(){i.isTopNComboInProgress=false;
this.selectedGraphPalette=this.up("panel").selectedGraphPalette;myDashApp.getController("Main").showPaletteWindow(this);i.isTopNComboInProgress=true;}});}if(g!=null&&(g=="dialChart"||g=="TopNGaugeChart")){i.toolsArr.push({xtype:"button",cls:"dragTools",height:20,id:e+"colorPicker",width:16,margin:"0 3 0 0",iconCls:"colorTool",tooltip:changeColorPickerLbl,blockId:e,hidden:false,handler:function(){i.isTopNComboInProgress=false;
this.selectedGaugeColor=this.up("panel").selectedGaugeColor;myDashApp.getController("Main").showColorPickerWindow(this);i.isTopNComboInProgress=true;}});}if(g!=null&&(g=="textWidget")){this.ui="newGraphPanel toshadow myDashWidgetPad textWidgetDrag";}if(g!=null&&g=="CombinedTimelineChart"){this.bodyPadding="0 10 10 10";
}if(g!=null&&g=="healthsummary"){this.bodyPadding="0 0 10 10";}if(a==true&&g!=null&&g=="vmAlarmsWidget"){k=false;}else{if(!a&&(g!=null&&(g=="TopNGaugeChart"||g=="TopNDigitalChart"))){k=false;}else{k=true;}}}else{if(!b&&!isTvMode&&e!=null&&(e=="weather"||e=="news"||e=="userExperience")){k=true;}}if(isMonitorHome||isComponentDashboard||isConsolidatedDashboard){k=false;
}if(!b&&!isMonitorHome&&!isPublishedDashboard&&!isComponentDashboard&&!isConsolidatedDashboard&&!isTvMode){i.toolsArr.push({xtype:"button",cls:"iconbuttonclass",margin:"0 0 0 3",style:{"background":"none","border":"none"},icon:"../images/"+strSkin+"/menuIcon_active.png",id:e+"menubutton",handler:function(m){i.popup(m,m.el.getX(),m.el.getY());
}});}if(!b&&!isMonitorHome&&!isComponentDashboard&&!isConsolidatedDashboard&&!isTvMode){this.isAllowedToChangeTitle=true;}}this.tools=i.toolsArr;this.resumeEvents();this.callParent();},blkType:"",highChartObj:null,isTopNChart:false,hideMaxmizeIcon:false,isRequestTimeoutHappened:false,isInitialResizeCompleted:false,layerModelUrl:null,selectedGraphPalette:null,selectedGaugeColor:null,showTopNCombo:false,changeTitle:function(){var a=this;
var b=Ext.get(a.header.id+"_hd-textEl");Ext.get(a.header.id).on("dblclick",function(k,j){$("#"+a.header.id+"_hd").css({"text-overflow":"clip"});var d=a.getWidth()-90;var h=b.dom.innerHTML;var f=a.id;var c="";if(f!=null&&f.lastIndexOf("_")>0){f=f.substring(0,f.lastIndexOf("_"));}var i=new Ext.Editor({width:150,alignment:"tl",floating:false,shadow:false,updateEl:true,ignoreNOChange:true,completeOnEnter:true,cancelOnEsc:true,field:{xtype:"textfield",cls:"headerTextEdit"},listeners:{"beforecomplete":function(n,m,e,l){if(m==null||m==""){n.setValue(e);
Ext.Msg.show({title:myDashboardAlertLbl,msg:emptyHeadrMsg,buttons:Ext.MessageBox.OK,icon:"iconInformation"});return false;}},"complete":function(q,p,l,m){$("#"+a.header.id+" .x-panel-header-text").attr("data-qtip",p);var o=Ext.getCmp("dashboardLayoutObj").profileName;var n=o;if(!Ext.isEmpty(n)){n=filterEncode(n);
}var e=p;if(!Ext.isEmpty(e)){e=filterEncode(e);}Ext.Ajax.request({url:"/final/servlet/com.eg.egMyDashboardController",method:"POST",params:"&action=rename&profileName="+encodeURIComponent(n)+"&key="+a.id+"_Title&value="+encodeURIComponent(e),success:function(r){var t=r.responseText;if(t!=null&&t!=""){var s=Ext.decode(t);
if(f!=null&&(f=="TrendGraph"||f=="TimelineChart"||f=="CombinedTimelineChart")){if(c!=null&&c!=""){b.dom.innerHTML=p+" - "+c;}}}}});$(".editor_layer").remove();$("#"+a.header.id+"_hd").css({"text-overflow":"ellipsis"});}}});var g=Ext.get(a.header.id+"_hd-textEl");i.startEdit(g,h);$("#"+a.header.id).append('<div class="editor_layer" style="position:absolute;top:0px;height:50px;width:'+d+'px">---</div>');
$("#dashboardLayoutObj-body").scroll(function(){if(!Ext.isEmpty(i)){i.cancelEdit(false);}$(".editor_layer").remove();});},a,{delegate:"#"+a.header.id+"_hd-textEl"});widgetTitleEditor=null;},listeners:{"afterrender":function(f){if(f.rendered==true){if(f.blockType!=null&&f.blockType=="textWidget"){if(!Ext.isEmpty(f.getHeader())){f.getHeader().setVisible(false);
}}f.porletSetTitle=function(c){if(!Ext.isEmpty(f)){f.setTitle(c);$("#"+f.id+" .x-panel-header-text").attr("data-qtip",c);}};var b=Ext.getCmp("dashboardLayoutObj").isPredefinedLayout;if(f.action!=null&&f.action=="loadWidget"){var a=publicJson["myDashboardConfigDetails"]["profileName"];a=myDashApp.getController("Main").replaceHtmlTag(a," &lt; ","<");
a=myDashApp.getController("Main").replaceHtmlTag(a," &gt; ",">");var d=publicJson["myDashboardConfigDetails"]["configIds"];if(d!=null&&d.indexOf(f.id)>-1){myDashApp.getController("Main").loadDataForBlock(this,a,f.id,true);}else{var e=Ext.getCmp(f.id);e.removeAll();if(!isPublishedDashboard&&b){e.add(myDashApp.getController("Main").configureWidget("iconOneClickHeaderAddWidget",f.id));
}else{e.add({xtype:"panel",layout:{type:"fit",},html:'<div style="height:100%;width:100%;display:table"><div class="msgFont" style="display:table-cell;vertical-align:middle"> <div class="iconInformation" style="margin:0px auto"></div><div style="text-align:center">'+WidgetNotConfigMsg+"</div></div></div>"});
}}}else{if(b&&(f.id).indexOf("Widget_")==0){var e=Ext.getCmp(f.id);e.removeAll();if(!isPublishedDashboard){e.add(myDashApp.getController("Main").configureWidget("iconOneClickHeaderAddWidget",f.id));}else{e.add({xtype:"panel",layout:{type:"fit",},html:'<div style="height:100%;width:100%;display:table"><div class="msgFont" style="display:table-cell;vertical-align:middle"> <div class="iconInformation" style="margin:0px auto"></div><div style="text-align:center">'+WidgetNotConfigMsg+"</div></div></div>"});
}}}}},"boxready":function(i){var e=null;var d=null;var g=null;var m=null;var j=null;var o=false;var n=false;var b=false;if(publicJson!=null&&publicJson["myDashboardConfigDetails"].hasOwnProperty("IsOneClickDashboard")){if(publicJson["myDashboardConfigDetails"]["IsOneClickDashboard"]=="yes"){b=true;}}if(!b){if(isOneClickDashboard==true||isOneClickDashboard=="true"||isOneClickDashboard=="yes"){b=true;
}}var h=false;if(i.blockType!=null&&i.blockType=="currentalarms"){h=true;}var a=i.isPreviewMode;m=Ext.getCmp(i.id+"dd_combo");if(!a&&i.header){var l=i.id+"Barchart_combo";var k=i.id+"dd_combo";i.tools.forEach(function(c,p){var r=c.id;var q=Ext.getCmp(r).el.setVisibilityMode(Ext.Element.DISPLAY);if(r!=null&&(r==l)){if(i.isTopNChart){q.hide();
}}else{q.hide();}});if(i.blockType!=null&&i.blockType!="textWidget"){var f=Ext.getCmp(i.id+"_header_hd");if(f!=""&&f!=null&&f!="undefined"){f.flex=0;f.setWidth(i.width-20);}}i.mon(i.el,"mouseenter",function(){if(!i.isTopNComboInProgress){i.tools.forEach(function(r,s){var v=r.id;var t=Ext.getCmp(v).el.setVisibilityMode(Ext.Element.DISPLAY);
if(v!=null&&(v==l)){if(i.isTopNChart&&i.showTopNCombo){t.show();}}else{if(v.indexOf("mybutton_")>-1){if(i.isChart){if(i.errorMsg=="-"){t.show();}else{t.hide();}}}else{if(v.indexOf("dd_combo")>-1){var q=i.showCombo;if(q==true){t.show();}else{t.hide();}}else{if(v.indexOf("segmentcombo")>-1){var u=i.showCombo;
if(u==true){t.show();}else{t.hide();}}else{if(v.indexOf("drilldownIcon_")>-1){if(i.showMoreDataOption){t.show();}else{t.hide();}}else{if(v.indexOf("searchTable")>-1){var w=i.isPaginationNeeded;if(w==true){t.setVisible(true);}else{t.setVisible(false);}}else{if(v.indexOf("colorPicker")>-1){if(i.showColorPicker){var p=true;
if(!isHighchartForGauge&&i.blockType=="dialChart"){p=false;}if(p){t.show();}}else{t.hide();}}else{if(v.indexOf("searchVms_")>-1){if(!i.isConfigured){t.hide();}else{t.show();}}else{if((v.indexOf("TimeLine_combo")>-1)&&i.showTimelineCombo){t.show();}else{if(isPublishedDashboard&&h&&(v.indexOf("searchAlarms_")>-1||v.indexOf("menubutton")>-1)){t.show();
}else{if(!isMonitorHome&&!isPublishedDashboard&&!isTvMode){t.show();}}}}}}}}}}}});if((i.blockType!=null&&i.blockType!="textWidget")&&!Ext.isEmpty(i)&&!Ext.isEmpty(Ext.getCmp(i.id+"_header_hd"))){var c=Ext.getCmp(i.id+"_header_hd");if(!Ext.isEmpty(c)&&c!=""&&c!=null&&c!="undefined"){c.flex=1;c.setWidth("100%");
}}}});i.mon(i.el,"mouseleave",function(){if(!i.isTopNComboInProgress){i.tools.forEach(function(p,q){var s=p.id;var r=Ext.getCmp(s).el.setVisibilityMode(Ext.Element.DISPLAY);if(s!=null&&(s==l)){if(i.isTopNChart){r.hide();}}else{if(s.indexOf("searchTable")>-1){r.setVisible(false);}else{if((s.indexOf("TimeLine_combo")>-1)&&i.showTimelineCombo){r.setVisible(false);
}else{r.hide();}}}});if(i.blockType!=null&&i.blockType!="textWidget"){var c=Ext.getCmp(i.id+"_header_hd");if(c!=""&&c!=null&&c!="undefined"){c.flex=0;c.setWidth(i.width-20);}}}if(Ext.getCmp("border_"+i.id)!=null&&Ext.getCmp("border_"+i.id)!=""&&Ext.getCmp("border_"+i.id)!="undefined"){if((Ext.getCmp("border_"+i.id).hidden==false)){Ext.getCmp("border_"+i.id).collapse();
$("#border_"+i.id+"-splitter").addClass("x-splitter-collapsed");Ext.getCmp("mybutton_"+i.id).setTooltip(legendPnlTootltip);Ext.getCmp("mybutton_"+i.id).pressed=false;$("#mybutton_"+i.id).removeClass("x-btn-pressed");if(i.blockType=="BarChart"){Ext.getCmp("ChartArea_"+i.id).addCls("HorzBar_panel");}}}});
}if(!a&&i.isConfigured){refreshIntervalTaskObj[i.id]=setInterval(function(){refreshPanel(i);},dashboardRefFreq);}if(i.isAllowedToChangeTitle){this.changeTitle(i);}}},resizeChart:function(f){var i=this;if(i!=null&&(i.isWidgetResizeInProgress||i.isInitialResizeCompleted==false||Ext.isEmpty(i.highChartObj))){i.isInitialResizeCompleted=true;
return;}switch(i.blockType){case"pieChart":if(i.highChartObj!=""&&i.highChartObj!=null){Ext.defer(function(){i.highChartObj.highchart.chart.height=f.getHeight()-7;i.highChartObj.highchart.chart.width=f.getWidth()-15;i.highChartObj.drawChart();},500);}break;case"activityChart":if(i.highChartObj!=""&&i.highChartObj!=null){Ext.defer(function(){i.highChartObj.height=f.getHeight()-7;
i.highChartObj.width=f.getWidth()-15;},500);}break;case"BarChart":if(i.highChartObj!=""&&i.highChartObj!=null){if(i.isTopNChart){if(i.chartType=="column"){barHeightVal=f.getHeight()-7;}else{barHeightVal=i.barHeight;if(f.getHeight()>barHeightVal){barHeightVal=f.getHeight();}}}else{if(i.chartType=="column"){barHeightVal=f.getHeight()-7;
}else{barHeightVal=i.barHeight-25;if(f.getHeight()>barHeightVal){barHeightVal=f.getHeight();}}}Ext.defer(function(){i.highChartObj.highchart.chart.height=barHeightVal;i.highChartObj.highchart.chart.width=f.getWidth()-15;i.highChartObj.drawChart();},500);}break;case"incidentssummary":if(i.highChartObj!=""&&i.highChartObj!=null){barHeightVal=f.getHeight()-7;
Ext.defer(function(){i.highChartObj.highchart.chart.height=barHeightVal;i.highChartObj.highchart.chart.width=f.getWidth()-15;i.highChartObj.drawChart();},500);}break;case"areaChart":if(i.highChartObj!=""&&i.highChartObj!=null){Ext.defer(function(){i.highChartObj.highchart.chart.width=Math.round(f.getWidth()-15);
i.highChartObj.drawChart();},500);}break;case"combinationChart":if(i.highChartObj!=""&&i.highChartObj!=null){Ext.defer(function(){i.highChartObj.highchart.chart.width=Math.round(f.getWidth()-15);i.highChartObj.drawChart();},500);}break;case"TimelineChart":if(i.highChartObj!=""&&i.highChartObj!=null){Ext.defer(function(){i.highChartObj.highchart.chart.width=Math.round(f.getWidth()-15);
i.highChartObj.drawChart();},500);}break;case"TrendGraph":if(i.highChartObj!=""&&i.highChartObj!=null){Ext.defer(function(){i.highChartObj.highchart.chart.width=Math.round(f.getWidth()-24);i.highChartObj.drawChart();},500);}break;case"CombinedTimelineChart":if(i.highChartObj!=""&&i.highChartObj!=null){Ext.defer(function(){i.highChartObj.highchart.chart.height=Math.round(f.getHeight()-7);
i.highChartObj.highchart.chart.width=Math.round(f.getWidth()-15);i.highChartObj.drawChart();},500);}break;case"servicehealth":if(i.highChartObj!=""&&i.highChartObj!=null){Ext.defer(function(){i.highChartObj.highchart.chart.height=f.getHeight()-7;i.highChartObj.highchart.chart.width=f.getWidth()-15;i.highChartObj.drawChart();
},500);}break;case"dialChart":if(i.highChartObj!=null){var h=i.highChartObj.highchart.chart;var g=h.renderTo;var a=jQuery(g).outerWidth();var j=jQuery(g).outerHeight();var b=f.getWidth();var d=f.getHeight();if(i.highChartObj.hasOwnProperty("full_guage")&&i.highChartObj.full_guage==true){Ext.defer(function(){i.highChartObj.highchart.chart.height=f.getHeight()-7;
i.highChartObj.highchart.chart.width=f.getWidth()-15;i.highChartObj.drawChart();},500);}else{if(h.container){h.width=b-20;h.height=d-20;}h.width=b-200;h.height=d-20;Ext.select("#"+i.id+" .timelineDiv").setHeight(d-10);Ext.select("#"+i.id+" .timelineDiv > div").setHeight(d-10);Ext.select("#"+i.id+" > .highcharts-container").setHeight(d-10);
Ext.select("#"+i.id+" .highcharts-container > svg").setHeight(d-10);var e=jQuery("#"+g).highcharts();Ext.defer(function(){e.setSize($("#"+i.id)[0].offsetWidth-20,$("#"+i.id)[0].offsetHeight-20,true);},500);}}break;case"TopNGaugeChart":if(i.highChartObj!=null){var h=i.highChartObj.highchart.chart;var g=h.renderTo;
var b=f.getWidth();var d=f.getHeight();var a=jQuery("#"+g).outerWidth();var j=jQuery("#"+g).outerHeight();if(i.highChartObj.hasOwnProperty("full_guage")&&i.highChartObj.full_guage==true){Ext.defer(function(){i.highChartObj.highchart.chart.height=f.getHeight()-7;i.highChartObj.highchart.chart.width=f.getWidth()-15;
i.highChartObj.drawChart();},500);}else{if(h.container){h.width=b-20;h.height=d-20;}var e=jQuery("#"+g).highcharts();Ext.defer(function(){e.setSize($("#"+i.id)[0].offsetWidth-20,$("#"+i.id)[0].offsetHeight-20,true);},500);}}break;}},setRefresh:function(a){if(!a.isConfigured){refreshIntervalTaskObj[a.id]=setInterval(function(){refreshPanel(a);
},dashboardRefFreq);}},onTextFieldChange:function(f,c,b,h){var i=this;var d=this.id;var a=Ext.getCmp(d+"_Grid");if(!Ext.isEmpty(a)){var e=a.store.pageSize;e=e-1;var j=a.store.pageMap.getRange(0,e);a.store.loadData(j);if(c=="*"){a.store.clearFilter();}else{if(c.lastIndexOf("*")==(c.length-1)){c=c.substr(0,(c.length-1));
}a.store.clearFilter();if(c){var g=new RegExp(Ext.String.escapeRegex(c),"i");a.store.filter({filterFn:function(k){var m=k.get("vmName").split("!*!");var l=g.test(m[1]);if(!l){l=g.test(k.get("CompName"));}return l;}});}f.focus();}}},destoryChart:function(){var f=this;try{if(this.isChart){var h="ChartArea_"+f.id;
var e=$("#"+h).find("div.highcharts-container");if(!Ext.isEmpty(e)){var a=$(e).parent().attr("id");var d=$("#"+a).highcharts();if(d){$("#"+a).highcharts().destroy();}else{$(a).unbind();}$("#"+h>"svg").unbind();a=null;d=null;delete a;delete d;}Ext.getCmp(h).removeAll();for(var j in Ext.getCmp(h)){if(!Ext.getCmp(h)[j]){delete Ext.getCmp(h)[j];
}}}else{var e=$("#"+f.id).find("div.highcharts-container");var g=Ext.getCmp(f.id);if(g.items.length!=0){if(g.down("grid")){Ext.destroy(g.down("grid").store);}for(var c=0;c<g.items.length;c++){Ext.destroy(g.items[c]);}}if(!Ext.isEmpty(e)){a=$(e).parent().attr("id");d=$("#"+a).highcharts();if(d){$("#"+a).highcharts().destroy();
}else{$(a).unbind();}$("#"+f.id>"svg").unbind();a=null;d=null;delete a;delete d;}g.removeAll();for(var j in Ext.getCmp(f.id)){if(!Ext.getCmp(f.id)[j]){delete Ext.getCmp(f.id)[j];}}}}catch(b){console.log("error "+b);}},onTextFieldChangeForTable:function(h,g,b,c){var d=this;isChanged=true;var e=this.id;
var a=Ext.getCmp(e+"_Grid");if(!Ext.isEmpty(a)){if(g=="*"){a.store.clearFilter();}else{if(g.lastIndexOf("*")==(g.length-1)){g=g.substr(0,(g.length-1));}a.store.clearFilter(true);if(g){var f=new RegExp(Ext.String.escapeRegex(g),"i");a.store.filter({filterFn:function(i){var k=i.get("COLUMN_0").substring(i.get("COLUMN_0").lastIndexOf("$")+1,i.get("COLUMN_0").size);
var j=f.test(k);if(!j){a.getView().emptyText='<table width="100%" height="100%" style="margin:0% auto"><tr><td align="center" valign="middle"><div class="iconInformation"></div><div styel="margin:10px auto">'+""+screenLabelsObj["No data found for"]+'"'+g+'"</div></td></tr></table>';}return j;}});}else{a.getView().emptyText='<table width="100%" height="100%" style="margin:0% auto"><tr><td align="center" valign="middle"><div class="iconInformation"></div><div styel="margin:10px auto">'+noMeasuresFoundMsg;
}a.getView().refresh();h.focus();}}},hideLoadingMask:function(){if(this.showLoadingMsg){this.disablePanelToolBar(false);this.showLoadingMsg=false;this.setLoading(false);}},onTextFieldChangeForAlert:function(h,g,a,c){var d=this;var e=this.id;var b=Ext.getCmp("CurrentAlarms_Grid");if(!Ext.isEmpty(b)){if(g=="*"){b.store.clearFilter();
}else{if(g.lastIndexOf("*")==(g.length-1)){g=g.substr(0,(g.length-1));}b.store.clearFilter();if(g){var f=new RegExp(Ext.String.escapeRegex(g),"i");b.store.filter({filterFn:function(i){var l="";var m=i.get("COMP_NAME");if(m!=""&&m!=null&&m!="undefined"){var n=i.get("ALERT_DESC");l=m+n;}else{var k=i.get("CompName").split("!*!");
l=k[1];}var j=f.test(l);if(!j){b.getView().emptyText='<table width="100%" height="100%" style="margin:0% auto"><tr><td align="center" valign="middle"><div class="iconInformation"></div><div styel="margin:10px auto">'+""+screenLabelsObj["No data found for"]+'"'+g+'"</div></td></tr></table>';}return j;
}});}h.focus();}}},onTextFieldChangeForNWHealth:function(e,c,b,h){var i=this;var d=this.id;var a=Ext.getCmp("nwHealthOnlineDataStr");console.log("grid",a);if(!Ext.isEmpty(a)){if(c=="*"){a.store.clearFilter();}else{console.log("grid",a);if(c.lastIndexOf("*")==(c.length-1)){c=c.substr(0,(c.length-1));}a.store.clearFilter();
if(c){var f=new RegExp(Ext.String.escapeRegex(c),"i");a.store.filter({filterFn:function(j){var l="";var m=j.get("hostserver");if(m!=""&&m!=null&&m!="undefined"){var n=j.get("state");l=m+n;}console.log("record",j);var k=f.test(l);if(!k){a.emptyText='<table width="100%" height="100%" style="margin:0% auto"><tr><td align="center" valign="middle"><div class="iconInformation"></div><div styel="margin:10px auto">'+""+screenLabelsObj["No data found for"]+'"'+c+'"</div></td></tr></table>';
a.refresh();}return k;}});}}}var g=Ext.getCmp("nwHealthOfflineDataStr");if(!Ext.isEmpty(g)){if(c=="*"){g.store.clearFilter();}else{if(c.lastIndexOf("*")==(c.length-1)){c=c.substr(0,(c.length-1));}g.store.clearFilter();if(c){var f=new RegExp(Ext.String.escapeRegex(c),"i");g.store.filter({filterFn:function(j){var l="";
console.log("record",j);var m=j.get("hostserver");if(m!=""&&m!=null&&m!="undefined"){var n=j.get("state");l=m+n;}var k=f.test(l);if(!k){g.emptyText='<table width="100%" height="100%" style="margin:0% auto"><tr><td align="center" valign="middle"><div class="iconInformation"></div><div styel="margin:10px auto">'+""+screenLabelsObj["No data found for"]+'"'+c+'"</div></td></tr></table>';
g.refresh();}return k;}});}e.focus();}}},disablePanelToolBar:function(a){this.tools.forEach(function(b,c){var e=b.id;var d=Ext.getCmp(e);if(a){d.setDisabled(true);}else{d.setDisabled(false);}});},onTextFieldChangeForDDWidget:function(g,d,b,i){var j=this;var f=this.id;var a=Ext.getCmp(f+"_Grid");if(!Ext.isEmpty(a)){if(d=="*"){a.store.clearFilter();
}else{if(d.lastIndexOf("*")==(d.length-1)){d=d.substr(0,(d.length-1));}a.store.clearFilter();console.log("grid",a);if(d){var c=a.gridColCnt;var h=new RegExp(Ext.String.escapeRegex(d),"i");a.store.filter({filterFn:function(m){var n="";console.log("record ",m);var k=false;for(var l=0;l<c;l++){var o=m.get("COLUMN_"+l);
if(h.test(o)){console.log(o);k=true;break;}}return k;}});}var e=Ext.getCmp(f+"_pagbar");if(e!=null){e.doRefresh();}}}}});