@duplicati/ngclient 0.0.51 → 0.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/spk.woff2 +0 -0
- package/{chunk-QVBSCQE5.js → chunk-357MEO73.js} +1 -1
- package/{chunk-LDPVZ7HY.js → chunk-4JABYZCU.js} +1 -1
- package/{chunk-PG6H3R6N.js → chunk-52PLNEEU.js} +1 -1
- package/chunk-62SAGIBE.js +1 -0
- package/chunk-6FOLH2A7.js +1 -0
- package/{chunk-FNBPWR4X.js → chunk-6G5MO2LW.js} +1 -1
- package/{chunk-5CNGSXWF.js → chunk-6XUGGGJW.js} +1 -1
- package/chunk-7DNBOPA2.js +1 -0
- package/{chunk-2JNOYYQN.js → chunk-7RHSTKHT.js} +1 -1
- package/{chunk-3RFC4Q5V.js → chunk-7ZY4AW73.js} +1 -1
- package/chunk-DNXP5WQT.js +1 -0
- package/{chunk-TFD4HD6F.js → chunk-E6NXFEY6.js} +1 -1
- package/chunk-EANM4F5Q.js +1 -0
- package/{chunk-WDHZG25P.js → chunk-ETMR6JG6.js} +1 -1
- package/chunk-FUENP7LQ.js +1 -0
- package/chunk-HGKCNEQ4.js +1 -0
- package/{chunk-6XZQG7L7.js → chunk-HRUCGEQL.js} +1 -1
- package/{chunk-LQL7UFPH.js → chunk-HW2X3WEE.js} +1 -1
- package/{chunk-WMC5H5UV.js → chunk-IQNE6QMR.js} +1 -1
- package/chunk-IW4H6RJH.js +1 -0
- package/chunk-JFN26EE2.js +1 -0
- package/{chunk-YK6SXMBM.js → chunk-JRLAYIPU.js} +1 -1
- package/{chunk-MWCNA7Y5.js → chunk-MRRA6ZB2.js} +1 -1
- package/{chunk-FALW4SDX.js → chunk-NZ5QQIUJ.js} +1 -1
- package/chunk-NZJCL3BX.js +1 -0
- package/chunk-PFQRJ432.js +1 -0
- package/{chunk-CKTCGJPR.js → chunk-QLEXNL6F.js} +1 -1
- package/{chunk-OJUBI3TM.js → chunk-R5ARSI2W.js} +1 -1
- package/{chunk-4765QCNT.js → chunk-TLM42G2X.js} +1 -1
- package/{chunk-YWZWJHRE.js → chunk-TOUGWZ56.js} +1 -1
- package/chunk-VBS3YNVR.js +1 -0
- package/{chunk-OYSDTWXA.js → chunk-XWIXIQIA.js} +1 -1
- package/{chunk-Z7UXXM2M.js → chunk-XWRLDJ4Y.js} +1 -1
- package/chunk-YFA44VRS.js +1 -0
- package/{chunk-DV7N4NYO.js → chunk-ZJMDOZXF.js} +1 -1
- package/{chunk-VQMEOBKY.js → chunk-ZOOONPFY.js} +1 -1
- package/{chunk-MJJYBD2L.js → chunk-ZS2AJHUM.js} +1 -1
- package/index.html +2 -2
- package/{main-PXBN3JIX.js → main-G2EKF3C3.js} +1 -1
- package/package.json +1 -1
- package/styles-AIQ3E4AK.css +1 -0
- package/chunk-2UNV5KQ7.js +0 -1
- package/chunk-5FSG4VRJ.js +0 -1
- package/chunk-7PE677UQ.js +0 -1
- package/chunk-EMJLB63Y.js +0 -1
- package/chunk-FFD5RG7J.js +0 -1
- package/chunk-FJKXE3RZ.js +0 -1
- package/chunk-IE4GYLKI.js +0 -1
- package/chunk-JRYVI7GA.js +0 -1
- package/chunk-N23IUXUM.js +0 -1
- package/chunk-U4SEXW7F.js +0 -1
- package/chunk-VOVR4GPX.js +0 -1
- package/chunk-WVBAR46B.js +0 -1
- package/chunk-XMM537S7.js +0 -1
- package/styles-QS7LVTVV.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as z}from"./chunk-JFN26EE2.js";import{a as X}from"./chunk-O47LGUY4.js";import"./chunk-QXNJFFEM.js";import{b as L}from"./chunk-PSJAIBCQ.js";import{d as E}from"./chunk-B5F2IYXZ.js";import"./chunk-UMMURHDH.js";import{a as R,g as f,h as k,k as G,o as w}from"./chunk-YFA44VRS.js";import"./chunk-U5DDVNLJ.js";import"./chunk-R6C4MOOH.js";import"./chunk-X566VMXX.js";import"./chunk-BI7LIYF6.js";import{Ab as i,Bb as s,Cb as D,Db as b,Lb as h,Mb as y,Nb as c,Oa as p,Ob as A,Pb as I,Sb as S,X as d,bb as O,ec as l,hb as m,hc as B,nb as M,ob as P,oc as g,pc as v,qb as u,vb as F,wb as N,xb as x,yb as $,zb as e}from"./chunk-NHACGZPI.js";import"./chunk-C6Q5SG76.js";var W=()=>[k,f,R,E],j=()=>["/restore-from-files"],K=()=>["/restore/from-config"],q=t=>["/restore",t];function V(t,r){if(t&1&&(e(0,"spk-card",5),s(1,"img",10),e(2,"div",7)(3,"h3"),c(4,1),i(),e(5,"p"),l(6),i()(),e(7,"button",8),h(8,2),s(9,"spk-icon"),y(),i()()),t&2){let n,a,o=r.$implicit;p(4),A((n=o.Backup==null?null:o.Backup.Name)!==null&&n!==void 0?n:"Backup name missing"),I(4),p(2),B(" ",(a=o.Backup==null||o.Backup.Metadata==null?null:o.Backup.Metadata.SourceSizeString)!==null&&a!==void 0?a:"-"," / ",(a=o.Backup==null||o.Backup.Metadata==null?null:o.Backup.Metadata.BackupListCount)!==null&&a!==void 0?a:"-"," "),p(),u("routerLink",v(4,q,o.Backup==null?null:o.Backup.ID))}}function H(t,r){if(t&1&&x(0,V,10,6,"spk-card",5,N),t&2){let n=S(2);$(n.backups())}}function J(t,r){t&1&&(D(0),c(1,3),b())}function Q(t,r){if(t&1&&m(0,H,2,0)(1,J,2,0,"ng-container"),t&2){let n=S();F(n.backups().length?0:1)}}function U(t,r){t&1&&(e(0,"div",11),s(1,"spk-progress-bar",12),e(2,"div",7)(3,"h3"),c(4,4),i()()())}var C=class t{#e=d(X);#t=d(L);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups()}restoreNow(r){this.#t.postApiV1BackupByIdRestore({id:r.Backup?.ID,requestBody:{}})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=O({type:t,selectors:[["app-restore"]],decls:32,vars:5,consts:()=>{let r;r=$localize`Where do you want to restore from?`;let n;n=$localize`Restore ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let a;a=$localize` Restore ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let o;o=$localize`No backups founds`;let T;return T=$localize`Loading backups...`,[r,n,a,o,T,[1,"type-a"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["spk-button","",3,"routerLink"],["src","assets/images/restore.png","alt","","width","48px"],["src","assets/images/folder.png","alt","","width","48px"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(n,a){n&1&&(s(0,"app-status-bar"),e(1,"section")(2,"h2"),c(3,0),i(),e(4,"spk-card",5),s(5,"img",6),e(6,"div",7)(7,"h3"),l(8,"Direct restore from backup files"),i(),e(9,"p"),l(10,"Point to your backup files and restore from there."),i()(),e(11,"button",8),l(12," Start "),e(13,"spk-icon"),l(14,"play-circle"),i()()(),e(15,"spk-card",5),s(16,"img",9),e(17,"div",7)(18,"h3"),l(19,"Restore from configuration"),i(),e(20,"p"),l(21,"Load destination from an exported job or a storage provider"),i()(),e(22,"button",8),l(23," Start "),e(24,"spk-icon"),l(25,"play-circle"),i()()(),e(26,"spk-divider"),l(27,"Or existing"),i(),m(28,Q,2,1)(29,U,5,0),M(30,28,W,null,29),i()),n&2&&(p(11),u("routerLink",g(3,j)),p(11),u("routerLink",g(4,K)),p(8),P(!a.backupsLoading()))},dependencies:[z,k,f,G,R,w,E],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{font:var(--title-30);text-align:center;padding:2rem}section[_ngcontent-%COMP%]{max-width:43.75rem;margin:0 auto;padding:2rem 0;display:flex;flex-direction:column;gap:1rem}spk-divider[_ngcontent-%COMP%]{color:var(--base-level-60)}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;--card-padding: 2rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}"],changeDetection:0})};export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as me}from"./chunk-O47LGUY4.js";import{b as te,d as ie,g as ne,i as oe,q as ae}from"./chunk-QXNJFFEM.js";import{b as y,c as ee}from"./chunk-PSJAIBCQ.js";import{a as le,e as se,g as re,i as pe,l as ce,o as _e,q as de,r as ue}from"./chunk-YFA44VRS.js";import{a as ge}from"./chunk-R6C4MOOH.js";import{pa as Q}from"./chunk-X566VMXX.js";import{a as Se}from"./chunk-BI7LIYF6.js";import{Ab as l,Bb as q,E as T,Hc as B,Jc as L,L as F,Nb as d,Oa as r,R as V,Rb as m,Sb as b,Va as p,X as c,bb as O,eb as W,ec as S,fc as v,hb as X,hc as K,ic as Z,jc as f,kc as h,l as U,lc as C,oa as H,p as z,qb as _,sb as R,sc as x,tc as J,uc as Y,vb as j,wb as N,xb as D,yb as I,zb as s}from"./chunk-NHACGZPI.js";import{a as k,b as E}from"./chunk-C6Q5SG76.js";var A=class n{#e=c(Se);transform(e,...t){return this.#e.locale(),this.#e(e).fromNow()}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=W({name:"appRelativeTime",type:n,pure:!0})};var Pe={Backup_Begin:$localize`Starting backup …`,Backup_PreBackupVerify:$localize`Verifying backend data …`,Backup_PostBackupTest:$localize`Verifying remote data …`,Backup_PreviousBackupFinalize:$localize`Completing previous backup …`,Backup_ProcessingFiles:$localize`Processing files to backup …`,Backup_Finalize:$localize`Completing backup …`,Backup_WaitForUpload:$localize`Waiting for upload to finish …`,Backup_Delete:$localize`Deleting unwanted files …`,Backup_Compact:$localize`Compacting remote data …`,Backup_VerificationUpload:$localize`Uploading verification file …`,Backup_PostBackupVerify:$localize`Verifying backend data …`,Backup_Complete:$localize`Backup complete!`,Restore_Begin:$localize`Starting restore …`,Restore_RecreateDatabase:$localize`Rebuilding local database …`,Restore_PreRestoreVerify:$localize`Verifying remote data …`,Restore_CreateFileList:$localize`Building list of files to restore …`,Restore_CreateTargetFolders:$localize`Creating target folders …`,Restore_ScanForExistingFiles:$localize`Scanning existing files …`,Restore_ScanForLocalBlocks:$localize`Scanning for local blocks …`,Restore_PatchWithLocalBlocks:$localize`Patching files with local blocks …`,Restore_DownloadingRemoteFiles:$localize`Downloading files …`,Restore_PostRestoreVerify:$localize`Verifying restored files …`,Restore_Complete:$localize`Restore complete!`,Recreate_Running:$localize`Recreating database …`,Vacuum_Running:$localize`Vacuuming database …`,Repair_Running:$localize`Repairing database …`,Verify_Running:$localize`Verifying files …`,BugReport_Running:$localize`Creating bug report …`,Delete_Listing:$localize`Listing remote files …`,Delete_Deleting:$localize`Deleting remote files …`,"PurgeFiles_Begin,":$localize`Listing remote files for purge …`,"PurgeFiles_Process,":$localize`Purging files …`,"PurgeFiles_Compact,":$localize`Compacting remote data …`,"PurgeFiles_Complete,":$localize`Purging files complete!`,Error:$localize`Error!`},M=class n{#e=1e3;#i=c(ge);#m=c(ee);#p=c(y);#a=c(me);#t=p(!1);#l=p(!1);#c=p(this.#e);#_=p(null);#s=p(!1);#n=p(!1);#o=p(null);#S=p(!1);statusData=this.#_.asReadonly();serverState=B(()=>{let e=this.#o();return e?(e.ProposedSchedule=e?.ProposedSchedule?.map(t=>{let i=t.Item1?this.#a.getBackupById(t.Item1):null;return E(k({},t),{backup:i})}),e):null});isFetching=this.#l.asReadonly();#r=null;#g=L(()=>{let e=this.#t(),t=this.#c();if(!e||!t||t<this.#e){this.#r&&window.clearInterval(this.#r);return}this.#r=window.setInterval(()=>{this.#u()},t)});start(){this.#s.set(!0),this.#d()}stop(){this.#s.set(!1)}startPollingProgress(){this.#u(),this.#t.set(!0)}stopPollingProgress(){this.#t.set(!1)}setProgressStatePollingInterval(e){if(e<this.#e){console.error(`Polling interval must be at least ${this.#e}ms`);return}this.#c.set(e)}serverStateEffect=L(()=>{if(this.#S()){this.stopPollingProgress();return}!this.#n()&&this.#s()?setTimeout(()=>{this.startPollingProgress(),this.#d()},1e3):this.stopPollingProgress()});calculateProgress(e){let t=-1;if(e.task&&e)if(e.Phase==="Backup_ProcessingFiles"||e.Phase==="Restore_DownloadingRemoteFiles")if(e.StillCounting)t=0;else{let i=e.CurrentFilecomplete?0:e.CurrentFileoffset,o=e.TotalFileCount-e.ProcessedFileCount,a=e.TotalFileSize-e.ProcessedFileSize-i;t=(e.ProcessedFileSize+i)/e.TotalFileSize,e.ProcessedFileCount===0?t=0:t>=.9&&(t=.9)}else e.Phase==="Backup_Finalize"||e.Phase==="Backup_WaitForUpload"?t=.9:e.Phase==="Backup_Delete"||e.Phase==="Backup_Compact"?t=.95:e.Phase==="Backup_VerificationUpload"||e.Phase==="Backup_PostBackupVerify"?t=.98:e.Phase==="Backup_Complete"||e.Phase==="Backup_WaitForUpload"?t=1:e.OverallProgress>0&&(t=e.OverallProgress);return t}constructStatusText(e){let t="Running \u2026";if(e.task&&e&&(t=e.Phase?Pe[e.Phase]:"Running \u2026",e.Phase==="Backup_ProcessingFiles"||e.Phase==="Restore_DownloadingRemoteFiles"))if(e.StillCounting)t=`Counting (${e.TotalFileCount} files found, ${this.#i.transform(e.TotalFileSize)})`;else{let i=e.CurrentFilecomplete?0:e.CurrentFileoffset,o=e.TotalFileCount-e.ProcessedFileCount,a=e.TotalFileSize-e.ProcessedFileSize-i,g=e.BackendSpeed<0?"":` at ${this.#i.transform(e.BackendSpeed)}/s`;t=`${e.Phase==="Restore_DownloadingRemoteFiles"?"Restoring: ":""}${o} files (${this.#i.transform(a)}) to go ${g}`}return t}#d(){if(this.#n())return;this.#n.set(!0);let e=this.#o()?.LastEventID,t=e==null?{}:{lastEventId:e,longpoll:!0,duration:"299s"};this.#p.getApiV1Serverstate(t).pipe(T(()=>this.#n.set(!1))).subscribe({next:i=>{this.#o()?.LastDataUpdateID!==i.LastDataUpdateID&&this.#a.getBackups(),this.#o.set(i)}})}#u(){this.#l.set(!0),this.#m.getApiV1Progressstate().pipe(F(e=>{let t=e.TaskID??null;return t===null?U(e):this.#p.getApiV1TaskByTaskid({taskid:t}).pipe(z(i=>E(k({},e),{task:i??null})))}),T(()=>this.#l.set(!1))).subscribe({next:e=>{let t=e.TaskID??null,i=e.BackupID??null;if(t!==null&&i!==null){let o=this.#a.getBackupById(i);e.backup=o}e.task?.Status==="Completed"?this.#t.set(!1):this.#t.set(!0),this.#_.set(E(k({},e),{progress:this.calculateProgress(e),statusText:this.constructStatusText(e),actionText:e.backup?.Backup?.Name??$localize`Running task`}))},error:e=>{e.status===404&&this.#t.set(!1)}})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=V({token:n,factory:n.\u0275fac,providedIn:"root"})};function Ee(n,e){if(n&1&&(s(0,"spk-option",14),S(1),l()),n&2){let t=e.$implicit;_("value",t),r(),v(t)}}function Oe(n,e){if(n&1&&(s(0,"spk-option",14),S(1),l()),n&2){let t=e.$implicit;_("value",t),r(),v(t)}}var Re=["Byte/s","KByte/s","MByte/s","GByte/s","TByte/s","PByte/s"],G={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},Te=Object.entries(G).reduce((n,[e,t])=>(n[t]=e,n),{}),P=class n{#e=c(y);closed=H();isSubmitting=p(!1);sizeOptions=p(Re);maxUploadActive=p(!1);maxDownloadActive=p(!1);maxUpload=p(0);maxDownload=p(0);maxUploadUnit=p("MByte/s");maxDownloadUnit=p("MByte/s");ngOnInit(){this.init()}init(){this.#e.getApiV1Serversettings().subscribe({next:e=>{let t=e?.["max-upload-speed"]?.split(/(\d+)/),i=e?.["max-download-speed"]?.split(/(\d+)/),o=t[1]??"",a=i[1]??"",g=t[2]??"MB",u=i[2]??"MB",he=o===""?10:parseInt(o),Ce=a===""?10:parseInt(a);console.log(o),this.maxUploadUnit.set(Te[g]+"/s"),this.maxDownloadUnit.set(Te[u]+"/s"),this.maxUploadActive.set(o!==""),this.maxDownloadActive.set(a!==""),this.maxUpload.set(he),this.maxDownload.set(Ce)}})}submit(){this.isSubmitting.set(!0);let e=this.maxUploadActive()?`${this.maxUpload()}${G[this.maxUploadUnit().replace("/s","")]}`:"",t=this.maxDownloadActive()?`${this.maxDownload()}${G[this.maxDownloadUnit().replace("/s","")]}`:"";console.log(e,t),this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":e,"max-download-speed":t}}).pipe(T(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{this.closed.emit(!0)}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:30,vars:14,consts:()=>{let e;e=$localize`Throttle network speed`;let t;t=$localize` Max upload speed `;let i;i=$localize` Max download speed `;let o;o=$localize` Note that speeds are entered in bytes, and line speeds are typically reported in bits. Use a factor of 8 to convert, such that an 8 mbit/s line is equivalent to 1 MByte/s. `;let a;a=$localize`Cancel`;let g;return g=$localize` Update settings `,[e,t,i,o,a,g,["header",""],["content",""],[1,"column"],[1,"field-row"],[1,"primary","raised",3,"click"],["type","number",3,"ngModelChange","ngModel","disabled"],[3,"hideClearButton"],["type","text",3,"ngModelChange","ngModel"],[3,"value"],["footer",""],["spk-button","",3,"click"],["spk-button","",1,"raised","primary",3,"click"]]},template:function(t,i){t&1&&(s(0,"header",6)(1,"h3"),d(2,0),l()(),s(3,"div",7)(4,"div",8)(5,"div",9)(6,"spk-checkbox",10),m("click",function(){return i.maxUploadActive.set(!i.maxUploadActive())}),d(7,1),l(),s(8,"spk-form-field")(9,"input",11),C("ngModelChange",function(a){return h(i.maxUpload,a)||(i.maxUpload=a),a}),l()(),s(10,"spk-select",12)(11,"input",13),C("ngModelChange",function(a){return h(i.maxUploadUnit,a)||(i.maxUploadUnit=a),a}),l(),D(12,Ee,2,2,"spk-option",14,N),l()(),s(14,"div",9)(15,"spk-checkbox",10),m("click",function(){return i.maxDownloadActive.set(!i.maxDownloadActive())}),d(16,2),l(),s(17,"spk-form-field")(18,"input",11),C("ngModelChange",function(a){return h(i.maxDownload,a)||(i.maxDownload=a),a}),l()(),s(19,"spk-select",12)(20,"input",13),C("ngModelChange",function(a){return h(i.maxDownloadUnit,a)||(i.maxDownloadUnit=a),a}),l(),D(21,Oe,2,2,"spk-option",14,N),l()(),s(23,"p"),d(24,3),l()()(),s(25,"footer",15)(26,"button",16),m("click",function(){return i.closed.emit(!1)}),d(27,4),l(),s(28,"button",17),m("click",function(){return i.submit()}),d(29,5),l()()),t&2&&(r(6),R("active",i.maxUploadActive()),r(3),f("ngModel",i.maxUpload),_("disabled",!i.maxUploadActive()),r(),_("hideClearButton",!0),r(),f("ngModel",i.maxUploadUnit),r(),I(i.sizeOptions()),r(3),R("active",i.maxDownloadActive()),r(3),f("ngModel",i.maxDownload),_("disabled",!i.maxDownloadActive()),r(),_("hideClearButton",!0),r(),f("ngModel",i.maxDownloadUnit),r(),I(i.sizeOptions()),r(7),R("loader",i.isSubmitting()))},dependencies:[ae,te,oe,ie,ne,ue,de,ce,pe],styles:["[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;width:100%}"],changeDetection:0})};function Be(n,e){if(n&1&&(s(0,"div"),S(1),l(),q(2,"spk-progress-bar",6)),n&2){let t=b();r(),K("",t.statusData().actionText," - ",t.statusData().statusText,""),r(),_("value",t.statusData().progress*100)}}function ye(n,e){if(n&1&&(s(0,"div",3),S(1),x(2,"appRelativeTime"),x(3,"date"),l()),n&2){let t,i=b();r(),Z(" ",(t=i.nextBackup().backup)==null||t.Backup==null?null:t.Backup.Name," - ",J(2,3,i.nextBackup().time)," at ",Y(3,5,i.nextBackup().time,"shortTime")," ")}}function Ae(n,e){n&1&&(s(0,"div",3),d(1,0),l())}var fe=new Date,w=class n{#e=c(M);#i=c(se);minsAgo=fe.setMinutes(fe.getMinutes()-1);statusData=this.#e.statusData;serverState=this.#e.serverState;nextBackup=B(()=>({backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}));openThrottleSettingsDialog(){this.#i.open(P,{maxWidth:"550px",width:"100%"})}ngOnInit(){this.#e.start()}ngOnDestroy(){this.#e.stop()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["app-status-bar"]],decls:9,vars:1,consts:()=>{let e;return e=$localize`Loading...`,[e,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"current-backup-actions"],["spk-button","",3,"click"],[1,"raised","primary",3,"value"]]},template:function(t,i){if(t&1&&(s(0,"div",1)(1,"div",2),X(2,Be,3,3)(3,ye,4,8,"div",3)(4,Ae,2,0,"div",3),l(),s(5,"div",4)(6,"button",5),m("click",function(){return i.openThrottleSettingsDialog()}),s(7,"spk-icon"),S(8,"speedometer"),l()()()()),t&2){let o;r(2),j(!((o=i.statusData())==null||o.task==null)&&o.task.Status&&((o=i.statusData())==null||o.task==null?null:o.task.Status)!=="Completed"?2:i.nextBackup().backup||i.nextBackup().time?3:4)}},dependencies:[_e,A,Q,le,re],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-level-40)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{w as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-R5ARSI2W.js";import"./chunk-VJJVFTK5.js";import"./chunk-TLM42G2X.js";import"./chunk-NZ5QQIUJ.js";import"./chunk-TYEKJAUH.js";import"./chunk-QTTCN7A7.js";import"./chunk-QXNJFFEM.js";import"./chunk-PSJAIBCQ.js";import"./chunk-B5F2IYXZ.js";import"./chunk-UMMURHDH.js";import"./chunk-YFA44VRS.js";import"./chunk-U5DDVNLJ.js";import"./chunk-X566VMXX.js";import"./chunk-NHACGZPI.js";import"./chunk-C6Q5SG76.js";export{a as createRestoreOptionsForm,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as F}from"./chunk-JWC6WDAE.js";import{b as h,c as N,d as S,e as b,h as w,l as y,o as L,p as M,r as P}from"./chunk-QXNJFFEM.js";import"./chunk-
|
|
1
|
+
import{a as F}from"./chunk-JWC6WDAE.js";import"./chunk-XCS7POXG.js";import{b as h,c as N,d as S,e as b,h as w,l as y,o as L,p as M,r as P}from"./chunk-QXNJFFEM.js";import"./chunk-PSJAIBCQ.js";import{c as C}from"./chunk-B5F2IYXZ.js";import"./chunk-UMMURHDH.js";import{a as v,g as O,l as E}from"./chunk-YFA44VRS.js";import"./chunk-U5DDVNLJ.js";import"./chunk-X566VMXX.js";import{Ab as i,Bb as f,E as p,Oa as m,Rb as _,Va as d,X as s,bb as c,ec as n,qb as u,sb as g,zb as t}from"./chunk-NHACGZPI.js";import"./chunk-C6Q5SG76.js";var G=new M,a=class l{#e=s(C);#t=s(F);isLoading=d(!1);loginForm=G.group({pass:G.control("",N.required)});submit(){let e=this.loginForm.value.pass;e&&(this.isLoading.set(!0),this.#t.login(e).pipe(p(()=>this.isLoading.set(!1))).subscribe({next:()=>this.#e.navigate(["/"])}))}static \u0275fac=function(o){return new(o||l)};static \u0275cmp=c({type:l,selectors:[["app-login"]],decls:13,vars:3,consts:()=>{let e;return e=$localize`Enter your password`,[[3,"submit","formGroup"],[1,"login-row"],["for","password"],["href","https://docs.duplicati.com/detailed-descriptions/duplicati-access-password","target","_blank","rel","noopener noreferrer"],["type","password","name","password","autocomplete","current-password","placeholder",e,"tabindex","1","formControlName","pass"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(o,r){o&1&&(t(0,"form",0),_("submit",function(){return r.submit()}),t(1,"div",1)(2,"spk-form-field")(3,"label",2),n(4," Password "),t(5,"a",3)(6,"spk-icon"),n(7,"question"),i()()(),f(8,"input",4),i(),t(9,"button",5),n(10," Login "),t(11,"spk-icon"),n(12,"arrow-right"),i()()()()),o&2&&(u("formGroup",r.loginForm),m(9),g("loader",r.isLoading()))},dependencies:[P,w,h,S,b,y,L,E,v,O],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{width:100vw;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.5rem}h3[_ngcontent-%COMP%]{font:var(--title-30)}.login-row[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}"],changeDetection:0})};export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
1
|
+
import{a as u}from"./chunk-YFA44VRS.js";import{Ab as n,Oa as g,Rb as h,Tb as _,Ub as a,Ya as d,bb as p,ec as s,hb as m,pa as r,sb as f,vb as C,zb as o}from"./chunk-NHACGZPI.js";var v=[[["","title",""]],[["","description",""]],[["","action",""]],"*"],P=["[title]","[description]","[action]","*"];function M(e,l){e&1&&s(0,"Title")}function T(e,l){e&1&&(o(0,"spk-icon"),s(1,"caret-down"),n())}var c=class e{isActive=d(!1);disallowToggle=r(!1);ngOnInit(){this.disallowToggle()&&this.isActive.set(!0)}toggle(){this.isActive.set(!this.isActive())}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=p({type:e,selectors:[["app-toggle-card"]],hostVars:2,hostBindings:function(t,i){t&2&&f("active",i.isActive())},inputs:{isActive:[1,"isActive"],disallowToggle:[1,"disallowToggle"]},outputs:{isActive:"isActiveChange"},ngContentSelectors:P,decls:11,vars:1,consts:[[1,"title"],[3,"click"],[1,"actions"],[1,"content"]],template:function(t,i){t&1&&(_(v),o(0,"header")(1,"div",0)(2,"h3",1),h("click",function(){return i.disallowToggle()||i.toggle()}),a(3,0,null,M,1,0),m(5,T,2,0,"spk-icon"),n(),a(6,1),n(),o(7,"div",2),a(8,2),n()(),o(9,"div",3),a(10,3),n()),t&2&&(g(5),C(i.disallowToggle()?-1:5))},dependencies:[u],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;border-radius:var(--shape-3);background-color:var(--base-level-20)}.active[_nghost-%COMP%] .content[_ngcontent-%COMP%]{max-height:1000px;transition:max-height 1s linear;padding:0 1rem 1rem}.active[_nghost-%COMP%] spk-icon[_ngcontent-%COMP%]{transform:rotate(180deg)}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;font:var(--paragraph-10);cursor:pointer;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] spk-icon[_ngcontent-%COMP%]{transform:rotate(0);transform-origin:center;transition:transform .2s ease}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;flex:1 0}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]:empty{display:none}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0 1rem;overflow:hidden;max-height:0;transition:max-height .25s linear,padding .25s linear}.content[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0})};export{c as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as a,p as b}from"./chunk-TOUGWZ56.js";import"./chunk-TLM42G2X.js";import"./chunk-NZ5QQIUJ.js";import"./chunk-DNHLTHLR.js";import"./chunk-TYEKJAUH.js";import"./chunk-QTTCN7A7.js";import"./chunk-QXNJFFEM.js";import"./chunk-PSJAIBCQ.js";import"./chunk-B5F2IYXZ.js";import"./chunk-UMMURHDH.js";import"./chunk-YFA44VRS.js";import"./chunk-U5DDVNLJ.js";import"./chunk-X566VMXX.js";import"./chunk-NHACGZPI.js";import"./chunk-C6Q5SG76.js";export{a as createSourceDataForm,b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as a,n as b}from"./chunk-TOUGWZ56.js";import"./chunk-TLM42G2X.js";import"./chunk-NZ5QQIUJ.js";import"./chunk-DNHLTHLR.js";import"./chunk-TYEKJAUH.js";import"./chunk-QTTCN7A7.js";import"./chunk-QXNJFFEM.js";import"./chunk-PSJAIBCQ.js";import"./chunk-B5F2IYXZ.js";import"./chunk-UMMURHDH.js";import"./chunk-YFA44VRS.js";import"./chunk-U5DDVNLJ.js";import"./chunk-X566VMXX.js";import"./chunk-NHACGZPI.js";import"./chunk-C6Q5SG76.js";export{a as createScheduleForm,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ae}from"./chunk-TYEKJAUH.js";import{
|
|
1
|
+
import{b as ae}from"./chunk-TYEKJAUH.js";import{a as te}from"./chunk-JFN26EE2.js";import{a as ee}from"./chunk-O47LGUY4.js";import{b as j,d as H,g as J,q as Q}from"./chunk-QXNJFFEM.js";import{b as W}from"./chunk-PSJAIBCQ.js";import{a as z,d as q}from"./chunk-B5F2IYXZ.js";import"./chunk-UMMURHDH.js";import{a as Y,g as Z,l as x}from"./chunk-YFA44VRS.js";import"./chunk-U5DDVNLJ.js";import"./chunk-R6C4MOOH.js";import"./chunk-X566VMXX.js";import"./chunk-BI7LIYF6.js";import{Ab as a,B as g,Bb as l,E as u,Hc as C,Jc as h,L as k,Lb as r,Mb as p,Nb as T,Oa as s,Ob as L,Pb as U,Rb as A,Va as c,X as D,bb as y,ec as E,hb as v,jc as w,kc as X,lc as V,p as O,qb as F,sb as P,ub as G,vb as K,zb as i}from"./chunk-NHACGZPI.js";import"./chunk-C6Q5SG76.js";function ie(S,t){S&1&&(i(0,"spk-icon",18),E(1,"check"),a())}function ne(S,t){S&1&&(i(0,"spk-icon",18),E(1,"warning"),a())}var m=class S{#a=D(z);#i=D(ee);#e=D(W);#t="";backupId=ae(this.#a.params.pipe(O(t=>t.id)));activeBackup=C(()=>{let t=this.#i.backups().find(_=>_.Backup?.ID===this.backupId());return this.#t=t?.Backup?.DBPath??"",t});backupFilePath=c("");lastValidatedPath=c("");isValidatedPath=C(()=>this.lastValidatedPath()===this.backupFilePath());backupFilePathEffect=h(()=>{let t=this.backupFilePath();t!==""&&this.#e.postApiV1FilesystemValidate({requestBody:{path:t}}).subscribe({next:()=>this.lastValidatedPath.set(t)})});isRestoring=c(!1);isRepairing=c(!1);isDeleting=c(!1);isSavingDbPath=c(!1);isSavingAndRepairing=c(!1);isMovingDb=c(!1);activeBackupEffect=h(()=>{let t=this.activeBackup();if(!t)return;let _=t.Backup?.DBPath??"";this.backupFilePath.set(_)});repairDatabase(){this.isRepairing.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),u(()=>this.isRepairing.set(!1))).subscribe()}deleteDatabase(){this.isDeleting.set(!0),this.#e.postApiV1BackupByIdDeletedb({id:this.backupId()}).pipe(g(1),u(()=>this.isDeleting.set(!1))).subscribe()}restoreDatabase(){this.isRestoring.set(!0),this.#e.postApiV1BackupByIdDeletedb({id:this.backupId()}).pipe(g(1),k(()=>this.#e.postApiV1BackupByIdRepair({id:this.backupId()})),u(()=>this.isRestoring.set(!1))).subscribe()}resetDatabasePath(){this.backupFilePath.set(this.#t)}saveDatabasePath(){this.isSavingDbPath.set(!0),this.#e.postApiV1BackupByIdUpdatedb({id:this.backupId(),requestBody:{path:this.backupFilePath()}}).pipe(u(()=>this.isSavingDbPath.set(!1))).subscribe()}saveAndRepairDatabasePath(){this.isSavingAndRepairing.set(!0),this.#e.postApiV1BackupByIdUpdatedb({id:this.backupId(),requestBody:{path:this.backupFilePath()}}).pipe(k(()=>this.#e.postApiV1BackupByIdRepair({id:this.backupId()})),u(()=>this.isSavingAndRepairing.set(!1)))}moveDatabasePath(){this.isMovingDb.set(!0),this.#e.postApiV1BackupByIdMovedb({id:this.backupId(),requestBody:{path:this.backupFilePath()}}).pipe(u(()=>this.isMovingDb.set(!1))).subscribe()}static \u0275fac=function(_){return new(_||S)};static \u0275cmp=y({type:S,selectors:[["app-database"]],decls:46,vars:15,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let _;_=$localize`Local database for ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize` Each backup has a local database associated with it, which stores information about the remote backup on the local machine. This makes it faster to perform many operations, and reduces the amount of data that needs to be downloaded for each operation. `;let n;n=$localize`Maintainance`;let d;d=$localize` If the backup and the remote storage is out of sync, Duplicati will require that you perform a repair operation to synchronize the database. If the repair is unsuccessful, you can delete the local database and re-generate. `;let f;f=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:wrench${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Repair `;let b;b=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:trash${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Delete `;let B;B=$localize`${"\uFFFD#25\uFFFD"}:START_TAG_SPK_ICON:clock-counter-clockwise${"\uFFFD/#25\uFFFD"}:CLOSE_TAG_SPK_ICON: Restore (delete and repair) `;let I;I=$localize`Placement`;let M;M=$localize`${"\uFFFD#36\uFFFD"}:START_TAG_SPK_ICON:backspace${"\uFFFD/#36\uFFFD"}:CLOSE_TAG_SPK_ICON: Reset `;let N;N=$localize`${"\uFFFD#39\uFFFD"}:START_TAG_SPK_ICON:floppy-disk${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SPK_ICON: Save `;let $;$=$localize`${"\uFFFD#42\uFFFD"}:START_TAG_SPK_ICON:wrench${"\uFFFD/#42\uFFFD"}:CLOSE_TAG_SPK_ICON: Save & Repair `;let R;return R=$localize`${"\uFFFD#45\uFFFD"}:START_TAG_SPK_ICON:flow-arrow${"\uFFFD/#45\uFFFD"}:CLOSE_TAG_SPK_ICON: Move existing database `,[t,_,e,n,d,f,b,B,I,M,N,$,R,[1,"back"],["type","button","spk-button","","routerLink","/",1,"small"],[1,"actions","maintainance"],["spk-button","",3,"click"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[1,"actions","placement"],["spk-button","",3,"click","disabled"]]},template:function(_,e){if(_&1&&(l(0,"app-status-bar"),i(1,"section")(2,"div",13)(3,"button",14),r(4,0),l(5,"spk-icon"),p(),a()(),i(6,"article")(7,"h1"),T(8,1),a(),i(9,"p"),T(10,2),a()(),i(11,"article")(12,"h2"),T(13,3),a(),i(14,"p"),T(15,4),a(),i(16,"div",15)(17,"button",16),A("click",function(){return e.repairDatabase()}),r(18,5),l(19,"spk-icon"),p(),a(),i(20,"button",16),A("click",function(){return e.deleteDatabase()}),r(21,6),l(22,"spk-icon"),p(),a(),i(23,"button",16),A("click",function(){return e.restoreDatabase()}),r(24,7),l(25,"spk-icon"),p(),a()()(),i(26,"article")(27,"h2"),T(28,8),a(),i(29,"spk-form-field")(30,"input",17),V("ngModelChange",function(d){return X(e.backupFilePath,d)||(e.backupFilePath=d),d}),a(),v(31,ie,2,0,"spk-icon",18)(32,ne,2,0,"spk-icon",18),a(),i(33,"div",19)(34,"button",20),A("click",function(){return e.resetDatabasePath()}),r(35,9),l(36,"spk-icon"),p(),a(),i(37,"button",20),A("click",function(){return e.saveDatabasePath()}),r(38,10),l(39,"spk-icon"),p(),a(),i(40,"button",20),A("click",function(){return e.saveAndRepairDatabasePath()}),r(41,11),l(42,"spk-icon"),p(),a(),i(43,"button",20),A("click",function(){return e.moveDatabasePath()}),r(44,12),l(45,"spk-icon"),p(),a()()()()),_&2){let n;s(8),L((n=e.activeBackup())==null||n.Backup==null?null:n.Backup.Name),U(8),s(9),P("loader",e.isRepairing()),s(3),P("loader",e.isDeleting()),s(3),P("loader",e.isRestoring()),s(6),G(e.isValidatedPath()?"success":"warn"),s(),w("ngModel",e.backupFilePath),s(),K(e.isValidatedPath()?31:32),s(3),F("disabled",!e.isValidatedPath()),s(3),F("disabled",!e.isValidatedPath()),s(3),F("disabled",!e.isValidatedPath()),s(3),F("disabled",!e.isValidatedPath())}},dependencies:[Q,j,H,J,te,Z,x,Y,q],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem}article[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}h1[_ngcontent-%COMP%]{font:var(--title-20)}h2[_ngcontent-%COMP%]{font:var(--title-30)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as De}from"./chunk-VJJVFTK5.js";import{a as Y}from"./chunk-4765QCNT.js";import{a as ye}from"./chunk-FALW4SDX.js";import{b as w}from"./chunk-TYEKJAUH.js";import{a as Ne,b as M,d as h,e as k,h as L,j as Pe,l as $,o as y,p as D,r as A}from"./chunk-QXNJFFEM.js";import{b as I}from"./chunk-PSJAIBCQ.js";import{a as P,c as d}from"./chunk-B5F2IYXZ.js";import{a as b,g as v,l as Ie,o as Me,p as he,q as ke,r as Le,w as $e}from"./chunk-FFD5RG7J.js";import{pa as z}from"./chunk-X566VMXX.js";import{Ab as a,B as le,Bb as l,Cb as W,Db as B,E as f,Fb as X,Hc as Ce,Jc as Re,K as pe,L as _e,Lb as c,Mb as u,Nb as T,Oa as S,Ob as Ee,Pb as Te,R as ce,Rb as O,Sb as j,Va as _,X as p,bb as N,c as ne,ca as C,da as R,ec as V,hb as U,hc as Oe,l as re,nc as de,p as se,qb as m,sb as ue,sc as ge,uc as fe,v as ae,vb as x,wb as Fe,xb as Se,yb as me,zb as r}from"./chunk-NHACGZPI.js";var Ae=new D,we=()=>Ae.group({passphrase:Ae.control("")}),q=class s{#t=p(I);#e=p(g);#o=p(d);#i=p(P);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);next(){let o=this.#e.destinationTargetUrl();if(!o)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[{Name:"--no-encryption",Value:"true"}];e&&(t=[{Name:"--passphrase",Value:e}]),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:o,Settings:t}},temporary:!0}).pipe(f(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:i=>{let n=i.ID;this.#e.getBackup(n),this.#o.navigate([`/restore-draft/${n}`])},error:i=>{console.error(i)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["encryption"],{relativeTo:this.#i.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=N({type:s,selectors:[["app-restore-encryption"]],decls:12,vars:1,consts:()=>{let o;o=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let i;return i=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `,[e,t,i,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",o,"formControlName","passphrase"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",3),O("submit",function(){return t.next()}),r(1,"spk-form-field")(2,"label",4),T(3,0),a(),l(4,"input",5),a(),r(5,"div",6)(6,"button",7),O("click",function(){return t.back()}),c(7,1),l(8,"spk-icon"),u(),a(),r(9,"button",8),c(10,2),l(11,"spk-icon"),u(),a()()()),e&2&&m("formGroup",t.encryptionForm)},dependencies:[A,L,M,h,k,$,y,Ie,b,v],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function We(s,o){s&1&&l(0,"spk-progress-bar",7)}function Be(s,o){if(s&1&&(r(0,"spk-option",13),V(1),ge(2,"date"),a()),s&2){let e=o.$implicit;m("value",e.Version),S(),Oe(" ",e.Version,": ",fe(2,3,e.Time,"d MMM y, h:mm")," ")}}function Xe(s,o){s&1&&l(0,"spk-progress-bar",7)}function Ve(s,o){if(s&1&&(r(0,"app-file-tree",14)(1,"label",15),T(2,4),a(),l(3,"input",16),a()),s&2){let e=j(2);m("rootPath",e.rootPath())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function ze(s,o){if(s&1&&(r(0,"spk-select",11),l(1,"input",12),Se(2,Be,3,6,"spk-option",13,Fe),a(),U(4,Xe,1,0,"spk-progress-bar",7)(5,Ve,4,4,"app-file-tree",14)),s&2){let e=j();m("displayFn",e.displayFn())("hideClearButton",!0),S(2),me(e.versionOptions()),S(2),x(e.isDraft()&&e.isRepairing()||!e.rootPathLoaded()?4:-1),S(),x(e.rootPathLoaded()&&(e.isDraft()&&!e.isRepairing()||!e.isDraft())?5:-1)}}var K=new D,Ge=()=>K.group({filesToRestore:K.control(""),selectedOption:K.control(null),passphrase:K.control(null)}),J=class s{#t=p(I);#e=p(g);#o=p(d);#i=p(P);#n=p(z);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectedOptionSignal=w(this.selectFilesForm.controls.selectedOption.valueChanges);backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isDraft=this.#e.isDraft;isFileRestore=this.#e.isFileRestore;backupSettings=Ce(()=>{let o=this.backupId(),e=this.selectFilesFormSignal(),t=e?.selectedOption?parseInt(e?.selectedOption):null;if(typeof t!="number"||!o)return null;let n=this.versionOptions()?.find(F=>F.Version===t)?.Time??null;return n?{id:o,time:n}:null});isRepairing=_(!1);repairEffect=Re(()=>{let o=this.#e.isDraft(),e=this.selectedOptionSignal();if(o&&e){let t=this.backupId();this.isRepairing.set(!0),this.#t.postApiV1BackupByIdRepairupdate({id:t,requestBody:{only_paths:!0,time:new Date().toISOString()}}).pipe(f(()=>this.isRepairing.set(!1))).subscribe()}});rootPathLoaded=_(!1);rootPath=De([this.selectFilesFormSignal,this.backupId],ne(pe([null,null]),_e(([o,e])=>{let t=o?.selectedOption?parseInt(o?.selectedOption):null,i=e;if(typeof t!="number"||!i)return re("/");let n=this.versionOptions()?.find(F=>F.Version===t);return this.#t.getApiV1BackupByIdFiles({id:i,time:n?.Time??"",prefixOnly:!1,folderContents:!0}).pipe(se(F=>(this.rootPathLoaded.set(!0),F.Files[0].Path)))})));displayFn(){let o=this.versionOptions();return e=>{if(!e)return"";let t=o?.find(i=>i.Version?.toString()===e);return t?`${t.Version}: ${this.#n.transform(t.Time,"d MMM y, h:mm")}`:""}}next(){this.#o.navigate(["options"],{relativeTo:this.#i.parent})}back(){this.#e.isFileRestore()?this.#o.navigate(["encryption"],{relativeTo:this.#i.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=N({type:s,selectors:[["app-select-files"]],features:[de([z])],decls:13,vars:3,consts:()=>{let o;o=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let i;i=$localize`Select an option...`;let n;return n=$localize`Path`,[["formRef",""],o,e,t,n,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"displayFn","hideClearButton"],["type","text","placeholder",i,"formControlName","selectedOption"],[3,"value"],[3,"rootPath","backupSettings","multiSelect","showFiles"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let i=X();r(0,"form",5,0),O("submit",function(){return C(i),R(t.next())}),r(2,"h3",6),T(3,1),a(),U(4,We,1,0,"spk-progress-bar",7)(5,ze,6,4),r(6,"div",8)(7,"button",9),O("click",function(){return C(i),R(t.back())}),c(8,2),l(9,"spk-icon"),u(),a(),r(10,"button",10),c(11,3),l(12,"spk-icon"),u(),a()()()}e&2&&(m("formGroup",t.selectFilesForm),S(4),x(t.versionOptionsLoading()?4:5),S(5),Ee(t.isFileRestore()?"Back":"Exit"),Te(8))},dependencies:[A,L,M,h,k,$,y,z,Y,v,ke,b,Le,Me],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var g=class s{#t=p(d);#e=p(I);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=Ge();optionsForm=xe();encryptionForm=we();optionsFormSignal=w(this.optionsForm.valueChanges);selectFilesFormSignal=w(this.selectFilesForm.valueChanges);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isDraft=_(!1);isFileRestore=_(!1);init(o,e=!1,t=!1){this.backupId.set(o),this.isFileRestore.set(e),this.isDraft.set(t),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(o,!0)}updateTargetUrl(o){this.destinationTargetUrl.set(o)}submit(){this.isSubmitting.set(!0);let o=this.backupId(),e=this.optionsForm.value,t=this.selectFilesForm.value,i=this.versionOptions()?.find(n=>n.Version===t.selectedOption);this.#e.postApiV1BackupByIdRestore({id:o??"",requestBody:{paths:t.filesToRestore?.split("\0").map(n=>`${n}*`)??[],passphrase:t.passphrase??null,time:i?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!0}}).pipe(f(()=>this.isSubmitting.set(!1))).subscribe({next:()=>this.exit(),error:n=>{console.error("restore error",n)}})}exit(){this.#o(),this.#t.navigate(["/"])}getVersionOptions(){this.versionOptions()}getBackup(o,e=!1){this.versionOptionsLoading.set(!0),ae([this.#e.getApiV1BackupById({id:o}),this.#e.getApiV1BackupByIdFilesets({id:o})]).pipe(le(1),f(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,i])=>{this.versionOptions.set(i),this.backup.set(t),e&&i.length>0&&this.selectFilesForm.controls.selectedOption.setValue(i[0].Version)}})}#o(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||s)};static \u0275prov=ce({token:s,factory:s.\u0275fac,providedIn:"root"})};var G=new D,xe=()=>G.group({restoreFrom:G.control("orignal"),restoreFromPath:G.control(""),handleExisting:G.control("overwrite"),permissions:G.control(!1)}),Q=class s{#t=p(g);#e=p(d);#o=p(P);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=N({type:s,selectors:[["app-options"]],decls:39,vars:6,consts:()=>{let o;o=$localize`Restore options`;let e;e=$localize`Where do you want to restore files from?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let i;i=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let F;F=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let Z;Z=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let ee;ee=$localize`Permissions`;let te;te=$localize` Restore read/write permissions ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let oe;oe=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#35\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let ie;return ie=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],o,e,t,i,n,F,Z,ee,te,oe,ie,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let i=X();r(0,"form",12,0),O("submit",function(){return C(i),R(t.submit())}),r(2,"h3",13),T(3,1),a(),r(4,"app-toggle-card",14),W(5,15),T(6,2),B(),r(7,"spk-radio",16),c(8,3),l(9,"input",17),u(),a(),r(10,"spk-radio",16),c(11,4),l(12,"input",18),u(),a(),r(13,"app-file-tree",19)(14,"label",20),V(15,"Path"),a(),l(16,"input",21),a()(),r(17,"app-toggle-card",14),W(18,15),T(19,5),B(),r(20,"spk-radio",16),c(21,6),l(22,"input",22),u(),a(),r(23,"spk-radio",16),c(24,7),l(25,"input",23),u(),a()(),r(26,"app-toggle-card"),W(27,15),T(28,8),B(),r(29,"spk-toggle",24),c(30,9),l(31,"input",25),u(),a()(),r(32,"div",26)(33,"button",27),O("click",function(){return C(i),R(t.goBack())}),c(34,10),l(35,"spk-icon"),u(),a(),r(36,"button",28),c(37,11),l(38,"spk-icon"),u(),a()()()}if(e&2){let i;m("formGroup",t.optionsForm),S(4),m("disallowToggle",!0),S(9),m("disabled",((i=t.optionsFormSignal())==null?null:i.restoreFrom)!=="pickLocation"),S(4),m("disallowToggle",!0),S(19),ue("loader",t.isSubmitting())}},dependencies:[A,L,M,Ne,Pe,h,k,$,y,ye,Y,$e,he,v,b],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{xe as a,Q as b,we as c,q as d,Ge as e,J as f,g};
|
|
1
|
+
import{a as De}from"./chunk-VJJVFTK5.js";import{a as Y}from"./chunk-TLM42G2X.js";import{a as ye}from"./chunk-NZ5QQIUJ.js";import{b as w}from"./chunk-TYEKJAUH.js";import{a as Ne,b as M,d as h,e as k,h as L,j as Pe,l as $,o as y,p as D,r as A}from"./chunk-QXNJFFEM.js";import{b as I}from"./chunk-PSJAIBCQ.js";import{a as P,c as d}from"./chunk-B5F2IYXZ.js";import{a as b,g as v,l as Ie,o as Me,p as he,q as ke,r as Le,w as $e}from"./chunk-YFA44VRS.js";import{pa as z}from"./chunk-X566VMXX.js";import{Ab as a,B as le,Bb as l,Cb as W,Db as B,E as f,Fb as X,Hc as Ce,Jc as Re,K as pe,L as _e,Lb as c,Mb as u,Nb as T,Oa as S,Ob as Ee,Pb as Te,R as ce,Rb as O,Sb as j,Va as _,X as p,bb as N,c as ne,ca as C,da as R,ec as V,hb as U,hc as Oe,l as re,nc as de,p as se,qb as m,sb as ue,sc as ge,uc as fe,v as ae,vb as x,wb as Fe,xb as Se,yb as me,zb as r}from"./chunk-NHACGZPI.js";var Ae=new D,we=()=>Ae.group({passphrase:Ae.control("")}),q=class s{#t=p(I);#e=p(g);#o=p(d);#i=p(P);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);next(){let o=this.#e.destinationTargetUrl();if(!o)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[{Name:"--no-encryption",Value:"true"}];e&&(t=[{Name:"--passphrase",Value:e}]),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:o,Settings:t}},temporary:!0}).pipe(f(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:i=>{let n=i.ID;this.#e.getBackup(n),this.#o.navigate([`/restore-draft/${n}`])},error:i=>{console.error(i)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["encryption"],{relativeTo:this.#i.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=N({type:s,selectors:[["app-restore-encryption"]],decls:12,vars:1,consts:()=>{let o;o=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let i;return i=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `,[e,t,i,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",o,"formControlName","passphrase"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",3),O("submit",function(){return t.next()}),r(1,"spk-form-field")(2,"label",4),T(3,0),a(),l(4,"input",5),a(),r(5,"div",6)(6,"button",7),O("click",function(){return t.back()}),c(7,1),l(8,"spk-icon"),u(),a(),r(9,"button",8),c(10,2),l(11,"spk-icon"),u(),a()()()),e&2&&m("formGroup",t.encryptionForm)},dependencies:[A,L,M,h,k,$,y,Ie,b,v],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function We(s,o){s&1&&l(0,"spk-progress-bar",7)}function Be(s,o){if(s&1&&(r(0,"spk-option",13),V(1),ge(2,"date"),a()),s&2){let e=o.$implicit;m("value",e.Version),S(),Oe(" ",e.Version,": ",fe(2,3,e.Time,"d MMM y, h:mm")," ")}}function Xe(s,o){s&1&&l(0,"spk-progress-bar",7)}function Ve(s,o){if(s&1&&(r(0,"app-file-tree",14)(1,"label",15),T(2,4),a(),l(3,"input",16),a()),s&2){let e=j(2);m("rootPath",e.rootPath())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function ze(s,o){if(s&1&&(r(0,"spk-select",11),l(1,"input",12),Se(2,Be,3,6,"spk-option",13,Fe),a(),U(4,Xe,1,0,"spk-progress-bar",7)(5,Ve,4,4,"app-file-tree",14)),s&2){let e=j();m("displayFn",e.displayFn())("hideClearButton",!0),S(2),me(e.versionOptions()),S(2),x(e.isDraft()&&e.isRepairing()||!e.rootPathLoaded()?4:-1),S(),x(e.rootPathLoaded()&&(e.isDraft()&&!e.isRepairing()||!e.isDraft())?5:-1)}}var K=new D,Ge=()=>K.group({filesToRestore:K.control(""),selectedOption:K.control(null),passphrase:K.control(null)}),J=class s{#t=p(I);#e=p(g);#o=p(d);#i=p(P);#n=p(z);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectedOptionSignal=w(this.selectFilesForm.controls.selectedOption.valueChanges);backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isDraft=this.#e.isDraft;isFileRestore=this.#e.isFileRestore;backupSettings=Ce(()=>{let o=this.backupId(),e=this.selectFilesFormSignal(),t=e?.selectedOption?parseInt(e?.selectedOption):null;if(typeof t!="number"||!o)return null;let n=this.versionOptions()?.find(F=>F.Version===t)?.Time??null;return n?{id:o,time:n}:null});isRepairing=_(!1);repairEffect=Re(()=>{let o=this.#e.isDraft(),e=this.selectedOptionSignal();if(o&&e){let t=this.backupId();this.isRepairing.set(!0),this.#t.postApiV1BackupByIdRepairupdate({id:t,requestBody:{only_paths:!0,time:new Date().toISOString()}}).pipe(f(()=>this.isRepairing.set(!1))).subscribe()}});rootPathLoaded=_(!1);rootPath=De([this.selectFilesFormSignal,this.backupId],ne(pe([null,null]),_e(([o,e])=>{let t=o?.selectedOption?parseInt(o?.selectedOption):null,i=e;if(typeof t!="number"||!i)return re("/");let n=this.versionOptions()?.find(F=>F.Version===t);return this.#t.getApiV1BackupByIdFiles({id:i,time:n?.Time??"",prefixOnly:!1,folderContents:!0}).pipe(se(F=>(this.rootPathLoaded.set(!0),F.Files[0].Path)))})));displayFn(){let o=this.versionOptions();return e=>{if(!e)return"";let t=o?.find(i=>i.Version?.toString()===e);return t?`${t.Version}: ${this.#n.transform(t.Time,"d MMM y, h:mm")}`:""}}next(){this.#o.navigate(["options"],{relativeTo:this.#i.parent})}back(){this.#e.isFileRestore()?this.#o.navigate(["encryption"],{relativeTo:this.#i.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=N({type:s,selectors:[["app-select-files"]],features:[de([z])],decls:13,vars:3,consts:()=>{let o;o=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let i;i=$localize`Select an option...`;let n;return n=$localize`Path`,[["formRef",""],o,e,t,n,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"displayFn","hideClearButton"],["type","text","placeholder",i,"formControlName","selectedOption"],[3,"value"],[3,"rootPath","backupSettings","multiSelect","showFiles"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let i=X();r(0,"form",5,0),O("submit",function(){return C(i),R(t.next())}),r(2,"h3",6),T(3,1),a(),U(4,We,1,0,"spk-progress-bar",7)(5,ze,6,4),r(6,"div",8)(7,"button",9),O("click",function(){return C(i),R(t.back())}),c(8,2),l(9,"spk-icon"),u(),a(),r(10,"button",10),c(11,3),l(12,"spk-icon"),u(),a()()()}e&2&&(m("formGroup",t.selectFilesForm),S(4),x(t.versionOptionsLoading()?4:5),S(5),Ee(t.isFileRestore()?"Back":"Exit"),Te(8))},dependencies:[A,L,M,h,k,$,y,z,Y,v,ke,b,Le,Me],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var g=class s{#t=p(d);#e=p(I);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=Ge();optionsForm=xe();encryptionForm=we();optionsFormSignal=w(this.optionsForm.valueChanges);selectFilesFormSignal=w(this.selectFilesForm.valueChanges);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isDraft=_(!1);isFileRestore=_(!1);init(o,e=!1,t=!1){this.backupId.set(o),this.isFileRestore.set(e),this.isDraft.set(t),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(o,!0)}updateTargetUrl(o){this.destinationTargetUrl.set(o)}submit(){this.isSubmitting.set(!0);let o=this.backupId(),e=this.optionsForm.value,t=this.selectFilesForm.value,i=this.versionOptions()?.find(n=>n.Version===t.selectedOption);this.#e.postApiV1BackupByIdRestore({id:o??"",requestBody:{paths:t.filesToRestore?.split("\0").map(n=>`${n}*`)??[],passphrase:t.passphrase??null,time:i?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!0}}).pipe(f(()=>this.isSubmitting.set(!1))).subscribe({next:()=>this.exit(),error:n=>{console.error("restore error",n)}})}exit(){this.#o(),this.#t.navigate(["/"])}getVersionOptions(){this.versionOptions()}getBackup(o,e=!1){this.versionOptionsLoading.set(!0),ae([this.#e.getApiV1BackupById({id:o}),this.#e.getApiV1BackupByIdFilesets({id:o})]).pipe(le(1),f(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,i])=>{this.versionOptions.set(i),this.backup.set(t),e&&i.length>0&&this.selectFilesForm.controls.selectedOption.setValue(i[0].Version)}})}#o(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||s)};static \u0275prov=ce({token:s,factory:s.\u0275fac,providedIn:"root"})};var G=new D,xe=()=>G.group({restoreFrom:G.control("orignal"),restoreFromPath:G.control(""),handleExisting:G.control("overwrite"),permissions:G.control(!1)}),Q=class s{#t=p(g);#e=p(d);#o=p(P);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=N({type:s,selectors:[["app-options"]],decls:39,vars:6,consts:()=>{let o;o=$localize`Restore options`;let e;e=$localize`Where do you want to restore files from?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let i;i=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let F;F=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let Z;Z=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let ee;ee=$localize`Permissions`;let te;te=$localize` Restore read/write permissions ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let oe;oe=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#35\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let ie;return ie=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],o,e,t,i,n,F,Z,ee,te,oe,ie,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let i=X();r(0,"form",12,0),O("submit",function(){return C(i),R(t.submit())}),r(2,"h3",13),T(3,1),a(),r(4,"app-toggle-card",14),W(5,15),T(6,2),B(),r(7,"spk-radio",16),c(8,3),l(9,"input",17),u(),a(),r(10,"spk-radio",16),c(11,4),l(12,"input",18),u(),a(),r(13,"app-file-tree",19)(14,"label",20),V(15,"Path"),a(),l(16,"input",21),a()(),r(17,"app-toggle-card",14),W(18,15),T(19,5),B(),r(20,"spk-radio",16),c(21,6),l(22,"input",22),u(),a(),r(23,"spk-radio",16),c(24,7),l(25,"input",23),u(),a()(),r(26,"app-toggle-card"),W(27,15),T(28,8),B(),r(29,"spk-toggle",24),c(30,9),l(31,"input",25),u(),a()(),r(32,"div",26)(33,"button",27),O("click",function(){return C(i),R(t.goBack())}),c(34,10),l(35,"spk-icon"),u(),a(),r(36,"button",28),c(37,11),l(38,"spk-icon"),u(),a()()()}if(e&2){let i;m("formGroup",t.optionsForm),S(4),m("disallowToggle",!0),S(9),m("disabled",((i=t.optionsFormSignal())==null?null:i.restoreFrom)!=="pickLocation"),S(4),m("disallowToggle",!0),S(19),ue("loader",t.isSubmitting())}},dependencies:[A,L,M,Ne,Pe,h,k,$,y,ye,Y,$e,he,v,b],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{xe as a,Q as b,we as c,q as d,Ge as e,J as f,g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ce}from"./chunk-QTTCN7A7.js";import{q as de}from"./chunk-QXNJFFEM.js";import{b as ae}from"./chunk-PSJAIBCQ.js";import{a as pe,f as ue,l as he,m as _e,o as fe,w as ge}from"./chunk-FFD5RG7J.js";import{ia as le}from"./chunk-X566VMXX.js";import{Ab as g,Bb as Z,E as B,Eb as G,Fb as k,Hc as A,Jc as w,Nb as R,Oa as f,Ob as ee,Pb as te,Rb as N,Sb as p,Tb as ne,Ub as I,Va as x,Wa as H,X as D,bb as K,bc as q,ca as F,cc as ie,da as O,dc as X,ec as y,gc as oe,hb as v,oa as V,pa as C,pc as L,qb as j,qc as re,rb as U,sb as P,v as z,vb as b,vc as se,xb as J,yb as Y,zb as _}from"./chunk-NHACGZPI.js";import{a as W,b as $}from"./chunk-C6Q5SG76.js";var Pe=["treeContainer"],Te=["formRef"],xe=[[["label"]],[["label"]],[["input"]]],be=["label","label","input"],Me=(r,t)=>t.id,Se=r=>({children:r,level:0}),me=r=>({$implicit:r}),Fe=(r,t)=>({children:r,level:t});function Oe(r,t){if(r&1){let e=k();_(0,"spk-button-group")(1,"button",13),N("click",function(){F(e);let s=p();return O(s.pathDiscoveryMethod.set("browse"))}),R(2,4),g(),_(3,"button",13),N("click",function(){F(e);let s=p();return O(s.pathDiscoveryMethod.set("path"))}),R(4,5),g()()}if(r&2){let e=p();f(),P("active",e.pathDiscoveryMethod()==="browse"),f(2),P("active",e.pathDiscoveryMethod()==="path")}}function Ne(r,t){r&1&&Z(0,"spk-progress-bar",9)}function ye(r,t){r&1&&(_(0,"spk-icon",16),y(1,"folder-open"),g())}function we(r,t){r&1&&(_(0,"spk-icon"),y(1,"file"),g())}function ke(r,t){r&1&&(_(0,"spk-icon",16),y(1,"folder"),g())}function Re(r,t){if(r&1&&v(0,ye,2,0,"spk-icon",16)(1,we,2,0,"spk-icon")(2,ke,2,0,"spk-icon",16),r&2){let e=p(2).$implicit;b(e.children.length?0:e.cls==="file"?1:2)}}function Ie(r,t){r&1&&(_(0,"spk-icon",16),y(1,"desktop-tower"),g())}function Le(r,t){r&1&&G(0)}function Ae(r,t){if(r&1&&v(0,Le,1,0,"ng-container",10),r&2){let e=p(2).$implicit,n=p().$implicit;p();let s=X(7);j("ngTemplateOutlet",s)("ngTemplateOutletContext",L(5,me,re(2,Fe,e.children,n.level+1)))}}function We(r,t){if(r&1){let e=k();_(0,"div",14,3),N("click",function(){F(e);let s=p().$implicit,i=p(2);return O(i.toggleNode(s.id,s))}),_(2,"div",15),v(3,Re,3,1)(4,Ie,2,0,"spk-icon",16),g(),_(5,"div",17),N("click",function(s){F(e);let i=p().$implicit,o=p(2);return O(o.toggleSelectedNode(s,i))}),y(6),g()(),v(7,Ae,1,7,"ng-container")}if(r&2){let e=p().$implicit,n=p(2);P("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden),f(3),b(e.id!=="/"?3:4),f(3),oe(" ",e.text," "),f(),b(e.children.length>0?7:-1)}}function $e(r,t){if(r&1&&v(0,We,8,13),r&2){let e=t.$implicit,n=p(2);b(e.hidden&&n._showHiddenNodes()||!e.hidden?0:-1)}}function Be(r,t){if(r&1&&(_(0,"spk-list"),J(1,$e,1,1,null,null,Me),g()),r&2){let e=t.$implicit;U("padding-left",e.level*.25,"rem"),f(),Y(e.children)}}function De(r,t){r&1&&G(0)}function Ve(r,t){if(r&1){let e=k();_(0,"spk-toggle",18),N("click",function(){F(e);let s=p();return O(s._showHiddenNodes.set(!s._showHiddenNodes()))}),R(1,6),g()}if(r&2){let e=p();P("active",e._showHiddenNodes()),f(),ee(e.showFiles()?"files":"folders"),te(1)}}var Ce=(i=>(i[i.ExcludedByParent=-2]="ExcludedByParent",i[i.Excluded=-1]="Excluded",i[i.None=0]="None",i[i.Included=1]="Included",i[i.IncludedByParent=2]="IncludedByParent",i))(Ce||{}),Q=class r{#t=D(ae);#r=D(ce);multiSelect=C(!1);disabled=C(!1);showFiles=C(!1);selectFiles=C(!1);accepts=C(null);startingPath=C(null);rootPath=C(void 0);backupSettings=C(null);showHiddenNodes=C(!1);hideShortcuts=C(!1);includes=V();excludes=V();_showHiddenNodes=x(!1);treeContainerRef=H("treeContainer");formRef=H("formRef");pathDiscoveryMethod=x("browse");isLoading=x(!1);currentPath=x("/");#e=x(null);treeSearchQuery=x("");treeNodes=x([]);filterGroups=this.#r.filterGroups();isByBackupSettings=A(()=>this.rootPath()&&this.backupSettings()?.id&&this.backupSettings()?.time);searchableTreeNodes=A(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=Ce;treeStructure=A(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(a=>a!==""&&a!=="/"),n=structuredClone(e);for(let a=0;a<n.length;a++){let u=n[a].slice(1);if(u.startsWith("{")&&u.endsWith("}")){let h=u.slice(1,-1),d=this.filterGroups?.FilterGroups[h];if(d&&d.length){let T=d.map(E=>`-${E}`);n.splice(a,1,...T)}}}let s=this.searchableTreeNodes(),i=new Map,o=this.rootPath(),m=this.accepts(),l=o?{id:o,resolvedpath:o,text:o?.replaceAll("/",""),parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}:{id:"/",resolvedpath:"/",text:"Computer",parentPath:"",children:[],evalState:0,isIndeterminate:!1};m&&(l.accepted=!0),i.set("/",l);for(let a of s){let u=a.id.replace(o??"","").split("/").filter(Boolean),h="",d=l;for(let T of u){if(h+="/"+T,!i.has(h)){let E=a.hidden===!0&&t?0:this.#s(n,a.id,a.cls,d),M={id:a.id,isIndeterminate:this.isIndeterminate(n,a.id),evalState:E,parentPath:h,resolvedpath:a.id?.startsWith("%")?a.resolvedpath+"/":h,hidden:a.hidden,text:a.text,cls:a.cls,children:[]};m&&(M.accepted=this.matchAccepts(m,M)),i.set(h,M),d.children.push(M)}d=i.get(h)}}return[l]});#s(t,e,n,s){if(s.evalState===-1)return-2;let i=0,o=t.filter(l=>!l.startsWith("-")&&!l.startsWith("+")),m=t.filter(l=>l.startsWith("-")||l.startsWith("+"));if(o.length===0)return i;for(let l=0;l<o.length;l++){let a=o[l];if(e?.startsWith(a)){i=1;break}}if(m.length===0)return i;for(let l=0;l<m.length;l++){let a=m[l],c=a.slice(1),u=a.startsWith("-")?"exclude":"include";if(c.startsWith("/")&&c.endsWith("/")){if(n!=="folder")continue;if(e===c){i=u==="include"?1:-1;break}}if(c.startsWith("*")&&c.endsWith("*/")){if(n!=="folder")continue;let d=c.slice(1,-2);if(d==="")break;if(e?.includes(d+"/")){i=u==="include"?1:-1;break}}if(c.startsWith("[.*")&&c.endsWith("[^\\/]*]")){if(n!=="file")continue;let d=c.slice(3,-7);if(new RegExp(d).test(e)){i=u==="include"?1:-1;break}}if(c.startsWith("[")&&c.endsWith("]")){let d=c.slice(1,-1),T=this.translateCSharpRegex(d);if(new RegExp(`${T}`).test(e)){i=u==="include"?1:-1;break}}if(c.startsWith("*.")){if(n!=="file"||c.replace("*.","").length===0)continue;if(this.#n(e,c,!0)){i=u==="include"?1:-1;break}}if(c==="")continue;if(this.#n(e,c,!0)){i=u==="include"?1:-1;break}}return i}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let n=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(n,(s,i,o)=>`(${o})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.some(n=>n.startsWith(e))}#n(t,e,n=!1){let s=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${s}${n?"$":""}`).test(t)}showHiddenNodesEffect=w(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=w(()=>{let t=this.pathDiscoveryMethod(),e=this.#e();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id==="/")return!0;let n=t.split(",");if(n.length===0)return!0;let s="."+e.id.slice(e.id.indexOf("."));return s?n.some(i=>s.endsWith(i)):!1}currentPathEffect=w(()=>{let t=this.#e();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=w(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#a(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#e.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();t?(console.log(t),this.currentPath.set(t),this.#p(t)):this.#o(null,this.rootPath())}toggleSelectedNode(t,e){if(e.id==="/"||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let s=this.currentPath().split("\0").filter(o=>o!==""&&o!=="/"),i=this.isChildOfSelected(e)?`-${e.id}`:e.id;this.multiSelect()?s.includes(e.id)?this.currentPath.set(s.filter(o=>o!==e.id).join("\0")):s.some(o=>o.startsWith(i))?this.currentPath.set(s.filter(o=>o!==i).join("\0")):this.currentPath.set([...s,i].join("\0")):s.includes(e.id)?this.currentPath.set(s.filter(o=>o!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(n=>n!==""&&n!=="/").some(n=>t.id?.startsWith(n)||`-${t.id}`.startsWith(n))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(n=>n.filter(s=>!s.id?.startsWith(e.id)||s.id===e.id)):this.#o(e,t))}#l(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#a(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#c(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#d(t){let e=this.backupSettings(),n={id:e.id,time:e.time,prefixOnly:!1,folderContents:!0};return t&&(n.filter="@"+t),this.#t.getApiV1BackupByIdFiles(n)}#i(t){return this.isByBackupSettings()?this.#d(t):this.#c(t)}#p(t){let e=t.split("\0").filter(o=>o.startsWith("-")).map(o=>o.slice(1,-1)),n=t.split("\0").filter(o=>!o.startsWith("-")).filter(Boolean),s=n.map(o=>o.split("/").filter(Boolean)),i=[this.rootPath()??"/"];s.forEach(o=>{o.forEach((m,l)=>{let a=o.slice(0,l+1).join("/"),c=a.startsWith("%")?a:"/"+a;i.includes(c)||i.push(c)})}),this.isLoading.set(!0),z([...i.map(o=>this.#i(o))]).pipe(B(()=>this.isLoading.set(!1))).subscribe({next:o=>{this.treeNodes.update(m=>{let l=o.flatMap(c=>c.map(u=>{let h=u.id,d=h&&h.split("/").filter(Boolean).slice(0,-1).join("/"),E="/"+(h&&h.split("/").filter(Boolean).join("/")),M=n.findIndex(S=>this.multiSelect()?E.startsWith(S):E===S)>-1,Ee=n.findIndex(S=>S===h)>-1,ve=e.findIndex(S=>S===E)>-1;return $(W({},u),{parentPath:d.startsWith("%")?d:"/"+d,isSelected:M&&!ve||Ee})})),a=[...new Map([...m,...l].map(c=>[c.resolvedpath??c.id,c])).values()];return this.#l(),a})}})}#o(t=null,e="/"){this.isLoading.set(!0),this.#i(e).pipe(B(()=>this.isLoading.set(!1))).subscribe({next:n=>{let s=this.isByBackupSettings()?n.Files.map(i=>({text:i.Path.split("/").filter(o=>o!=="").pop(),id:i.Path,cls:i.Path.endsWith("/")?"folder":"file",leaf:t!==null,resolvedpath:i.Path,hidden:!1})):n;this.treeNodes.update(i=>{let o=s.map(l=>{let a=l.id.startsWith("%")&&l.id.endsWith("%")||l.id.endsWith("/")?"folder":"file";return $(W({},l),{cls:a,parentPath:e})}),m=[...new Map([...i,...o].map(l=>[l.resolvedpath??l.id,l])).values()];return this.hideShortcuts()?m.filter(l=>!l.id.startsWith("%")):m})}})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=K({type:r,selectors:[["app-file-tree"]],viewQuery:function(e,n){e&1&&(q(n.treeContainerRef,Pe,5),q(n.formRef,Te,5)),e&2&&ie(2)},hostVars:2,hostBindings:function(e,n){e&2&&P("disabled",n.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPath:[1,"rootPath"],backupSettings:[1,"backupSettings"],showHiddenNodes:[1,"showHiddenNodes"],hideShortcuts:[1,"hideShortcuts"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:be,decls:15,vars:15,consts:()=>{let t;t=$localize` Browser path `;let e;e=$localize` Manually type path `;let n;return n=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,n,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"primary","raised","browse-files-toggle",3,"active"],[1,"form-field"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"spk-primary"],[1,"text",3,"click"],[1,"primary","raised","browse-files-toggle",3,"click"]]},template:function(e,n){if(e&1&&(ne(xe),v(0,Oe,5,4,"spk-button-group"),_(1,"div",7),I(2,0,["ngProjectAs","label",5,["label"]]),_(3,"div",8,0),v(5,Ne,1,0,"spk-progress-bar",9)(6,Be,3,2,"ng-template",null,1,se)(8,De,1,0,"ng-container",10),g(),v(9,Ve,2,3,"spk-toggle",11),g(),_(10,"div",12,2)(12,"spk-form-field"),I(13,1,["ngProjectAs","label",5,["label"]]),I(14,2,["ngProjectAs","input",5,["input"]]),g()()),e&2){let s=X(7);b(n.multiSelect()?-1:0),f(),P("hidden",n.pathDiscoveryMethod()!=="browse"),f(2),P("visualize-accepted",n.accepts()),f(2),b(n.isLoading()?5:-1),f(3),j("ngTemplateOutlet",s)("ngTemplateOutletContext",L(13,me,L(11,Se,n.treeStructure()))),f(),b(n.accepts()?-1:9),f(),P("hidden",n.pathDiscoveryMethod()!=="path")}},dependencies:[ue,ge,pe,he,_e,fe,le,de],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] spk-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-level-10);position:relative}.browse-files[_ngcontent-%COMP%] spk-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-level-30);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:.25rem;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:var(--base-level-40)}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-level-40)}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-level-60R)}.hidden[_ngcontent-%COMP%]{display:none}'],changeDetection:0})};export{Q as a};
|
|
1
|
+
import{a as ce}from"./chunk-QTTCN7A7.js";import{q as de}from"./chunk-QXNJFFEM.js";import{b as ae}from"./chunk-PSJAIBCQ.js";import{a as pe,f as ue,l as he,m as _e,o as fe,w as ge}from"./chunk-YFA44VRS.js";import{ia as le}from"./chunk-X566VMXX.js";import{Ab as g,Bb as Z,E as B,Eb as G,Fb as k,Hc as A,Jc as w,Nb as R,Oa as f,Ob as ee,Pb as te,Rb as N,Sb as p,Tb as ne,Ub as I,Va as x,Wa as H,X as D,bb as K,bc as q,ca as F,cc as ie,da as O,dc as X,ec as y,gc as oe,hb as v,oa as V,pa as C,pc as L,qb as j,qc as re,rb as U,sb as P,v as z,vb as b,vc as se,xb as J,yb as Y,zb as _}from"./chunk-NHACGZPI.js";import{a as W,b as $}from"./chunk-C6Q5SG76.js";var Pe=["treeContainer"],Te=["formRef"],xe=[[["label"]],[["label"]],[["input"]]],be=["label","label","input"],Me=(r,t)=>t.id,Se=r=>({children:r,level:0}),me=r=>({$implicit:r}),Fe=(r,t)=>({children:r,level:t});function Oe(r,t){if(r&1){let e=k();_(0,"spk-button-group")(1,"button",13),N("click",function(){F(e);let s=p();return O(s.pathDiscoveryMethod.set("browse"))}),R(2,4),g(),_(3,"button",13),N("click",function(){F(e);let s=p();return O(s.pathDiscoveryMethod.set("path"))}),R(4,5),g()()}if(r&2){let e=p();f(),P("active",e.pathDiscoveryMethod()==="browse"),f(2),P("active",e.pathDiscoveryMethod()==="path")}}function Ne(r,t){r&1&&Z(0,"spk-progress-bar",9)}function ye(r,t){r&1&&(_(0,"spk-icon",16),y(1,"folder-open"),g())}function we(r,t){r&1&&(_(0,"spk-icon"),y(1,"file"),g())}function ke(r,t){r&1&&(_(0,"spk-icon",16),y(1,"folder"),g())}function Re(r,t){if(r&1&&v(0,ye,2,0,"spk-icon",16)(1,we,2,0,"spk-icon")(2,ke,2,0,"spk-icon",16),r&2){let e=p(2).$implicit;b(e.children.length?0:e.cls==="file"?1:2)}}function Ie(r,t){r&1&&(_(0,"spk-icon",16),y(1,"desktop-tower"),g())}function Le(r,t){r&1&&G(0)}function Ae(r,t){if(r&1&&v(0,Le,1,0,"ng-container",10),r&2){let e=p(2).$implicit,n=p().$implicit;p();let s=X(7);j("ngTemplateOutlet",s)("ngTemplateOutletContext",L(5,me,re(2,Fe,e.children,n.level+1)))}}function We(r,t){if(r&1){let e=k();_(0,"div",14,3),N("click",function(){F(e);let s=p().$implicit,i=p(2);return O(i.toggleNode(s.id,s))}),_(2,"div",15),v(3,Re,3,1)(4,Ie,2,0,"spk-icon",16),g(),_(5,"div",17),N("click",function(s){F(e);let i=p().$implicit,o=p(2);return O(o.toggleSelectedNode(s,i))}),y(6),g()(),v(7,Ae,1,7,"ng-container")}if(r&2){let e=p().$implicit,n=p(2);P("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden),f(3),b(e.id!=="/"?3:4),f(3),oe(" ",e.text," "),f(),b(e.children.length>0?7:-1)}}function $e(r,t){if(r&1&&v(0,We,8,13),r&2){let e=t.$implicit,n=p(2);b(e.hidden&&n._showHiddenNodes()||!e.hidden?0:-1)}}function Be(r,t){if(r&1&&(_(0,"spk-list"),J(1,$e,1,1,null,null,Me),g()),r&2){let e=t.$implicit;U("padding-left",e.level*.25,"rem"),f(),Y(e.children)}}function De(r,t){r&1&&G(0)}function Ve(r,t){if(r&1){let e=k();_(0,"spk-toggle",18),N("click",function(){F(e);let s=p();return O(s._showHiddenNodes.set(!s._showHiddenNodes()))}),R(1,6),g()}if(r&2){let e=p();P("active",e._showHiddenNodes()),f(),ee(e.showFiles()?"files":"folders"),te(1)}}var Ce=(i=>(i[i.ExcludedByParent=-2]="ExcludedByParent",i[i.Excluded=-1]="Excluded",i[i.None=0]="None",i[i.Included=1]="Included",i[i.IncludedByParent=2]="IncludedByParent",i))(Ce||{}),Q=class r{#t=D(ae);#r=D(ce);multiSelect=C(!1);disabled=C(!1);showFiles=C(!1);selectFiles=C(!1);accepts=C(null);startingPath=C(null);rootPath=C(void 0);backupSettings=C(null);showHiddenNodes=C(!1);hideShortcuts=C(!1);includes=V();excludes=V();_showHiddenNodes=x(!1);treeContainerRef=H("treeContainer");formRef=H("formRef");pathDiscoveryMethod=x("browse");isLoading=x(!1);currentPath=x("/");#e=x(null);treeSearchQuery=x("");treeNodes=x([]);filterGroups=this.#r.filterGroups();isByBackupSettings=A(()=>this.rootPath()&&this.backupSettings()?.id&&this.backupSettings()?.time);searchableTreeNodes=A(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=Ce;treeStructure=A(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(a=>a!==""&&a!=="/"),n=structuredClone(e);for(let a=0;a<n.length;a++){let u=n[a].slice(1);if(u.startsWith("{")&&u.endsWith("}")){let h=u.slice(1,-1),d=this.filterGroups?.FilterGroups[h];if(d&&d.length){let T=d.map(E=>`-${E}`);n.splice(a,1,...T)}}}let s=this.searchableTreeNodes(),i=new Map,o=this.rootPath(),m=this.accepts(),l=o?{id:o,resolvedpath:o,text:o?.replaceAll("/",""),parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}:{id:"/",resolvedpath:"/",text:"Computer",parentPath:"",children:[],evalState:0,isIndeterminate:!1};m&&(l.accepted=!0),i.set("/",l);for(let a of s){let u=a.id.replace(o??"","").split("/").filter(Boolean),h="",d=l;for(let T of u){if(h+="/"+T,!i.has(h)){let E=a.hidden===!0&&t?0:this.#s(n,a.id,a.cls,d),M={id:a.id,isIndeterminate:this.isIndeterminate(n,a.id),evalState:E,parentPath:h,resolvedpath:a.id?.startsWith("%")?a.resolvedpath+"/":h,hidden:a.hidden,text:a.text,cls:a.cls,children:[]};m&&(M.accepted=this.matchAccepts(m,M)),i.set(h,M),d.children.push(M)}d=i.get(h)}}return[l]});#s(t,e,n,s){if(s.evalState===-1)return-2;let i=0,o=t.filter(l=>!l.startsWith("-")&&!l.startsWith("+")),m=t.filter(l=>l.startsWith("-")||l.startsWith("+"));if(o.length===0)return i;for(let l=0;l<o.length;l++){let a=o[l];if(e?.startsWith(a)){i=1;break}}if(m.length===0)return i;for(let l=0;l<m.length;l++){let a=m[l],c=a.slice(1),u=a.startsWith("-")?"exclude":"include";if(c.startsWith("/")&&c.endsWith("/")){if(n!=="folder")continue;if(e===c){i=u==="include"?1:-1;break}}if(c.startsWith("*")&&c.endsWith("*/")){if(n!=="folder")continue;let d=c.slice(1,-2);if(d==="")break;if(e?.includes(d+"/")){i=u==="include"?1:-1;break}}if(c.startsWith("[.*")&&c.endsWith("[^\\/]*]")){if(n!=="file")continue;let d=c.slice(3,-7);if(new RegExp(d).test(e)){i=u==="include"?1:-1;break}}if(c.startsWith("[")&&c.endsWith("]")){let d=c.slice(1,-1),T=this.translateCSharpRegex(d);if(new RegExp(`${T}`).test(e)){i=u==="include"?1:-1;break}}if(c.startsWith("*.")){if(n!=="file"||c.replace("*.","").length===0)continue;if(this.#n(e,c,!0)){i=u==="include"?1:-1;break}}if(c==="")continue;if(this.#n(e,c,!0)){i=u==="include"?1:-1;break}}return i}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let n=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(n,(s,i,o)=>`(${o})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.some(n=>n.startsWith(e))}#n(t,e,n=!1){let s=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${s}${n?"$":""}`).test(t)}showHiddenNodesEffect=w(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=w(()=>{let t=this.pathDiscoveryMethod(),e=this.#e();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id==="/")return!0;let n=t.split(",");if(n.length===0)return!0;let s="."+e.id.slice(e.id.indexOf("."));return s?n.some(i=>s.endsWith(i)):!1}currentPathEffect=w(()=>{let t=this.#e();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=w(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#a(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#e.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();t?(console.log(t),this.currentPath.set(t),this.#p(t)):this.#o(null,this.rootPath())}toggleSelectedNode(t,e){if(e.id==="/"||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let s=this.currentPath().split("\0").filter(o=>o!==""&&o!=="/"),i=this.isChildOfSelected(e)?`-${e.id}`:e.id;this.multiSelect()?s.includes(e.id)?this.currentPath.set(s.filter(o=>o!==e.id).join("\0")):s.some(o=>o.startsWith(i))?this.currentPath.set(s.filter(o=>o!==i).join("\0")):this.currentPath.set([...s,i].join("\0")):s.includes(e.id)?this.currentPath.set(s.filter(o=>o!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(n=>n!==""&&n!=="/").some(n=>t.id?.startsWith(n)||`-${t.id}`.startsWith(n))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(n=>n.filter(s=>!s.id?.startsWith(e.id)||s.id===e.id)):this.#o(e,t))}#l(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#a(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#c(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#d(t){let e=this.backupSettings(),n={id:e.id,time:e.time,prefixOnly:!1,folderContents:!0};return t&&(n.filter="@"+t),this.#t.getApiV1BackupByIdFiles(n)}#i(t){return this.isByBackupSettings()?this.#d(t):this.#c(t)}#p(t){let e=t.split("\0").filter(o=>o.startsWith("-")).map(o=>o.slice(1,-1)),n=t.split("\0").filter(o=>!o.startsWith("-")).filter(Boolean),s=n.map(o=>o.split("/").filter(Boolean)),i=[this.rootPath()??"/"];s.forEach(o=>{o.forEach((m,l)=>{let a=o.slice(0,l+1).join("/"),c=a.startsWith("%")?a:"/"+a;i.includes(c)||i.push(c)})}),this.isLoading.set(!0),z([...i.map(o=>this.#i(o))]).pipe(B(()=>this.isLoading.set(!1))).subscribe({next:o=>{this.treeNodes.update(m=>{let l=o.flatMap(c=>c.map(u=>{let h=u.id,d=h&&h.split("/").filter(Boolean).slice(0,-1).join("/"),E="/"+(h&&h.split("/").filter(Boolean).join("/")),M=n.findIndex(S=>this.multiSelect()?E.startsWith(S):E===S)>-1,Ee=n.findIndex(S=>S===h)>-1,ve=e.findIndex(S=>S===E)>-1;return $(W({},u),{parentPath:d.startsWith("%")?d:"/"+d,isSelected:M&&!ve||Ee})})),a=[...new Map([...m,...l].map(c=>[c.resolvedpath??c.id,c])).values()];return this.#l(),a})}})}#o(t=null,e="/"){this.isLoading.set(!0),this.#i(e).pipe(B(()=>this.isLoading.set(!1))).subscribe({next:n=>{let s=this.isByBackupSettings()?n.Files.map(i=>({text:i.Path.split("/").filter(o=>o!=="").pop(),id:i.Path,cls:i.Path.endsWith("/")?"folder":"file",leaf:t!==null,resolvedpath:i.Path,hidden:!1})):n;this.treeNodes.update(i=>{let o=s.map(l=>{let a=l.id.startsWith("%")&&l.id.endsWith("%")||l.id.endsWith("/")?"folder":"file";return $(W({},l),{cls:a,parentPath:e})}),m=[...new Map([...i,...o].map(l=>[l.resolvedpath??l.id,l])).values()];return this.hideShortcuts()?m.filter(l=>!l.id.startsWith("%")):m})}})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=K({type:r,selectors:[["app-file-tree"]],viewQuery:function(e,n){e&1&&(q(n.treeContainerRef,Pe,5),q(n.formRef,Te,5)),e&2&&ie(2)},hostVars:2,hostBindings:function(e,n){e&2&&P("disabled",n.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPath:[1,"rootPath"],backupSettings:[1,"backupSettings"],showHiddenNodes:[1,"showHiddenNodes"],hideShortcuts:[1,"hideShortcuts"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:be,decls:15,vars:15,consts:()=>{let t;t=$localize` Browser path `;let e;e=$localize` Manually type path `;let n;return n=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,n,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"primary","raised","browse-files-toggle",3,"active"],[1,"form-field"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"spk-primary"],[1,"text",3,"click"],[1,"primary","raised","browse-files-toggle",3,"click"]]},template:function(e,n){if(e&1&&(ne(xe),v(0,Oe,5,4,"spk-button-group"),_(1,"div",7),I(2,0,["ngProjectAs","label",5,["label"]]),_(3,"div",8,0),v(5,Ne,1,0,"spk-progress-bar",9)(6,Be,3,2,"ng-template",null,1,se)(8,De,1,0,"ng-container",10),g(),v(9,Ve,2,3,"spk-toggle",11),g(),_(10,"div",12,2)(12,"spk-form-field"),I(13,1,["ngProjectAs","label",5,["label"]]),I(14,2,["ngProjectAs","input",5,["input"]]),g()()),e&2){let s=X(7);b(n.multiSelect()?-1:0),f(),P("hidden",n.pathDiscoveryMethod()!=="browse"),f(2),P("visualize-accepted",n.accepts()),f(2),b(n.isLoading()?5:-1),f(3),j("ngTemplateOutlet",s)("ngTemplateOutletContext",L(13,me,L(11,Se,n.treeStructure()))),f(),b(n.accepts()?-1:9),f(),P("hidden",n.pathDiscoveryMethod()!=="path")}},dependencies:[ue,ge,pe,he,_e,fe,le,de],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] spk-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-level-10);position:relative}.browse-files[_ngcontent-%COMP%] spk-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-level-30);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:.25rem;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:var(--base-level-40)}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-level-40)}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-level-60R)}.hidden[_ngcontent-%COMP%]{display:none}'],changeDetection:0})};export{Q as a};
|