/* Copyright (c) 2019 Synology Inc. All rights reserved. */

Ext.ns("SYNO.PhotoStation.CMS");Ext.define("SYNO.PhotoStation.CMS.Panel",{extend:"SYNO.ux.FormPanel",constructor:function(a){this.callParent([this.fillConfig(a||{})])},fillConfig:function(b){var a={cls:"img-setting-panel",layout:"form",border:false,buttonAlign:"right",footer:true,renderTo:document.body,autoFlexcroll:false,width:500,height:184,padding:20,buttons:[{xtype:"syno_button",text:"OK",btnStyle:"blue",scope:this,handler:function(){var c=this.getForm();if(!c.isValid()){return}window.Settings.callback(c.getValues())}},{xtype:"syno_button",btnStyle:"gary",text:"Cancel",handler:function(){window.Settings.callback()}}],items:[{xtype:"syno_textfield",itemCls:"img-setting-host-field",fieldLabel:"Synology NAS",name:"host",value:window.Settings.host,allowBlank:false,width:280,height:28},{xtype:"syno_radiogroup",itemCls:"img-setting-protocol-field",hideLabel:false,fieldLabel:"Protocol",items:[{type:"syno_radio",height:28,boxLabel:"http",name:"protocol",inputValue:"http",checked:"http"===window.Settings.protocol},{type:"syno_radio",height:28,boxLabel:"https",name:"protocol",inputValue:"https",checked:"https"===window.Settings.protocol}]}]};return a}});Ext.onReady(function(){var a;Ext.fly(document.body).addClass("sds-window-v5");a=new SYNO.PhotoStation.CMS.Panel();a.show()});window.Settings={host:window.location.host,protocol:window.location.protocol.replace(":","")};function init(a,b){if(!Ext.isObject(a)){return}if(!Ext.isEmpty(a.host)){window.Settings.host=a.host}if(!Ext.isEmpty(a.protocol)){window.Settings.protocol=a.protocol}window.Settings.callback=b};