FR.editSettings={};FR.editSettings.formPanel=new FR.components.editForm({title:"API Settings",layout:"form",autoScroll:true,defaults:{width:500},items:[{xtype:"displayfield",hideLabel:true,style:"color:var(--theme-textLighter);padding:13px",value:'<i class="fa fa-info-circle"></i> '+FR.T("The API is required by the mobile and desktop apps.")},{xtype:"fieldset",checkboxToggle:"settings[oauth2]",title:"Enable API",animCollapse:true,collapsed:!parseInt(FR.settings.oauth2),labelWidth:250,width:500,defaults:{width:300},listeners:{expand:function(){if(!this.layoutPatched){this.doLayout(false,true);this.layoutPatched=true}}},items:[{xtype:"checkbox",hideLabel:true,boxLabel:"Allow unsafe access over plain HTTP.",value:1,name:"settings[oauth2_allow_over_http]",checked:parseInt(FR.settings.oauth2_allow_over_http),helpText:"Enabling this puts your data at risk and should not be used during production."}]}],tbar:[{text:"Save changes",cls:"fr-btn-primary",ref:"saveBtn",handler:function(){var editForm=this.ownerCt.ownerCt;var params=editForm.form.getFieldValues();var extra={};extra["settings[oauth2]"]=Ext.get("settings[oauth2]").dom.checked?1:0;Ext.apply(params,extra);var opts={url:FR.URLRoot+"/?module=cpanel&section=settings&page=oauth&action=save",maskText:"Saving changes...",params:params};editForm.submitForm(opts)}}]});Ext.getCmp("appTab").add(FR.editSettings.formPanel);Ext.getCmp("appTab").doLayout();