Ext.define("OperationUptime.controller.Main",{extend:"Ext.app.Controller",views:["Main"],refs:[{selector:"main",ref:"main"},{selector:"ReporterSettings",ref:"ReporterSettings"},{selector:"newUtilities",ref:"newUtilities"},{selector:"reportgeneration",ref:"reportgeneration"},{selector:"operationuptimemainform",ref:"operationuptimemainform"},{selector:"operationuptimesettings",ref:"operationuptimesettings"},{selector:"selectiondetails",ref:"selectiondetails"},{selector:"operationuptimesubmitteddata",ref:"operationuptimesubmitteddata"},{selector:"operationUptimeSubmittedDataForOverview",ref:"operationUptimeSubmittedDataForOverview"},{selector:"mainform",ref:"mainform"},{selector:"nomeasurepanel",ref:"nomeasurepanel"},{selector:"backGroundPanel",ref:"backGroundPanel"}],init:function(){this.control({"newUtilities":{"afterrender":this.loadTools},"main":{"boxready":this.defaultLoad},"operationuptimesettings":{"afterrender":this.fillSettingsElements},"operationuptimemainform":{"afterrender":this.loadMainElements},"newUtilities > #saveTool > button":{"click":this.saveFile},"newUtilities > #mailTool > button":{"click":this.sendMail},"newUtilities > #printTool > button":{"click":this.print},'operationuptimemainform combo[name="uptimeReport"]':{"select":this.selectReportTypeCombos},'operationuptimemainform combo[name="analyzeBy"]':{"select":this.selectReportTypeCombos},'operationuptimemainform combo[name="compType"]':{"select":this.selectComponents},'operationuptimemainform combo[name="zone"]':{"select":this.selectZoneComponents},'operationuptimemainform combo[name="segment"]':{"select":this.selectSegmentComponents},'operationuptimemainform combo[name="service"]':{"select":this.selectServiceComponents},'egcomponent button[id="expandSelector"]':{"click":this.expandMe},'operationuptimemainform combo[name="subzone"]':{"select":this.includeOrExcludeSubzone},'reportgeneration combo[name="reportGeneration"]':{"select":this.showBackgroundReport},'operationuptimesettings button[id="moreOptionCloseId"]':{"click":this.validateSettings},'operationuptimesettings button[id="submitViaSetting"]':{"click":this.closeSettingAndSubmit},'operationuptimesettings combo[name="chartOptionsCombo"]':{"select":this.showUptimeChartOptions},'mainform button[id="submit"]':{"click":this.beforeFormSubmit},'mainform button[name="save"]':{"click":this.addTo},'mainform combo[id="report_Type"]':{"select":this.showDetailsRadio},"newUtilities > #favoriteTool > button":{"click":this.addTo},"newUtilities > #scheduleTool > button":{"click":this.addTo},"print":{"boxready":this.printPageRender},"newUtilities > #csvTool > button":{"click":this.saveDataInCSVFormat},'timeline combo[name="er_mode"]':{"select":this.changeEr_mode},'mainform button[id="panelinsidetoggle"]':{"click":this.toggleForm},'egcomponent trigger[id="filterOpt"]':{"change":this.filterMultiselect}});
},loadRepData:function(){var a=Ext.getCmp("uptimeReport");var b=Ext.getCmp("report_Type");if(a!=undefined){if(a.getValue()=="Services"){a.hide();}else{a.show();}}if(b!=undefined&&a!=undefined){if(b.getValue()=="data"&&a.getValue()=="Systems"){Ext.getCmp("runningDurationFilter").show();}else{Ext.getCmp("runningDurationFilter").hide();
}}var c=appConstants.publicJsonData["rm_titleDisplay"];if(c!=null&&c!="undefined"){this.getMain().setTitle(c);appConstants.er_RmDispName=c;}if(appConstants.isSubmit!=null&&appConstants.isSubmit=="true"){this.updateQueryString("submit");var d=Ext.getCmp("uptimeReport").getValue();if(d=="Services"){this.loadUptimeForServiceReportData(appConstants.publicJsonData);
}else{this.loadReportData(appConstants.publicJsonData);}appConstants.isSubmit="false";}else{if(appConstants.isForceSubmit=="true"){appConstants.isForceSubmit="false";this.beforeFormSubmit();}}},changeEr_mode:function(d){var a=appConstants.publicJsonData.hiddenParams["favorite_id"];var c=appConstants.publicJsonData.hiddenParams["fromScheduleModify"];
if(!(a=="undefined"||a==undefined)||!(c==null||c=="null")){return;}if(Ext.get("configMod")!=null){Ext.get("configMod").animate({duration:250,to:{y:-530}});}var b=appConstants.publicJsonData.hiddenParams["fromSchedule"];if(!(b!=null&&b=="Yes")){this.beforeFormSubmit();}},expandMe:function(a){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");
}appConstants.erUtils.expandMultiComboButton(Ext.getCmp("components"),Ext.getCmp("systemLabel").text,a);},filterMultiselect:function(a){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}a.toggleTriggger();appConstants.erUtils.filterComboStore(a,Ext.getCmp("components"),appConstants.publicJsonData["compFilterJSON"]);
},validateSettings:function(){var b=Ext.getCmp("timefrom").getValue();var p=Ext.getCmp("minfrom").getValue();var k=Ext.getCmp("timeto").getValue();var d=Ext.getCmp("minto").getValue();var m=Ext.getCmp("er_stdate").getValue();var a=Ext.getCmp("er_enddate").getValue();m.setHours(Ext.getCmp("er_sthr").getValue());
a.setHours(Ext.getCmp("er_endhr").getValue());if(!checkTimePeriod(b,p,k,d)){return false;}var h=Ext.getCmp("er_timeline").getValue();if(Ext.isEmpty(h)){h="1 day";}if(h!=null&&h=="Any"){if(!checkDateTime(m,a)){return false;}}var e=Ext.getCmp("reportGeneration").getValue();var o=appConstants.publicJsonData.hiddenParams["getMaxDaysInMonth"];
var c="";if(!Ext.isEmpty(o)){c=o;}var f="";var i=appConstants.publicJsonData.hiddenParams["er_usertimeline"];if(!Ext.isEmpty(i)){f=i;}if(f!=null&&f!="-1"){if(!isUserTimelineLimitExceeded(f,c,m,a)){return false;}}var j=true;if(e!=null&&(e=="background"||e=="background-csv")){var g=Ext.getCmp("bgReportName");
var n=g.getValue();if(!validateTextBoxWithSpecialChars(n,"Attachment",true)){g.focus();return false;}}if(j){var l=Ext.getCmp("submit");l.setDisabled(false);Ext.get("configMod").animate({duration:500,to:{y:-500}});}return true;},toggleForm:function(b){Ext.getCmp("panelinsidetoggle").show();var a=Ext.getCmp("mainform");
if(a.isHidden()){a.show();Ext.getCmp("selectionDetails").hide();}else{a.hide();Ext.getCmp("selectionDetails").show();}},beforeFormSubmit:function(){var i=Ext.getCmp("er_stdate").getValue();var a=Ext.getCmp("er_enddate").getValue();i.setHours(Ext.getCmp("er_sthr").getValue());a.setHours(Ext.getCmp("er_endhr").getValue());
var f=Ext.getCmp("er_timeline").getValue();if(Ext.isEmpty(f)){f="1 day";}if(f!=null&&f=="Any"){if(!checkDateTime(i,a)){return;}}var d=this.validateForm();if(d){var g=appConstants.publicJsonData.hiddenParams["fromSchedule"];if(g!=null&&g=="Yes"){this.addTo(Ext.getCmp("scheduleImg"),null,"save");}else{var c=appConstants.publicJsonData.pageParams.er_reportgenration;
if(isSettingsEnabled){c=Ext.getCmp("reportGeneration").getValue();}var e=appConstants.publicJsonData.hiddenParams["limitforbg"];var j=appConstants.publicJsonData.hiddenParams["getMaxDaysInMonth"];var b="0";var h=Ext.getCmp("submit");if(!Ext.isEmpty(j)){b=j;}if(!Ext.isEmpty(e)){var k=e;if(!checkTimeLineForBgLimit(k,b,i,a)){Ext.MessageBox.confirm("Confirm",appConstants.forGrdReportConfirmMsg,this.showResult,this);
}else{this.formSubmit(h);}}else{this.formSubmit(h);}}}},showResult:function(c){if(c=="yes"){var a=Ext.getCmp("submit");a.setDisabled(false);if(isSettingsEnabled){Ext.get("configMod").animate({duration:500,to:{y:-500}});}this.formSubmit(a);}else{this.getReporterSettings().down("button").fireHandler();
Ext.getCmp("reportGeneration").setValue("background");var b=Ext.getCmp("bgReportName");b.show();b.focus(false,1000);b.setValue("");validateTextBoxWithSpecialChars(b.getValue(),"Attachment",true);Ext.getCmp("submitViaSetting").show();Ext.getCmp("moreOptionCloseId").hide();return false;}},loadpageTitle:function(){this.getMain().setTitle("OPERATION REPORTS - UPTIME");
if(appConstants.isSubmit!=null&&appConstants.isSubmit=="true"){this.beforeFormSubmit();fromPageRefresh="false";}var a=this;},sendMail:function(){var a=Ext.widget("sendmail");a.show();},saveFile:function(){var j=Ext.getCmp("analyzeBy").getValue();var n=Ext.getCmp("uptimeReport").getValue();var d=Ext.getCmp("compType").getValue();
var m=Ext.getCmp("er_timeline").getValue();if(Ext.isEmpty(m)){m="1 day";}var s=Ext.getCmp("er_sthr").dataArray;var a=Ext.getCmp("er_endhr").dataArray;var r=appConstants.publicJsonData.pageParams.selectHrsFrom;var b=appConstants.publicJsonData.pageParams.selectMinsFrom;var k=appConstants.publicJsonData.pageParams.selectHrsTo;
var c=appConstants.publicJsonData.pageParams.er_show;var i=appConstants.publicJsonData.pageParams.selectMinsTo;var q=appConstants.publicJsonData.pageParams.showDetails;if(isSettingsEnabled){q=Ext.getCmp("showdetailsCombo").getValue();r=Ext.getCmp("timefrom").getValue();b=Ext.getCmp("minfrom").getValue();
k=Ext.getCmp("timeto").getValue();i=Ext.getCmp("minto").getValue();c=Ext.getCmp("chartOptionsCombo").getValue();c=c.replace(new RegExp("%","g"),"|pct|");}var t=Ext.getCmp("er_stdate").dataArray;var l=Ext.getCmp("er_enddate").dataArray;var u=Ext.getCmp("report_Type").getValue();var e="No";if(u!=null&&u.toLowerCase()=="graph"){e="Yes";
}if(u!=null&&u.toLowerCase()=="overview"){e="overview";}var g="../reporter/ErHtmlToSavePdf.jsp?er_comptype="+d+"&er_datafrom="+j+"&er_type="+e+"&er_uptimetest="+n+"&er_show_details="+q+"&startdate="+t+"&enddate="+l+"&timefrom="+r+"&minfrom="+b+"&timeto="+k+"&minto="+i+"&starthr="+s+"&endhr="+a+"&er_timeline="+m+"&startmin="+mgr_stmin+"&endmin="+mgr_enmin+"&inidate="+appConstants.iniDate+"&pgTittle=OPERATION&er_show="+appConstants.erUtils.specialCharEncode(c);
if(j=="Zone"){var f=Ext.getCmp("zone").getValue();g=g+"&er_site="+encodeURIComponent(f);}else{if(j=="Segment"){var p=Ext.getCmp("segment").getValue();g=g+"&er_site="+encodeURIComponent(p);}else{if(j=="Service"){var h=Ext.getCmp("service").getValue();g=g+"&er_site="+encodeURIComponent(h);}}}var o=Ext.widget("erutils");
o.savePDF(g);},bookletQuery:function(k){var i=Ext.getCmp("analyzeBy").getValue();var n=Ext.getCmp("uptimeReport").getValue();var c=Ext.getCmp("compType").getValue();var m=Ext.getCmp("er_timeline").getValue();if(Ext.isEmpty(m)){m="1 day";}var r=Ext.getCmp("er_sthr").dataArray;var a=Ext.getCmp("er_endhr").dataArray;
var q=appConstants.publicJsonData.pageParams.selectHrsFrom;var b=appConstants.publicJsonData.pageParams.selectMinsFrom;var j=appConstants.publicJsonData.pageParams.selectHrsTo;var h=appConstants.publicJsonData.pageParams.selectMinsTo;var p=appConstants.publicJsonData.pageParams.showDetails;if(isSettingsEnabled){p=Ext.getCmp("showdetailsCombo").getValue();
q=Ext.getCmp("timefrom").getValue();b=Ext.getCmp("minfrom").getValue();j=Ext.getCmp("timeto").getValue();h=Ext.getCmp("minto").getValue();}var s=Ext.getCmp("er_stdate").dataArray;var l=Ext.getCmp("er_enddate").dataArray;var t=Ext.getCmp("report_Type").getValue();var d="No";if(t!=null&&t.toLowerCase()=="graph"){d="Yes";
}if(t!=null&&t.toLowerCase()=="overview"){d="overview";}var f="er_comptype="+c+"&er_datafrom="+i+"&er_type="+d+"&er_uptimetest="+n+"&er_show_details="+p+"&startdate="+s+"&enddate="+l+"&timefrom="+q+"&minfrom="+b+"&timeto="+j+"&minto="+h+"&starthr="+r+"&endhr="+a+"&er_timeline="+m+"&startmin="+mgr_stmin+"&endmin="+mgr_enmin+"&inidate="+appConstants.iniDate+"&pgTittle=OPERATION";
var u=Ext.getCmp("components").getValue();if(i=="Zone"){var e=Ext.getCmp("zone").getValue();f=f+"&er_site="+encodeURIComponent(e);}else{if(i=="Segment"){var o=Ext.getCmp("segment").getValue();f=f+"&er_site="+encodeURIComponent(o);}else{if(i=="Service"){var g=Ext.getCmp("service").getValue();f=f+"&er_site="+encodeURIComponent(g);
}}}return f;},bookletScheduleQuery:function(r){var m="";var o=Ext.getCmp("analyzeBy").getValue();var v=Ext.getCmp("uptimeReport").getValue();var f=Ext.getCmp("compType").getValue();var u=Ext.getCmp("er_timeline").getValue();if(Ext.isEmpty(u)){u="1 day";}var D=appConstants.publicJsonData.pageParams.selectHrsFrom;
var b=appConstants.publicJsonData.pageParams.selectMinsFrom;var p=appConstants.publicJsonData.pageParams.selectHrsTo;var n=appConstants.publicJsonData.pageParams.selectMinsTo;var w=appConstants.publicJsonData.pageParams.priority;var C=appConstants.publicJsonData.pageParams.er_reportgenration;var z=appConstants.publicJsonData.pageParams.sortby;
var j=appConstants.publicJsonData.pageParams.includeMaintenancePeriod;var d=appConstants.publicJsonData.pageParams.er_show;var A=appConstants.publicJsonData.pageParams.excludeweekend;var y=appConstants.publicJsonData.pageParams.showDetails;if(isSettingsEnabled){y=Ext.getCmp("showdetailsCombo").getValue();
A=Ext.getCmp("excludeWeekendsCombo").getValue();w=Ext.getCmp("showByPriority").getValue();C=Ext.getCmp("reportGeneration").getValue();j=Ext.getCmp("includeMaintenanceCombo").getValue();d=Ext.getCmp("chartOptionsCombo").getValue();z=Ext.getCmp("sortByCombo").getValue();D=Ext.getCmp("timefrom").getValue();
b=Ext.getCmp("minfrom").getValue();p=Ext.getCmp("timeto").getValue();n=Ext.getCmp("minto").getValue();}d=d.replace(new RegExp("%","g"),"|pct|");var F=Ext.getCmp("er_stdate").dataArray;var t=Ext.getCmp("er_enddate").dataArray;var s=Ext.getCmp("er_sthr").dataArray;var c=Ext.getCmp("er_endhr").dataArray;
var G=new Array();G=Ext.getCmp("components").getValue();var E=Ext.getCmp("report_Type").getValue();m+="&er_uptimetest="+encodeURIComponent(v)+"&er_datafrom="+encodeURIComponent(o)+"&er_comptype="+encodeURIComponent(f)+"&er_timeline="+encodeURIComponent(u)+"&er_option="+encodeURIComponent(o);var e="No";
if(E!=null&&E.toLowerCase()=="graph"){e="Yes";var k=Ext.getCmp("er_mode").getValue();m+="&er_mode="+k;}if(E!=null&&E.toLowerCase()=="overview"){e="overview";}if(o=="Zone"){var h=Ext.getCmp("zone").getValue();m+="&er_site="+encodeURIComponent(h);}else{if(o=="Segment"){var x=Ext.getCmp("segment").getValue();
m+="&er_site="+encodeURIComponent(x);}else{if(o=="Service"){var l=Ext.getCmp("service").getValue();m+="&er_site="+encodeURIComponent(l);}}}var g="";var q="";if(G!=null&&(G!=""&&G!="null")){for(var B=0;B<G.length;B++){g+="&er_component="+encodeURIComponent(G[B]);q+=G[B]+"##";}}m+="&er_type="+encodeURIComponent(e)+"&er_show_details="+encodeURIComponent(y)+"&startdate="+encodeURIComponent(F)+"&enddate="+encodeURIComponent(t)+"&starthr="+encodeURIComponent(s)+"&endhr="+encodeURIComponent(c)+"&er_maintenance="+encodeURIComponent(j)+"&er_show="+encodeURIComponent(d)+"&timeto="+encodeURIComponent(p)+"&minto="+encodeURIComponent(n)+"&er_excwe="+encodeURIComponent(A)+"&er_priority="+encodeURIComponent(w)+"&timefrom="+encodeURIComponent(D)+"&minfrom="+encodeURIComponent(b)+"&er_reportgenration="+encodeURIComponent(C)+"&er_sortby="+z+"&er_combination="+encodeURIComponent(q)+g;
var a=this.getHiddenFieldValues(true);if(a!=null&&(a!="null"&&a!="undefined")){m+=a;}m+="&forwardto=ErUptimeReportData";return m;},bookletPreview:function(){this.print();},saveDataInCSVFormat:function(){var c=Ext.getCmp("uptimeReport").getValue()?"Yes":"No";var a="../servlet/egurkha.reporter.SaveInCSVFormat?reporttype=uptime";
var b=Ext.widget("erutils");b.savePDF(a);},loadTools:function(){this.getNewUtilities().loadIcon(true,true,true,false,true,true,true,false,false,false,true);Ext.getCmp("favoriteTool").setDisabled(false);Ext.getCmp("scheduleTool").setDisabled(false);},hideTools:function(){Ext.getCmp("printTool").setDisabled(true);
Ext.getCmp("mailTool").setDisabled(true);Ext.getCmp("csvTool").setDisabled(true);Ext.getCmp("upbutton").setDisabled(true);Ext.getCmp("bookletTool").setDisabled(true);Ext.getCmp("saveTool").setDisabled(true);},enableTools:function(){Ext.getCmp("printTool").setDisabled(false);Ext.getCmp("mailTool").setDisabled(false);
Ext.getCmp("upbutton").setDisabled(false);Ext.getCmp("bookletTool").setDisabled(false);Ext.getCmp("saveTool").setDisabled(false);Ext.getCmp("csvTool").setDisabled(true);},printPageRender:function(){var i=Ext.getCmp("analyzeBy").getValue();var m=Ext.getCmp("uptimeReport").getValue();var c=Ext.getCmp("compType").getValue();
var l=Ext.getCmp("er_timeline").getValue();if(Ext.isEmpty(l)){l="1 day";}var q=Ext.getCmp("er_sthr").dataArray;var a=Ext.getCmp("er_endhr").dataArray;var p=appConstants.publicJsonData.pageParams.selectHrsFrom;var b=appConstants.publicJsonData.pageParams.selectMinsFrom;var j=appConstants.publicJsonData.pageParams.selectHrsTo;
var h=appConstants.publicJsonData.pageParams.selectMinsTo;var o=appConstants.publicJsonData.pageParams.showDetails;if(isSettingsEnabled){o=Ext.getCmp("showdetailsCombo").getValue();p=Ext.getCmp("timefrom").getValue();b=Ext.getCmp("minfrom").getValue();j=Ext.getCmp("timeto").getValue();h=Ext.getCmp("minto").getValue();
}var r=Ext.getCmp("er_stdate").dataArray;var k=Ext.getCmp("er_enddate").dataArray;var s=Ext.getCmp("report_Type").getValue();var d="No";if(s!=null&&s.toLowerCase()=="graph"){d="Yes";}var f="/final/reporter/ErUptimePrintData.jsp?er_comptype="+c+"&er_datafrom="+i+"&er_type="+d+"&er_uptimetest="+m+"&er_show_details="+o+"&startdate="+r+"&enddate="+k+"&timefrom="+p+"&minfrom="+b+"&timeto="+j+"&minto="+h+"&starthr="+q+"&endhr="+a+"&er_timeline="+l+"&startmin="+mgr_stmin+"&endmin="+mgr_enmin+"&inidate="+appConstants.iniDate+"&pdfPrint=yes&pgTittle=OPERATION";
if(i=="Zone"){var e=Ext.getCmp("zone").getValue();f=f+"&er_site="+encodeURIComponent(e);}else{if(i=="Segment"){var n=Ext.getCmp("segment").getValue();f=f+"&er_site="+encodeURIComponent(n);}else{if(i=="Service"){var g=Ext.getCmp("service").getValue();f=f+"&er_site="+encodeURIComponent(g);}}}},print:function(){var j=Ext.getCmp("analyzeBy").getValue();
var n=Ext.getCmp("uptimeReport").getValue();var d=Ext.getCmp("compType").getValue();var m=Ext.getCmp("er_timeline").getValue();if(Ext.isEmpty(m)){m="1 day";}if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}var r=Ext.getCmp("er_sthr").dataArray;var a=Ext.getCmp("er_endhr").dataArray;
var q=appConstants.publicJsonData.pageParams.selectHrsFrom;var b=appConstants.publicJsonData.pageParams.selectMinsFrom;var k=appConstants.publicJsonData.pageParams.selectHrsTo;var i=appConstants.publicJsonData.pageParams.selectMinsTo;var p=appConstants.publicJsonData.pageParams.showDetails;if(isSettingsEnabled){p=Ext.getCmp("showdetailsCombo").getValue();
q=Ext.getCmp("timefrom").getValue();b=Ext.getCmp("minfrom").getValue();k=Ext.getCmp("timeto").getValue();i=Ext.getCmp("minto").getValue();}var s=Ext.getCmp("er_stdate").dataArray;var l=Ext.getCmp("er_enddate").dataArray;var t=Ext.getCmp("report_Type").getValue();var e="No";if(t!=null&&t.toLowerCase()=="graph"){e="Yes";
}if(t!=null&&t.toLowerCase()=="overview"){e="overview";}var g="";if(n=="Services"){g="/final/reporter/ErServiceUptimePrintData.jsp?er_comptype="+d+"&er_datafrom="+j+"&er_type="+e+"&er_uptimetest="+n+"&er_show_details="+p+"&startdate="+s+"&enddate="+l+"&timefrom="+q+"&minfrom="+b+"&timeto="+k+"&minto="+i+"&starthr="+r+"&endhr="+a+"&er_timeline="+m+"&startmin="+mgr_stmin+"&endmin="+mgr_enmin+"&inidate="+appConstants.iniDate+"&pdfPrint=yes&pgTittle=OPERATION";
}else{g="/final/reporter/ErUptimePrintData.jsp?er_comptype="+d+"&er_datafrom="+j+"&er_type="+e+"&er_uptimetest="+n+"&er_show_details="+p+"&startdate="+s+"&enddate="+l+"&timefrom="+q+"&minfrom="+b+"&timeto="+k+"&minto="+i+"&starthr="+r+"&endhr="+a+"&er_timeline="+m+"&startmin="+mgr_stmin+"&endmin="+mgr_enmin+"&inidate="+appConstants.iniDate+"&pdfPrint=yes&pgTittle=OPERATION";
}var c=appConstants.publicJsonData.pageParams.er_show;if(isSettingsEnabled){c=Ext.getCmp("chartOptionsCombo").getValue();c=c.replace(new RegExp("%","g"),"|pct|");}g+="&er_show="+appConstants.erUtils.specialCharEncode(c);if(j=="Zone"){var f=Ext.getCmp("zone").getValue();g=g+"&er_site="+encodeURIComponent(f);
}else{if(j=="Segment"){var o=Ext.getCmp("segment").getValue();g=g+"&er_site="+encodeURIComponent(o);}else{if(j=="Service"){var h=Ext.getCmp("service").getValue();g=g+"&er_site="+encodeURIComponent(h);}}}parent.printWindowFn(g);},includeOrExcludeSubzone:function(){var b=Ext.getCmp("zone").getValue();if(b!="-1"){var c=Ext.getCmp("components");
this.selectZoneComponents();}else{var a=Ext.getCmp("compType");var c=Ext.getCmp("components");this.insertNotApplicable(appConstants.getNotApplicationData,a);this.insertNotApplicable(appConstants.getNotApplicationData,c);}},addTo:function(B,S,w){var s=B.getId();var d=w;var L=Ext.getCmp("analyzeBy").getValue();
var R=Ext.getCmp("uptimeReport").getValue();var l=Ext.getCmp("compType").getValue();var p=Ext.getCmp("er_timeline").getValue();if(Ext.isEmpty(p)){p="1 day";}var r=appConstants.publicJsonData.pageParams.selectHrsFrom;var F=appConstants.publicJsonData.pageParams.selectMinsFrom;var K=appConstants.publicJsonData.pageParams.selectHrsTo;
var M=appConstants.publicJsonData.pageParams.selectMinsTo;var D=appConstants.publicJsonData.pageParams.priority;var o=appConstants.publicJsonData.pageParams.er_reportgenration;var t=appConstants.publicJsonData.pageParams.sortby;var N=appConstants.publicJsonData.pageParams.includeMaintenancePeriod;var z=appConstants.publicJsonData.pageParams.er_show;
var J=appConstants.publicJsonData.pageParams.excludeweekend;var Q=appConstants.publicJsonData.pageParams.showDetails;if(isSettingsEnabled){Q=Ext.getCmp("showdetailsCombo").getValue();J=Ext.getCmp("excludeWeekendsCombo").getValue();D=Ext.getCmp("showByPriority").getValue();o=Ext.getCmp("reportGeneration").getValue();
N=Ext.getCmp("includeMaintenanceCombo").getValue();z=Ext.getCmp("chartOptionsCombo").getValue();t=Ext.getCmp("sortByCombo").getValue();r=Ext.getCmp("timefrom").getValue();F=Ext.getCmp("minfrom").getValue();K=Ext.getCmp("timeto").getValue();M=Ext.getCmp("minto").getValue();}z=z.replace(new RegExp("%","g"),"|pct|");
var n=Ext.getCmp("er_stdate").dataArray;var y=Ext.getCmp("er_enddate").dataArray;var H=Ext.getCmp("er_sthr").dataArray;var T=Ext.getCmp("er_endhr").dataArray;var I=new Array();I=Ext.getCmp("components").getValue();var h=Ext.getCmp("report_Type").getValue();var b="&er_uptimetest="+encodeURIComponent(R)+"&er_datafrom="+encodeURIComponent(L)+"&er_comptype="+encodeURIComponent(l)+"&er_timeline="+encodeURIComponent(p)+"&er_option="+encodeURIComponent(L);
var f="No";if(h!=null&&h.toLowerCase()=="graph"){f="Yes";var q=Ext.getCmp("er_mode").getValue();b=b+"&er_mode="+q;}if(h!=null&&h.toLowerCase()=="overview"){f="overview";}if(L=="Zone"){var g=Ext.getCmp("zone").getValue();b=b+"&er_site="+encodeURIComponent(g);}else{if(L=="Segment"){var c=Ext.getCmp("segment").getValue();
b=b+"&er_site="+encodeURIComponent(c);}else{if(L=="Service"){var O=Ext.getCmp("service").getValue();b=b+"&er_site="+encodeURIComponent(O);}}}var A=Ext.getCmp("runningDurationFilter");if(A.isVisible()){b+="&runningDurationVal="+Ext.getCmp("runningDuration").getValue();b+="&runningDurationFun="+Ext.getCmp("runningDurationFun").getValue();
b+="&runningDurationUnit="+Ext.getCmp("runningDurationUnit").getValue();}var k="";var G="";if(I!=null&&(I!=""&&I!="null")){for(var P=0;P<I.length;P++){k+="&er_component="+encodeURIComponent(I[P]);G+=I[P]+"##";}}b=b+"&er_type="+encodeURIComponent(f)+"&er_show_details="+encodeURIComponent(Q)+"&startdate="+encodeURIComponent(n)+"&enddate="+encodeURIComponent(y)+"&starthr="+encodeURIComponent(H)+"&endhr="+encodeURIComponent(T)+"&er_maintenance="+encodeURIComponent(N)+"&er_show="+encodeURIComponent(z)+"&timeto="+encodeURIComponent(K)+"&minto="+encodeURIComponent(M)+"&er_excwe="+encodeURIComponent(J)+"&er_priority="+encodeURIComponent(D)+"&timefrom="+encodeURIComponent(r)+"&minfrom="+encodeURIComponent(F)+"&er_reportgenration="+encodeURIComponent(o)+"&er_sortby="+t+"&er_combination="+encodeURIComponent(G)+k;
var m=this.getHiddenFieldValues(true);if(m!=null&&(m!="null"&&m!="undefined")){b=m+b;}if(o=="background"){b=b+"&forwardto=ErUptimeReportDataJson";}else{b=b+"&forwardto=ErUptimeReportData";}var a="";var j;var E;if((s!=null&&s=="scheduleImg")||(appConstants.fromScheduleModify!=null&&appConstants.fromScheduleModify=="Yes")){a="/final/reporter/ErSaveSchedule.jsp?"+b+"&com.eg.CSRF_NONCE="+csrfToken;
if(s=="save"){a+="&showSchWindow=no";var x=a.substr(0,a.indexOf("?"));var C=a.substr(a.indexOf("?")+1,a.length-1);var v=Ext.create("Ext.form.Panel");v.submit({url:x,params:C,standardSubmit:true,method:"POST"});}else{parent.scheduleWindowFn(a);}}else{var u=appConstants.publicJsonData.hiddenParams["favorite_id"];
a="../servlet/com.eg.ErFavoriteC?er_view=GRAPH&cmd=client&"+b+"&er_RmDispName="+appConstants.er_RmDispName+"&com.eg.CSRF_NONCE="+csrfToken;if(s=="save"){a+="&showSchWindow=no"+"&FavoriteId="+u+"&fromFavoriteModify="+appConstants.fromFavoriteModify;var x=a.substr(0,a.indexOf("?"));var C=a.substr(a.indexOf("?")+1,a.length-1);
var v=Ext.create("Ext.form.Panel");v.submit({url:x,params:C,standardSubmit:true,method:"POST"});}else{parent.favouriteWindowFn(a);}}},validateForm:function(){var a=Ext.getCmp("analyzeBy").getValue();var g=new Array();g=Ext.getCmp("components").getValue();if(a=="Zone"){var h=Ext.getCmp("zone").getValue();
if(h!=null&&h=="-1"||h==""||h=="NotApplicable"){Ext.MessageBox.show({title:"Operation Uptime",msg:appConstants.noZoneMsg,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return false;}}else{if(a=="Segment"){var b=Ext.getCmp("segment").getValue();if(b!=null&&b=="-1"||b==""||b=="NotApplicable"){Ext.MessageBox.show({title:"Operation Uptime",msg:appConstants.noSegmentMsg,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
return false;}}else{if(a=="Service"){var f=Ext.getCmp("service").getValue();if(f!=null&&f=="-1"||f==""||f=="NotApplicable"){Ext.MessageBox.show({title:"Operation Uptime",msg:appConstants.noServiceMsg,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return false;}}}}if(g!=null&&g=="-1"||g==""||g=="NotApplicable"){Ext.MessageBox.show({title:"Operation Uptime",msg:appConstants.noComponentMsg,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
return false;}var c=Ext.getCmp("runningDurationFilter");if(c.isVisible()){var d=Ext.getCmp("runningDuration").getValue();var e=Ext.getCmp("runningDurationFun").getValue();var i=Ext.getCmp("runningDurationUnit").getValue();if(e==undefined||e==""){Ext.MessageBox.show({title:"Operation Uptime",msg:"Please Choose Running From value",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
return false;}if(d==undefined||d==""){Ext.MessageBox.show({title:"Operation Uptime",msg:"Please enter the valid Duration",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return false;}if(i==undefined||i==""){Ext.MessageBox.show({title:"Operation Uptime",msg:"Please Choose Valid data for Duration Measure",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
return false;}}return true;},updateQueryString:function(w){var l=false;if(w!=null&&w=="submit"){l=true;}var B=Ext.getCmp("analyzeBy").getValue();var I=Ext.getCmp("uptimeReport").getValue();var g=Ext.getCmp("compType").getValue();var m=Ext.getCmp("er_timeline").getValue();if(Ext.isEmpty(m)){m="1 day";
}if(!isSettingsEnabled){var o=appConstants.publicJsonData.pageParams.selectHrsFrom;var u=appConstants.publicJsonData.pageParams.selectMinsFrom;var A=appConstants.publicJsonData.pageParams.selectHrsTo;var C=appConstants.publicJsonData.pageParams.selectMinsTo;var t=appConstants.publicJsonData.pageParams.priority;
var k=appConstants.publicJsonData.pageParams.er_reportgenration;var p=appConstants.publicJsonData.pageParams.sortby;var D=appConstants.publicJsonData.pageParams.includeMaintenancePeriod;var r=appConstants.publicJsonData.pageParams.er_show;var z=appConstants.publicJsonData.pageParams.excludeweekend;var H=appConstants.publicJsonData.pageParams.showDetails;
}else{H=Ext.getCmp("showdetailsCombo").getValue();z=Ext.getCmp("excludeWeekendsCombo").getValue();t=Ext.getCmp("showByPriority").getValue();k=Ext.getCmp("reportGeneration").getValue();D=Ext.getCmp("includeMaintenanceCombo").getValue();r=Ext.getCmp("chartOptionsCombo").getValue();p=Ext.getCmp("sortByCombo").getValue();
o=Ext.getCmp("timefrom").getValue();u=Ext.getCmp("minfrom").getValue();A=Ext.getCmp("timeto").getValue();C=Ext.getCmp("minto").getValue();}r=r.replace(new RegExp("%","g"),"|pct|");var j=Ext.getCmp("er_stdate").dataArray;var q=Ext.getCmp("er_enddate").dataArray;var x=Ext.getCmp("er_sthr").dataArray;var K=Ext.getCmp("er_endhr").dataArray;
var y=new Array();y=Ext.getCmp("components").getValue();var e=Ext.getCmp("report_Type").getValue();var c="No";var G="&er_uptimetest="+I+"&er_datafrom="+B+"&er_comptype="+g+"&er_timeline="+m+"&er_option="+B;if(e!=null&&e.toLowerCase()=="graph"){c="Yes";var n=Ext.getCmp("er_mode").getValue();G=G+"&er_mode="+n;
}if(e!=null&&e.toLowerCase()=="overview"){c="overview";}if(B=="Zone"){var d=Ext.getCmp("zone").getValue();G=G+"&er_site="+d;}else{if(B=="Segment"){var b=Ext.getCmp("segment").getValue();G=G+"&er_site="+b;}else{if(B=="Service"){var E=Ext.getCmp("service").getValue();G=G+"&er_site="+E;}}}var f="";var v="";
var a="";if(y!=null&&(y!=""&&y!="null")){for(var F=0;F<y.length;F++){f+="&er_component="+y[F];a+="&divQstr=img_"+F;v+=y[F]+"##";}}G=G+"&er_type="+c+"&er_show_details="+H+"&startdate="+j+"&enddate="+q+"&starthr="+x+"&endhr="+K+"&er_maintenance="+D+"&er_show="+encodeURIComponent(r)+"&timeto="+A+"&minto="+C+"&er_excwe="+z+"&er_priority="+t+"&timefrom="+o+"&minfrom="+u+"&startmin="+mgr_stmin+"&endmin="+mgr_enmin+"&er_reportgenration="+k+"&er_sortby="+p;
if(l){if(I=="Services"){G+=a;}var h=this.getHiddenFieldValues(false);if(h!=null&&(h!="null"&&h!="undefined")){G=h+G;}if(k!=null&&k=="background"){selectedReportGen="background";var J=Ext.getCmp("bgReportName").getValue();J=checkFileName(J);G=G+"&bg_reportname="+J+"&forwardto=ErUptimeReportDataJson";appConstants.urlForSubmit="../servlet/com.eg.ErStartBackGroundReportC";
}else{if(k!=null&&k=="background-csv"){selectedReportGen="background-csv";var J=Ext.getCmp("bgReportName").getValue();J=checkFileName(J);G=G+"&bg_reportname="+J+"&forwardto=ErUptimeReportDataJson";appConstants.urlForSubmit="../servlet/com.eg.ErStartBackGroundReportC?isSubmit=true&SaveFormat=CSV";}else{selectedReportGen="foreground";
G=G+"&forwardto=ErUptimeReportData";appConstants.urlForSubmit="../servlet/com.eg.ErUptimeServletC";}}if((selectedReportGen!=null&&(selectedReportGen=="background"||selectedReportGen=="background-csv"))||(I!="Services")){G=G+"&er_combination="+v+f;}}var s=Ext.getCmp("runningDurationFilter");if(s.isVisible()){G+="&runningDurationVal="+Ext.getCmp("runningDuration").getValue();
G+="&runningDurationFun="+Ext.getCmp("runningDurationFun").getValue();G+="&runningDurationUnit="+Ext.getCmp("runningDurationUnit").getValue();}G+="&er_RmDispName="+appConstants.er_RmDispName;queryString=G;},loadReportData:function(I){this.getNomeasurepanel().hide();this.getBackGroundPanel().hide();var i=I.dataAvailable;
var s=Ext.getCmp("uptimeResultPanel");var b=Ext.getCmp("backGroundPanel");var q="<div class='font_bold' style='padding:4px 0px 0px 0px'>"+I.screenLabels["Details_Table_Title"]+"</div>";var x=this.getOperationuptimesubmitteddata();var P=this.getOperationUptimeSubmittedDataForOverview();var ae=Ext.getCmp("uptimeReport").getValue();
var c="Components";if(ae=="Network Devices"){c="Devices";}if(selectedReportGen!=null&&selectedReportGen=="background"){x.show();s.hide();Ext.getCmp("bookletTool").setDisabled(false);P.hide();Ext.getCmp("saveTool").setDisabled(false);Ext.getCmp("printTool").setDisabled(false);Ext.getCmp("mailTool").setDisabled(false);
Ext.getCmp("csvTool").setDisabled(false);Ext.getCmp("favoriteTool").setDisabled(false);Ext.getCmp("upbutton").setDisabled(false);Ext.getCmp("bgReportName").setValue(I.pageParams["bg_reportname"]);Ext.getCmp("bgReportName").show();var w=I.pageParams["bgGroundMsg"];var J=I.pageParams["status"];var t=I.pageParams["bckGrdSaveMsg"];
var aa=I.pageParams["bckGrdSaveURL"];var H=I.pageParams["bglinkMsg"];s.hide();b.show();var T=Ext.getCmp("analyzeBy");var O=T.getStore();var L=O.find("valueField",T.getValue());var u=O.getAt(L).get("displayField");var y=Ext.getCmp("compType");var z=y.getStore();var K=z.find("valueField",y.getValue());
var k=z.getAt(K).get("displayField");var ad=Ext.getCmp("showByPriority");var h=ad.getStore();var Z=h.find("valueField",ad.getValue());var Q=h.getAt(Z).get("displayField");var j=Ext.getCmp("sortByCombo");var o=j.getStore();var g=o.find("valueField",j.getValue());var C=o.getAt(g).get("displayField");var p=Ext.getCmp("er_stdate").dataArray;
var G=Ext.getCmp("er_enddate").dataArray;var U=Ext.getCmp("er_sthr").dataArray;var ai=Ext.getCmp("er_endhr").dataArray;var B=Ext.getCmp("timefrom").getValue();var S=Ext.getCmp("minfrom").getValue();var X=Ext.getCmp("timeto").getValue();var ab=Ext.getCmp("minto").getValue();var A=Ext.getCmp("excludeWeekendsCombo");
var f=A.getStore();var m=f.find("valueField",A.getValue());var d=f.getAt(m).get("displayField");var n="iconSuccess";if(J!=null&&(J=="duplicate"||J=="exceedLimit")){n="iconExclamation";}var ag='<table border="0px" width="100%" height="100%"><tr><td align="center" valign="middle"><table style="width:480px;"border="0px"><tr><td><div style="margin:0px 10px 0px 0px;display:block;width:32px;height:32px;float:right;" class="'+n+'"></div></td><td><div style="line-height:1.5em" class="font_bold11">'+t+".</br>"+'<a class="backgroundMsgLink" href='+aa+">"+H+"</a></div></td></tr></table></td></tr></table>";
var ah=this.getBackGroundPanel();ah.update(ag);ah.doLayout();ah.show();}else{if(selectedReportGen!=null&&selectedReportGen=="background-csv"){x.show();s.hide();Ext.getCmp("bookletTool").setDisabled(false);Ext.getCmp("saveTool").setDisabled(false);Ext.getCmp("printTool").setDisabled(false);Ext.getCmp("mailTool").setDisabled(false);
Ext.getCmp("csvTool").setDisabled(false);Ext.getCmp("favoriteTool").setDisabled(false);Ext.getCmp("bgReportName").setValue(I.pageParams["bg_reportname"]);Ext.getCmp("bgReportName").show();var w=I.pageParams["bgGroundMsg"];var J=I.pageParams["status"];var t=I.pageParams["bckGrdSaveMsg"];var aa=I.pageParams["bckGrdSaveURL"];
var H=I.pageParams["bglinkMsg"];s.hide();b.show();var T=Ext.getCmp("analyzeBy");var O=T.getStore();var L=O.find("valueField",T.getValue());var u=O.getAt(L).get("displayField");var y=Ext.getCmp("compType");var z=y.getStore();var K=z.find("valueField",y.getValue());var k=z.getAt(K).get("displayField");
var ad=Ext.getCmp("showByPriority");var h=ad.getStore();var Z=h.find("valueField",ad.getValue());var Q=h.getAt(Z).get("displayField");var j=Ext.getCmp("sortByCombo");var o=j.getStore();var g=o.find("valueField",j.getValue());var C=o.getAt(g).get("displayField");var p=Ext.getCmp("er_stdate").dataArray;
var G=Ext.getCmp("er_enddate").dataArray;var U=Ext.getCmp("er_sthr").dataArray;var ai=Ext.getCmp("er_endhr").dataArray;var B=Ext.getCmp("timefrom").getValue();var S=Ext.getCmp("minfrom").getValue();var X=Ext.getCmp("timeto").getValue();var ab=Ext.getCmp("minto").getValue();var A=Ext.getCmp("excludeWeekendsCombo");
var f=A.getStore();var m=f.find("valueField",A.getValue());var d=f.getAt(m).get("displayField");var n="iconSuccess";if(J!=null&&(J=="duplicate"||J=="exceedLimit")){n="iconExclamation";}var ag='<table border="0px" width="100%" height="100%"><tr><td align="center" valign="middle"><table style="width:480px;"border="0px"><tr><td><div style="margin:0px 10px 0px 0px;display:block;width:32px;height:32px;float:right;" class="'+n+'"></div></td><td><div style="line-height:1.5em" class="font_bold11">'+t+".</br>"+'<a class="backgroundMsgLink" href='+aa+">"+H+"</a></div></td></tr></table></td></tr></table>";
var ah=this.getBackGroundPanel();ah.removeAll();ah.update(ag);ah.doLayout();ah.show();}else{var N=I.pageParams.er_type;s.removeAll();if(N!="overview"){s.show();}else{s.show();x.hide();}b.hide();if(i!=null&&i=="true"){Ext.getCmp("selectionDetails").setSelectionDetailsData(I.selectionDetailsData);if(N!="overview"){x.show();
}this.getNomeasurepanel().hide();Ext.getCmp("printTool").setDisabled(false);Ext.getCmp("mailTool").setDisabled(false);Ext.getCmp("bookletTool").setDisabled(false);Ext.getCmp("saveTool").setDisabled(false);var N=I.pageParams.er_type;if(N!=null&&N=="Yes"){P.hide();Ext.getCmp("csvTool").setDisabled(true);
var F='<div class="graphMainDiv"><div  style="height:375px;width:100%" id="uptimeGraphDiv"></div></div>';s.add({xtype:"panel",margin:"10 10 0 10",ui:"newGraphPanel",autoScroll:true,title:I.screenLabels["Details_Table_Title"],html:F});var D=I.pageParams.graphHeight;if(appConstants.chartType=="fusionchart"){if(FusionCharts("chart2Id")){FusionCharts("chart2Id").dispose();
}var ac=new FusionCharts(I.chartData.swfPath,"chart2Id","100%",D,"0","1");ac.setDataXML(I.chartData.xmlData);ac.setTransparent(true);ac.render("uptimeGraphDiv");}else{if(appConstants.chartType=="highchart"){var r={};r=jQuery.extend(true,{},getHighChartsBarInstance("uptimeGraphDiv",I.chartData.chartHeight,I.chartData.chartWidth+100),r);
r.setData(I.chartData,"<%=currentDateFormat%>","");r.drawChart();}}}else{if(N!=null&&N=="No"){P.hide();var F='<div ><table  width="100%"><tr><td align="center" valign="top"><div id="uptimeGraphDiv"></div><div id="uptimeDataDiv" style="margin:0px 10px 10px 10px" class="newTable"></div></td</tr></table></div>';
s.add({xtype:"panel",ui:"newGraphPanel",title:I.screenLabels["Details_Table_Title"],margin:"10 10 10 10",html:F});var ae=Ext.getCmp("uptimeReport").getValue();var e=Ext.get("uptimeDataDiv");Ext.getCmp("csvTool").setDisabled(false);var M=I["canShowDetails"];var T=Ext.getCmp("analyzeBy");var O=T.getStore();
var L=O.find("valueField",T.getValue());var u=O.getAt(L).get("displayField");var y=Ext.getCmp("compType");var z=y.getStore();var K=z.find("valueField",y.getValue());var k=z.getAt(K).get("displayField");var ag="<table cellspacing='0' cellpadding='0' border='0' width='100%'>"+"<thead>"+"<tr>"+'<th style="text-align:left; vertical-align: middle;width:240px;" >'+"<div>"+I.screenLabels["reporter.uptime.Server"]+"</div>"+"</th>";
if(ae!=undefined&&ae=="Systems"){ag+='<th style="text-align:left; vertical-align: middle;">'+"<div>"+I.screenLabels["reporter.uptime.Running since"]+'<br><span style="text-transform:none !important;">'+I.screenLabels["reporter.uptime.Uptime (yMdhm)"]+"</span></div>"+"</th>";}ag+='<th style="text-align:left; vertical-align: middle;">'+"<div>"+I.screenLabels["reporter.uptime.Uptime"]+'<br><span style="text-transform:none !important;">'+I.screenLabels["reporter.uptime.Uptime (yMdhm)"]+"</span></div>"+"</th>"+'<th style="text-align: center; vertical-align: middle;">'+"<div>"+I.screenLabels["reporter.uptime.% Uptime"]+"</div>"+"</th>"+'<th style="text-align: left; vertical-align: middle;" >'+"<div>"+I.screenLabels["reporter.uptime.Downtime"]+'<br><span style="text-transform:none !important;">'+I.screenLabels["reporter.uptime.Downtime (yMdhm)"]+"</span></div>"+"</th>"+'<th style="text-align: center; vertical-align: middle;">'+"<div>"+I.screenLabels["reporter.uptime.% Downtime"]+"</div>"+"</th>"+'<th style="text-align: center; vertical-align: middle;">'+"<div>"+I.screenLabels["reporter.uptime.Reboots"]+"</div>"+"</th>"+'<th style="text-align: center; vertical-align: middle;width:60;">'+"<div>"+I.screenLabels["reporter.uptime.Details"]+"</div>"+"</th>"+"</tr>"+"</thead>"+"<tbody>";
var R=I.dataTable;if(!Ext.isEmpty(R)){for(var V in R){var Y=R[V];ag+="<tr>"+"<td style='width:240px'><div style='text-align:left;'>"+Y.component+"</div></td>";if(ae!=undefined&&ae=="Systems"){ag+="<td><div style='text-align:left;'>"+Y.runningSince+"</div></td>";}ag+="<td><div style='text-align:left;'>"+Y.uptime+"</div></td>"+"<td><div style='text-align:center;'>"+this.getDecimalAlignFormat(Y.uptimePercent)+"</div></td>"+"<td><div style='text-align:left;' >"+Y.downTime+"</div></td>"+"<td><div style='text-align:center;'>"+this.getDecimalAlignFormat(Y.downTimePercent)+"</div></td>"+"<td style='width:90px'><div style='text-align:center;'>"+this.getDecimalAlignFormat(Y.reBoots)+"</div></td>";
if(Y.hasOwnProperty("detailsLink")){if(Y.detailsLink=="NOLINK"){ag+="<td><div style='text-align:center;' >&nbsp;-&nbsp;</div></td>";}else{ag+="<td><div align='center' style='cursor:pointer;padding:4px'><div><img src='../images/spacer.gif' class='iconDetailedList' border='0px' style='display:block;' onClick='javascript:openInGraphWin(\""+Y.detailsLink+"\");'></div></div></td>";
}}else{ag+="<td><div >&nbsp;-&nbsp;</div></td>";}ag+="</tr>";}}ag+="</tbody>";ag+="</table>";ag+="<div style='font-size:12px;padding:8px;'><div style='float:left;'>"+I.screenLabels["reporter.uptime.y - year, M - month, d - day, h - hour, m - min"]+"</div></div>";if(M!=null&&M=="true"){ag+="<br><br><div class='newTable'>"+"<table cellspacing='0' cellpadding='0' border='0' width='100%'>"+"<thead>"+"<tr>"+'<th style="text-align:left; vertical-align: middle;" >'+"<div>"+I.screenLabels["reporter.uptime.Server"]+"</div>"+"</th>"+'<th style="text-align:center; vertical-align: middle;" >'+"<div>"+I.screenLabels["reporter.uptime.Shutdown At"]+"</div>"+"</th>"+'<th style="text-align:center; vertical-align: middle;" >'+"<div>"+I.screenLabels["reporter.uptime.Rebooted At"]+"</div>"+"</th>"+'<th style="text-align:center; vertical-align: middle;">'+"<div>"+I.screenLabels["reporter.uptime.Downtime"]+"<br>("+I.screenLabels["reporter.uptime.mins"]+")* </div>"+"</th>"+'<th style="text-align:center; vertical-align: middle;" >'+"<div>"+I.screenLabels["reporter.uptime.UptimeBeforeReboot"]+'<br><span style="text-transform:none !important;">('+I.screenLabels["reporter.uptime.yMdhm"]+")* </span></div>"+"</th>"+"</tr>"+"</thead>"+"<tbody>";
var a=I.detailsData;if(!Ext.isEmpty(a)){for(var af in a){var aj=a[af];ag+="<tr>"+"<td style='width:240px;text-align:left'><div >"+aj.component+"</div></td>"+"<td style='text-align:center'><div >"+aj.shutDownAt+"</div></td>"+"<td style='text-align:center'><div >"+aj.reBootAt+"</div></td>"+"<td style='text-align:center'><div >"+aj.downTime+"</div></td>"+"<td style='text-align:center'><div >"+aj.uptimeBeforeReBoot+"</div></td></tr>";
}}ag+="</tbody>";ag+="</table>";}e.update(ag);}else{P.show();s.hide();var E=Ext.getCmp("uptimeResultPanelOverview");E.show();E.removeAll();console.log("<< uptimeRPOverview >>>>>>",E);var v={xtype:"container",title:"Overview",border:true,margin:0,layout:{type:"vbox",align:"stretch"},items:[{xtype:"panel",flex:1,frame:false,title:"Overview",margin:"10 10 10 10",ui:"newGraphPanel",layout:{type:"hbox",align:"center"},defaults:{minWidth:180,margin:"0 0 5 0",flex:1,layout:{type:"column",align:"center",},},items:[{xtype:"container",align:"center",autoSize:true,layout:{type:"table",columns:1,align:"center",border:false,tableAttrs:{style:{align:"center",margin:"auto auto",}},tdAttrs:{style:{textAlign:"center",padding:"0px 0px 5px 0px"}}},defaults:{bodyStyle:{"padding":"5px","background":"transparent !important"},align:"center",xtype:"container",},items:[{html:'<table align="center"><tr><td align="right" style="padding-right:5px"><div class="iconServerGray"></div></td><td style="text-align:left;padding-left:5px" class="newFont_bold28" >'+I.overviewData["totalNoOfServers"]+"</td></tr></table>",width:"100%",style:{textAlign:"center",width:"50px"}},{html:'<span class="newFont_normal13">Total number of '+c+"</span>",}]},{xtype:"container",align:"center",autoSize:true,layout:{type:"table",columns:1,align:"center",tableAttrs:{style:{align:"center",margin:"auto auto",}},tdAttrs:{style:{textAlign:"center",padding:"0px 0px 5px 0px"}}},defaults:{bodyStyle:{"padding":"5px","background":"transparent !important"},align:"center",xtype:"container",},items:[{html:'<table align="center"><tr><td align="right" style="padding-right:5px"><div class="iconUpGreen" ></div></td><td style="text-align:left;padding-left:5px" class="newFont_bold28" >'+I.overviewData["fullUptimeServerCount"]+"</td></tr></table>",width:"100%",style:{textAlign:"center",width:"50px"}},{html:'<span class="newFont_normal13">'+c+" with no downtime</span>",}]},{xtype:"container",align:"center",autoSize:true,layout:{type:"table",columns:1,align:"center",tableAttrs:{style:{align:"center",margin:"auto auto",}},tdAttrs:{style:{textAlign:"center",padding:"0px 0px 5px 0px"}}},defaults:{bodyStyle:{"padding":"5px","background":"transparent !important"},align:"center",xtype:"container",},items:[{html:'<table align="center"><tr><td align="right" style="padding-right:5px"><div class="iconDownRed"></div></td><td style="text-align:left;padding-left:5px" class="newFont_bold28" >'+I.overviewData["downtimeServerCount"]+"</td></tr></table>",width:"100%",style:{textAlign:"center",width:"50px"}},{html:'<span class="newFont_normal13">'+c+" with downtime</span>",}]},{xtype:"container",align:"center",autoSize:true,layout:{type:"table",columns:1,align:"center",tableAttrs:{style:{align:"center",margin:"auto auto",}},tdAttrs:{style:{textAlign:"center",padding:"0px 0px 5px 0px"}}},defaults:{bodyStyle:{"padding":"5px","background":"transparent !important"},align:"center",xtype:"container",},items:[{html:'<table align="center"><tr><td align="right" style="padding-right:5px"><div class="iconDownRed"></div></td><td style="text-align:left;padding-left:5px" class="newFont_bold28" >'+I.overviewData["avgDownTimeMin"]+(I.overviewData["avgDownTimeMin"]=="0"?"":' <span class="newFont_normal13">mins</span>')+"</td></tr></table>",width:"100%",style:{textAlign:"center",width:"50px"}},{html:'<span class="newFont_normal13">Average downtime</span>',}]}]}]};
E.show();E.add(v);var l='<div style="width:100%"><table class="htmlGraphTable" width="100%"  style="border:0px;background-color:transparent"><col width="50%"><col width="50%"><tr>';l+='<td style="padding:0px 5px 0px 0px">';l+='<div width="100%" class="graphMainDiv" >';l+='<div class="htmlGraphTableHeader">';
l+="Top 10 "+c+" "+((I.isLowUptimeNotServerFound)?"":" with High")+" Down Time";l+="</div>";l+='<div id="leftChartContent" style="height:305px;width:100% !important;overflow:auto;padding:0px" class="htmlGraphTableBody">';l+="</div>";l+="</div></td>";l+='<td style="padding:0px 0px 0px 5px">';l+='<div width="100%" class="graphMainDiv">';
l+='<div class="htmlGraphTableHeader">';l+="Overall Uptime/Downtime";l+="</div>";l+='<div id="rightChartContent" style="height:305px;width:100% !important;overflow:auto;padding:0px" class="htmlGraphTableBody">';l+="</div>";l+="</div></td>";l+="</tr></table></div>";E.add({xtype:"container",flex:1,margin:"0 10 10 10",html:l,});
if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}var r={};r=jQuery.extend(true,{},getHighChartsBarInstance("leftChartContent",I.overviewLineChat.chartHeight,600),r);r.setData(I.overviewLineChat,"<%=currentDateFormat%>","");r.drawChart();var W={};W=jQuery.extend(true,{},getHighChartsBarInstance("rightChartContent",300,600),W);
W.setData(I.overviewPieChat,"<%=currentDateFormat%>","");W.drawChart();}}Ext.getCmp("panelinsidetoggle").setDisabled(false);}else{var E=Ext.getCmp("uptimeResultPanelOverview");E.removeAll();E.hide();s.hide();x.hide();this.getNomeasurepanel().doLayout();this.getNomeasurepanel().show();Ext.getCmp("panelinsidetoggle").setDisabled(true);
this.hideTools();if(N!=null&&N=="Yes"){this.getNomeasurepanel().doLayout();this.getNomeasurepanel().show();}else{this.getNomeasurepanel().doLayout();this.getNomeasurepanel().show();}}}}},loadUptimeForServiceReportData:function(x){this.getNomeasurepanel().hide();this.getBackGroundPanel().hide();var q=Ext.getCmp("uptimeResultPanel");
var d=x.dataAvailable;var o="Uptime of NetScaler by virtual servers";var u=this.getOperationuptimesubmitteddata();var e=Ext.getCmp("analyzeBy").getValue();if(selectedReportGen!=null&&selectedReportGen=="background"){loadMask=new Ext.LoadMask(Ext.getBody(),{msg:"Loading ..."});loadMask.show();Ext.Ajax.request({url:appConstants.urlForSubmit,params:"responseType=Json&isSubmit=true&"+queryString,async:true,scope:this,success:function(P){var Q=P.responseText;
if(Ext.isEmpty(Q)){Ext.getCmp("uptimeResultPanel").hide();loadMask.hide();this.getNomeasurepanel().show();Ext.getCmp("backGroundPanel").hide();Ext.getCmp("panelinsidetoggle").setDisabled(true);}else{var ah=Ext.decode(Q);loadMask.hide();Ext.getCmp("bookletTool").setDisabled(false);Ext.getCmp("saveTool").setDisabled(false);
Ext.getCmp("printTool").setDisabled(false);Ext.getCmp("mailTool").setDisabled(false);Ext.getCmp("csvTool").setDisabled(false);Ext.getCmp("favoriteTool").setDisabled(false);Ext.getCmp("upbutton").setDisabled(false);Ext.getCmp("bgReportName").setValue(ah.pageParams["bg_reportname"]);Ext.getCmp("bgReportName").show();
var Z=ah.pageParams["bgGroundMsg"];var ai=ah.pageParams["status"];var X=ah.pageParams["bckGrdSaveMsg"];var at=ah.pageParams["bckGrdSaveURL"];var ag=ah.pageParams["bglinkMsg"];q.hide();var ao=Ext.getCmp("analyzeBy");var al=ao.getStore();var ak=al.find("valueField",ao.getValue());var Y=al.getAt(ak).get("displayField");
var aa=Ext.getCmp("compType");var ab=aa.getStore();var aj=ab.find("valueField",aa.getValue());var S=ab.getAt(aj).get("displayField");var av=Ext.getCmp("showByPriority");var y=av.getStore();var ar=y.find("valueField",av.getValue());var am=y.getAt(ar).get("displayField");var R=Ext.getCmp("sortByCombo");
var V=R.getStore();var j=V.find("valueField",R.getValue());var ae=V.getAt(j).get("displayField");var W=Ext.getCmp("er_stdate").dataArray;var af=Ext.getCmp("er_enddate").dataArray;var ap=Ext.getCmp("er_sthr").dataArray;var ay=Ext.getCmp("er_endhr").dataArray;var ad=Ext.getCmp("timefrom").getValue();var an=Ext.getCmp("minfrom").getValue();
var aq=Ext.getCmp("timeto").getValue();var au=Ext.getCmp("minto").getValue();var ac=Ext.getCmp("excludeWeekendsCombo");var k=ac.getStore();var T=k.find("valueField",ac.getValue());var i=k.getAt(T).get("displayField");var aw="<div style='text-align:center;margin-top:50px'>";var U="iconSuccess";if(ai!=null&&(ai=="duplicate"||ai=="exceedLimit")){U="iconExclamation";
}aw+='<table border="0px" width="100%" height="100%"><tr><td align="center" valign="middle"><table style="width:480px;"border="0px"><tr><td><div style="margin:0px 10px 0px 0px;display:block;width:32px;height:32px;float:right;" class="'+U+'"></div></td><td><div style="line-height:1.5em" class="font_bold11">'+X+".</br>"+'<a class="backgroundMsgLink" href='+at+">"+ag+"</a></div></td></tr></table></td></tr></table>";
var ax=this.getBackGroundPanel();ax.removeAll();ax.update(aw);ax.doLayout();this.getBackGroundPanel().show();}}});}else{if(selectedReportGen!=null&&selectedReportGen=="background-csv"){loadMask=new Ext.LoadMask(Ext.getBody(),{msg:"Loading ..."});loadMask.show();Ext.Ajax.request({url:appConstants.urlForSubmit,params:"responseType=Json&isSubmit=true&"+queryString,async:true,scope:this,success:function(P){var Q=P.responseText;
if(Ext.isEmpty(Q)){Ext.getCmp("uptimeResultPanel").hide();loadMask.hide();this.getNomeasurepanel().show();Ext.getCmp("backGroundPanel").hide();Ext.getCmp("panelinsidetoggle").setDisabled(true);}else{var ah=Ext.decode(Q);loadMask.hide();q.hide();Ext.getCmp("bookletTool").setDisabled(false);Ext.getCmp("saveTool").setDisabled(false);
Ext.getCmp("printTool").setDisabled(false);Ext.getCmp("mailTool").setDisabled(false);Ext.getCmp("csvTool").setDisabled(false);Ext.getCmp("favoriteTool").setDisabled(false);Ext.getCmp("bgReportName").setValue(ah.pageParams["bg_reportname"]);Ext.getCmp("bgReportName").show();var Z=ah.pageParams["bgGroundMsg"];
var ai=ah.pageParams["status"];var X=ah.pageParams["bckGrdSaveMsg"];var at=ah.pageParams["bckGrdSaveURL"];var ag=ah.pageParams["bglinkMsg"];q.hide();this.getBackGroundPanel().show();var ao=Ext.getCmp("analyzeBy");var al=ao.getStore();var ak=al.find("valueField",ao.getValue());var Y=al.getAt(ak).get("displayField");
var aa=Ext.getCmp("compType");var ab=aa.getStore();var aj=ab.find("valueField",aa.getValue());var S=ab.getAt(aj).get("displayField");var av=Ext.getCmp("showByPriority");var y=av.getStore();var ar=y.find("valueField",av.getValue());var am=y.getAt(ar).get("displayField");var R=Ext.getCmp("sortByCombo");
var V=R.getStore();var j=V.find("valueField",R.getValue());var ae=V.getAt(j).get("displayField");var W=Ext.getCmp("er_stdate").dataArray;var af=Ext.getCmp("er_enddate").dataArray;var ap=Ext.getCmp("er_sthr").dataArray;var ay=Ext.getCmp("er_endhr").dataArray;var ad=Ext.getCmp("timefrom").getValue();var an=Ext.getCmp("minfrom").getValue();
var aq=Ext.getCmp("timeto").getValue();var au=Ext.getCmp("minto").getValue();var ac=Ext.getCmp("excludeWeekendsCombo");var k=ac.getStore();var T=k.find("valueField",ac.getValue());var i=k.getAt(T).get("displayField");var aw="";var U="iconSuccess";if(ai!=null&&(ai=="duplicate"||ai=="exceedLimit")){U="iconExclamation";
}aw+='<table border="0px" width="100%" height="100%"><tr><td align="center" valign="middle"><table style="width:480px;"border="0px"><tr><td><div style="margin:0px 10px 0px 0px;display:block;width:32px;height:32px;float:right;" class="'+U+'"></div></td><td><div style="line-height:1.5em" class="font_bold11">'+X+".</br>"+'<a class="backgroundMsgLink" href='+at+">"+ag+"</a></div></td></tr></table></td></tr></table>";
var ax=this.getBackGroundPanel();ax.removeAll();ax.add({xtype:"panel",margin:0,bodyPadding:0,height:"100%",width:"100%",html:"<div>"+aw+"</div>"});ax.doLayout();ax.show();}}});}else{q.removeAll();q.show();this.getBackGroundPanel().hide();if(d!=null&&d=="true"){u.show();this.getNomeasurepanel().hide();
Ext.getCmp("printTool").setDisabled(false);Ext.getCmp("mailTool").setDisabled(false);Ext.getCmp("bookletTool").setDisabled(false);Ext.getCmp("saveTool").setDisabled(false);var f=Ext.getCmp("report_Type").getValue();var D="No";if(f!=null&&f.toLowerCase()=="graph"){D="Yes";}if(D!=null&&D=="Yes"){u.setTitle("<div class='htmlGraphTableHeader' style='padding:4px 0px 0px 0px'>"+o+"</div>");
u.getHeader().hide();var I=new Array();I=Ext.getCmp("components").getValue();if(I!=null&&(I!=""&&I!="null")){var C=new Array();var t=new Array();var n=new Array();var a=new Array();var m="";noOfCharts=0;for(var L=0;I.length>L;L++){var N="myChartId"+L;var O=t[L];noOfCharts+=1;n.push(L);}if(noOfCharts==1){m='<div style="width:100%"><table width="100%" border="0" class="htmlGraphTable" style="border:0px;"><col width="50%"><tr>';
}else{m='<div style="width:100%"><table width="100%" border="0" class="htmlGraphTable" style="border:0px;"><col width="50%"><col width="50%"><tr>';}var g=0;for(var p in n){var s=false;var K=n[p];var M=I[K];var A="";if(e=="Component"){if(M!=undefined){A=M.substring(0,M.indexOf(":"));}}else{if(M!=undefined){A=M.substring(M.indexOf(":")+1,M.lastIndexOf(":"));
}}if(g==2){g=0;m+="</tr>";m+="<tr>";}if(p==0){if(n.length>2){m+='<td style="padding:0px 10px 10px 10px">';}else{if(n.length==2){m+='<td style="padding:0px 10px 10px 10px">';}else{m+='<td style="padding:0px 10px 10px 10px">';}}}else{if(p==1){if(n.length>2){m+='<td style="padding:0px 10px 10px 0px">';}else{m+='<td style="padding:0px 10px 10px 0px">';
}}else{if((p%2)==0){if(p==n.length-1){s=true;m+='<td style="padding:0px 10px 10px 10px">';}else{if(p==n.length-2){m+='<td style="padding:0px 10px 10px 10px">';}else{m+='<td style="padding:0px 10px 10px 10px">';}}}else{if((p%2)!=0){if(p==n.length-1){m+='<td style="padding:0px 10px 10px 0px">';}else{m+='<td style="padding:0px 10px 10px 0px">';
}}}}}m+='<div width="100%" class="graphMainDiv">';m+='<div class="htmlGraphTableHeader"><div style="float:left;">';m+=A;m+="</div></div>";var b="img_"+p;t.push(b);if(I.length==1){m+='<div id="'+b+'" style="height:330;width:100%;overflow:auto;align-items:baseline;" class="htmlGraphTableBody">';}else{m+='<div id="'+b+'" style="height:310px;width:100%;overflow:auto;" class="htmlGraphTableBody">';
}m+='<table cellspacing="0" cellpadding="0" border="0" width="100%"><tbody><tr><td width="100%" height="305px" valign="middle" align="center"><div class="font_bold11">Loading...</div></td></tr></tbody></table>';m+="</div>";m+="</div></td>";if(s){m+='<td style="padding:5px 10px 10px 5px;">&nbsp;</td>';
}g++;}if(g==2){m+="</tr>";}m+="</table></div>";Ext.getCmp("csvTool").setDisabled(true);q.removeAll();q.add({xtype:"panel",title:o,margin:"10 10 10 10",ui:"multiGraphPanel",columnWidth:1,html:m,id:"html_content"});for(var L=0;L<n.length;L++){var K=n[L];var O=t[L];h=encodeURIComponent(I[L]);Ext.Ajax.request({url:appConstants.urlForSubmit,params:"responseType=Json&isSubmit=true&"+queryString+"&imgDivId="+O+"&er_component="+h+"&er_combination="+h+"##",method:"post",async:true,scope:this,success:function(j){var y=j.responseText;
if(Ext.isEmpty(y)){}else{x=Ext.decode(y);console.log(x);var k=x.dataAvailable;if(k!=null&&k=="true"){if(x.rImgDivId=="img_0"){Ext.getCmp("selectionDetails").setSelectionDetailsData(x.selectionDetailsData);}var i={};i=jQuery.extend(true,{},getHighChartsBarInstance(x.rImgDivId,x.chartData.chartHeight-20,x.chartData.chartWidth+100),i);
i.setData(x.chartData,"<%=currentDateFormat%>","");i.drawChart();}else{if(Ext.get(x.rImgDivId)!=null){if(x.rImgDivId=="img_0"){Ext.getCmp("selectionDetails").setSelectionDetailsData(x.selectionDetailsData);}Ext.get(x.rImgDivId).update('<div><img src="/final/images/'+strSkin+'/nomeasures_custom.png"></img></div>');
}}}}});}}}else{var H="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+"* y - year, M - month, d - day, h - hour, m - min"+"";
var I=new Array();I=Ext.getCmp("components").getValue();var t=new Array();if(I!=null&&(I!=""&&I!="null")){u.setTitle("<div class='font_bold' style='padding:4px 0px 0px 0px'>"+o+"</div>");u.getHeader().hide();q.removeAll();var m="";m='<div style="width:100%;">';for(var J=0;J<I.length;J++){var M=I[J];var A="";
if(e=="Component"){if(M!=undefined){A=M.substring(0,M.indexOf(":"));}}else{if(M!=undefined){A=M.substring(M.indexOf(":")+1,M.lastIndexOf(":"));}}m+='<table width="100%" border="0" class="htmlGraphTable" style="border:0px;"><tr>';m+='<td style="padding:0px 0px 10px 0px">';m+='<div class="font_bold14">';
m+=A;m+="</div>";var b="img_"+J;t.push(b);m+='<div id="'+b+'" style="height:auto;width:100%;margin-bottom:5px" class="htmlGraphTableBody">';m+='<table cellspacing="0" cellpadding="0" border="0" width="100%"><tbody><tr class="x-grid-row"><td width="100%" height="140px" valign="middle" align="center"><div class="font_bold11">Loading...</div></td></tr></tbody></table>';
m+="</div>";m+="</td></tr>";m+="</table>";}m+="</div>";q.add({xtype:"panel",ui:"newGraphPanel",title:o+'<div style="float:right" class="font_normal12">* y - year, M - month, d - day, h - hour, m - min</div>',margin:10,bodyPadding:"0 10 10 10",html:m});var c=Ext.get("uptimeDataDiv");Ext.getCmp("csvTool").setDisabled(false);
var G=Ext.getCmp("analyzeBy");var E=G.getStore();var B=E.find("valueField",G.getValue());var r=E.getAt(B).get("displayField");var v=Ext.getCmp("compType");var w=v.getStore();var z=w.find("valueField",v.getValue());var l=w.getAt(z).get("displayField");for(var F=0;F<I.length;F++){var h=encodeURIComponent(I[F]);
var O=t[F];Ext.Ajax.request({url:appConstants.urlForSubmit,params:"responseType=Json&isSubmit=true&"+queryString+"&imgDivId="+O+"&er_component="+h+"&er_combination="+h+"##",method:"post",async:true,scope:this,success:function(R){var Q=R.responseText;if(Ext.isEmpty(Q)){console.log("<<< 10000 >>>");}else{x=Ext.decode(Q);
var V=x.dataAvailable;var i=x["canShowDetails"];if(V!=null&&V=="true"){if(x.rImgDivId=="img_0"){Ext.getCmp("selectionDetails").setSelectionDetailsData(x.selectionDetailsData);}var k="<div class='newTable' style='margin-top:5px'>"+"<table cellspacing='0' cellpadding='0' border='0' >"+"<thead>"+"<tr>"+'<th style="text-align: center; vertical-align: middle;width:240px;" >'+"<div>"+x.screenLabels["reporter.uptime.Services"]+"</div>"+"</th>"+'<th style="text-align: center; vertical-align: middle;">'+"<div>"+x.screenLabels["reporter.uptime.Uptime"]+'<br><span style="text-transform:none !important;">'+x.screenLabels["reporter.uptime.Uptime (yMdhm)"]+"</span></div>"+"</th>"+'<th style="text-align: center; vertical-align: middle;">'+"<div>"+x.screenLabels["reporter.uptime.% Uptime"]+"</div>"+"</th>"+'<th style="text-align: center; vertical-align: middle;">'+'<div style="width:150px;">'+x.screenLabels["reporter.uptime.Downtime"]+'<br><span style="text-transform:none !important;">'+x.screenLabels["reporter.uptime.Downtime (yMdhm)"]+"</span></div>"+"</th>"+'<th style="text-align: center; vertical-align: middle;">'+"<div>"+x.screenLabels["reporter.uptime.% Downtime"]+"</div>"+"</th>"+'<th style="text-align: center; vertical-align: middle;">'+"<div>"+x.screenLabels["reporter.uptime.Details"]+"</div>"+"</th>"+"</tr>"+"</thead>"+"<tbody>";
var y=x.dataTable;if(!Ext.isEmpty(y)){var S=0;for(var W in y){S++;var P=y[W];k+="<tr>"+"<td style='width:240px'><div style='text-align:left;'>"+P.component+"</div></td>"+"<td><div style='text-align:center;'>"+P.uptime+"</div></td>"+"<td><div style='text-align:center;'>"+P.uptimePercent+"</div></td>"+"<td><div style='text-align:center;' >"+P.downTime+"</div></td>"+"<td><div style='text-align:center;'>"+P.downTimePercent+"</div></td>";
if(P.hasOwnProperty("detailsLink")){if(P.detailsLink=="NOLINK"){k+="<td><div style='text-align:center;' >&nbsp;-&nbsp;</div></td>";}else{k+="<td><div align='center' style='cursor:pointer;padding:4px'><div><img src='../images/spacer.gif' class='iconDetailedList' border='0px' style='display:block;' onClick='javascript:openInGraphWin(\""+P.detailsLink+"\");'></div></div></td>";
}}else{k+="<td><div >&nbsp;-&nbsp;</div></td>";}k+="</tr>";}}k+="</tbody>";k+="</table>";k+="</div>";if(i!=null&&i=="true"){k+="<br><br><div class='newTable' style='margin-top:5px'>"+"<table cellspacing='0' cellpadding='0' border='0'>"+"<thead>"+"<tr>"+'<th style="text-align: center; vertical-align: middle;" >'+"<div>"+x.screenLabels["reporter.uptime.Services"]+"</div>"+"</th>"+'<th style="text-align: center; vertical-align: middle;">'+"<div>"+x.screenLabels["reporter.uptime.Down At"]+"</div>"+"</th>"+'<th style="text-align: center; vertical-align: middle;">'+"<div>"+x.screenLabels["reporter.uptime.Up At"]+"</div>"+"</th>"+'<th style="text-align: center; vertical-align: middle;">'+"<div>"+x.screenLabels["reporter.uptime.Downtime"]+"<br>("+x.screenLabels["reporter.uptime.mins"]+")* </div>"+"</th>"+"</tr>"+"</thead>"+"<tbody>";
var j=x.detailsData;if(!Ext.isEmpty(j)){for(var T in j){var U=j[T];k+="<tr>"+"<td style='width:240px'><div>"+U.component+"</div></td>"+"<td><div style='text-align:center'>"+U.shutDownAt+"</div></td>"+"<td><div style='text-align:center'>"+U.reBootAt+"</div></td>"+"<td><div style='text-align:center'>"+U.downTime+"</div></td>";
}}k+="</tbody>";k+="</table></div>";}Ext.fly(x.rImgDivId).update(k);}else{if(Ext.get(x.rImgDivId)!=null){if(x.rImgDivId=="img_0"){Ext.getCmp("selectionDetails").setSelectionDetailsData(x.selectionDetailsData);}Ext.get(x.rImgDivId).update('<div class="errorMsgBox"><img src="/final/images/spacer.gif" class="iconExclamation" border="0px" style="border:0px" /> <br/>No measures available</div>');
}}}}});}}}Ext.getCmp("panelinsidetoggle").setDisabled(false);}else{if(d!=null&&d=="false"){if(isFromScheOrFav){isFromScheOrFav=false;this.beforeFormSubmit();}}}}}},formSubmit:function(d){var c=null;var b="";if(d!=null&&d!="undefined"){b=d.getId();}if(b!=null&&b=="submit"){var e=Ext.getCmp("uptimeReport").getValue();
this.updateQueryString(b);if(e=="Services"){var a=new Object();a.dataAvailable="true";this.loadUptimeForServiceReportData(a);}else{c=new Ext.LoadMask(Ext.getBody(),{msg:"Loading ..."});c.show();Ext.Ajax.request({url:appConstants.urlForSubmit,params:"responseType=Json&isSubmit=true&"+queryString,async:true,scope:this,success:function(f){var h=f.responseText;
if(Ext.isEmpty(h)){Ext.getCmp("uptimeResultPanel").hide();c.hide();this.getNomeasurepanel().show();Ext.getCmp("backGroundPanel").hide();Ext.getCmp("panelinsidetoggle").setDisabled(true);}else{var g=Ext.decode(h);c.hide();this.loadReportData(g);}}});}}else{this.updateQueryString(b);Ext.Ajax.request({url:"/final/reporter/ErUptimeReportDataJson.jsp",params:queryString+"&OperationUptimeUIAction=defaultLoad",scope:this,async:true,success:function(f){var F=f.responseText;
var n=Ext.decode(F);if(b!=null&&(b!="er_timeline"&&b!="showdetailsCombo")){var E=Ext.getCmp("analyzeBy").getValue();var y=Ext.getCmp("compType");var s=n["comptypecombo"];if(E=="Zone"){var z=Ext.getCmp("zone");var J=n["vSiteJson"];if(!Ext.isEmpty(J)){z.getStore().clearFilter(true);z.getStore().loadRawData(J);
z.setValue(n.pageParams.selctedSite);}}else{if(E=="Segment"){var N=Ext.getCmp("segment");var t=n["vSiteJson"];if(!Ext.isEmpty(t)){N.getStore().clearFilter(true);N.getStore().loadRawData(t);N.setValue(n.pageParams.selctedSite);}}else{if(E=="Service"){var j=Ext.getCmp("service");var i=n["vSiteJson"];if(!Ext.isEmpty(i)){j.getStore().clearFilter(true);
j.getStore().loadRawData(i);j.setValue(n.pageParams.selctedSite);}}}}var y=Ext.getCmp("compType");var s=n["vCompTypeJson"];y.getStore().clearFilter(true);y.getStore().loadRawData(s);y.setValue(n.pageParams.selectedCompType);var w=n.pageParams["selectedComps"];var u=n["compFilterJSON"];var o=Ext.getCmp("components");
o.getStore().loadRawData(u);o.setValue(w);}var x=Ext.getCmp("reportGeneration");if(x!=undefined&&x!="undefined"){var l=Ext.getCmp("bgReportName");var m=n.reportGenerationJSONArray;var g=m[0].valueField;if(!Ext.isEmpty(m)){x.getStore().loadRawData(m);x.setValue(g);if(g!=undefined&&g!=null&&g=="foreground"){l.hide();
}else{l.show();}}}var D=Ext.getCmp("er_stdate");var v=Ext.getCmp("er_enddate");var r=Ext.getCmp("er_sthr");var B=Ext.getCmp("er_endhr");var K=n.pageParams["s_st_time"];var H=n.pageParams["s_en_time"];var L=n.pageParams["starthr"];var h=n.pageParams["endhr"];D.setValue(n.pageParams["startDateForDisplay"]);
D.dataArray=K;v.setValue(n.pageParams["endDateForDisplay"]);v.dataArray=H;r.setValue(n.pageParams["startHourForDisplay"]);r.dataArray=L;B.setValue(n.pageParams["endHourForDisplay"]);B.dataArray=h;if(b!=null&&b=="er_timeline"){var G=Ext.getCmp("reportGeneration");var I=G.getValue();if(I!=null&&I=="foreground"){var q=appConstants.publicJsonData.hiddenParams["limitforbg"];
if(!Ext.isEmpty(q)){var k=q;var p=appConstants.publicJsonData.hiddenParams["getMaxDaysInMonth"];var C="0";if(!Ext.isEmpty(p)){C=p;}var M=Ext.getCmp("er_stdate").getValue();var A=Ext.getCmp("er_enddate").getValue();M.setHours(Ext.getCmp("er_sthr").getValue());A.setHours(Ext.getCmp("er_endhr").getValue());
if(!checkTimeLineForBgLimit(k,C,M,A)){var l=Ext.getCmp("bgReportName");G.setValue("background");l.show();}else{var l=Ext.getCmp("bgReportName");G.setValue("foreground");l.hide();}}}}}});}},loadMainElements:function(){this.getMainform().loadFields();},fillSettingsElements:function(){var a=appConstants.publicJsonData.hiddenParams.favorite_id;
if(!Ext.isEmpty(a)){Ext.getCmp("reportGeneration").setDisabled(true);}Ext.getCmp("moreOptionCloseId").show();this.getOperationuptimesettings().loadSettingsData();},showConfigDropdown:function(){var e=this;isSettingsEnabled=true;var c=new Ext.XTemplate('<div style="float:left;padding:0px 0px 0px 0px;">More Options</div><div style="text-align:right;float:right;"><div class="iconCloseNew" id="closeSettings"></div></div>');
Ext.create("Ext.container.Container",{width:565,height:"auto",id:"configMod",ui:"settingsWindowContainer",items:[{xtype:"container",cls:"configMode_popupArrow",style:{"top":"-14px","left":"355px"}},{xtype:"container",html:c.apply(),cls:"containerHeader",style:{"top":"0px","margin":"0px"}},{xtype:"operationuptimesettings",parent:this}],renderTo:"operationuptimedata-body"});
var a=Ext.getCmp("report_Type").getValue();if(a=="overview"){var g=Ext.getCmp("chartOptionsCombo");var d=Ext.get("sortByCombo");var b=Ext.get("showByPriority");var f=Ext.get("splitterID");g.hide();d.hide();b.hide();f.hide();}Ext.get("closeSettings").on("click",function(){e.validateSettings();});},closeSettingAndSubmit:function(){if(this.validateSettings()){this.beforeFormSubmit();
}},defaultLoad:function(){var e=Ext.getCmp("submit");e.setDisabled(true);updatingAppSettings();var b=appConstants.publicJsonData.hiddenParams["fromScheduleModify"];var d=appConstants.publicJsonData.hiddenParams["fromFavoriteModify"];var f=appConstants.publicJsonData.hiddenParams["schedule_id"];var a=appConstants.publicJsonData.hiddenParams["favorite_id"];
if((b!=null&&b=="Yes")||(d!=null&&d=="Yes")){appConstants.fromScheduleModify=b;appConstants.fromFavoriteModify=d;appConstants.schedule_id=f;appConstants.favorite_id=a;Ext.getCmp("submit").hide();Ext.getCmp("save").show();Ext.getCmp("favoriteTool").setDisabled(true);Ext.getCmp("scheduleTool").setDisabled(true);
}else{Ext.getCmp("submit").show();Ext.getCmp("save").hide();}var c=this;this.loadRepData();if(!hideBackButton){Ext.getCmp("uptimereportform").add({xtype:"hidden",id:"ID",name:"ID",value:appConstants.publicJsonData["ID"]});}},showDetailsRadio:function(){if(!isSettingsEnabled){this.showConfigDropdown();
}var b=Ext.getCmp("report_Type").getValue();var c=Ext.getCmp("showdetailsCombo");var f=Ext.getCmp("chartOptionsCombo");var h=Ext.getCmp("er_mode");var d=Ext.getCmp("sortByCombo");var a=Ext.getCmp("showByPriority");var e=Ext.getCmp("splitterID");var g=Ext.getCmp("uptimeReport");Ext.getCmp("runningDurationFilter").hide();
if(b=="data"){c.show();f.hide();d.show();a.show();e.show();if(g.getValue()=="Systems"){Ext.getCmp("runningDurationFilter").show();}}else{if(b=="graph"){c.hide();f.show();d.show();a.show();e.show();}else{c.hide();f.hide();d.hide();a.hide();e.hide();}}this.formSubmit(c);},showBackgroundReport:function(b){var c=b.getValue();
var a=Ext.getCmp("bgReportName");if(c=="background"){a.show();Ext.getCmp("submitViaSetting").show();Ext.getCmp("moreOptionCloseId").hide();}else{if(c=="background-csv"){a.show();Ext.getCmp("submitViaSetting").show();Ext.getCmp("moreOptionCloseId").hide();}else{a.hide();Ext.getCmp("submitViaSetting").hide();
Ext.getCmp("moreOptionCloseId").show();}}},selectCompComponents:function(){var a=Ext.getCmp("compType");this.selectComponents(a);},selectZoneComponents:function(){var a=Ext.getCmp("zone");if(a.getValue()!="-1"){this.selectComponents(a);}else{var b=Ext.getCmp("compType");var c=Ext.getCmp("components");
this.insertNotApplicable(appConstants.getNotApplicationData,b);this.insertNotApplicable(appConstants.getNotApplicationData,c);}},selectServiceComponents:function(){var c=Ext.getCmp("service");if(c.getValue()!="-1"){this.selectComponents(c);}else{var a=Ext.getCmp("compType");var b=Ext.getCmp("components");
this.insertNotApplicable(appConstants.getNotApplicationData,a);this.insertNotApplicable(appConstants.getNotApplicationData,b);}},selectSegmentComponents:function(){var a=Ext.getCmp("segment");if(a.getValue()!="-1"){this.selectComponents(a);}else{var b=Ext.getCmp("compType");var c=Ext.getCmp("components");
this.insertNotApplicable(appConstants.getNotApplicationData,b);this.insertNotApplicable(appConstants.getNotApplicationData,c);}},selectReportTypeCombos:function(){var n=Ext.getCmp("uptimeReport");var v=Ext.getCmp("report_Type");if(!Ext.isEmpty(n)){var o=n.getValue();if(v.getValue()=="data"&&o=="Systems"){Ext.getCmp("runningDurationFilter").show();
}else{Ext.getCmp("runningDurationFilter").hide();}if(o=="Services"){if(isSettingsEnabled){var r=Ext.getCmp("showByPriority");if(!Ext.isEmpty(r)){r.hide();}var h=Ext.getCmp("includeMaintenanceCombo");if(!Ext.isEmpty(h)){h.hide();}var c=appConstants.publicJsonData;var e=c.screenLabels["reporter.uptime.Chart"];
var g=c["chartOptionJSONArray"];var b=Ext.getCmp("chartOptionsCombo");var s=new Array();if(g!=undefined){for(var p=0;p<g.length;p++){if(p==2){break;}s.push(g[p]);}}b.getStore().loadRawData(s);b.setValue(c.pageParams.er_show);b.setFieldLabel(e);var q=c["sortByJSONArray"];var f=Ext.getCmp("sortByCombo");
var m=c.screenLabels["reporter.comparison.Sort by"];var u=new Array();if(q!=undefined&&q.length==4){for(var p=0;p<q.length;p++){if(p==0||p==3){continue;}u.push(q[p]);}}f.getStore().loadRawData(u);f.setValue(c.pageParams.sortby);f.setFieldLabel(m);}}else{if(isSettingsEnabled){var r=Ext.getCmp("showByPriority");
if(!Ext.isEmpty(r)){r.show();}var h=Ext.getCmp("includeMaintenanceCombo");if(!Ext.isEmpty(h)){h.show();}var c=appConstants.publicJsonData;var e=c.screenLabels["reporter.uptime.Chart"];var g=c["chartOptionJSONArray"];var b=Ext.getCmp("chartOptionsCombo");b.getStore().loadRawData(g);b.setValue(c.pageParams.er_show);
b.setFieldLabel(e);var q=c["sortByJSONArray"];var f=Ext.getCmp("sortByCombo");var m=c.screenLabels["reporter.comparison.Sort by"];f.getStore().loadRawData(q);f.setValue(c.pageParams.sortby);f.setFieldLabel(m);}}}var i=Ext.getCmp("analyzeBy").getValue();var j=Ext.getCmp("compType");var l=Ext.getCmp("zone");
var d=Ext.getCmp("subzone");var t=Ext.getCmp("segment");var a=Ext.getCmp("service");if(i=="Component"){l.hide();d.hide();t.hide();a.hide();}else{if(i=="Zone"){l.show();d.show();t.hide();a.hide();}else{if(i=="Segment"){l.hide();d.hide();t.show();a.hide();}else{if(i=="Service"){l.hide();d.hide();t.hide();
a.show();}}}}this.formSubmit(j);},selectComponents:function(e){var d=e.getId();var h="";var a=Ext.getCmp("analyzeBy").getValue();var c=Ext.getCmp("uptimeReport").getValue();var g="";if(d=="compType"){var j=Ext.getCmp(d).getValue();g="er_uptimetest="+c+"&er_datafrom="+a+"&er_comptype="+j;if(a=="Zone"){var k=Ext.getCmp("zone").getValue();
var b=Ext.getCmp("subzone").getValue();g=g+"&er_site="+k+"&er_dataZone="+b;}else{if(a=="Segment"){var f=Ext.getCmp("segment").getValue();g=g+"&er_site="+f;}else{if(a=="Service"){var i=Ext.getCmp("service").getValue();g=g+"&er_site="+i;}}}}else{if(d=="zone"){var b=Ext.getCmp("subzone").getValue();var k=Ext.getCmp("zone").getValue();
g="er_uptimetest="+c+"&er_datafrom="+a+"&er_site="+k+"&er_dataZone="+b;}else{if(d=="segment"){var f=Ext.getCmp("segment").getValue();g="er_uptimetest="+c+"&er_datafrom="+a+"&er_site="+f;}else{if(d=="service"){var i=Ext.getCmp("service").getValue();g="er_uptimetest="+c+"&er_datafrom="+a+"&er_site="+i;
}}}}Ext.Ajax.request({url:"/final/reporter/ErUptimeReportDataJson.jsp",method:"post",async:true,params:g+"&OperationUptimeUIAction=loadComponents",scope:this,success:function(m){var r=m.responseText;var p=Ext.decode(r);if(d=="compType"){if(a=="Zone"){var l=p["compFilterJSON"];var o=Ext.getCmp("components");
o.getStore().loadRawData(l);}else{var n=Ext.getCmp("components");var l=p["compFilterJSON"];n.getStore().loadRawData(l);var q=p.pageParams["selectedComps"];n.setValue(q);}}else{if(d=="zone"){var l=p["vCompTypeJson"];var s=Ext.getCmp("compType");s.getStore().removeAll();s.getStore().loadRawData(l);s.setValue(p.pageParams.selectedCompType);
var n=Ext.getCmp("components");var l=p["compFilterJSON"];n.getStore().loadRawData(l);var q=p.pageParams["selectedComps"];n.setValue(q);}else{if(d=="segment"){var l=p["vCompTypeJson"];var s=Ext.getCmp("compType");s.getStore().removeAll();s.getStore().loadRawData(l);s.setValue(p.pageParams.selectedCompType);
var n=Ext.getCmp("components");var l=p["compFilterJSON"];n.getStore().loadRawData(l);var q=p.pageParams["selectedComps"];n.setValue(q);}else{if(d=="service"){var l=p["vCompTypeJson"];var s=Ext.getCmp("compType");s.getStore().removeAll();s.getStore().loadRawData(l);s.setValue(p.pageParams.selectedCompType);
var n=Ext.getCmp("components");var l=p["compFilterJSON"];n.getStore().loadRawData(l);var q=p.pageParams["selectedComps"];n.setValue(q);}}}}}});},insertTypeAndAll:function(b,a,d){var c=d.getStore();c.insert(0,{"displayField":b,"valueField":"-1"});if(c.getCount()>2){c.insert(c.getCount(),{"displayField":"All","valueField":"All"});
}},insertNotApplicable:function(b,c){var a=c.getStore();a.removeAll();a.insert(0,{"displayField":b,"valueField":b});if(c.getId()!="components"){c.setValue(b);}},showUptimeChartOptions:function(d){var b=d.getValue();var a=Ext.getCmp("sortByCombo");if(b!=null&&b=="Reboots"){if(sortByRebootJSONArray!=null){a.getStore().loadRawData(sortByRebootJSONArray);
a.setValue("6");}}else{var e=Ext.getCmp("uptimeReport");if(!Ext.isEmpty(e)){var c=e.getValue();if(c=="Services"){return;}}if(sortByJSONArray!=null){var a=Ext.getCmp("sortByCombo");a.getStore().loadRawData(sortByJSONArray);a.setValue("1");}}},getHiddenFieldValues:function(s){var c="";var P="";var L="";
var b="";var d="";var j="";var l="";var Q="";var O="";var h="";var C="";var g="";var w="";var t="";var a="";var k="";var z="";var J="";var i="";var v="";var e=appConstants.publicJsonData["hiddenParams"];var x=e["er_rtype"];var I=e["font"];var m=e["reporttype"];var o=e["er_trgttype"];var H=e["eruserid"];
var q=e["fromSchedule"];var M=e["schedule_id"];var f=e["er_ViewName"];var A=e["er_trenddata"];var E=e["inidate"];var D=e["userID"];var F=e["getMaxDaysInMonth"];var N=e["forwardto"];var B=e["er_bgreportfrom"];var p=e["bgenabled"];var r=e["limitforbg"];var y=e["savereport"];var K=e["servletName"];var G=e["divStatus"];
var u=e["er_usertimeline"];if(!Ext.isEmpty(x)){c=x;}if(!Ext.isEmpty(I)){P=I;}if(!Ext.isEmpty(m)){L=m;}if(!Ext.isEmpty(o)){b=o;}if(!Ext.isEmpty(H)){d=H;}if(!Ext.isEmpty(q)){j=q;}if(!Ext.isEmpty(M)){l=M;}if(!Ext.isEmpty(f)){Q=f;}if(!Ext.isEmpty(A)){O=A;}if(!Ext.isEmpty(E)){h=E;}if(!Ext.isEmpty(D)){C=D;
}if(!Ext.isEmpty(F)){g=F;}if(!Ext.isEmpty(N)){w=N;}if(!Ext.isEmpty(B)){t=B;}if(!Ext.isEmpty(p)){a=p;}if(!Ext.isEmpty(r)){k=r;}if(!Ext.isEmpty(y)){z=y;}if(!Ext.isEmpty(K)){J=K;}if(!Ext.isEmpty(G)){i=G;}if(!Ext.isEmpty(v)){v=u;}var n="";if(s){n="er_rtype="+c+"&font="+encodeURIComponent(P)+"&reporttype="+encodeURIComponent(L)+"&er_trgttype="+b+"&eruserid="+encodeURIComponent(d)+"&fromSchedule="+j+"&schedule_id="+encodeURIComponent(l)+"&er_ViewName="+encodeURIComponent(Q)+"&er_trenddata="+O+"&inidate="+encodeURIComponent(h)+"&userID="+encodeURIComponent(C)+"&getMaxDaysInMonth="+encodeURIComponent(g)+"&er_bgreportfrom="+t+"&bgenabled="+a+"&limitforbg="+encodeURIComponent(k)+"&savereport="+z+"&servletName="+encodeURIComponent(J)+"&divStatus="+i+"&er_usertimeline="+encodeURIComponent(v);
}else{n="er_rtype="+c+"&font="+P+"&reporttype="+L+"&er_trgttype="+b+"&eruserid="+d+"&fromSchedule="+j+"&schedule_id="+l+"&er_ViewName="+Q+"&er_trenddata="+O+"&inidate="+h+"&userID="+C+"&getMaxDaysInMonth="+g+"&er_bgreportfrom="+t+"&bgenabled="+a+"&limitforbg="+k+"&savereport="+z+"&servletName="+J+"&divStatus="+i+"&er_usertimeline="+v;
}return n;},getDecimalAlignFormat:function(a){if(true){return a;}if(!isNaN(a)&&!isNaN(parseFloat(a))){if(a!=null&&a.indexOf(".")>-1){strDecimal=a.substring(a.indexOf("."));str=a.substring(0,a.indexOf("."));a='<span class="decimal-align">'+str+'</span><span class="decimal-align2">'+strDecimal+"</span>";
}else{a='<span class="decimal-align">'+a+"</span>";}}else{if(a!=undefined&&a=="-"){a='<div style="text-align:center;">'+a+"</div>";}}return a;}});