@sync-in/server
Version:
The secure, open-source platform for file storage, sharing, collaboration, and sync
2 lines (1 loc) • 6.97 kB
JavaScript
import{a as M,b as R}from"./chunk-XBKCQCBI.js";import"./chunk-L3BIP4AA.js";import{f as I,h as W}from"./chunk-XTVNHFKX.js";import"./chunk-RTNEBRKJ.js";import{Cb as O,pb as N,qb as y,rb as d,s as b,xb as u,zb as A}from"./chunk-O3YLAEVE.js";import{d as w}from"./chunk-QHJT5H4M.js";import{Eb as x,Gb as m,Ia as C,Kd as z,Oa as o,Sb as T,Tb as a,Ub as p,ab as E,cc as g,ja as v,lb as S,mb as h,qg as D,rb as s,sb as i,tb as n,ub as l}from"./chunk-D55YR5X7.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import{i as P}from"./chunk-KAVP6UXH.js";function L(e,r){if(e&1&&l(0,"fa-icon",24),e&2){let t=m();T(g("circle-",t.syncService.wizard.remotePath.iconClass,"-icon")),s("icon",t.syncService.wizard.remotePath.icon)}}function Y(e,r){if(e&1&&l(0,"img",7),e&2){let t=m();s("src",t.syncService.wizard.remotePath.mimeUrl,C)}}function k(e,r){if(e&1&&(i(0,"div",18),a(1),n()),e&2){let t=m();o(),p(t.error)}}function B(e,r){e&1&&(i(0,"span",26),a(1,"and from"),n())}function F(e,r){e&1&&(i(0,"span",28),a(1,"to"),n())}function Z(e,r){e&1&&(i(0,"span",26),a(1,"(Two-Way)"),n())}function U(e,r){e&1&&(i(0,"span",26),a(1,"(One-Way)"),n())}function V(e,r){e&1&&(i(0,"span",28),a(1,"the most recent files will be kept"),n())}function $(e,r){if(e&1&&(i(0,"span",26),a(1,"the files in"),n(),i(2,"span",29),a(3),n(),i(4,"span",26),a(5,"will be preferred"),n()),e&2){let t=m(3);o(3),p(t.syncPath.settings.conflictMode===t.SYNC_PATH_CONFLICT_MODE.LOCAL?t.syncService.wizard.localPath.name:t.syncService.wizard.remotePath.name)}}function j(e,r){if(e&1&&(i(0,"div")(1,"span",26),a(2,"In case of conflict,"),n(),i(3,"span"),a(4,"\xA0"),n(),S(5,V,2,0,"span",28)(6,$,6,1),n()),e&2){let t=m(2);o(5),h(t.syncPath.settings.conflictMode===t.SYNC_PATH_CONFLICT_MODE.RECENT?5:6)}}function G(e,r){if(e&1&&(i(0,"div")(1,"span",26),a(2,"All files created or modified in"),n(),i(3,"span",30),a(4),n(),i(5,"span",26),a(6,"will be ignored and deleted"),n()()),e&2){let t=m(2);o(4),p(t.syncPath.settings.mode===t.SYNC_PATH_MODE.DOWNLOAD?t.syncService.wizard.localPath.name:t.syncService.wizard.remotePath.name)}}function q(e,r){if(e&1&&(i(0,"div",25)(1,"span",26),a(2,"The data will be synchronized from"),n(),i(3,"span",27),a(4),n(),S(5,B,2,0,"span",26)(6,F,2,0,"span",28),i(7,"span",27),a(8),n(),S(9,Z,2,0,"span",26)(10,U,2,0,"span",26),n(),l(11,"br"),i(12,"div",25),S(13,j,7,1,"div")(14,G,7,1,"div"),n()),e&2){let t=m();o(4),p(t.syncPath.settings.mode===t.SYNC_PATH_MODE.DOWNLOAD?"the server folder":"the client folder"),o(),h(t.syncPath.settings.mode===t.SYNC_PATH_MODE.BOTH?5:6),o(3),p(t.syncPath.settings.mode===t.SYNC_PATH_MODE.DOWNLOAD?"the client folder":"the server folder"),o(),h(t.syncPath.settings.mode===t.SYNC_PATH_MODE.BOTH?9:10),o(4),h(t.syncPath.settings.mode===t.SYNC_PATH_MODE.BOTH?13:14)}}var de=(()=>{let r=class r{constructor(){this.syncService=v(W),this.SYNC_PATH_CONFLICT_MODE=A,this.SYNC_PATH_MODE=u,this.icons={CLIENT:y.CLIENT,SERVER:y.SERVER},this.translatedRemotePath=this.syncService.translateServerPath(this.syncService.wizard.remotePath.serverPath),this.error=null,this.router=v(w),this.layout=v(O),this.syncPath=new I({settings:{name:this.syncService.wizard.localPath.name,localPath:this.syncService.wizard.localPath.path,remotePath:this.syncService.wizard.remotePath.serverPath,enabled:this.syncService.wizard.settings.enabled,mode:this.syncService.wizard.remotePath.isWriteable?this.syncService.wizard.settings.mode:u.DOWNLOAD,conflictMode:this.syncService.wizard.settings.conflictMode,diffMode:this.syncService.wizard.settings.diffMode,scheduler:this.syncService.wizard.settings.scheduler,permissions:this.syncService.wizard.remotePath.permissions}}),this.layout.setBreadcrumbIcon(y.WIZARD),this.layout.setBreadcrumbNav({url:`/${d.BASE}/${d.WIZARD}/${d.WIZARD_SETTINGS}/${N.WIZARD_SETTINGS}`,splicing:3,translating:!0,sameLink:!0})}onPrevious(){this.router.navigate([d.BASE,d.WIZARD,d.WIZARD_SERVER]).catch(console.error)}onSubmit(){return P(this,null,function*(){let _=yield this.syncService.addPath(this.syncPath.settings);typeof _=="string"?this.error=_:(yield this.syncService.refreshPaths(),this.router.navigate([d.BASE,d.PATHS],{state:{id:_.id,withSettings:!1}}).catch(console.error),this.syncService.resetWizard())})}};r.\u0275fac=function(f){return new(f||r)},r.\u0275cmp=E({type:r,selectors:[["app-sync-wizard-settings"]],decls:38,vars:12,consts:[[1,"wizard","fs-sm"],[1,"d-flex","flex-row","justify-content-center","mb-3"],[1,"d-flex","flex-column","align-items-end"],[1,"fw-bold","mb-1","me-1"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["placement","left",1,"cursor-pointer",3,"tooltip"],["alt","","height","35",3,"src"],[1,"position-absolute","text-truncate","pe-2",2,"top","110px"],[1,"d-flex","align-items-end","mb-2","mx-5"],[3,"syncPath"],[1,"d-flex","flex-column","align-items-start"],[1,"fw-bold","mb-1","ms-1"],["placement","right",1,"cursor-pointer",3,"tooltip"],[2,"width","32px","height","32px","font-size","16px",3,"icon","class"],[1,"position-absolute","text-truncate","ps-2",2,"top","110px"],[1,"mt-auto"],[1,"mb-auto"],["l10nTranslate","",1,"text-center","text-warning"],[1,"d-flex","align-items-start"],["translate","","type","button",1,"btn","btn-sm","btn-secondary","me-auto",3,"click"],[1,"fas","fa-arrow-circle-left","fa-fw"],["translate","","type","button",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click","disabled"],[1,"fas","fa-check-circle","fa-fw"],[2,"width","32px","height","32px","font-size","16px",3,"icon"],[1,"text-center"],["l10nTranslate",""],["l10nTranslate","",1,"mx-1"],["l10nTranslate","",1,"fw-bold"],[1,"fw-bold","mx-1"],["l10nTranslate","",1,"fw-bold","mx-1"]],template:function(f,c){f&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",2)(4,"div",3),l(5,"fa-icon",4),i(6,"span",5),a(7,"Client"),n()(),i(8,"div",6),l(9,"img",7),n(),i(10,"div",8),a(11),n()()(),i(12,"div",9),l(13,"app-sync-path-direction-icon",10),n(),i(14,"div",11)(15,"div",11)(16,"div",12),l(17,"fa-icon",4),i(18,"span",5),a(19,"Server"),n()(),i(20,"div",13),S(21,L,1,4,"fa-icon",14)(22,Y,1,1,"img",7),n(),i(23,"div",15),a(24),n()()()(),l(25,"hr",16)(26,"app-sync-path-settings",10)(27,"hr",17),S(28,k,2,1,"div",18)(29,q,15,5),i(30,"div",16)(31,"div",19)(32,"button",20),x("click",function(){return c.onPrevious()}),l(33,"i",21),a(34," Previous "),n(),i(35,"button",22),x("click",function(){return c.onSubmit()}),l(36,"i",23),a(37," Done "),n()()()()),f&2&&(o(5),s("icon",c.icons.CLIENT),o(3),s("tooltip",c.syncService.wizard.localPath.path),o(),s("src",c.syncService.wizard.localPath.mimeUrl,C),o(2),p(c.syncService.wizard.localPath.name),o(2),s("syncPath",c.syncPath),o(4),s("icon",c.icons.SERVER),o(3),s("tooltip",c.translatedRemotePath),o(),h(c.syncService.wizard.remotePath.icon?21:22),o(3),p(c.syncService.wizard.remotePath.name),o(2),s("syncPath",c.syncPath),o(2),h(c.error?28:29),o(7),s("disabled",!c.syncPath.settings.name))},dependencies:[z,D,b,M,R],encapsulation:2});let e=r;return e})();export{de as SyncWizardSettingsComponent};