HEX
Server: Apache/2.4.63 (Unix)
System: Linux Synopilou92 4.4.302+ #72806 SMP Mon Jul 21 23:16:00 CST 2025 x86_64
User: pilou92 (1026)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /volume1/@appstore/WebDAVServer/ui/webdavserver.js
/* Copyright (c) 2026 Synology Inc. All rights reserved. */

Ext.ns("SYNO.SDS.WebDAVServer");SYNO.SDS.WebDAVServer.APP_WIDTH=990;SYNO.SDS.WebDAVServer.APP_HEIGHT=560;SYNO.SDS.WebDAVServer.GetErrStr=function(a){var b="";switch(a){case 1001:b=SYNO.SDS.WebDAVServer._V("dav_common","get_cfg_failed");break;case 1002:b=SYNO.SDS.WebDAVServer._V("dav_common","set_cfg_failed");break;default:b=SYNO.SDS.WebDAVServer._V("error","error_unknown")}return b};SYNO.SDS.WebDAVServer._V=function(b,a){if(0===b.indexOf("dav_")||0===b.indexOf("webdav")||0===b.indexOf("app")){return _TT("SYNO.SDS.WebDAVServer.Instance",b,a)}else{return _T(b,a)}};SYNO.SDS.WebDAVServer.IsDSM7=(_S("majorversion")==="7");if(SYNO.API.Response!==undefined&&SYNO.API.Response.GetValByAPI!==undefined){SYNO.SDS.WebDAVServer.GetValByAPI=SYNO.API.Response.GetValByAPI}else{SYNO.SDS.WebDAVServer.GetValByAPI=SYNO.API.Util.GetValByAPI}if(SYNO.API.Response!==undefined&&SYNO.API.Response.GetFirstError!==undefined){SYNO.SDS.WebDAVServer.GetFirstError=SYNO.API.Response.GetFirstError}else{SYNO.SDS.WebDAVServer.GetFirstError=SYNO.API.Util.GetFirstError}if(SYNO.ux.AddTip!==undefined){SYNO.SDS.WebDAVServer.AddTip=SYNO.ux.AddTip}else{SYNO.SDS.WebDAVServer.AddTip=SYNO.SDS.Utils.AddTip}Ext.define("SYNO.SDS.WebDAVServer.GeneralSettingPanel",{extend:"SYNO.SDS.Utils.FormPanel",constructor:function(a){this.owner=a.appWin;this.module=a.module;var b=this.fillConfig(a);this.callParent([b]);this.on("afterlayout",function(d,e){var c;c=new SYNO.ux.Utils.EnableCheckGroup(this.getForm(),"enable_http",["http_port"]);var g;g=new SYNO.ux.Utils.EnableCheckGroup(this.getForm(),"enable_https",["https_port"]);var f;f=new SYNO.ux.Utils.EnableCheckGroup(this.getForm(),"enable_customized_max_connections",["max_connections"]);SYNO.SDS.WebDAVServer.AddTip(this.getForm().findField("max_connections").getEl(),SYNO.SDS.WebDAVServer._V("webdav","http_connections_hint"))},this,{single:this})},fillConfig:function(a){var b={autoScroll:false,trackresetonload:true,items:[this.createGeneralSetting(),this.createAdvancedSetting()]};var c=[{xtype:"syno_button",text:SYNO.SDS.WebDAVServer._V("common","reset"),handler:this.onReset,scope:this},{xtype:"syno_button",btnStyle:"blue",text:SYNO.SDS.WebDAVServer._V("common","commit"),handler:this.onSave,scope:this}];if(SYNO.SDS.WebDAVServer.IsDSM7){b.buttons=c}else{b.buttons=[c[1],c[0]]}Ext.apply(b,a);return b},createGeneralSetting:function(){var a={title:"HTTP/HTTPS",collapsible:true,items:[{xtype:"syno_checkbox",name:"enable_http",boxLabel:SYNO.SDS.WebDAVServer._V("dav_common","enable_http")},{xtype:"syno_numberfield",name:"http_port",fieldLabel:SYNO.SDS.WebDAVServer._V("dav_common","http_port"),allowBlank:false,allowDecimals:false,maxlength:5,indent:1,vtype:"port",validator:function(b){if(SYNO.SDS.Utils.isReservedPort("webdav",b,b)){return _T("service","error_dl_port_in_used")}else{return true}}},{xtype:"syno_checkbox",name:"enable_https",boxLabel:SYNO.SDS.WebDAVServer._V("dav_common","enable_https")},{xtype:"syno_numberfield",name:"https_port",fieldLabel:SYNO.SDS.WebDAVServer._V("dav_common","https_port"),allowBlank:false,allowDecimals:false,maxlength:5,indent:1,vtype:"port",validator:function(b){if(SYNO.SDS.Utils.isReservedPort("webdav",b,b)){return _T("service","error_dl_port_in_used")}else{return true}}},{xtype:"syno_displayfield",name:"tls_level_confirm_desc",hideLabel:true,htmlEncode:false,hidden:true,indent:0,value:'<span class="syno-ux-note">'+_T("common","note")+_T("common","colon")+" </span>"+String.format(SYNO.SDS.WebDAVServer._V("webdav","tls_level_confirm_desc"),SYNO.SDS.WebDAVServer._V("app","app_name"),_T("tls_profile","modern"),'<a id="'+Ext.id()+'" class="link-font" href="">'+_T("tls_profile","title")+"</a>",_T("tls_profile","intermediate")),listeners:{render:function(c){var b=c.el.first("a");if(b){this.mon(b,"click",function(d){d.preventDefault();SYNO.SDS.AppLaunch("SYNO.SDS.AdminCenter.Application",{fn:"SYNO.SDS.AdminCenter.Security.Main",tab:"AdvancedTab"})},this)}},scope:this,single:true,buffer:80}}]};return new SYNO.ux.FieldSet(a)},createAdvancedSetting:function(){var a={title:SYNO.SDS.WebDAVServer._V("dav_common","advanced_setting"),collapsible:true,items:[{xtype:"syno_checkbox",name:"enable_anonymous",boxLabel:SYNO.SDS.WebDAVServer._V("webdav","enable_anonymous")},{xtype:"syno_displayfield",indent:1,name:"anonymous_desc",value:SYNO.SDS.WebDAVServer._V("webdav","anonymous_desc")},{xtype:"syno_checkbox",name:"enable_depth_infinity",boxLabel:SYNO.SDS.WebDAVServer._V("webdav","enable_depth_infinity")},{xtype:"syno_checkbox",name:"enable_customized_max_connections",boxLabel:SYNO.SDS.WebDAVServer._V("webdav","enable_customized_max_http_connections")},{xtype:"syno_numberfield",name:"max_connections",fieldLabel:SYNO.SDS.WebDAVServer._V("webdav","http_connections"),allowBlank:false,allowDecimals:false,allowNegative:false,indent:1,maxlength:5,minValue:1,maxValue:20000},{xtype:"syno_checkbox",name:"enable_log",boxLabel:SYNO.SDS.WebDAVServer._V("webdav","enable_log")},{xtype:"syno_button",indent:1,name:"log_subtitle",id:this.logBtn=Ext.id(),text:_T("log","log_subtitle"),scope:this,handler:function(){var d="SYNO.SDS.LogCenter.Instance";var b="SYNO.SDS.LogCenter.BuiltIn";var c={logType:"fileTransfer",protocol:"webdavxfer"};if(SYNO.SDS.WebDAVServer.IsDSM7){SYNO.SDS.AppLaunch(b,c)}else{SYNO.SDS.AppLaunch(d,c)}}},SYNO.SDS.BandwidthControl.SchedulePanelConfig(this,"WebDAV")]};return new SYNO.ux.FieldSet(a)},getScheduleForm:function(){return this.getForm()},switchUIComp:function(b,d){var c=this.getForm().findField("enable_http").getValue()||this.getForm().findField("enable_https").getValue();var a=this.getForm().findField("enable_log").getValue();this.getForm().findField("enable_anonymous").setDisabled(!c);this.getForm().findField("anonymous_desc").setDisabled(!c);this.getForm().findField("enable_depth_infinity").setDisabled(!c);this.getForm().findField("enable_log").setDisabled(!c);this.getForm().findField("enable_customized_max_connections").setDisabled(!c);Ext.getCmp(this.logBtn).setDisabled(!c||!a);this.bandwidthSettingEnable(c)},onPageActivate:function(){if(_S("is_admin")){this.mon(this.getForm().findField("enable_http"),"check",this.switchUIComp,this);this.mon(this.getForm().findField("enable_https"),"check",this.switchUIComp,this);this.mon(this.getForm().findField("enable_log"),"check",this.switchUIComp,this);this.loadForm()}},setFieldValue:function(b,a){b.setValue(a);b.originalValue=a},getInfoCallback:function(f,d,c){this.clearStatusBusy();if(!f){this.owner.getMsgBox().alert(SYNO.SDS.WebDAVServer._V("app","app_name"),SYNO.SDS.WebDAVServer.GetErrStr(d.code));return}var e=SYNO.SDS.WebDAVServer.GetValByAPI(d,"SYNO.WebDAV.Common","get");this.getForm().setValues(e);e=SYNO.SDS.WebDAVServer.GetValByAPI(d,"SYNO.Core.SyslogClient.FileTransfer","get");var b=e.webdav;this.setFieldValue(this.getForm().findField("enable_log"),b);Ext.getCmp(this.logBtn).setDisabled(!b);e=SYNO.SDS.WebDAVServer.GetValByAPI(d,"SYNO.Core.BandwidthControl.Protocol","get");d.result[2].data=SYNO.SDS.BandwidthControl.reConstructApiKey("get","WebDAV",e);this.getForm().loadRecords([d.result[2]],[c.compound[2]]);this.bandwidthPolicy=e.policy;if(SYNO.SDS.WebDAVServer.IsDSM7){e=SYNO.SDS.WebDAVServer.GetValByAPI(d,"SYNO.Core.Web.Security.TLSProfile","get");if(e&&e.services&&e.services.synowebdavserver_httpd){var a=e.services.synowebdavserver_httpd["current-level"]===1||(e["default-level"]===1&&e.services.synowebdavserver_httpd["current-level"]===0);if(a){this.getForm().findField("tls_level_confirm_desc").show()}else{this.getForm().findField("tls_level_confirm_desc").hide()}}}this.switchUIComp()},loadForm:function(){this.setStatusBusy();this.getInfoArray=[{api:"SYNO.WebDAV.Common",version:1,method:"get"},{api:"SYNO.Core.SyslogClient.FileTransfer",version:1,method:"get"},{api:"SYNO.Core.BandwidthControl.Protocol",version:1,method:"get",params:{protocol:"WebDAV"}}];if(SYNO.SDS.WebDAVServer.IsDSM7){var a=this.getKnownAPI("SYNO.Core.Web.Security.TLSProfile").minVersion;this.getInfoArray.push({api:"SYNO.Core.Web.Security.TLSProfile",version:a,method:"get"})}this.sendWebAPI({params:{},scope:this,compound:{stopwhenerror:false,params:this.getInfoArray},callback:this.getInfoCallback})},isPortsValid:function(){var a=this.getForm().getValues();if((a.http_port===a.https_port)&&(undefined!==a.http_port)){this.getForm().findField("https_port").markInvalid(SYNO.SDS.WebDAVServer._V("dav_common","err_http_https_same_port"));return false}return true},onSave:function(){if(_S("is_admin")){if(!this.checkDirty()){this.setStatusError({text:SYNO.SDS.WebDAVServer._V("error","nochange_subject"),clear:true});return}if(!this.getForm().isValid()||!this.isPortsValid()){this.setStatusError({text:SYNO.SDS.WebDAVServer._V("common","forminvalid"),clear:true});return}this.applyForm()}},checkDirty:function(){var b=false;var a=this.getForm().getValues();this.params={};if(this.getForm().findField("enable_http").isDirty()){b=true;this.params.enable_http=a.enable_http}if(this.getForm().findField("enable_https").isDirty()){b=true;this.params.enable_https=a.enable_https}if(this.getForm().findField("http_port").isDirty()){b=true;this.params.http_port=a.http_port}if(this.getForm().findField("https_port").isDirty()){b=true;this.params.https_port=a.https_port}if(this.getForm().findField("enable_anonymous").isDirty()){b=true;this.params.enable_anonymous=a.enable_anonymous}if(this.getForm().findField("enable_depth_infinity").isDirty()){b=true;this.params.enable_depth_infinity=a.enable_depth_infinity}if(this.getForm().findField("enable_log").isDirty()){b=true;this.params.enable_log=a.enable_log}if(this.getForm().findField("enable_customized_max_connections").isDirty()){b=true;this.params.enable_customized_max_connections=a.enable_customized_max_connections}if(this.getForm().findField("max_connections").isDirty()){b=true;this.params.max_connections=a.max_connections}this.bandwidthChanged=false;if((this.bandwidthPolicy!==this.getForm().findField("WebDAV_policy").getGroupValue())||(this.getForm().findField("WebDAV_schedule_plan").isDirty())){b=true;this.bandwidthChanged=true}return b},setInfoCallback:function(a,d,e,b){this.clearStatusBusy();if(a&&!d.has_fail){if(this.saveResolve){this.saveResolve()}else{this.loadForm()}}else{if(this.saveReject){this.saveReject()}var c=SYNO.SDS.WebDAVServer.GetValByAPI(d,"SYNO.WebDAV.Common","set");if(!Ext.isEmpty(c)&&1701===c.code){this.owner.getMsgBox().alert(SYNO.SDS.WebDAVServer._V("app","app_name"),_T("error","error_port_conflict"))}else{this.owner.getMsgBox().alert(SYNO.SDS.WebDAVServer._V("app","app_name"),SYNO.SDS.WebDAVServer._V("dav_common","set_cfg_failed"))}}},applyForm:function(){this.setStatusBusy({text:SYNO.SDS.WebDAVServer._V("common","saving")});var a=[{api:"SYNO.WebDAV.Common",version:1,method:"set",params:this.params}];if(undefined!==this.params.enable_log){a.push({api:"SYNO.Core.SyslogClient.FileTransfer",version:1,method:"set",params:{webdav:this.params.enable_log}})}if(this.bandwidthChanged){a.push({api:"SYNO.Core.BandwidthControl.Protocol",version:1,method:"set",params:{protocol:"WebDAV",policy:this.getForm().findField("WebDAV_policy").getGroupValue(),schedule_plan:this.getForm().findField("WebDAV_schedule_plan").getValue()}})}this.sendWebAPI({params:{},scope:this,compound:{stopwhenerror:false,params:a},callback:this.setInfoCallback})},onReset:function(){this.getForm().reset()},onPageDeactivate:function(){if(_S("is_admin")&&this.checkDirty()){return false}},onPageConfirmLostChangeSave:function(){var a=this;return new Promise(function(c,b){a.saveResolve=c;a.saveReject=b;a.applyForm()})}});Ext.define("SYNO.SDS.WebDAVServer.CalendarListPanel",{extend:"SYNO.ux.GridPanel",constructor:function(b){this.owner=b.module.owner;this.btntask=new Ext.util.DelayedTask(this.checkState,this);this.IpAddr=this.getDsmHost();if(undefined===this.IpAddr){this.IpAddr=window.location.hostname}Ext.apply(this,b||{});this.createActions();var d=[this.getAction("del")];var c=new SYNO.ux.Toolbar({defaultType:"syno_button",items:d,style:{border:"none"}});var a=this.getStore();b={store:a,loadMask:true,stripeRows:true,autoExpandColumn:"destination",border:false,sm:new Ext.grid.RowSelectionModel({singleSelect:false,listeners:{scope:this,selectionchange:function(){this.btntask.delay(100)}}}),enableHdMenu:false,colModel:new Ext.grid.ColumnModel({columns:[{id:"calendarname",header:_T("service","calendar_name"),dataIndex:"calendarname",width:135},{id:"destination",header:_T("service","calendar_location"),dataIndex:"destination",renderer:function(j,g,i,f,h,e){j="<span>";j+=i.data.destination+"/"+i.data.calendarname+"</span>";return j}.createDelegate(this)},{id:"status",header:_T("download","download_list_status"),dataIndex:"status",width:100,renderer:function(l,i,k,h,j,g){var f;var e;l='<span ext:qtip="{0}" class="{1}">{2}</span>';if("normal"===k.data.status){e=_T("service","status_normal");f="normal-font"}else{f="red-status";if("noexist"===k.data.status){e=_T("service","calendar_broken")}else{e=_T("service","calendar_crashed")}}l=String.format(l,e,f,e);return l}}]}),listeners:{scope:this,beforedestroy:function(){this.btntask.cancel()},rowcontextmenu:this.onRowCtxMenu,containercontextmenu:this.showCtxMenu},tbar:c,bbar:this.getBottomToolBar()};this.callParent([b]);this.defineBehaviors()},getBottomToolBar:function(){var a=SYNO.SDS.WebDAVServer._V("webdav","calendar_migrate_desc");var b=a.indexOf("\uFF1A");if(b===-1){b=a.indexOf(":")}var c='<font class="red-status">'+a.slice(0,b+1)+"</font>"+a.slice(b+1);return this.bbar||new Ext.Container({items:[new SYNO.ux.PageLessToolbar({store:this.getStore(),displayInfo:true}),new SYNO.ux.DisplayField({htmlEncode:false,value:c,style:{"margin-top":"6px"}})]})},getStore:function(){this.store=this.store||new SYNO.API.JsonStore({appWindow:this.findAppWindow()||false,api:"SYNO.WebDAV.CalDAV.Calendar",method:"list",version:1,root:"item",fields:["id","calendarname","destination","share","status"],autoLoad:false,listeners:{load:this.checkState,scope:this}});return this.store},defineBehaviors:function(){var a=this.getTopToolbar();this.btnDelete=a.getComponent("delete");this.btnEdit=a.getComponent("edit")},getSelectedRecords:function(){var a=this.getSelectionModel();return a.getSelections()},deleteHandler:function(){var b=this.getSelectedRecords();var c;if(b.length<=5){c=_T("service","delete_check_calendar")+'<br><font class="red-status">'+_T("service","delete_check_calendar_note")+"</font>";for(var a=0;a<b.length;a++){c+="<br/>"+Ext.util.Format.htmlEncode(b[a].data.calendarname)}}else{c=String.format(SYNO.SDS.WebDAVServer._V("dav_common","delete_check_calendar_count"),b.length)+'<br><font class="red-status">'+_T("service","delete_check_calendar_note")+"</font>"}this.module.findAppWindow().getMsgBox().confirmDelete(_T("service","calendar_list"),c,this.deleteBtnCB,this);return},deleteBtnCB:function(b){var c=this.getSelectedRecords();var d=[];if("yes"!=b){return}if(0>=c.length){return}for(var a=0;a<c.length;a++){d.push(c[a].id)}this.module.getEl().mask();this.sendWebAPI({api:"SYNO.WebDAV.CalDAV.Calendar",version:1,method:"delete",params:{id:d},scope:this,callback:this.onDeleteDone})},onDeleteDone:function(c,b,a){if(this.module.getEl().isMasked()){this.module.getEl().unmask()}if(!c){this.errorHandling(b);return}this.module.loadCalendar()},errorHandling:function(c){var b=SYNO.SDS.WebDAVServer.GetFirstError(c);var a=_T("common","commfail");if(SYNO.API.Erros.core[b.code]){a=SYNO.API.Erros.core[b.code]}this.module.findAppWindow().getMsgBox().alert(_T("tree","leaf_downloadtask"),a)},createActions:function(){var a=function(e,d,c,b){return new Ext.Action(Ext.apply({text:e,scope:c,handler:d},b))};this.actions={del:a(_T("common","delete"),this.deleteHandler,this)};return this.actions},getAction:function(a){if(a in this.actions){return this.actions[a]}else{SYNO.Debug("no this action: "+a);return undefined}},enableAction:function(a,b){var c=this.getAction(a);if(c){c[b?"enable":"disable"]()}},checkState:function(){var a=this.getSelectionModel().getCount();this.enableAction("del",0<a);if(this._S("demo_mode")){this.enableAction("del",false)}},initCtxMenu:function(){this.gridCtxMenu=new SYNO.ux.Menu({autoDestroy:true,items:[this.getAction("del")]})},getCtxMenu:function(){if(!this.gridCtxMenu){this.initCtxMenu()}this.checkState();return this.gridCtxMenu},showCtxMenu:function(b,a){var c=this.getCtxMenu();c.showAt(a.getXY())},onRowCtxMenu:function(b,d,a){var c=b.getSelectionModel();if(!c.isSelected(d)){c.selectRow(d)}this.showCtxMenu(b,a)},loadGridData:function(a){this.getStore().loadData(a)}});Ext.define("SYNO.SDS.WebDAVServer.CalendarEmptyMessagePanel",{extend:"SYNO.ux.Panel",constructor:function(a){a=a||{};var b=[];if(SYNO.SDS.WebDAVServer.IsDSM7){b.push({xtype:"syno_displayfield",htmlEncode:false,itemId:"empty_msg",value:['<div class="syno-dataview">','<div class="empty-text-wrap">','<div class="empty-text-inner-wrap">','<div class="empty-text-icon"></div>','<div class="empty-text">',String.format(SYNO.SDS.WebDAVServer._V("webdav","get_synology_calendar_desc"),'<a id="'+Ext.id()+'" class="link-font" href="#">Synology Calendar</a>'),"</div>","</div>","</div>","</div>"].join("")})}var c={layout:"fit",items:b,listeners:{afterlayout:this.handleLinkToSynologyCalendar}};Ext.apply(c,a);this.callParent([c])},handleLinkToSynologyCalendar:function(){if(SYNO.SDS.WebDAVServer.IsDSM7){this.addLinkToDisplayField()}else{this.showAndAddLinkToMaskInfo()}},showAndAddLinkToMaskInfo:function(){var b=this.getEl();if(!Ext.isDefined(b)){return}var d=String.format(SYNO.SDS.WebDAVServer._V("webdav","get_synology_calendar_desc"),'<a id="'+Ext.id()+'" class="link-font" href="#">Synology Calendar</a>');b.mask(d,"syno-ux-mask-info");var a=Ext.Element.data(b.id,"maskMsg");var c=Ext.get(a.query("a")[0]);this._linkSynologyCalendarToEl(c)},addLinkToDisplayField:function(){var b=this.getComponent("empty_msg");if(!Ext.isDefined(b)){return}var a=Ext.get(b.getEl().query("a")[0]);this._linkSynologyCalendarToEl(a)},_linkSynologyCalendarToEl:function(a){if(!a){return}a.on("click",function(c){c.preventDefault();var b="SYNO.Cal.Application";if(SYNO.SDS.AppUtil.isValidApp(b)){SYNO.SDS.AppLaunch(b)}else{SYNO.SDS.AppLaunch("SYNO.SDS.PkgManApp.Instance",{action:"open",packages:["Calendar"]})}},this)}});Ext.define("SYNO.SDS.WebDAVServer.CalendarSettingPanel",{extend:"SYNO.ux.Panel",constructor:function(a){this.owner=a.appWin;this.module=a.module;this.caldavSettingCardPanel=new SYNO.SDS.WebDAVServer.CalDAVSettingCardPanel({});var b=this.fillConfig(a);this.callParent([b])},fillConfig:function(a){var b={trackresetonload:true,layout:"fit",items:[this.caldavSettingCardPanel]};Ext.apply(b,a);return b},onPageActivate:function(){this.caldavSettingCardPanel.loadCalendar()}});Ext.define("SYNO.SDS.WebDAVServer.CalDAVSettingCardPanel",{extend:"SYNO.ux.Panel",constructor:function(a){a=a||{};this.calendarListPanel=new SYNO.SDS.WebDAVServer.CalendarListPanel({itemId:"calendarListPanel",module:this});this.calendarEmptyMessagePanel=new SYNO.SDS.WebDAVServer.CalendarEmptyMessagePanel({itemId:"calendarEmptyMessagePanel"});var b=[this.calendarListPanel,this.calendarEmptyMessagePanel];var c={layout:"card",border:false,items:b};Ext.apply(c,a);this.callParent([c])},loadCalendar:function(){this.sendWebAPI({api:"SYNO.WebDAV.CalDAV.Calendar",method:"list",version:1,scope:this,callback:this.handleCalendarResponse})},handleCalendarResponse:function(b,a){if(!b||a.item&&a.item.length===0){this.switchTocalendarEmptyMessagePanel()}else{this.switchToCalendarListPanel();this.calendarListPanel.loadGridData(a)}},switchToCalendarListPanel:function(){if(!this.layout.activeItem||this.layout.activeItem.itemId==="calendarEmptyMessagePanel"){this.layout.setActiveItem("calendarListPanel");this.calendarListPanel.doLayout()}},switchTocalendarEmptyMessagePanel:function(){if(!this.layout.activeItem||this.layout.activeItem.itemId==="calendarListPanel"){this.layout.setActiveItem("calendarEmptyMessagePanel")}}});Ext.define("SYNO.SDS.WebDAVServer.Instance",{extend:"SYNO.SDS.AppInstance",appWindowName:"SYNO.SDS.WebDAVServer.WebDAVServerMainWindow"});Ext.define("SYNO.SDS.WebDAVServer.WebDAVServerMainWindow",{extend:"SYNO.SDS.PageListAppWindow",width:SYNO.SDS.WebDAVServer.APP_WIDTH,height:SYNO.SDS.WebDAVServer.APP_HEIGHT,activePage:"SYNO.SDS.WebDAVServer.GeneralSettingPanel",constructor:function(a){var b=[{iconCls:"icon-setting",text:SYNO.SDS.WebDAVServer._V("dav_common","setting"),fn:"SYNO.SDS.WebDAVServer.GeneralSettingPanel",help:""},{iconCls:"icon-calendar",text:SYNO.SDS.WebDAVServer._V("dav_common","calendar"),fn:"SYNO.SDS.WebDAVServer.CalendarSettingPanel",help:""}];var c={cls:"syno-app-webdavserver",width:SYNO.SDS.WebDAVServer.APP_WIDTH,height:SYNO.SDS.WebDAVServer.APP_HEIGHT,minWidth:SYNO.SDS.WebDAVServer.APP_WIDTH,minHeight:SYNO.SDS.WebDAVServer.APP_HEIGHT,listItems:b};Ext.apply(c,a);this.callParent([c])},onOpen:function(a){this.callParent(a);if(_S("is_admin")){this.caldavPanel=this.getPageList().getRootNode().childNodes[1];this.load()}else{this.getMsgBox().alert(SYNO.SDS.WebDAVServer._V("app","app_name"),SYNO.SDS.WebDAVServer._V("error","error_privilege_not_enough"),this.close,this)}},load:function(){this.setStatusBusy({text:_T("common","loading")});this.sendWebAPI({api:"SYNO.WebDAV.CalDAV.Calendar",method:"list",version:1,scope:this,callback:this.loadListData})},loadListData:function(d,c,b){this.clearStatusBusy();if(c.item.length!==0&&SYNO.SDS.UserSettings.getProperty("SYNO.SDS.WebDAVServer.Instance","notShowCalendarEolConfirmDialog")!==true){var a=new SYNO.SDS.WebDAVServer.CalDAVEolConfirmDialog({owner:this});a.open()}}});Ext.define("SYNO.SDS.WebDAVServer.CalDAVEolConfirmDialog",{extend:"SYNO.SDS.ModalWindow",constructor:function(a){this.owner=a.owner;this.form=this.createFormPanel();var b=this.fillConfig();this.callParent([b])},createFormPanel:function(){var a=new SYNO.SDS.Utils.FormPanel({border:false,trackResetOnLoad:true,padding:"0px",items:[{xtype:"syno_displayfield",hideLabel:true,htmlEncode:false,value:SYNO.SDS.WebDAVServer._V("webdav","calendar_eol_desc")},{xtype:"syno_checkbox",boxLabel:_T("common","dont_alert_again"),name:"dont_alert_again"}]});return a},fillConfig:function(){var a={height:230,width:450,resizable:false,modal:false,title:SYNO.SDS.WebDAVServer._V("app","app_name"),layout:"fit",items:[this.form],buttons:[{xtype:"syno_button",btnStyle:"blue",text:_T("common","apply"),handler:this.closeHandler,scope:this}]};return a},closeHandler:function(){if(this.form.getForm().findField("dont_alert_again").getValue()===true){SYNO.SDS.UserSettings.setProperty("SYNO.SDS.WebDAVServer.Instance","notShowCalendarEolConfirmDialog",true)}this.close()}});