| Server IP : 193.86.120.172 / Your IP : 216.73.216.67 Web Server : Apache/2.4.63 (Unix) System : Linux JServices 3.10.108 #86003 SMP Wed Oct 22 13:20:46 CST 2025 x86_64 User : kubec ( 1026) PHP Version : 8.2.28 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /volume1/@appstore/HyperBackupVault/ui/ |
Upload File : |
/* Copyright (c) 2026 Synology Inc. All rights reserved. */
Ext.ns("SYNO.SDS.Backup.Server.Explore.Utils"),Ext.apply(SYNO.SDS.Backup.Server.Explore.Utils,{isTarget:function(e,t){var i=e.split(".");if(1===i.length)return!1;var s=i[i.length-1].toLowerCase();if(t){if("hbk"!==s)return!1}else if("bkpi"!==s)return!1;return!0},isThisPkgNewer:function(){if(!SYNO.SDS.StatusNotifier.isAppEnabled("SYNO.SDS.BackupService.Instance"))return!1;if(!SYNO.SDS.StatusNotifier.isAppEnabled("SYNO.SDS.Backup.Application"))return!0;var e=0,t=SYNO.SDS.Backup.Server.Explore.AppInstance.prototype.version;return SYNO.SDS.Backup.Client&&SYNO.SDS.Backup.Client.Explore&&(e=SYNO.SDS.Backup.Client.Explore.AppInstance.prototype.version),!(e>t)},checkFn_v1:function(e,t){return"6"===_S("majorversion")&&"0"===_S("minorversion")&&!!SYNO.SDS.Backup.Server.Explore.Utils.checkFn(e,t)},checkFn:function(e,t){return!!_S("is_admin")&&(!!SYNO.SDS.Backup.Server.Explore.Utils.isThisPkgNewer()&&!!SYNO.SDS.Backup.Server.Explore.Utils.isTarget(t[0].get("filename"),t[0].get("isdir")))},launchFn:function(e){SYNO.SDS.AppLaunch("SYNO.SDS.Backup.Server.Explore.AppInstance",{fb_recs:e,launcher:"FileStation",backend:"HyperBackupVault-backend"})},getIconFn:function(e,t,i){return!!SYNO.SDS.Backup.Server.Explore.Utils.isThisPkgNewer()&&(!!SYNO.SDS.Backup.Server.Explore.Utils.isTarget(t.get("filename"),t.get("isdir"))&&(SYNO.SDS.UIFeatures.test("isRetina")?t.get("isdir")?"webman/3rdparty/HyperBackupVault/images/2x/target_icon.png":"webman/3rdparty/HyperBackupVault/images/files_ext/bkpi_32.png":t.get("isdir")?"webman/3rdparty/HyperBackupVault/images/1x/target_icon.png":"webman/3rdparty/HyperBackupVault/images/files_ext/bkpi_16.png"))},checkThumbnailFn:function(e){return!!SYNO.SDS.Backup.Server.Explore.Utils.isThisPkgNewer()&&!!SYNO.SDS.Backup.Server.Explore.Utils.isTarget(e.filename,e.isdir)},getThumbnailFn:function(e){var t=Ext.decode(e.path).split("."),i=!1;return"bkpi"===t[t.length-1].toLowerCase()&&(i=!0),SYNO.SDS.UIFeatures.test("isRetina")?i?"webman/3rdparty/HyperBackupVault/images/files_ext/bkpi_512.png":"webman/3rdparty/HyperBackupVault/images/2x/target_thumb.png":i?"webman/3rdparty/HyperBackupVault/images/files_ext/bkpi_256.png":"webman/3rdparty/HyperBackupVault/images/1x/target_thumb.png"},GetErrorString:function(e,t){return SYNO.SDS.BackupServer.GetErrorString?SYNO.SDS.BackupServer.GetErrorString(e,t):""},GetErrorStringEx:function(e){return SYNO.SDS.BackupServer.GetErrorStringEx?SYNO.SDS.BackupServer.GetErrorStringEx(e):""},GetString:function(e,t){return SYNO.SDS.BackupServer.String?SYNO.SDS.BackupServer.String(e,t):""},GetJobTrayCls:function(){return"syno-sds-backup-server-jobtray"}}),Ext.ns("SYNO.SDS.Backup.Explore"),SYNO.SDS.Backup.Explore.ConverSize=function(e,t){e=e||0,t=t||0;var i=1024,s=1048576,a=1073741824,n=1099511627776,r=parseFloat(e);return isNaN(r)?e:(e=r)>=0&&e<i?e.toFixed(t)+" B":e>=i&&e<s?(e/i).toFixed(t)+" KB":e>=s&&e<a?(e/s).toFixed(t)+" MB":e>=a&&e<n?(e/a).toFixed(t)+" GB":(e/n).toFixed(t)+" TB"},SYNO.SDS.Backup.Explore.htmlEncodeTip=function(e){var t=Ext.util.Format.htmlEncode(e);return Ext.util.Format.htmlEncode(t)},SYNO.SDS.Backup.Explore.lengthEllipsis=function(e,t,i){return'<span ext:qtip="'+SYNO.SDS.Backup.Explore.htmlEncodeTip(e)+'">'+Ext.util.Format.ellipsis(Ext.util.Format.htmlEncode(e),t,i)+"</span>"},SYNO.SDS.Backup.Explore.widthEllipsis=function(e,t){return'<span ext:qtip="'+SYNO.SDS.Backup.Explore.htmlEncodeTip(e)+'" style="overflow: hidden; text-overflow: ellipsis; display: block; white-space: nowrap; width: '+t+'px">'+Ext.util.Format.htmlEncode(e)+"</span>"},SYNO.SDS.Backup.Explore.DateTimeFormatter=SYNO.SDS.DateTimeFormatter||function(e,t){if(!e||"[object Date]"!==Object.prototype.toString.call(e))return"";var i,s=t&&t.type;return i="date"===s?"Y-m-d":"time"===s?"H:i":"datetimesec"===s?"Y-m-d H:i:s":"datetimesecms"===s?"Y-m-d H:i:s.u":"timesec"===s?"H:i:s":"timesecms"===s?"H:i:s.u":"Y-m-d H:i",e.format(i)},SYNO.SDS.Backup.Explore.ClearTreeNodeLoadingState=function(e){e.loading=!1},Ext.define("SYNO.SDS.Backup.Server.Explore.ShareDecyptDialog",{extend:"SYNO.SDS.ModalWindow",constructor:function(e){this.owner=e.owner,this.uploadParams=e.uploadParams,this.confirmResolve=Ext.emptyFn;var t=this.fillConfig(e);this.callParent([t]),this.panel=this.getComponent("formpanel"),this.DefineBehaviors()},fillConfig:function(e){var t=new SYNO.SDS.Utils.FormPanel({itemId:"formpanel",trackResetOnLoad:!0,fileUpload:!0,items:[{xtype:"container",layout:"column",hideLabel:!0,items:[{xtype:"syno_radio",name:"decrypt_method",width:200,inputValue:"manual",boxLabel:_T("share","share_encryption_keyinput")+_T("common","colon"),checked:!0},{xtype:"syno_textfield",textType:"password",name:"passwd",maxLength:64,allowBlank:!1}]},{xtype:"syno_displayfield"},{xtype:"container",layout:"column",hideLabel:!0,items:[{xtype:"syno_radio",name:"decrypt_method",width:200,inputValue:"keyfile",boxLabel:_T("share","share_encryption_importfrom")},{xtype:"syno_filebutton",allowBlank:!1,name:"password_file",textConfig:{width:192}},{xtype:"syno_textfield",name:"abs_path",hidden:!0},{xtype:"syno_textfield",name:"node",hidden:!0},{xtype:"syno_textfield",name:"target_id",hidden:!0},{xtype:"syno_textfield",name:"target_type",hidden:!0},{xtype:"syno_numberfield",name:"task_id",value:-1,hidden:!0},{xtype:"syno_textfield",name:"sess_id",hidden:!0},{xtype:"syno_textfield",name:"sess_key",hidden:!0},{xtype:"syno_textfield",name:"transfer_type",hidden:!0},{xtype:"syno_textfield",name:"version_id",hidden:!0}]}]}),i={width:600,height:260,minWidth:600,minHeight:230,title:_T("share","share_encryption_decrypt"),layout:"fit",items:t,keys:[{key:Ext.EventObject.ENTER,scope:this,handler:this.onApply}],buttons:[{itemId:"cancel",text:_T("common","cancel"),scope:this,handler:this.onCancel},{itemId:"apply",btnStyle:"blue",text:_T("common","apply"),scope:this,handler:this.onApply}]};return Ext.apply(i,e),i},DefineBehaviors:function(){this.mon(this,"afterlayout",(function(e,t){var i=this.panel.getForm();new SYNO.ux.Utils.EnableRadioGroup(i,"decrypt_method",{manual:["passwd"],keyfile:["password_file"]})}),this,{single:!0}),this.mon(this,"close",(function(e,t){this.confirmResolve&&this.confirmResolve(null)}),this,{single:!0})},onOpen:function(){this.callParent(arguments),this.panel.getForm().findField("passwd").focus(!1,100)},showPromise:async function(){return new Promise(((e,t)=>{this.confirmResolve=e,this.show()}))},onCancel:function(){this.confirmResolve(null),this.close()},onApply:function(){const e=this.panel.getForm();if(!e.isValid())return;let t=null;const i=e.findField("decrypt_method").getGroupValue();if("keyfile"===i){if(!e.findField("password_file").getValue())return;e.findField("node").setValue(this.uploadParams.node),e.findField("version_id").setValue(this.uploadParams.version_id),Ext.isEmpty(this.uploadParams.abs_path)||e.findField("abs_path").setValue(this.uploadParams.abs_path),Ext.isEmpty(this.uploadParams.target_id)||e.findField("target_id").setValue(this.uploadParams.target_id),Ext.isEmpty(this.uploadParams.target_type)||e.findField("target_type").setValue(this.uploadParams.target_type),Ext.isEmpty(this.uploadParams.transfer_type)||e.findField("transfer_type").setValue(this.uploadParams.transfer_type),Ext.isEmpty(this.uploadParams.task_id)||e.findField("task_id").setValue(this.uploadParams.task_id),Ext.isEmpty(this.uploadParams.sess_id)||e.findField("sess_id").setValue(this.uploadParams.sess_id),Ext.isEmpty(this.uploadParams.sess_key)||e.findField("sess_key").setValue(this.uploadParams.sess_key),this.sendWebAPI({api:"SYNO.SDS.Backup.Server.Explore.File",method:"list",version:1,form:e.el.dom,scope:this,callback:function(e,i,s){e?(t={method:"password_file"},this.confirmResolve(t),this.close()):this.getMsgBox().alert(SYNO.SDS.Backup.Server.Explore.Utils.GetString("app","backup_explorer"),SYNO.SDS.Backup.Server.Explore.Utils.GetErrorString(i.code),this.onCancel,this)}})}else if("manual"===i){var s=e.findField("passwd").getValue();if(!s)return;t={method:"password",password:s},this.confirmResolve(t),this.close()}}}),function(){var e=SYNO.SDS.Backup.Server.Explore.Utils.GetString,t=SYNO.SDS.Backup.Server.Explore.Utils.GetErrorString,i=SYNO.SDS.Backup.Server.Explore.Utils.GetErrorStringEx;Ext.define("SYNO.SDS.Backup.Server.Explore.AppInstance",{extend:"SYNO.SDS.AppInstance",version:2,appWindowName:"SYNO.SDS.Backup.Server.Explore.AppWindow"}),Ext.define("SYNO.SDS.Backup.Server.Explore.AppWindow",{extend:"SYNO.SDS.AppWindow",minHeight:580,minWidth:800,layout:"fit",isDownloading:!1,support_filter:!1,support_restore:!1,data_enc:!1,sess_id:null,sess_key:null,isEntireDSMTask:!1,warnedNodes:[],hostname:e("explorer","unknown_host"),folderDisplayLimit:1e4,constructor:function(e){var t={height:580,width:800,cls:"syno-backup-server-explore ",showHelp:!1};Ext.apply(t,e),this.callParent([t])},open:function(){return this.pathBar.path="",this.opened=!0,this.sess_id=null,this.sess_key=null,this.taskId=null,this.accountMeta=null,this.warnedNodes=[],this.onOpen.apply(this,arguments)},loadConfig:function(e){if(Ext.apply(this,e),"BackupServer"===e.launcher&&e.repoPath&&(this.transferType="browse_local",this.targetType="image"),"FileStation"===e.launcher&&e.fb_recs){var t=e.fb_recs[0].data.real_path.split("/");e.fb_recs[0].data.isdir?(this.repoPath=t.slice(0,-1).join("/"),this.targetId=t[t.length-1]):(this.repoPath=t.slice(0,-2).join("/"),this.targetId=t[t.length-2]),this.transferType="browse_local",this.targetType="image"}_S("is_admin")&&"BackupAndRestore"===e.launcher&&(this.support_restore=!0)},onOpen:function(i){this.loadConfig(i),this.setStatusBusy(),this.sendWebAPI({api:"SYNO.SDS.Backup.Server.Explore.Target",version:1,method:"get",scope:this,params:Ext.apply(this.getBaseParams(),{additional:["support_filter","account_meta","from_cache"]}),callback:function(i,s,a){return i?s.is_multi_ver_lun_task?(this.clearStatusBusy(),void this.getMsgBox().alert("",e("error","multiver_lun_task_not_mountable"),this.close,this)):(this.data_enc=s.data_enc,this.hostname=s.host_name,this.uni_key=s.uni_key,this.support_filter=s.support_filter,this.isEntireDSMTask=s.is_entire_dsm_task,this.accountMeta=SYNO.SDS.Backup.Server.Common.Utils.createAccountMeta(),Ext.isEmpty(s.account_meta)||this.accountMeta.setData(s.account_meta),this.clearStatusBusy(),void(this.data_enc&&!this.sess_id?this.launchPasswordWindow(this.updateView,this.setSession,Ext.apply(a,this.getBaseParams())):this.updateView())):(this.clearStatusBusy(),void this.getMsgBox().alert(e("app","backup_explorer"),t(s.code),this.close,this))}}),this.callParent(arguments)},launchPasswordWindow:function(e,t,i){new SYNO.SDS.Backup.Server.Common.Password.Window({owner:this,verify_params:i,setter:Ext.createDelegate(t,this),callback:Ext.createDelegate(e,this)}).open()},setSession:function(e){this.sess_id=e.sess_id,this.sess_key=e.sess_key},updateView:function(){this.support_restore?(this.gridMenu.get(1).show(),this.menuToolbar.get(1).show()):(this.gridMenu.get(1).hide(),this.menuToolbar.get(1).hide()),this.hostname&&this.treePanel.getRootNode().setText(this.hostname),this.support_filter?(this.pathBarMargin=295,this.pathBar.setWidth(this.width-this.pathBarMargin),this.searchField.show()):(this.searchField.hide(),this.pathBarMargin=101,this.pathBar.setWidth(this.width-this.pathBarMargin)),this.timeline.setAccountMeta(this.accountMeta),this.timeline.load(this.defaultVersion)},getTip:function(e){var t=document.createElement("unused_A"),i=document.createElement("unused_B");t.appendChild(i);var s=SYNO.ux.AddTip(i,e);return s.setAttribute("style","position: absolute; margin-top:0px"),s.outerHTML},initComponent:function(){this.pathBarMargin=101,this.pathBar=new SYNO.SDS.Backup.Server.Explore.PathBar({width:this.width-this.pathBarMargin});var i=[{xtype:"syno_button",iconCls:"syno-sds-backup-filebrowser-tbar-back",disabled:!0,listeners:{click:{fn:function(){this.pathBar.moveToPrevPath()},scope:this}}},{xtype:"syno_button",iconCls:"syno-sds-backup-filebrowser-tbar-next",disabled:!0,listeners:{click:{fn:function(){this.pathBar.moveToNextPath()},scope:this}}},this.pathBar];this.filterPanel=new SYNO.SDS.Backup.Server.Explore.Filter.FormPanel({cls:"syno-backup-server-common-adv-search-panel",renderTo:Ext.getBody(),shadow:!1,hidden:!0,owner:this}),i.push("->"),this.searchField=new SYNO.SDS.Backup.Server.Explore.AdvancedSearchField({owner:this,width:188,searchPanel:this.filterPanel,hidden:!0}),i.push(this.searchField),this.pathToolbar=new SYNO.ux.Toolbar({cls:"syno-sds-backup-filebrowser-tbar",items:i}),this.menuToolbar=new SYNO.ux.Toolbar({items:[{xtype:"syno_button",itemId:"btn_copy",text:e("explorer","copy_to")+" ...",disabled:!0,listeners:{scope:this,click:this.launchPathSelector}},{xtype:"syno_button",itemId:"btn_restore",text:e("explorer","restore"),disabled:!0,hidden:!0,listeners:{scope:this,click:this.onRestoreApply}},{xtype:"syno_button",itemId:"btn_download",text:e("explorer","download"),disabled:!0,listeners:{scope:this,click:this.onDownloadApply}}]}),this.tbar=new Ext.Container({layout:{type:"vbox",pack:"start",align:"stretch"},height:72,defaults:{flex:1},items:[this.pathToolbar,this.menuToolbar]}),this.callParent(arguments),this.treeloader||(this.treeloader=new SYNO.SDS.Backup.Server.Explore.TreeLoader({sendWebAPI:this.sendWebAPI.createDelegate(this),parseWebApiResponse:function(e,t){return e&&!e.isRoot&&t.length>this.treePanel.folderDisplayLimit?(this.fireEvent("treediscarddata",e),t.slice(0,this.treePanel.folderDisplayLimit)):t}.createDelegate(this),webapi:{api:"SYNO.SDS.Backup.Server.Explore.Folder",method:"list",version:1},baseParams:Ext.apply(this.getBaseParams(),{limit:this.folderDisplayLimit+1}),encryption:["enc_share_password"],createNodeFn:function(e){e.text=e.name,e.id=e.path,Ext.isBoolean(e.browseable)&&!e.browseable&&(e.leaf=!0,e.disabled=!0)},createNodeScope:this,owner:this,listeners:{scope:this,beforeload:function(e,t){return(!this.badShares||!(t.id in this.badShares))&&(!SYNO.SDS.Backup.Server.Common.Utils.isABBDataFolder("/"+t.id)&&void 0)},loadexception:function(i,s,a){SYNO.SDS.Backup.Explore.ClearTreeNodeLoadingState(s),this.getMsgBox().alert(e("app","backup_explorer"),t(a.code),(function(){SYNO.SDS.Backup.Explore.ERR_SESSION_EXPIRED===a.code&&this.doSessionExpired(),SYNO.SDS.Backup.Explore.ERR_PROTOCOL_VERSION_CLIENT_TOO_OLD!==a.code&&SYNO.SDS.Backup.Explore.ERR_PROTOCOL_VERSION_SERVER_TOO_OLD!==a.code||this.close()}),this)}}})),this.treePanel=new SYNO.SDS.Backup.Server.Explore.BasicTreePanel({loader:this.treeloader,root:new Ext.tree.AsyncTreeNode({name:"@pathRoot",id:"@pathRoot",path:"@pathRoot",text:this.hostname,cls:"root_node",expanded:!0,disabled:!0,loaded:!0}),autoFlexcroll:!0,region:"west",cls:"syno-sds-backup-filebrowser-treepanel",split:!0,width:200,minWidth:150,maxWidth:500,folderDisplayLimit:this.folderDisplayLimit}),this.gridStore||(this.gridStore=new Ext.data.JsonStore({proxy:new SYNO.API.Proxy({api:"SYNO.SDS.Backup.Server.Explore.File",method:"list",version:1,encryption:["enc_share_password"]}),totalProperty:"total",root:"files",fields:["name","path","size","mtime","type","is_bad","enc_share_state"],baseParams:this.getBaseParams(),hasMultiSort:!0,multiSortInfo:{sorters:[{field:"type",direction:"DESC"},{field:"name",direction:"ASC"}],direction:"ASC"},listeners:{scope:this,beforeload:function(t,i){var s=this.getShareNode();if(Ext.isBoolean(s.attributes.browseable)&&!s.attributes.browseable){let t;return t="SYNO.SDS.Backup.Client.Explore.AppWindow"===this.self.displayName?"not_support_btrfs_volume_in_vault_tips":"not_support_btrfs_volume_tips",this.gridPanel.getStore().removeAll(),this.gridPanel.bwrap.mask(e("explorer",t),"syno-ux-mask-info"),this.searchField.disable(),!1}return s&&s.attributes.is_bad?(this.gridPanel.getStore().removeAll(),this.gridPanel.bwrap.mask(e("app","broken_share"),"syno-ux-mask-info"),this.searchField.disable(),!1):SYNO.SDS.Backup.Server.Common.Utils.isABBDataFolder("/"+i.params.node)?(this.gridPanel.getStore().removeAll(),this.gridPanel.bwrap.mask(e("app","ABB_no_restore_part_data"),"syno-ux-mask-info"),this.searchField.disable(),!1):(this.searchField.enable(),Ext.apply(i.params,this.getBaseParams()),i)},load:function(e,t,i){if(Ext.isString(i.params.enc_share_password)&&i.params.enc_share_password.length>0){const e=this.treePanel.getSelectionModel().getSelectedNode();e&&(e.attributes.enc_share_state="mounted")}if(0===t.length&&this.isFilterCondSet())return this.gridPanel.bwrap.mask(_T("search","no_search_result")),this.gridPanel.getBottomToolbar().updateInfo(),!1;if(!0===this.data_enc){this.gridPanelPagingBar.displayItem.getEl().setWidth("auto");this.gridStore.getTotalCount()>=1e5?(this.gridPanelPagingBar.displayMsg=this.displayMsgWithTip,this.gridPanelPagingBar.updateInfo(),this.gridPanelPagingBar.displayItem.getEl().setWidth(this.gridPanelPagingBar.displayItem.getWidth()+28)):(this.gridPanelPagingBar.displayMsg=this.displayMsg,this.gridPanelPagingBar.updateInfo())}},exception:function(i,s,a,n,r,o){if(SYNO.SDS.Backup.Explore.ERR_SHARE_NOT_EXIST===r.code)return this.gridPanel.getStore().removeAll(),this.gridPanel.bwrap.mask(e("explorer","no_folder"),"syno-ux-mask-info"),this.searchField.disable(),!1;this.getMsgBox().alert(e("app","backup_explorer"),t(r.code),(function(){this.clearSelections(),SYNO.SDS.Backup.Explore.ERR_SESSION_EXPIRED===r.code&&this.doSessionExpired(),SYNO.SDS.Backup.Explore.ERR_PROTOCOL_VERSION_CLIENT_TOO_OLD!==r.code&&SYNO.SDS.Backup.Explore.ERR_PROTOCOL_VERSION_SERVER_TOO_OLD!==r.code||this.close()}),this)}}})),this.gridMenu=new SYNO.ux.Menu({cls:"syno-backup-server-explore syno-sds-backup-filebrowser-menu",items:[{text:e("explorer","copy_to")+" ...",iconCls:"syno-sds-backup-filebrowser-copy-icon",itemId:"menu_copy",disabled:!0,listeners:{scope:this,click:this.launchPathSelector}},{text:e("explorer","restore"),iconCls:"syno-sds-backup-filebrowser-restore-icon",itemId:"menu_restore",disabled:!0,hidden:!0,listeners:{scope:this,click:this.onRestoreApply}},{text:e("explorer","download"),iconCls:"syno-sds-backup-filebrowser-download-icon",itemId:"menu_download",disabled:!0,listeners:{scope:this,click:this.onDownloadApply}}]}),this.gridPanelPagingBar=null,this.gridPanelPagingBar=new SYNO.ux.PagingToolbar({store:this.gridStore,pageSize:1e3,displayInfo:!0,showRefreshBtn:!1}),this.displayMsg=this.gridPanelPagingBar.displayMsg,this.displayMsgWithTip=this.gridPanelPagingBar.displayMsg+this.getTip(e("explorer","unsort_hint")),this.gridPanel=new SYNO.ux.GridPanel({colModel:new Ext.grid.ColumnModel({columns:[{header:_T("common","name"),dataIndex:"name",width:4,renderer:function(t,i,s,a,n,r){var o=SYNO.SDS.Backup.Explore.htmlEncodeTip(t);if("Folder"===s.data.type){var l="syno-sds-backup-filebrowser-folder-icon";s.get("is_bad")&&(o="("+e("explorer","broken_folder")+")"+o,l="syno-sds-backup-filebrowser-broken-folder-icon");const i=s.get("enc_share_state")||"not_enc_share";return"mounted"===i?l+=" syno-sds-backup-filebrowser-enc-share-mounted-icon":"not_mounted"===i&&(l+=" syno-sds-backup-filebrowser-enc-share-not-mounted-icon"),'<div class="'+l+'" ext:qtip="'+o+'"> '+Ext.util.Format.htmlEncode(t)+"</div>"}return s.get("is_bad")&&(o="("+e("explorer","broken_file")+")"+o),'<div class="syno-sds-backup-filebrowser-file-icon" ext:qtip="'+o+'"> '+Ext.util.Format.htmlEncode(t)+"</div>"}},{header:_T("common","size"),dataIndex:"size",width:1,renderer:function(e,t,i,s,a,n){return SYNO.SDS.Backup.Explore.ConverSize(e,2)}},{header:e("explorer","file_type"),width:1,dataIndex:"type"},{header:e("explorer","modified_date"),dataIndex:"mtime",width:2,renderer:function(e,t,i,s,a,n){var r=new Date(1e3*e);return SYNO.SDS.Backup.Explore.DateTimeFormatter(r,{type:"datetimesec"})}}]}),viewConfig:{hideSortIcons:!0,getRowClass:function(e,t,i,s){return e.get("is_bad")&&"Folder"!==e.get("type")?"disabled-file":""}},store:this.gridStore,sm:new Ext.grid.RowSelectionModel({singleSelect:!1,listeners:{beforerowselect:{fn:function(e,t,i,s){return!s.get("is_bad")||"Folder"===s.get("type")}}}}),keys:[{key:65,ctrl:!0,scope:this,handler:function(){this.gridPanel.getSelectionModel().selectAll()}}],loadMask:!0,cls:"syno-sds-backup-filebrowser-gridpanel",collapsible:!1,region:"center",bbar:this.gridPanelPagingBar,margins:"5 0 0 0",listeners:{rowcontextmenu:{fn:function(e,t,i){var s=e.getStore().getAt(t);s.get("is_bad")&&"Folder"!==s.get("type")||this.gridMenu.showAt(i.getXY());var a=e.getSelectionModel();a.isSelected(t)||a.selectRow(t)},scope:this}}}),this.timeline=new SYNO.SDS.Backup.Server.Explore.TimeLine({owner:this,getBaseParams:Ext.createDelegate(this.getBaseParams,this),split:!1,region:"south",height:112}),this.add(new SYNO.ux.Panel({layout:"border",border:!1,cls:"syno-sds-backup-filebrowser-mainpanel",viewConfig:{forceFit:!0},defaults:{fit:!0},items:[this.treePanel,this.gridPanel,this.timeline]}))},initEvents:function(){this.callParent(arguments),this.mon(SYNO.SDS.StatusNotifier,"thirdpartychanged",this.onHyperBackupUpgrade,this),this.mon(this,"resize",(function(e,t,i){this.pathBar.setWidth(t-this.pathBarMargin)}),this),this.mon(this,"afterrender",(function(){this.isDownloading&&this.launchProgressPanel()}),this),this.mon(this.treePanel.getSelectionModel(),"selectionchange",(function(e,t){t&&(this.pathBar.setPath(t.attributes.path,!1,!1),this.updateGridPanel())}),this),this.mon(this.gridPanel,"rowdblclick",(function(e,t,i){var s=e.getStore().getAt(t);"Folder"===s.get("type")?this.pathBar.setPath(s.get("path"),!1,!0):"File"===s.get("type")&&(s.get("is_bad")||this.onDownloadApply())}),this),this.mon(this.gridPanel.getSelectionModel(),"selectionchange",(function(e){var t=e.getSelections();if(0===t.length)return this.menuToolbar.getComponent("btn_copy").disable(),this.menuToolbar.getComponent("btn_restore").disable(),this.menuToolbar.getComponent("btn_download").disable(),this.gridMenu.getComponent("menu_copy").disable(),this.gridMenu.getComponent("menu_restore").disable(),void this.gridMenu.getComponent("menu_download").disable();var i=!0,s=!0,a=!(t.length>1);Ext.each(t,(function(e){if("File"!==e.get("type")&&(a=!1,this.checkTypeFile=!1),e.get("is_bad")&&"Folder"!==e.get("type")&&(i=!1,s=!1,a=!1,this.checkTypeFile=!1),!1===this.checkTypeFile&&!1===this.checkIsBadAndType)return!1}),{checkTypeFile:!0,checkIsBadAndType:!0});var n=this.pathBar.getRelatedPath();/^volume\d+$/.test(n)&&(s=!1),i&&(this.menuToolbar.getComponent("btn_copy").enable(),this.gridMenu.getComponent("menu_copy").enable()),s?(this.menuToolbar.getComponent("btn_restore").enable(),this.gridMenu.getComponent("menu_restore").enable()):(this.menuToolbar.getComponent("btn_restore").disable(),this.gridMenu.getComponent("menu_restore").disable()),a?(this.menuToolbar.getComponent("btn_download").enable(),this.gridMenu.getComponent("menu_download").enable()):(this.menuToolbar.getComponent("btn_download").disable(),this.gridMenu.getComponent("menu_download").disable())}),this),this.mon(this.pathBar,"updatepath",this.onPathBarUpdate,this),this.mon(this.timeline,"select",this.onTimelineSelect,this),this.mon(this.treePanel.getLoader(),"load",this.onTreeLoad,this),this.mon(this,"treediscarddata",this.onTreeDiscardData,this),this.filterPanel&&this.mon(this.filterPanel,"filter",this.updateGridPanel,this)},onTreeDiscardData:function(t){if(-1===this.warnedNodes.indexOf(t.attributes.id)){this.warnedNodes.push(t.attributes.id);var i=String.format(e("app","subfolder_exceed_limit"),t.attributes.path,this.treePanel.folderDisplayLimit);this.getMsgBox().alert(e("app","backup_explorer"),i)}},isFilterCondSet:function(){return this.filterPanel&&this.filterPanel.isCondSet()},getBaseParams:function(){var e={};return this.taskId?Ext.apply(e,{task_id:this.taskId}):this.repoId?Ext.apply(e,{repo_id:this.repoId,target_id:this.targetId}):Ext.apply(e,{target_type:this.targetType,transfer_type:this.transferType,abs_path:this.repoPath,target_id:this.targetId}),this.versionId&&Ext.apply(e,{version_id:this.versionId}),this.pathBar&&this.pathBar.getRelatedPath()&&Ext.apply(e,{node:this.pathBar.getRelatedPath()}),this.filterPanel&&this.filterPanel.getParams()&&Ext.apply(e,this.filterPanel.getParams()),this.data_enc&&(Ext.apply(e,{sess_id:this.sess_id,sess_key:this.sess_key}),this.taskId||Ext.apply(e,{data_enc:this.data_enc,uni_key:this.uni_key})),this.backend&&Ext.apply(e,{backend:this.backend}),e},onHyperBackupUpgrade:function(e,t){"HyperBackup"!==e||"upgrade"!==t&&"install"!==t||this.close()},onTimelineSelect:function(){this.versionId=this.timeline.getVersionId(),this.updateTreePanel()},onPathBarUpdate:function(e,t){this.pathBar.getPrevPath()?this.pathToolbar.items.items[0].enable():this.pathToolbar.items.items[0].disable(),this.pathBar.getNextPath()?this.pathToolbar.items.items[1].enable():this.pathToolbar.items.items[1].disable(),this.treePanel.selectPath(this.pathBar.getPath(),"name",Ext.createDelegate(this.onTreeSelect,this,[t],!0))},onTreeLoad:function(e,t,i,s){var a=this.pathBar.getPath();if((!a||"/@pathRoot"===a)&&0<i.length&&(a=this.treePanel.getNodeById(i[0].id).getPath(),this.pathBar.setPath(a,!1,s)),t.isRoot){this.badShares={};for(var n=0;n<i.length;n++)i[n].is_bad&&(this.badShares[i[n].name]=!0);this.treePanel.selectPath(a,"name",Ext.createDelegate(this.onTreeSelect,this,[s],!0))}},onTreeSelect:function(t,i,s){if(t)this.searchField.enable();else{var a=this.treePanel.getSelectionModel().getSelectedNode();if(a&&this.badShares&&a.id.split("/")[0]in this.badShares)return this.gridPanel.getStore().removeAll(),this.gridPanel.bwrap.mask(e("app","broken_share"),"syno-ux-mask-info"),void this.searchField.disable();if(!0===s&&((n=this.pathBar.getRelatedPath())&&-1!==n.indexOf("/")))return this.clearSelections(),void this.updateGridPanel();this.gridPanel.getStore().removeAll(),this.gridPanel.bwrap.mask(e("explorer","no_folder"),"syno-ux-mask-info"),this.searchField.disable()}var n},onPathSelectorApply:function(t,s){var a=this.gridPanel.getSelectionModel().getSelections(),n=[];a.forEach((function(e){n.push(e.data.path)}));var r={action:"copy",source_path:n};Ext.apply(r,this.getBaseParams()),Ext.apply(r,s),this.setStatusBusy(),this.sendWebAPI({api:"SYNO.SDS.Backup.Server.Explore.File",version:1,method:"copy",params:r,scope:this,callback:function(t,s,a){this.clearStatusBusy(),t?this.launchProgressPanel():this.getMsgBox().alert(e("app","backup_explorer"),i(s),(function(){SYNO.SDS.Backup.Explore.ERR_SESSION_EXPIRED===s.code&&this.doSessionExpired(),SYNO.SDS.Backup.Explore.ERR_PROTOCOL_VERSION_CLIENT_TOO_OLD!==s.code&&SYNO.SDS.Backup.Explore.ERR_PROTOCOL_VERSION_SERVER_TOO_OLD!==s.code||this.close()}),this)}})},onDownloadApply:function(){var i=this.gridPanel.getSelectionModel();if(i.getSelected())if(this.isPreparingDownload())this.getMsgBox().alert(e("app","backup_explorer"),e("app","wait_another_file_downloaded"));else{var s=i.getSelected().data.path,a=(new Date).getTime()+Math.random().toString(36),n=Ext.apply({source_path:s,support_utf8_name:Ext.isChrome||Ext.isGecko||Ext.isSafari,download_id:a},this.getBaseParams());this.findAppWindow().downloadWebAPI({filename:s.replace(/^.*\//,""),webapi:{api:"SYNO.SDS.Backup.Server.Explore.File",version:1,method:"download",params:n},timeout:36e5,scope:this,callback:function(i,s,a,n){!a&&n&&this.getMsgBox().alert(e("app","backup_explorer"),t(n.code),(function(){SYNO.SDS.Backup.Explore.ERR_SESSION_EXPIRED===n.code&&this.doSessionExpired(),SYNO.SDS.Backup.Explore.ERR_PROTOCOL_VERSION_CLIENT_TOO_OLD!==n.code&&SYNO.SDS.Backup.Explore.ERR_PROTOCOL_VERSION_SERVER_TOO_OLD!==n.code||this.close()}),this)}}),setTimeout(function(){this.launchProgressPanel(a)}.createDelegate(this),1e3)}},getShareNode:function(){var e,t=this.pathBar.getRelatedPath();return-1===(e=t.indexOf("/"))?this.treePanel.getNodeById(t):this.treePanel.getNodeById(t.substr(0,e))},onRestoreApply:function(){var t=e("explorer","restore_overwrite_hint"),s=this.getShareNode();s&&s.attributes.restore_unsafe_warn&&(t=e("error","restore_file_not_safe")+"<br/>"+t),this.getMsgBox().confirm(e("app","backup_explorer"),t,(function(t){if("yes"===t){var s=this.gridPanel.getSelectionModel(),a=s.getSelections(),n=[];a.forEach((function(e){n.push(e.data.path)}));var r={action:"restore",overwrite:!0,source_path:n,dest_path:s.getSelected().data.path};Ext.apply(r,this.getBaseParams()),this.setStatusBusy(),this.sendWebAPI({api:"SYNO.SDS.Backup.Server.Explore.File",version:1,method:"restore",params:r,scope:this,callback:function(t,s,a){if(this.clearStatusBusy(),t)this.launchProgressPanel();else{var n=i(s);if(s.code==SYNO.SDS.Backup.Explore.ERR_SHARE_READ_ONLY&&(n=String.format(n,SYNO.SDS.Backup.getReadOnlyOwnerString(s.errors.read_only_owner))),this.isEntireDSMTask){if(s.code===SYNO.SDS.Backup.Explore.ERR_VOLUME_NOT_EXIST)return n=e("explorer","restore_rollback_to_copy_hint"),void this.getMsgBox().confirm(e("app","backup_explorer"),n,(function(e){"yes"===e&&this.launchPathSelector()}),this);if(s.code===SYNO.SDS.Backup.WEBAPI_BACKUP_ERR_SHARE_NAME_CONFLICT){let e=s.errors.src_share_name||"",t=s.errors.dest_share_name||"";n=String.format(n,e,t,e)}}this.getMsgBox().alert(e("app","backup_explorer"),n,(function(){SYNO.SDS.Backup.Explore.ERR_SESSION_EXPIRED===s.code&&this.doSessionExpired(),SYNO.SDS.Backup.Explore.ERR_PROTOCOL_VERSION_CLIENT_TOO_OLD!==s.code&&SYNO.SDS.Backup.Explore.ERR_PROTOCOL_VERSION_SERVER_TOO_OLD!==s.code||this.close()}),this)}}})}}),this)},mask:function(e,t,i){t||(t=_T("common","loading")),i||(i="x-mask-loading"),this.callParent([e,t,i])},launchPathSelector:function(){var t=new SYNO.SDS.Backup.Server.Explore.PathSelector.Window({title:e("explorer","copy_to")+" ... - "+e("explorer","select_path"),bodyStyle:"padding-right: 20px; padding-left: 20px;",width:480,height:500,layout:"fit",minWidth:480,minHeight:500,cls:"syno-backup-server-explore",owner:this});t.open(),this.mon(t,"apply",this.onPathSelectorApply,this,{single:!0})},launchProgressPanel:function(e){SYNO.SDS.AppLaunch("SYNO.SDS.Backup.Server.JobTray.AppInstance",{},!1,(function(){var t=SYNO.SDS.AppMgr.getByAppName("SYNO.SDS.Backup.Server.JobTray.AppInstance")[0];e&&t.addDownloadId(e),t.start({launcher:this.launcher,backend:this.backend})}),this)},isPreparingDownload:function(){var e=SYNO.SDS.AppMgr.getByAppName("SYNO.SDS.Backup.Server.JobTray.AppInstance")[0];return!!e&&e.isPreparingDownload()},updateTreePanel:function(){var e=this.treePanel.getRootNode(),t=this.treePanel.getLoader();this.treePanel.getEl().mask(),t.baseParams=Ext.apply(this.getBaseParams(),{limit:this.treePanel.folderDisplayLimit+1});var i=Ext.apply({},{params:Ext.apply({preload:this.pathBar.getPath().replace(/^\/@pathRoot\//,"")},t.getParams(e)),argument:{callback:void 0,node:e,scope:void 0},callback:function(e,i,s,a){var n=a.argument.node;for(this.treePanel.getEl().unmask();n.firstChild;)n.removeChild(n.firstChild);t.handleNodeData(n,i)},scope:this},t.webapi);this.sendWebAPI(i)},clearSelections:function(){this.treePanel.getSelectionModel().clearSelections()},updateGridPanel:async function(){var e=this.gridPanel.getStore(),t=this.getBaseParams();this.support_filter&&(this.searchField.setValue(t.filter_keyword),this.searchField.fireEvent("keyup",this.searchField));let i="not_enc_share";const s=this.treePanel.getSelectionModel().getSelectedNode();if(s&&(i=s.attributes.enc_share_state),"not_mounted"===i){const e=new SYNO.SDS.Backup.Server.Explore.ShareDecyptDialog({owner:this,uploadParams:t}),i=await e.showPromise();if(null===i)return this.clearSelections(),void this.pathBar.moveToPrevPath();"password"===i.method?t.enc_share_password=i.password:"password_file"===i.method&&(s.attributes.enc_share_state="mounted")}e.load({params:t})},doSessionExpired:function(){this.launchInstance&&(this.launchInstance.clearCurTaskSession?this.launchInstance.clearCurTaskSession():this.launchInstance.owner&&this.launchInstance.owner.clearCurTaskSession&&(this.launchInstance.owner.clearCurTaskSession(),this.launchInstance.close()),this.close())}})}(),Ext.namespace("SYNO.SDS.Backup.Explore"),function(e){Ext.iterate({ERR_DISALLOW_DEMOSITE:[116],ERR_PARAM:[4400],ERR_INTERNAL_ERROR:[4401],ERR_CLIENT_NO_SPACE:[4402],ERR_SERVER_NO_SPACE:[4403],ERR_CLIENT_NO_QUOTA:[4404],ERR_SERVER_NO_QUOTA:[4405],ERR_NOT_OWNER:[4406],ERR_SNAPSHOT_RESTORING:[4407],ERR_RESTORING:[4408],ERR_BACKING_UP_RESTORING:[4409],ERR_CLIENT_PERM_DENIED:[4410],ERR_SERVER_PERM_DENIED:[4411],ERR_PORT_NOT_VALID:[4412],ERR_NAME_NOT_VALID:[4413],ERR_CONFIG_OPERATE_ADMIN:[4416],ERR_SHARE_READ_ONLY:[4417],ERR_SERVICE_NO_VOLUME:[4418],ERR_SERVICE_NO_SHARE:[4419],ERR_VOLUME_NOT_EXIST:[4420],ERR_VOLUME_FS_NOT_SUPPORT:[4422],ERR_SHARE_NOT_EXIST:[4423],ERR_SHARE_ENCRYPTION:[4425],ERR_CONFIG_VERSION_WRONG:[4428],ERR_CONFIG_VERSION_FUTURE:[4429],ERR_OFFLINE:[4430],ERR_RESTORE_VOLUME_BUILDING:[4431],ERR_PROTOCOL_VERSION_CLIENT_TOO_OLD:[4432],ERR_PROTOCOL_VERSION_SERVER_TOO_OLD:[4433],ERR_BAD_ADDRESS:[4434],ERR_CONFIG_RESTORING:[4435],ERR_CONFIG_NO_SPACE:[4436],ERR_CONFIG_WRONG_FORMAT:[4437],ERR_CONFIG_PORT_CONFLICT:[4438],ERR_CONFIG_SERVICE_FAIL:[4439],ERR_NO_RESPONSE:[4440],ERR_CONNECTION_BLOCKED:[4441],ERR_SERVICE_DISABLE:[4442],ERR_SSH_FAIL:[4443],ERR_AUTH_FAIL:[4444],ERR_AUTH_DENIED:[4445],ERR_UNSTABLE_NETWORK:[4446],ERR_SSL_NOT_SUPPORT:[4447],ERR_SSL_VERIFY_FAIL:[4448],ERR_TIME_SKEWED:[4449],ERR_REPOSITORY_NOT_EXIST:[4455],ERR_REPOSITORY_EXIST:[4456],ERR_REPOSITORY_BUSY:[4457],ERR_REPOSITORY_PERM_DENIED:[4459],ERR_TARGET_NOT_EXIST:[4460],ERR_TARGET_EXIST:[4461],ERR_TARGET_BUSY:[4462],ERR_TARGET_BUSY_ROLLBACK:[4463],ERR_TARGET_BUSY_BACKUP:[4464],ERR_TARGET_BUSY_RESTORE:[4465],ERR_TARGET_BUSY_CHECKING:[4466],ERR_TARGET_BROKEN:[4467],ERR_TARGET_NEED_ROLLBACK:[4468],ERR_TARGET_PERM_DENIED:[4471],ERR_VERSION_NOT_EXIST:[4472],ERR_VERSION_LOCKED:[4475],ERR_NO_AVAILABLE_VERSION:[4476],ERR_USER_EXCEED_MAX:[4478],ERR_GROUP_EXCEED_MAX:[4479],ERR_APP_VERSION_INVALID:[4480],ERR_APP_MYSQL_PWD_WRONG:[4482],ERR_APP_SURVEILLANCE_ENABLE:[4483],ERR_APP_MYSQL_ENABLE:[4484],ERR_APP_MYSQL_VOLUME_CRASH:[4485],ERR_APP_VOLUME:[4486],ERR_APP_OCCUPIED:[4487],ERR_APP_NO_SPACE:[4488],ERR_APP_NETWORK:[4489],CUSTOMIZED_WEBAPI_ERROR_CODE:[4490],CUSTOMIZED_WEBAPI_ERROR_CODE_CONTAINER_INVALID_NAME:[4491],CUSTOMIZED_WEBAPI_ERROR_CODE_CONTAINER_EXIST:[4492],CUSTOMIZED_WEBAPI_ERROR_CODE_CONTAINER_TOO_MANY:[4493],ERR_BACKUP_CONF_FAIL:[4494],ERR_BACKUP_APP_FAIL:[4495],ERR_ENCRYPT_VERIFY_FAIL:[4496],ERR_SHARE_ENCRYPTED:[4497],ERR_SESSION_EXPIRED:[4498],ERR_SERVER_NOT_READY:[4499],ERR_CANCEL_JOB_NOT_EXIST:[4500],ERR_OBJECT_IN_GLACIER:[4513]},(function(t,i){e[t]=i[0]}))}(SYNO.SDS.Backup.Explore),function(){var e=SYNO.SDS.Backup.Server.Explore.Utils.GetString;Ext.define("SYNO.SDS.Backup.Server.Explore.Filter.FormPanel",{extend:"SYNO.ux.FormPanel",constructor:function(t){this.dateType={custom:1,today:2,yesterday:4,lastweek:8,lastmonth:16},this.dataRange=[[this.dateType.custom,e("app","log_date_custom")],[this.dateType.today,e("app","log_date_today")],[this.dateType.yesterday,e("app","log_date_yesterday")],[this.dateType.lastweek,e("app","log_date_lastweek")],[this.dateType.lastmonth,e("app","log_date_lastmonth")]],this.defaultAnimation=["#000",1,{duration:.35}],Ext.apply(this,t||{});var i=this.fillConfig(t);this.callParent([i]),this.defineBehaviors()},initComponent:function(){this.callParent(arguments),this.addEvents("filter")},fillConfig:function(t){var i,s,a,n,r,o=[];return i=this.createKeyword(),s=this.createFileType(),a=this.createFileSize(),n=this.createFriendlyDate(),r=this.createCustDate(),o.push(i),o.push(s),o.push(a),o.push(n),o.push(r),o.push({xtype:"toolbar",border:!1,itemId:"btns",toolbarCls:"search-panel-fbar-btnPanel",items:[{xtype:"tbfill"},{xtype:"syno_button",minWidth:80,text:_T("common","reset"),handler:this.onReset,scope:this},{xtype:"syno_button",btnStyle:"blue",style:"margin-right: 10px",text:e("app","log_search"),itemId:"btn_search",handler:this.onSearch,scope:this}]}),{width:368,heigh:480,floating:!0,labelAlign:"left",trackResetOnLoad:!0,waitMsgTarget:!0,border:!0,bodyStyle:"padding: 20px; padding-top: 0px; font-size: 24px;",autoFlexcroll:!1,defaults:{hideLabel:!0,anchor:"100%"},items:o,listeners:{actionfailed:{fn:function(){this.form.reset()},scope:this},beforeshow:{fn:function(){this.doLayout()},single:!0},show:{fn:this.doLayout,single:!0}},keys:[{key:[10,13],fn:function(){this.isVisible()&&(this.btnSearch.hidden||this.btnSearch.disabled||this.onSearch())},scope:this}]}},createTpl:function(){return new Ext.XTemplate('<tpl for=".">','<div class="x-combo-list-item" ext:qtip="{displayText:htmlEncode}">',"{displayText:htmlEncode}","</div>","</tpl>")},createKeyword:function(){return[{xtype:"syno_displayfield",value:e("app","log_keyword")+_T("common","colon"),flex:1},{xtype:"syno_textfield",msgTarget:"qtip",validateOnBlur:!0,validationEvent:"blur",name:"keyword",flex:2,vaule:""}]},createFileType:function(){return this.FileTypeComboBox=new SYNO.ux.ComboBox({mode:"local",editable:!1,name:"fileType",tpl:this.createTpl(),resizable:!0,store:this.getFileTypeStore(),displayField:"displayText",valueField:"value",triggerAction:"all",lazyRender:!0,flex:6,value:"any"}),[{xtype:"syno_displayfield",value:e("explorer","file_type")+_T("common","colon"),flex:1},this.FileTypeComboBox]},getFileTypeStore:function(){return new Ext.data.SimpleStore({autoDestroy:!0,fields:["value","displayText"],data:[["any",e("explorer","any")],["folder",e("explorer","any_folder")],["file",e("explorer","any_file")]]})},createFileSize:function(){return this.FileSizeField=new SYNO.ux.CompositeField({hideLabel:!0,defaults:{flex:1},defaultMargins:"0 8 0 0",items:[{xtype:"syno_combobox",mode:"local",editable:!1,name:"fileSizeOption",tpl:this.createTpl(),resizable:!0,store:this.getFileSizeStore(),displayField:"displayText",valueField:"value",triggerAction:"all",lazyRender:!0,value:"any",listeners:{select:{fn:function(e,t,i){this.enableDisableItem(t.get("value"),this.form.findField("fileSize"))},scope:this}}},{xtype:"syno_numberfield",name:"fileSize",minValue:0,maxValue:4294967296,disabled:!0}]}),[{xtype:"syno_displayfield",value:_T("common","size")+" ("+_T("common","size_kb")+")"+_T("common","colon"),flex:1},this.FileSizeField]},getFileSizeStore:function(){return new Ext.data.SimpleStore({autoDestroy:!0,fields:["value","displayText"],data:[["any",e("explorer","search_any")],["equal",e("explorer","size_equal")],["greater",e("explorer","size_greater")],["less",e("explorer","size_less")]]})},setDate:function(e,t,i){!0===i&&(this.frameAnimation(this.form.findField("searchdatefrom").el,this.defaultAnimation),this.frameAnimation(this.form.findField("searchdateto").el,this.defaultAnimation)),this.form.findField("searchdatefrom").setMaxValue(t),this.form.findField("searchdateto").setMinValue(e),this.form.findField("searchdatefrom").setValue(e),this.form.findField("searchdateto").setValue(t)},getFromToDate:function(e){var t,i,s=new Date;if(e===this.dateType.today)t=s,i=s;else if(e===this.dateType.yesterday)i=t=s.add(Date.DAY,-1);else if(e===this.dateType.lastweek){var a=s.getDay();i=(t=s.add(Date.DAY,-7-a)).add(Date.DAY,6)}else e===this.dateType.lastmonth&&(t=(s=s.add(Date.MONTH,-1)).getFirstDateOfMonth(),i=s.getLastDateOfMonth());return{from:t,to:i}},friendlyDateSelect:function(e,t,i){var s=t.get("id"),a=this.getFromToDate(s);this.setDate(a.from,a.to,!0)},getFriendlyDateStore:function(){var e=this.dataRange;return new Ext.data.ArrayStore({autoDestroy:!0,fields:["id","displayText"],data:e})},createFriendlyDate:function(){return this.FriendlyDate=new SYNO.ux.ComboBox({mode:"local",editable:!1,name:"dateRange",tpl:this.createTpl(),resizable:!0,store:this.getFriendlyDateStore(),displayField:"displayText",valueField:"id",triggerAction:"all",lazyRender:!0,flex:6,value:this.dateType.custom,listeners:{scope:this,beforequery:function(e){delete e.combo.lastQuery},beforeselect:this.friendlyDateSelect}}),[{xtype:"syno_displayfield",value:e("explorer","modified_date")+_T("common","colon"),flex:1},this.FriendlyDate]},createCustDate:function(){var t={name:"searchdatefrom",editable:!1,emptyText:e("app","log_date_from"),value:"",listeners:{scope:this,select:function(e,t){this.form.findField("searchdateto").setMinValue(t)}}},i={name:"searchdateto",editable:!1,emptyText:e("app","log_date_to"),value:"",listeners:{scope:this,select:function(e,t){this.form.findField("searchdatefrom").setMaxValue(t)}}};return SYNO.SDS.DateTimeUtils||(t.format="m/d/Y",i.format="m/d/Y"),this.DateFrom=new SYNO.ux.DateTimeField(t),this.DateTo=new SYNO.ux.DateTimeField(i),[{xtype:"syno_compositefield",hideLabel:!0,defaults:{flex:1},defaultMargins:"0 8 0 0",items:[this.DateFrom,this.DateTo]}]},frameAnimation:function(e,t){e&&e.isVisible()&&Ext.Element.prototype.frame.apply(e,t)},defineBehaviors:function(){var e=this.get("btns");this.btnSearch=e.get("btn_search"),this.btnStop=e.get("btn_stop")},setKeyWord:function(e){var t=this.form.findField("keyword");t&&Ext.isString(e)&&t.setValue(e),t.focus("",1)},enableDisableItem:function(e,t){return"any"!==e?(this.frameAnimation(t.el,this.defaultAnimation),t.enable(),1):(t.reset(),t.disable(),0)},onSearch:function(e,t){this.getForm().isValid()&&this.fireEvent("filter",this)},onReset:function(){this.form.items.each((function(e){e.isDirty()&&this.frameAnimation(e.el,this.defaultAnimation)}),this),this.form.reset(),this.form.findField("fileSize").disable(),this.form.findField("searchdatefrom").setMaxValue(null),this.form.findField("searchdateto").setMinValue(null)},isCondSet:function(){var e,t,i,s,a,n;return s=(e=this.getForm()).findField("keyword").getValue(),t=e.findField("fileType").getValue(),i=e.findField("fileSizeOption").getValue(),a=e.findField("searchdatefrom").getRawValue(),n=e.findField("searchdateto").getRawValue(),!Ext.isEmpty(s)||"any"!==t||"any"!==i||!Ext.isEmpty(a)||!Ext.isEmpty(n)},getParams:function(){var e,t,i,s,a,n,r;return a=(e=this.getForm()).findField("keyword").getValue(),t=e.findField("fileType").getValue(),i=e.findField("fileSizeOption").getValue(),s=e.findField("fileSize").getValue(),n=e.findField("searchdatefrom").getRawValue(),r=e.findField("searchdateto").getRawValue(),{filter_keyword:a,filter_type:t,filter_size_option:i,filter_size:1024*s,filter_date_from:n?new Date(n+" 00:00:00").getTime()/1e3:0,filter_date_to:r?new Date(r+" 23:59:59").getTime()/1e3:0}}})}(),Ext.define("SYNO.SDS.Backup.Server.Explore.AdvancedSearchField",{extend:"SYNO.ux.SearchField",initEvents:function(){this.callParent(arguments),this.mon(Ext.getDoc(),"mousedown",this.onMouseDown,this),this.mon(this,"keypress",(function(e,t){t.getKey()===Ext.EventObject.ENTER&&(this.searchPanel.setKeyWord(this.getValue()),this.searchPanel.onSearch())}),this)},isInnerComponent:function(e,t){var i=!1;return t.items.each((function(t){if(t instanceof Ext.form.ComboBox){if(t.view&&e.within(t.view.getEl()))return i=!0,!1}else if(t instanceof Ext.form.DateField){if(t.menu&&e.within(t.menu.getEl()))return i=!0,!1}else if(t instanceof Ext.form.CompositeField&&this.isInnerComponent(e,t))return i=!0,!1}),this),i},onMouseDown:function(e){var t=this.searchPanel;!t||!t.isVisible()||t.isDestroyed||t.inEl||e.within(t.getEl())||e.within(this.searchtrigger)||this.isInnerComponent(e,this.searchPanel.getForm())||t.hide()},onSearchTriggerClick:function(){this.disabled||(this.searchPanel.isVisible()?this.searchPanel.hide():(this.searchPanel.getEl().alignTo(this.wrap,"tr-br?",[6,0]),this.searchPanel.show(),this.searchPanel.setKeyWord(this.getValue())))},onTriggerClick:function(){this.disabled||(this.callParent(),this.searchPanel.onReset(),this.searchPanel.onSearch())}}),Ext.define("SYNO.SDS.Backup.Server.Explore.PathBar",{extend:"Ext.Container",cls:"syno-sds-backup-pathbar syno-ux-textfield x-form-text x-form-field",path:"",historyManager:null,initComponent:function(){this.callParent(arguments),this.historyManager||(this.historyManager=new SYNO.SDS.Backup.Server.Explore.HistoryManager),Ext.isEmpty(this.defaultPath)||this.setPath(this.defaultPath),this.addEvents("updatepath")},setPath:function(e,t,i){if(e==this.path)return!1;var s=e.split("/").filter((function(e){return!Ext.isEmpty(e)}));this.removeAll(),"@pathRoot"!==s[0]&&s.unshift("@pathRoot");var a="";Ext.each(s,(function(e,t,i){if(Ext.isEmpty(e))return!0;a+="/"+e;var s="syno-sds-backup-pathbutton";if(0===t&&"@pathRoot"==e)return!0;1===t&&(s="syno-sds-backup-pathbutton-first"),this.add(new SYNO.SDS.Backup.Server.Explore.PathButton({path:a,cls:s,owner:this,listeners:{click:{fn:function(){this.owner.setPath(this.path,!1,!0)}}}}))}),this),this.path=a,this.doLayout(),t=void 0!==t&&t,this.historyManager&&!t&&this.historyManager.addEvent(this.path),this.fireEvent("updatepath",this,i)},getPath:function(){return this.path},getRelatedPath:function(){return this.path.substr("/@pathRoot".length+1)},moveToPrevPath:function(){var e=null;return this.historyManager&&(e=this.historyManager.moveToPrevEvent())&&this.setPath(e,!0,!0),e},moveToNextPath:function(){var e=null;return this.historyManager&&(e=this.historyManager.moveToNextEvent())&&this.setPath(e,!0,!0),e},getPrevPath:function(){var e=null;return this.historyManager&&(e=this.historyManager.getPrevEvent()),e},getNextPath:function(){var e=null;return this.historyManager&&(e=this.historyManager.getNextEvent()),e}}),Ext.define("SYNO.SDS.Backup.Server.Explore.PathButton",{extend:"SYNO.ux.Button",cls:"syno-sds-backup-pathbutton",iconCls:"syno-sds-backup-pathbutton-text",path:"",initComponent:function(){this.setPath(this.path),this.callParent(arguments)},setPath:function(e){Ext.isEmpty(this.path)||(this.path=e,this.text=this.path.split("/").pop(),this.tooltip=Ext.util.Format.htmlEncode(this.text))},getPath:function(){return this.path}}),Ext.define("SYNO.SDS.Backup.Server.Explore.HistoryManager",{history:[],historyPoint:-1,historyMaxLength:30,addEvent:function(e){this.history[this.historyPoint]!==e&&(this.history.splice(this.historyPoint+1,this.history.length-(this.historyPoint+1),e),this.history.length>this.historyMaxLength&&this.history.shift(),this.historyPoint=this.history.length-1)},moveToPrevEvent:function(){var e=null;return 0<this.historyPoint&&(this.historyPoint--,e=this.history[this.historyPoint]),e},moveToNextEvent:function(){var e=null;return this.historyPoint+1<this.history.length&&(this.historyPoint++,e=this.history[this.historyPoint]),e},getPrevEvent:function(){var e=null;return 0<this.historyPoint&&(e=this.history[this.historyPoint-1]),e},getNextEvent:function(){var e=null;return this.historyPoint+1<this.history.length&&(e=this.history[this.historyPoint+1]),e}}),function(){var e=SYNO.SDS.Backup.Server.Explore.Utils.GetString,t=SYNO.SDS.Backup.Server.Explore.Utils.GetErrorString,i=function(e){var t=e.clone();return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},s=function(e){var t=e.clone();return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t.setDate(1),t},a=function(e,t,i){return new Ext.Template(t,{compiled:!0,disableFormats:!0}).append(e,i||{},!0)},n=function(e,t){return!Ext.isDefined(e)&&!Ext.isDefined(t)||!(!Ext.isDefined(e)||!Ext.isDefined(t))&&e.version_id===t.version_id},r=function(e){return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()]},o="syno-backup-timeline-scroller",l="Y-m-d",h="Y-m";Ext.define("SYNO.SDS.Backup.Server.Explore.VersionMenu",{extend:"Ext.menu.Menu",cls:"syno-backup-server-timeline-version-menu",initComponent:function(){Ext.apply(this,{plain:!0,showSeparator:!1}),this.callParent(arguments),this.addEvents("select")},renderVersinfo:function(){if(this.rendered){var t,i,s,a,r,o,l=[],h=this.getVersinfo(),d=this.owner.selectedVersion;for(l.push("<table>"),t=0;t<h.length;t+=2)s=n(h[t],d),l.push('<tr><td data-index="'+t+'" '+(s?'class="version-selected"':"")+" >"+SYNO.SDS.Backup.Explore.DateTimeFormatter(h[t].date,{type:"timesec"})+"</td>"),t+1<h.length&&(s=n(h[t+1],d),l.push('<td data-index="'+(t+1)+'" '+(s?'class="version-selected"':"")+" >"+SYNO.SDS.Backup.Explore.DateTimeFormatter(h[t+1].date,{type:"timesec"})+"</td>")),l.push("</tr>");return l.push("</table>"),a=this.getEl(),r=['<div class="syno-backup-timeline-version-ct">','<div class="version-menu-header">',"<b>{vers_count}</b> {vers_desc} {vers_date}","</div>","</div>"].join(""),o={vers_desc:e("explorer","timeline_versions"),vers_count:h.length,vers_date:SYNO.SDS.Backup.Explore.DateTimeFormatter(h[0].date,{type:"date"})},i=new Ext.Template(r,{compiled:!0,disableFormats:!0}).overwrite(a,o||{},!0),this._box=new Ext.BoxComponent({renderTo:i,cls:"version-menu-ct",html:l}),h.length>6&&(this._box.setHeight(80),this._box.updateScroller(0)),i.on("click",this.onClickVersion,this),i}this.mon(this,"afterrender",this.renderVersinfo,this)},setVersinfo:function(e){return this.versinfo=e,this.changed=!1,this.renderVersinfo(e)},getVersinfo:function(){return this.versinfo},onClickVersion:function(e,t,i){if("TD"===t.tagName){var s=t.getAttribute("data-index");this.changed=!0,this.selectedVersion=this.getVersinfo()[s],this.fireEvent("select",this.selectedVersion),this.hide(!0)}}}),Ext.define("SYNO.SDS.Backup.Server.Explore.TimeLine",{extend:"Ext.Panel",calendar:null,minDate:null,maxDate:null,selectedDate:null,versionMenu:null,versionList:null,_elMonth:null,_elTimeline:null,defaultVersion:null,panelWidth:0,statusBusy:!1,constructor:function(e){var t=new Date,s=Ext.apply({owner:e.owner,border:!1,frame:!1,minDate:t.add(Date.YEAR,-1),maxDate:t},e);return s.minDate=i(s.minDate),s.maxDate=i(s.maxDate),this._elMonth={},this.versionList={},this.apiClass="SYNO.SDS.Backup.Server.Explore.Version",this.methodVersionMap={summary:1,list:1},this.callParent([s])},initComponent:function(){this.callParent(arguments),this.addEvents("select"),this.mon(this,"afterrender",this.onAfterRender,this)},onAfterRender:function(){this.renderTimeLine(),this.loadAfterRender&&this.loadVersionSummary()},setAccountMeta:function(e){this.accountMeta=e},load:function(e){this.defaultVersion=null,this.selectedVersion=null,e&&(this.defaultVersion=e),Ext.iterate(this._elMonth,(function(e,t){t.remove()})),this._elMonth={},this.versionList={},this.preLoadAll=!1,Ext.isEmpty(this.accountMeta)||SYNO.SDS.Backup.Server.Common.Utils.AccountMeta.ROTATION_BASIC!==this.accountMeta.versionRotation||(this.preLoadAll=!0),this.loadVersionSummary()},getPanelWidth:function(){return this._elTimeline.getWidth()},getScrollerWidth:function(){return this._elTimeline.child(".syno-backup-timeline-scroller").getWidth()},getDateByOffsetX:function(e){void 0===e&&(e=-this.scroll.x);var t=-Math.ceil((this.getScrollerWidth()-(this.getPanelWidth()/2+15)-e)/30);return this.maxDate.add(Date.DAY,t)},getOffsetXByDate:function(e){var t=i(e);return this.getScrollerWidth()-(this.getPanelWidth()/2+15)-(this.maxDate-t)/864e5*30},getOffsetXByMonthDate:function(e){return this.getOffsetXByDate(e.getFirstDateOfMonth())},getMonthEl:function(e){var t=e.getFirstDateOfMonth();return this._elMonth[t.format(l)]},setMonthEl:function(e,t){var i=e.getFirstDateOfMonth();this._elMonth[i.format(l)]=t},getVersionDomByVersionInfo:function(e){var t=e[0].date;return this.getMonthEl(t).dom.childNodes[t.getDate()]},getVersionId:function(){return this.selectedVersion?this.selectedVersion.version_id:void 0},getVersionDate:function(){return this.selectedVersion?this.selectedVersion.name:void 0},renderTimeLine:function(){var e=this,t=a(e.getEl(),['<div class="{wrapper_cls}">','<div class="{scroller_cls}"></div>','<div class="{calendar_cls}"></div>','<div class="{pin_bg_cls}"></div>',"</div>"],{wrapper_cls:"syno-backup-timeline-wrapper",scroller_cls:o,calendar_cls:"syno-backup-timeline-calendar x-btn syno-ux-button syno-ux-button-default x-btn-icon",pin_bg_cls:"syno-backup-timeline-pin-bg"});return e.scroll=new SYNO.SDS.Utils.IScroll(t.dom,{scrollX:!0,scrollY:!1,mouseWheel:!0,deceleration:.01,startX:1.2*t.getWidth()-10980,tap:!Ext.isIE8}),t.on(Ext.isIE8?"click":"tap",(function(t,i,s){var a=null;i.classList.contains("syno-backup-timeline-calendar")?e.onCalendarClick(i):i.classList.contains("version-prev")?e.onClickPrevVersion():i.classList.contains("version-next")?e.onClickNextVersion():i.classList.contains("version-time")||i.classList.contains("version-count")?(a=i.parentNode.parentNode,e.onDateClick(a)):i.classList.contains("syno-backup-timeline-version-tag")||i.classList.contains("clickable")?(a=i.parentNode)!==e._lastClickDom?e.onDateClick(a):a=null:"TD"===i.tagName?(a=i.parentNode.parentNode.parentNode.parentNode,e.onDateClick(a)):e.versionMenu&&e.versionMenu.isVisible()&&e.versionMenu.hide(),e._lastClickDom=a})),e.scroll.on("beforeScrollStart",(function(){e.versionMenu&&e.versionMenu.isVisible()&&e.versionMenu.hide()})),e.scroll.on("scrollEnd",(function(){e.updateCurrentView()})),e._elTimeline=t,this.panelWidth=e._elTimeline.getWidth(),t},renderMonth:function(e){if(this.getMonthEl(e))return this.getMonthEl(e);var t,i,s=this,n=e.getDaysInMonth(),l=['<ul class="timeline-month" style="left:{offsetX}px; width:{width}px">','<div class="month-label">{month}</div>'];for(t=1;t<=n;t+=1)t%2==0?l.push('<li data-day="'+t+'"><div class="day-grid-line"></div><div class="day-mark"></div><a>'+t+"</a></li>"):l.push('<li data-day="'+t+'"><div class="day-grid-line"></div><div class="day-mark"></div></li>');return l.push("</ul>"),(i=a(s._elTimeline.child("."+o),l,{offsetX:s.getOffsetXByMonthDate(e),month:r(e),width:30*n})).date=e.getFirstDateOfMonth(),s.setMonthEl(e,i),this.versionList[e.format(h)]&&0<this.versionList[e.format(h)].length&&this.renderVersions(this.versionList[e.format(h)]),i},setVersionInfo:function(e){var t=e[0].date,i=t.getDate()-t.getFirstDateOfMonth().getDate()+1,s=this.renderMonth(t);s.dom.childNodes[i],s.versions||(s.versions=[]),s.versions[i]=e,this.renderVersionTag(s,i)},renderVersions:function(e){var t={};Ext.each(e,(function(e){var i=Date.parseDate(e.timestamp,"U"),s=i.format(l);e.date=i,t[s]?t[s].push(e):t[s]=[e]}),this),Ext.iterate(t,(function(e,t){this.setVersionInfo(t)}),this)},scrollToDate:function(e,t){this.scroll.scrollTo(-this.getOffsetXByDate(e)+this.getPanelWidth()-(this.getPanelWidth()/2+15),0,t)},updateMonthOffset:function(){for(var e in this._elMonth)this._elMonth[e]&&this._elMonth[e].setLeft(this.getOffsetXByDate(this._elMonth[e].date))},resizeScroller:function(e){var t=e-this.getScrollerWidth();this._elTimeline.child(".syno-backup-timeline-scroller").setWidth(e),this.updateMonthOffset(),this.scroll.refresh(),this.scroll.scrollTo(this.scroll.x-t,0,0)},onResize:function(e,t,i,s){this.callParent(arguments);var a=e-this.panelWidth;this.panelWidth=e,this.selectedVersion&&(this.resizeScroller(this.getScrollerWidth()+a),this.scrollToDate(this.selectedVersion.date,0))},renderVersionTagByDate:function(e,t){return this.renderVersionTag(this.getMonthEl(e),e.getDate(),t)},renderVersionTag:function(e,t,i){var s=e.dom.childNodes[t],a=e.versions[t],n="";if(s.classList.remove("version-exists"),s.classList.remove("version-select"),s.classList.remove("version-show"),t%2==0&&t!==e.date.getDaysInMonth()&&(n="<a>"+t+"</a>"),!Ext.isDefined(a))return s.innerHTML=n,s;if(!Ext.isDefined(i)||!1===i)return s.classList.add("version-exists"),s.innerHTML='<div class="day-grid-line"></div><div class="day-mark"></div><div class="syno-backup-timeline-version-tag clickable"><div class="syno-backup-timeline-version-tag-bubble"><span>'+a.length+'</span></div><div class="syno-backup-timeline-version-tag-triangle "></div><div class="syno-backup-timeline-version-tag-circle unselect"></div></div>'+n,s;!0===i?(s.classList.add("version-show"),s.innerHTML='<div class="day-grid-line"></div><div class="day-mark"></div><div class="syno-backup-timeline-version-tag"><div class="syno-backup-timeline-version-tag-pin"></div><div class="syno-backup-timeline-version-tag-box-triangle"></div><div class="syno-backup-timeline-version-tag-circle show"></div></div>'+n,this.createVersionMenu(a).show(s.childNodes[2],"b-t?")):(s.classList.add("version-select"),s.innerHTML='<div class="day-grid-line"></div><div class="day-mark"></div><div class="version-box"><div class="version-count">'+a.length+'</div><div class="version-prev"> </div><div class="version-time">'+SYNO.SDS.Backup.Explore.DateTimeFormatter(i.date)+'</div><div class="version-next"> </div></div><div class="syno-backup-timeline-version-tag"><div class="syno-backup-timeline-version-tag-pin"></div><div class="syno-backup-timeline-version-tag-box-triangle"></div><div class="syno-backup-timeline-version-tag-circle select"></div></div>'+n);return s},createVersionMenu:function(e){var t=this;return t.versionMenu||(t.versionMenu=new SYNO.SDS.Backup.Server.Explore.VersionMenu({width:172,owner:t,enableScrolling:!1,defaultOffsets:[0,-1],listeners:{hide:t.onVersionMenuHide,scope:t}})),t.versionMenu.setVersinfo(e),t.versionMenu},updateCurrentView:function(){var e=this.getDateByOffsetX(-this.scroll.x),t=this.getPreloadWindow(e,5);t&&this.loadVersionList(t.minDate,t.maxDate)},checkVersionLoaded:function(e){return this.versionList[e.format(h)]},onCalendarClick:function(e){null===this.calendar&&(this.calendar=new SYNO.ux.DateTimeMenu({hideOnClick:!0,focusOnSelect:!1,pickerCfg:{isAllDay:!0,minDate:this.minDate,maxDate:this.maxDate,onClearClick:this.switchToDefaultVersion.bind(this)}}),this.mon(this.calendar,"select",(function(e,t){this.scrollToDate(t,700)}),this),this.mon(this.calendar,"updateDirtyValue",(function(e){this.scrollToDate(e,700)}),this)),this.calendar.show(e,"bl-tl?")},switchToDefaultVersion:function(){var e=this.defaultVersion?Date.parseDate(this.defaultVersion+3,"U"):this.maxDate;e&&(this.loadNextVersionInfo(e,-1,!1),this.scrollToDate(this.selectedVersion.date,700))},selectNextVersionForPreloadAll:function(e){var t,i=this.selectedVersion.date,s=this.versionList[i.format(h)],a=null;if(0>=e){for(t=s.length-1;t>=0;t--)if(s[t].timestamp<this.selectedVersion.timestamp){a=s[t];break}for(;!a&&(i=i.add(Date.MONTH,-1),s=this.versionList[i.format(h)]);)if(s.length>0){a=s[s.length-1];break}}else{for(t=0;t<s.length;t++)if(s[t].timestamp>this.selectedVersion.timestamp){a=s[t];break}for(;!a&&(i=i.add(Date.MONTH,1),s=this.versionList[i.format(h)]);)if(s.length>0){a=s[0];break}}a||(a=this.selectedVersion),this.selectVersion(a)},selectVersion:function(e){if(e&&(!this.selectedVersion||e.date.toString()!==this.selectedVersion.date.toString())){var t=this.selectedVersion;this.selectedVersion=e,t&&this.renderVersionTagByDate(t.date,!1),this.renderVersionTagByDate(e.date,e),this.scrollToDate(this.selectedVersion.date,700),this.fireEvent("select",this.selectedVersion)}},onDateClick:function(e){var t=Ext.get(e.parentNode).versions[e.getAttribute("data-day")];!t||t.length<=0?SYNO.Debug("renderVersions: failed?"):1===t.length?this.selectVersion(t[0]):this.renderVersionTagByDate(t[0].date,!0)},onVersionMenuHide:function(e){if(e.changed){if(this.selectedVersion){if(n(this.selectedVersion,e.selectedVersion))return void this.renderVersionTagByDate(this.selectedVersion.date,this.selectedVersion);this.renderVersionTagByDate(this.selectedVersion.date,!1)}this.selectVersion(e.selectedVersion)}else{if(!this.selectedVersion)return void this.renderVersionTagByDate(e.getVersinfo()[0].date,!1);if(t=this.selectedVersion.date,i=e.getVersinfo()[0].date,t.format("Y-m-d")!==i.format("Y-m-d"))return void this.renderVersionTagByDate(e.getVersinfo()[0].date,!1);this.renderVersionTagByDate(this.selectedVersion.date,this.selectedVersion)}var t,i},setDateInterval:function(e,t){return this.minDate=i(e),this.maxDate=i(t),this.calendar&&(this.calendar.picker.setMinDate(this.minDate),this.calendar.picker.setMaxDate(this.maxDate)),this.resizeScroller((this.maxDate.getTime()-this.minDate.getTime())/864e5*30+this.getPanelWidth()),this},loadVersionList:function(i,a,n){this.statusBusy||(this.owner.setStatusBusy(),this.statusBusy=!0);var r=Ext.apply(this.getBaseParams(),{time_from:s(i).getTime()/1e3,time_to:s(a).add(Date.MONTH,1).getTime()/1e3,filter_name:"success",account_meta:this.accountMeta,additional:["skip_check_key"]});this.sendWebAPI({api:this.apiClass,version:this.methodVersionMap.list,method:"list",params:r,encryption:["pwd","secret","remote_refresh_token","remote_access_token"],scope:this,callback:function(s,r,o){this.owner.clearStatusBusy(),this.statusBusy=!1,s?(this.updateVersionList(i,a,r.version_info_list),this.renderVersionList(i,a,n)):this.owner.getMsgBox().alert(e("app","backup_explorer"),t(r.code),(function(){this.owner.close()}),this)}})},updateVersionList:function(e,t,i){for(;e<=t;)this.versionList[e.format(h)]||(this.versionList[e.format(h)]=[]),e=e.add(Date.MONTH,1);Ext.each(i,(function(e,t,i){if("success"===e.status||"partial"===e.status){var s=Date.parseDate(e.timestamp,"U");this.versionList[s.format(h)]||(this.versionList[s.format(h)]=[]),this.versionList[s.format(h)].unshift(e)}}),this)},renderVersionList:function(e,t,i){for(;t>=e;)this.renderMonth(t),t=t.add(Date.MONTH,-1);i&&this.selectVersion(i)},getPreloadWindow:function(e,t){var i={},a=s(e),n=!0;if(this.checkVersionLoaded(a))if(this.checkVersionLoaded(a.add(Date.MONTH,-1))){if(this.checkVersionLoaded(a.add(Date.MONTH,1)))return;a=a.add(Date.MONTH,1)}else a=a.add(Date.MONTH,-1);for(i.maxDate=a,i.minDate=a;!0===n;)n=!1,!this.checkVersionLoaded(i.minDate.add(Date.MONTH,-1))&&0<t&&(i.minDate=i.minDate.add(Date.MONTH,-1),--t,n=!0),!this.checkVersionLoaded(i.maxDate.add(Date.MONTH,1))&&0<t&&(i.maxDate=i.maxDate.add(Date.MONTH,1),--t,n=!0);return i},loadNextVersionInfo:function(i,a,n){if(this.preLoadAll&&this.selectedVersion)this.selectNextVersionForPreloadAll(a);else{this.statusBusy||(this.owner.setStatusBusy(),this.statusBusy=!0);var r=Ext.apply(this.getBaseParams(),{offset:0,limit:this.preLoadAll?999:1,filter_name:"success",account_meta:this.accountMeta,additional:["skip_check_key"]});0>=a?(r.sort_direction="desc",r.time_from=1,r.time_to=Math.floor(i.getTime()/1e3)-1):(r.sort_direction="asc",r.time_from=Math.floor(i.getTime()/1e3)+1,r.time_to=-1),this.sendWebAPI({api:this.apiClass,version:this.methodVersionMap.list,method:"list",params:r,encryption:["pwd","secret","remote_refresh_token","remote_access_token"],scope:this,callback:function(i,a,r){if(!i)return this.owner.clearStatusBusy(),this.statusBusy=!1,void this.owner.getMsgBox().alert(e("app","backup_explorer"),t(a.code),(function(){this.owner.close()}),this);if(a.version_info_list.length<1)return this.owner.clearStatusBusy(),this.statusBusy=!1,void(n&&this.owner.getMsgBox().alert(e("app","backup_explorer"),e("error","no_available_restore_version"),(function(){this.owner.close()}),this));var o=a.version_info_list[0];if(o.date=Date.parseDate(o.timestamp,"U"),this.preLoadAll){this.owner.clearStatusBusy(),this.statusBusy=!1;var l=a.version_info_list[a.version_info_list.length-1],h=Date.parseDate(l.timestamp,"U"),d=o.date;h=s(h).add(Date.MONTH,-2),d=s(d).add(Date.MONTH,2),this.updateVersionList(h,d,a.version_info_list),this.renderVersionList(h,d,o)}else{var c=this.getPreloadWindow(o.date,5);c?this.loadVersionList(c.minDate,c.maxDate,o):(this.owner.clearStatusBusy(),this.statusBusy=!1,this.selectVersion(o))}}})}},loadVersionSummary:function(){this.statusBusy||(this.owner.setStatusBusy(),this.statusBusy=!0);var t=this.getBaseParams();this.sendWebAPI({api:this.apiClass,version:this.methodVersionMap.summary,method:"summary",params:t,encryption:["pwd","secret","remote_refresh_token","remote_access_token"],scope:this,callback:function(t,i,s){if(t){if(i.version_count<1)return this.owner.clearStatusBusy(),this.statusBusy=!1,void this.owner.getMsgBox().alert(e("app","backup_explorer"),e("error","no_available_restore_version"),(function(){this.owner.close()}),this);var a=Date.parseDate(i.start_time,"U"),n=Date.parseDate(i.end_time,"U").add(Date.SECOND,1);0>=n&&(n=new Date),this.setDateInterval(a,this.maxDate),this.defaultVersion?this.loadNextVersionInfo(Date.parseDate(this.defaultVersion+3,"U"),-1,!0):this.loadNextVersionInfo(n,-1,!0)}else this.loadVersionSummaryCompatible()}})},loadVersionSummaryCompatible:function(){this.statusBusy||(this.owner.setStatusBusy(),this.statusBusy=!0);var i=Ext.apply(this.getBaseParams(),{offset:0,limit:1,sort_direction:"asc",filter_name:"success",account_meta:this.accountMeta,additional:["skip_check_key"]});this.sendWebAPI({api:this.apiClass,version:this.methodVersionMap.list,method:"list",params:i,scope:this,callback:function(i,s,a){if(!i||s.version_info_list.length<1)return this.owner.clearStatusBusy(),this.statusBusy=!1,void this.owner.getMsgBox().alert(e("app","backup_explorer"),t(s.code),(function(){this.owner.close()}),this);var n=new Date,r=Date.parseDate(s.version_info_list[0].timestamp,"U");this.setDateInterval(r,this.maxDate),this.loadNextVersionInfo(n,-1,!0)}})},onClickPrevVersion:function(){this.selectedVersion&&this.loadNextVersionInfo(this.selectedVersion.date,-1,!1)},onClickNextVersion:function(){this.selectedVersion&&this.loadNextVersionInfo(this.selectedVersion.date,1,!1)}})}(),function(){let e=SYNO.SDS.Backup.Server.Explore.Utils.GetString;Ext.define("SYNO.SDS.Backup.Server.Explore.TreeLoader",{extend:"Ext.tree.TreeLoader",sendWebAPI:void 0,webapi:void 0,numPerLevel:void 0,encryption:void 0,constructor:function(){var e=arguments[0];return e&&e.webapi&&(this.dataUrl="dummy"),this.callParent(arguments)},requestData:async function(e,t,i){if(!1!==this.fireEvent("beforeload",this,e,t))if(this.directFn){var s=this.getParams(e);s.push(this.processDirectResponse.createDelegate(this,[{callback:t,node:e,scope:i}],!0)),this.directFn.apply(window,s)}else if(this.nodeData&&-1!==this.owner.fm_root_nodes.indexOf(e.id))this.handleNodeData(e,this.nodeData,t,i);else if(Ext.isFunction(this.sendWebAPI)){let s=this.getParams(e);if("not_mounted"===e.attributes.enc_share_state){const t=new SYNO.SDS.Backup.Server.Explore.ShareDecyptDialog({owner:i.getOwnerTree().findAppWindow(),uploadParams:s}),a=await t.showPromise();if(null===a)return void SYNO.SDS.Backup.Explore.ClearTreeNodeLoadingState(i);"password"===a.method?s.enc_share_password=a.password:"password_file"===a.method&&(e.attributes.enc_share_state="mounted")}var a=Ext.apply({},{params:s,encryption:this.encryption,argument:{callback:t,node:e,scope:i},callback:this.handleWebAPIResponse,scope:this},this.webapi);this.transId=this.sendWebAPI(a)}else this.transId=Ext.Ajax.request({method:this.requestMethod,url:this.dataUrl||this.url,success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{callback:t,node:e,scope:i},params:this.getParams(e)});else this.runCallback(t,i||e,[])},handleNodeData:function(e,t,i,s){Ext.isFunction(this.parseWebApiResponse)&&(t=this.parseWebApiResponse.call(this,e,t)),e.beginUpdate();for(var a=0,n=t.length;a<n;a++){var r=this.createNode(t[a]);r&&e.appendChild(r)}e.endUpdate();var o=e.getOwnerTree();o&&o.doLayout(),this.runCallback(i,s||e,[e]),this.fireEvent("load",this,e,t,!0)},handleWebAPIResponse:function(e,t,i,s){var a=s.argument,n=a.node;if(this.transId=!1,e){try{Ext.isFunction(this.parseWebApiResponse)&&(t=this.parseWebApiResponse.call(this,n,t)),n.beginUpdate();for(var r=0,o=t.length;r<o;r++)if(!t[r].recycle){var l=this.createNode(t[r]);l&&n.appendChild(l)}n.endUpdate();Ext.isString(s.params.enc_share_password)&&s.params.enc_share_password.length>0&&(n.attributes.enc_share_state="mounted"),this.runCallback(a.callback,a.scope||n,[n])}catch(e){return SYNO.Debug("tree loadexception"),void this.fireEvent("loadexception",this,n,t)}this.fireEvent("load",this,n,t,!1)}else this.fireEvent("loadexception",this,n,t)},unbrowsableNodes:[],createNode:function(e){if(e.uiProvider="SYNO.SDS.Backup.Server.Explore.TriTreeNodeUI",e.draggable=!1,!Ext.isFunction(this.createNodeFn)||!1!==this.createNodeFn.call(this.createNodeScope||this,e)){var t=this.callParent(arguments);return!1===t.attributes.browseable&&this.unbrowsableNodes.push(t),t}}}),Ext.define("SYNO.SDS.Backup.Server.Explore.BasicTreePanel",{extend:"SYNO.ux.TreePanel",constructor:function(e){var t=Ext.apply({useArrows:!0,autoScroll:!0,containerScroll:!0,bodyStyle:"overflow-x: hidden;overflow-y:auto; padding-right: 12px;",enableDD:!1},e);return this.callParent([t])},initEvents:function(){var e=this.callParent(arguments);return this.mon(this,"checkchange",this.onCheckChange,this),this.mon(this,"expandnode",this.onExpandNode,this),this.mon(this,"afterlayout",this.markUnbrowseableNodes,this),e},markUnbrowseableNodes:function(){if(!this.loader.unbrowsableNodeMarked){for(var t of this.loader.unbrowsableNodes){var i=t.getUI();if(i){let t;t="SYNO.SDS.Backup.Server.Explore.BasicTreePanel"===this.self.displayName?"not_support_btrfs_volume_tips":"not_support_btrfs_volume_in_vault_tips",SYNO.ux.AddTip(i.textNode,e("explorer",t))}}this.loader.unbrowsableNodes=[]}},getCheckedSubTreeRoot:function(e){var t=[],i=function(e){e.eachChild((function(e){var s=e.getUI()||{};Ext.isFunction(s.getCheckValue)&&(!0===s.getCheckValue()?t.push(e):"gray"===s.getCheckValue()&&i(e))}))};return i(e||this.root),t},onCheckChange:function(e,t){var i,s,a,n=function(e){var t=0,i=0,s=0;return e.eachChild((function(e){var a=e.getUI()||{};!a.checkbox||!Ext.isFunction(a.getCheckValue)||Ext.isFunction(a.isDisabled)&&a.isDisabled()||(!0===a.getCheckValue()?i+=1:!1===a.getCheckValue()&&(s+=1),t+=1)})),0===t?e.getUI().getCheckValue():i===t||s!==t&&"gray"},r=function(e){var t=Ext.apply({},e.attributes.depend);return Ext.applyIf(t,{parent:!1,children:!0})};for(!0===(a=r(e)).children&&(!0===t?e.eachChild((function(e){var t=e.getUI();!t||!Ext.isFunction(t.setCheckValue)||Ext.isFunction(t.isDisabled)&&t.isDisabled()||t.setCheckValue(!0)}),this):!1===t&&e.eachChild((function(e){var t=e.getUI();!t||!Ext.isFunction(t.setCheckValue)||Ext.isFunction(t.isDisabled)&&t.isDisabled()||t.setCheckValue(!1)}),this)),i=e.parentNode;i;)(s=i.getUI())&&Ext.isFunction(s.getCheckValue)?(!0===a.parent?i.attributes.checked=n(i):!0===t&&!1===i.attributes.checked?i.attributes.checked="gray":!1===t&&(i.attributes.checked=n(i)),s.syncCheckCssClass(),a=r(i),i=i.parentNode):(a=r(i),i=i.parentNode)},onExpandNode:function(e){var t=e.getUI(),i=Ext.apply({},e.attributes.depend);Ext.applyIf(i,{parent:!1,children:!0}),t&&Ext.isFunction(t.getCheckValue)&&!0===i.children&&!0===t.getCheckValue()&&e.eachChild((function(e){(t=e.getUI())&&Ext.isFunction(t.isDisabled)&&!t.isDisabled()&&Ext.isFunction(t.setCheckValue)&&t.setCheckValue(!0)}),this)}})}(),function(){var e=SYNO.SDS.Backup.Server.Explore.Utils.GetString;Ext.define("SYNO.SDS.Backup.Server.Explore.TriTreeNodeUI",{extend:"Ext.tree.TreeNodeUI",renderElements:function(e,t,i,s){this.indentMarkup=e.parentNode?e.parentNode.ui.getChildIndent():"";var a,n=Ext.isBoolean(t.checked)||"gray"===t.checked,r=Ext.util.Format.htmlEncode,o=t.input,l=this.getHref(t.href),h=['<li class="x-tree-node syno-backup-tri-tree-node"><div ext:tree-node-id="',r(e.id),'" class="x-tree-node-el x-tree-node-leaf x-unselectable ',t.cls,'" unselectable="on">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img alt="" src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow" />',n?'<img alt="" src="'+this.emptyIcon+'" class="syno-backup-tri-tree-node-cb syno-ux-checkbox-icon" />':"",'<img alt="" src="',t.icon||this.emptyIcon,'" class="x-tree-node-icon',t.icon?" x-tree-node-inline-icon":"",t.iconCls?" "+t.iconCls:"",'" unselectable="on" ',(t.icon||t.iconCls?"":'style="display: none;"')+"/>",'<a hidefocus="on" class="x-tree-node-anchor" href="',l,'" tabIndex="1" ',t.hrefTarget?' target="'+t.hrefTarget+'"':"",'><span unselectable="on" ext:qtip="',SYNO.SDS.Backup.Explore.htmlEncodeTip(e.text),'">',r(e.text),"</span></a>","</div>",'<ul class="x-tree-node-ct" style="display:none;"></ul>',"</li>"].join("");!0!==s&&e.nextSibling&&(a=e.nextSibling.ui.getEl())?this.wrap=Ext.DomHelper.insertHtml("beforeBegin",a,h):this.wrap=Ext.DomHelper.insertHtml("beforeEnd",i,h),this.elNode=this.wrap.childNodes[0],this.ctNode=this.wrap.childNodes[1];var d=this.elNode.childNodes,c=0;this.indentNode=d[c++],this.ecNode=d[c++],n&&(this.checkbox=d[c++]),this.iconNode=d[c++],this.anchor=d[c++],this.textNode=this.anchor.firstChild,"rename"===t.shareConflict&&(this.renameNode=d[c++]),"overwrite"===t.shareConflict&&(this.overwriteNode=d[c++]),this.volumeWarnNode=d[c++],o&&(this.createInputField(o,t,this.elNode),c++),n&&this.syncCheckCssClass(),e.on("disabledchange",this.onDisabled,this)},onIdChange:function(e){var t=Ext.util.Format.htmlEncode;this.rendered&&this.elNode.setAttribute("ext:tree-node-id",t(e))},createInputField:function(e,t,i){var s=e;switch(Ext.isObject(e)?(this.inputConfig=Ext.apply({},e),s=e.xtype||"textfield",delete e.xtype):this.inputConfig={},Ext.isDefined(t.value)&&(this.inputConfig.value=t.value),this.inputConfig.renderTo=i,s){case"textfield":this.input=new SYNO.ux.TextField(this.inputConfig);break;case"numberfield":this.input=new SYNO.ux.NumberField(this.inputConfig)}},initEvent:function(){var e=this.callParent(arguments);return this.checkbox&&this.initCheckEvent(),e},isChecked:function(){return this.getCheckValue()},isDisabled:function(){return!0===this.node.disabled},toggleCheck:function(){var e=this.checkbox;!0!==this.node.disabled&&e&&this.setCheckValue(!this.getCheckValue())},onClick:function(e){if(!e.getTarget(".x-form-field"))return e.getTarget(".syno-backup-tri-tree-node-cb")&&this.toggleCheck(),this.callParent(arguments)},onDblClick:function(e){e.preventDefault(),this.disabled||!1!==this.fireEvent("beforedblclick",this.node,e)&&(!this.animating&&this.node.isExpandable()&&this.node.toggle(),this.fireEvent("dblclick",this.node,e))},onDisabled:function(e,t){this.input&&(t?this.input.disable():this.input.enable()),this.checkbox&&(t?this.checkbox.classList.add("syno-ux-cb-disabled"):this.checkbox.classList.remove("syno-ux-cb-disabled"))},onCheckChange:function(){this.syncCheckCssClass(),this.fireEvent("checkchange",this.node,this.getCheckValue())},isValid:function(){return!!this.node.disabled||!(this.input&&!this.input.isValid())},getInputValue:function(){if(this.input&&!this.disabled)return this.input.getValue()},setInputValue:function(e){this.input&&this.input.setValue(e)},getCheckValue:function(){return this.node.attributes.checked},setCheckValue:function(e){this.node.disabled||e!==this.getCheckValue()&&(e="false"!==e&&"off"!==e&&"0"!==e&&("gray"===e?"gray":!!e),this.node.attributes.checked=e,this.onCheckChange())},syncCheckCssClass:function(){var e=this.getCheckValue();this.checkbox&&(Ext.each(["checked","grayed","disabled"],(function(e){this.checkbox.classList.remove("syno-ux-cb-"+e)}),this),this.volumeWarnNode&&this.volumeWarnNode.classList.remove("syno-ux-cb-selected"),!0===e?(this.checkbox.classList.add("syno-ux-cb-checked"),this.volumeWarnNode&&this.volumeWarnNode.classList.add("syno-ux-cb-selected")):"gray"===e&&(this.checkbox.classList.add("syno-ux-cb-grayed"),this.volumeWarnNode&&this.volumeWarnNode.classList.add("syno-ux-cb-selected")),this.node.disabled&&this.checkbox.classList.add("syno-ux-cb-disabled"))},initCheckEvent:function(){this.checkbox.addListener("mouseover",this.onCheckMouseover,this),this.checkbox.addListener("mouseout",this.onCheckMouseout,this),this.checkbox.addListener("focus",this.onCheckIconfocus,this),this.checkbox.addListener("blur",this.onCheckIconblur,this)},onCheckMouseover:function(){this.checkbox.classList.add("syno-ux-cb-hover")},onCheckMouseout:function(){this.checkbox.classList.remove("syno-ux-cb-hover")},onCheckIconfocus:function(){this.checkbox.classList.add("syno-ux-cb-focus")},onCheckIconblur:function(){this.checkbox.classList.remove("syno-ux-cb-focus")}}),Ext.define("SYNO.SDS.Backup.Server.Explore.TriTreeDisableCheckNodeUI",{extend:"SYNO.SDS.Backup.Server.Explore.TriTreeNodeUI",checkShareNode:function(e,t,i){e.dependAppRows&&0!==e.dependAppRows.length&&Ext.each(e.dependAppRows,(function(s){s.get("checked")&&(-1===t.indexOf(e.id.substr(1))&&t.push(e.id.substr(1)),-1===i.indexOf(s.get("name"))&&(i.push(s.get("name")),this.node.appRowsToBeUnselected.push(s)),this.node.appGrid=e.dependGrid)}),this)},setCheckValue:function(t){if(!0!==t&&!this.node.clickConfirmed){this.node.appRowsToBeUnselected=[];var i,s=[],a=[];if("fm_root"===this.node.id)Ext.each(this.node.childNodes,(function(e){this.checkShareNode(e,s,a)}),this);else{var n=this.node.id.substr(1).split("/",1)[0],r=this.node.getOwnerTree().getNodeById("/"+n);this.checkShareNode(r,s,a)}if(0<a.length&&0<s.length)return i=s[0].isBackup?e("explorer","unselect_share_alert_bkp"):e("explorer","unselect_share_alert_restore"),i=String.format(i,s.join(", "),a.join(", ")),this.node.getOwnerTree().owner.getMsgBox().confirm("",i,(function(e){"yes"===e&&(this.node.clickConfirmed=!0,this.setCheckValue(!1))}),this),!1}this.node.clickConfirmed=!1,Ext.each(this.node.appRowsToBeUnselected,(function(e){e.set("checked",!1)})),this.node.appRowsToBeUnselected=[],this.node.appGrid&&(this.node.appGrid.syncCheckedStatus(),delete this.node.appGrid),!t&&this.node.disabled?(this.node.disabled=!1,this.callParent(arguments),this.node.disabled=!0,this.syncCheckCssClass()):this.callParent(arguments)}})}(),function(){var e=SYNO.SDS.Backup.Server.Explore.Utils.GetString;Ext.define("SYNO.SDS.Backup.Server.Explore.PathSelector.Window",{extend:"SYNO.SDS.ModalWindow",selectedPath:null,constructor:function(e){var t=Ext.apply({buttons:[{text:_T("common","cancel"),handler:function(){this.close()},scope:this},{itemId:"btn_apply",text:_T("common","apply"),btnStyle:"blue",handler:function(){this.fireEvent("apply",this,this.getParams()),this.close()},scope:this,disabled:!0}]},e);return this.callParent([t])},initEvents:function(){this.callParent(arguments),this.addEvents("apply"),this.mon(this.treePanel.getSelectionModel(),"selectionchange",(function(e,t){t&&(this.selectedPath=t.attributes.abspath,this.fbar.getComponent("btn_apply").enable())}),this),this.mon(this.treePanel.getLoader(),"load",this.onTreeLoad,this)},initComponent:function(){this.callParent(arguments),this.treeLoader=new SYNO.SDS.Backup.Server.Explore.TreeLoader({nodeParameter:"folder_path",sendWebAPI:this.sendWebAPI.createDelegate(this),webapi:{api:"SYNO.Core.File",method:"list",version:1},createNodeScope:this,createNodeFn:function(e){e.checked=null,e.spath?(e.id=e.spath,e.abspath=e.path,e.path=e.spath,""!==e.mountType&&(e.hidden=!0)):e.path&&(e.id=e.path,e.abspath=e.additional.real_path,e.text=e.name,""!==e.additional.mount_point_type&&(e.hidden=!0))},parseWebApiResponse:function(e,t){var i=[];return i=t.files?t.files.filter((function(e){return!SYNO.SDS.Backup.Util.isRecycleBinFolder(e.path)&&e.additional.perm.acl.write})):t.filter((function(e){return"RW"===e.right})),e&&!e.isRoot&&i.length>this.treePanel.folderDisplayLimit?(e.attributes.expandable=!0,e.attributes.exceedLimit=!0,[]):i}.createDelegate(this),baseParams:{superuser:!1,status_filter:"valid",filetype:"dir",additional:["real_path","mount_point_type","perm"],support_enum_cold_storage:!0},owner:this}),this.treePanel=new SYNO.SDS.Backup.Server.Explore.PathSelector.TreePanel({loader:this.treeLoader,border:!1,folderDisplayLimit:1e4,root:new Ext.tree.AsyncTreeNode({name:"fm_root",id:"/",path:"/",text:_S("hostname"),cls:"root_node",expanded:!0,disabled:!0}),autoFlexcroll:!0,cls:"syno-sds-backup-filebrowser-treepanel",owner:this}),this.add(this.treePanel)},getParams:function(){return{dest_path:this.selectedPath,overwrite:this.treePanel.getBottomToolbar().getComponent("overwrite").checked}},onTreeLoad:function(e,t,i){!this.selectedPath&&0<i.length&&this.treePanel.getSelectionModel().select(this.treePanel.getNodeById(i[0].id))}}),Ext.define("SYNO.SDS.Backup.Server.Explore.PathSelector.TreePanel",{extend:"SYNO.SDS.Backup.Server.Explore.BasicTreePanel",initComponent:function(){this.bbar=[new Ext.form.Label({height:32,text:e("explorer","same_file_description")+":"}),new SYNO.ux.DisplayField({style:"width: 13px",fieldLabel:"",value:" ",htmlEncode:!1}),new SYNO.ux.Radio({itemId:"skip",boxLabel:e("explorer","skip"),name:"writestrategy",inputValue:"skip",checked:!0}),new SYNO.ux.DisplayField({style:"width: 13px",fieldLabel:"",value:" ",htmlEncode:!1}),new SYNO.ux.Radio({itemId:"overwrite",boxLabel:e("explorer","overwrite"),name:"writestrategy",inputValue:"overwrite"})],this.callParent(arguments)},initEvents:function(){this.callParent(arguments),this.mon(this,"beforeexpandnode",this.onBeforeExpandNode,this)},onBeforeExpandNode:function(e){if(e.attributes.exceedLimit)return this.owner.getMsgBox().alert(_T("tree","leaf_backup"),String.format(SYNO.SDS.Backup.String("app","node_exceed_display_limit"),e.text,this.folderDisplayLimit)),!1}})}();