Ext.define("citrixDashboard.model.SelectData",{extend:"Ext.data.Model",fields:["name","value"]});Ext.define("citrixDashboard.view.ConfigWindow",{extend:"Ext.window.Window",requires:["Ext.form.Panel","Ext.form.RadioGroup","Ext.form.field.Radio","Ext.form.field.Text"],alias:"widget.configwindow",autoDestroy:true,header:false,flotable:false,floating:false,resizable:false,ui:"configOuterContainer",layout:"fit",modal:false,refresher:true,refreshurl:null,controllername:null,resizable:false,dockedItems:[{dock:"bottom",xtype:"toolbar",buttonAlign:"center",layout:{type:"hbox",align:"stretch",pack:"center"},style:(!Ext.isEmpty(strRumSkin)&&strRumSkin=="Dark")?"border-top:1px solid #777 !important":"border-top:1px solid #e1e1e1 !important",ui:"footer",cls:"toolbarPositionManual",items:[{xtype:"button",text:"Add",action:"submit",margin:"5 0 0 0",padding:"1 15 1 15",cls:"quickMenuWhiteButton",}]}],defaults:{margin:"6 8 6 8"},jsonData:null,setData:function(n,o,f,d,m,k,l,h,c,b,e){var a;
var p="";var q="componentsList";var g={};if(n==""){a="/final/monitor/seviceDashboardConfig.jsp?selectedTab=System&perform=Add&descMeasureUnit=No&testfun=Sum&titleText=System";}else{a="/final/monitor/seviceDashboardConfig.jsp?";if(n!=""){g["selectedTab"]=n;}if(o!=""){g["perform"]=o;}if(f!=""){g["serviceComp"]=f;
}if(d!=""){g["compLayer"]=d;}if(m!=""){g["testName"]=m;}if(k!=""){g["measureName"]=k;}if(h!=null&&h!=""){g["testfun"]=h;}else{g["testfun"]="Avg";}if(b!=""){g["onchange"]=b;}if(c!=""){g["serviceDispName"]=c;}if(q!=""){g["titleText"]=q;}}Ext.Ajax.request({url:a,method:"GET",params:g,scope:this,success:function(u){var s=u.responseText;
var y=Ext.decode(s);this.jsonData=y;if(!Ext.isEmpty(this.getEl())){this.getEl().mask("Loading...");}if(!Ext.isEmpty(y)){var w=y.Window;this.setTitle(w.title);var v=y.Window.fields;var r=Ext.create("Ext.form.Panel",{layout:"column",defaults:{labelWidth:220,labelSeparator:" "}});for(i=0;i<v.length;i++){var A=false;
if(v[i].label!=null&&v[i].label=="Tabs"){A=true;}switch(v[i].type){case"radio":r.add({xtype:"radiogroup",fieldLabel:v[i].label,name:v[i].label,cls:"radiobt",margin:"5 10 5 5",columns:4,items:this.radioresponse(v,i),hidden:A});break;case"textfield":r.add({xtype:"textfield",maxLength:35,enforceMaxLength:true,name:v[i].name,fieldLabel:v[i].label,value:v[i].value,cls:"textbox",padding:"5 10 5 5",labelAlign:"top",width:215});
break;case"combo":var t=v[i].name;if(t=="serviceTest"){p=v[i].selected;}var x=y.Window.screenlabels[0];if(!Ext.isEmpty(v[i].items)){v[i].items.splice(0,0,{value:-1,name:x[t]});}else{v[i].items=new Array();v[i].items.splice(0,0,{value:-1,name:x[t]});}var z=Ext.create("Ext.data.Store",{model:"citrixDashboard.model.SelectData",proxy:{type:"memory",reader:{type:"json",root:"items"}},data:v[i]});
r.add({xtype:"combo",store:z,emptyText:v[i].selected,fieldLabel:v[i].label,name:v[i].name,id:v[i].name,padding:"5 10 5 5",labelAlign:"top",editable:false,width:215,displayField:"name",valueField:"value",cls:"dropdown",value:-1});}}this.removeAll();this.add(r);if(!Ext.isEmpty(f)){r.getForm().findField("serviceComp").setValue(f);
}if(o=="Add"||Ext.isEmpty(o)){if(!Ext.isEmpty(d)){r.getForm().findField("compLayer").setValue(d);}this.down("toolbar").items.items[0].setText(y.Window.screenlabels[0].AddButtonText);}else{if(!Ext.isEmpty(o)&&o=="Delete"){this.down("toolbar").items.items[0].setText(y.Window.screenlabels[0].DeleteButtonText);
}else{if(!Ext.isEmpty(o)&&o=="Modify"){this.down("toolbar").items.items[0].setText(y.Window.screenlabels[0].ModifyButtonText);}}}if(!Ext.isEmpty(m)){if(p!=null&&p!=undefined&&p!="-1"&&m==p){r.getForm().findField("serviceTest").setValue(m);}else{if(p!=null&&p=="-1"){r.getForm().findField("serviceTest").setValue(p);
}else{r.getForm().findField("serviceTest").setValue(m);}}}if(!Ext.isEmpty(k)){r.getForm().findField("serviceMeasure").setValue(k);}}if(!Ext.isEmpty(this.getEl())){this.getEl().unmask();}},failure:function(r,s){}});},radioresponse:function(c,d){var b=new Array();for(j=0;j<c[d].items.length;j++){var a=false;
if(c[d].selected==(c[d].items[j].label)){a=true;}b[j]={boxLabel:c[d].items[j].label,name:c[d].name,inputValue:c[d].items[j].label,checked:a,padding:0,margin:0,width:60};}return b;}});