@duplicati/ngclient 0.0.139 → 0.0.141
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/{chunk-SISVWTKC.js → chunk-2ULYPLGO.js} +1 -1
- package/{chunk-OBFPN4Q2.js → chunk-52KRFMSD.js} +1 -1
- package/{chunk-Q3EG4ZLT.js → chunk-AC7QC7PU.js} +1 -1
- package/chunk-AH5TLYN4.js +1 -0
- package/{chunk-SDLN3QK4.js → chunk-C26ZMSTR.js} +1 -1
- package/{chunk-6WNZ5AZZ.js → chunk-CDXBWYCI.js} +1 -1
- package/{chunk-GJXR776M.js → chunk-E4GCCYDQ.js} +1 -1
- package/{chunk-5V3CTTYH.js → chunk-EBXKOOS2.js} +1 -1
- package/{chunk-PZCO6IX3.js → chunk-EJZXEK6Z.js} +1 -1
- package/chunk-EQAVG2TR.js +1 -0
- package/{chunk-74BJ4GVA.js → chunk-F3LCHCDX.js} +1 -1
- package/{chunk-ONBF7XZA.js → chunk-FJ62TYXT.js} +1 -1
- package/{chunk-P5GBD4XK.js → chunk-FTFVEVRT.js} +1 -1
- package/{chunk-SKWDGX7G.js → chunk-IVBTBJGC.js} +1 -1
- package/chunk-JA3Y722G.js +1 -0
- package/{chunk-HDDYOVZL.js → chunk-JPMOGXHN.js} +1 -1
- package/{chunk-654PTAAL.js → chunk-MQI6JU7H.js} +1 -1
- package/{chunk-EESK45BW.js → chunk-N7RSCHJF.js} +1 -1
- package/{chunk-PZA4FRVJ.js → chunk-UKPX2XRO.js} +1 -1
- package/chunk-VLBSM6YW.js +1 -0
- package/{chunk-K6PEXJFJ.js → chunk-WPGKMLVU.js} +1 -1
- package/chunk-ZAFFTZSE.js +1 -0
- package/index.html +1 -1
- package/{main-YSTAIUGS.js → main-A5QFJ7CT.js} +1 -1
- package/package.json +1 -1
- package/chunk-E2CREQ7G.js +0 -1
- package/chunk-JI7GCFQB.js +0 -1
- package/chunk-MB34F2MX.js +0 -1
- package/chunk-OZV5FSRK.js +0 -1
- package/chunk-TW56VFHP.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Ue}from"./chunk-N57J64DN.js";import{a as se}from"./chunk-WZNH4JPF.js";import{a as ne}from"./chunk-BCHZRC5K.js";import{b as pe}from"./chunk-LDIZ5E5Z.js";import{a as Ve}from"./chunk-J6BHRR34.js";import{a as H}from"./chunk-2BX65XJQ.js";import{a as oe}from"./chunk-6JQM2X3B.js";import{a as xe}from"./chunk-WXARH2SG.js";import{b as We,c as G,e as B,f as x,i as ze,j as V,l as Xe,o as W,q as z,r as X,s as Ye,t as Y}from"./chunk-NSIELNIY.js";import{b as N,d as h}from"./chunk-2W6BEUGU.js";import{A as Be,a as A,e as De,g as v,l as Ae,p as ve,q as we,t as Ge}from"./chunk-Y5IRBMLB.js";import{h as w}from"./chunk-DNJOKPEL.js";import{la as ie}from"./chunk-CWLTHXVS.js";import{Ab as c,B as Oe,Bb as L,Cb as $,Eb as j,F as K,H as O,Hc as le,Ic as D,Kb as F,L as fe,Lb as m,Mb as g,Nb as he,Ob as Pe,P as Ce,Q,Qa as d,Qb as f,Rb as b,U as Re,Z as p,ab as M,bc as Ie,da as C,ea as R,ec as q,fb as Ne,gc as Me,hc as ye,i as ge,jc as Z,kc as ee,lc as te,na as _,o as Te,rc as ke,sb as y,sc as Le,tb as k,wc as ae,x as re,xb as S,xc as $e,y as Ee,yb as r,yc as be,zb as l}from"./chunk-BTMXQPBB.js";var Ke=new X,He=()=>Ke.group({passphrase:Ke.control("")}),_e=class a{#t=p(w);#e=p(P);#o=p(h);#n=p(N);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#o.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["destination"],{relativeTo:this.#n.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[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",4),f("submit",function(){return t.next()}),r(1,"spk-form-field")(2,"label",5),g(3,0),l(),c(4,"input",6),l(),r(5,"app-toggle-card"),L(6,7),g(7,1),$(),r(8,"app-options-list",8),te("optionsChange",function(n){return ee(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),f("click",function(){return t.back()}),F(11,2),c(12,"spk-icon"),m(),l(),r(13,"button",11),F(14,3),c(15,"spk-icon"),m(),l()()()),e&2&&(S("formGroup",t.encryptionForm),d(8),Z("options",t.settings),S("hasFreeTextSettings",!0))},dependencies:[Y,V,G,B,x,W,z,Ae,A,v,ne,Ue],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 Ze=()=>({standalone:!0});function et(a,i){a&1&&c(0,"spk-progress-bar",8)}function tt(a,i){if(a&1&&(q(0),ae(1,"bytes")),a&2){let e=b().$implicit;Me(" (",$e(1,1,e.FileSizes),") ")}}function it(a,i){a&1&&(r(0,"span",16),g(1,4),l())}function ot(a,i){if(a&1&&(r(0,"div",15),q(1),ae(2,"date"),y(3,tt,2,3),y(4,it,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),ye(" ",e.Version,": ",be(2,4,e.Time,"medium")," "),d(2),k(e.FileSizes?3:-1),d(),k(e.IsFullBackup===!1?4:-1)}}function nt(a,i){a&1&&c(0,"spk-progress-bar",8)}function st(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),g(2,5),l(),c(3,"input",18),l()),a&2){let e=b(2);S("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function rt(a,i){if(a&1){let e=j();r(0,"spk-select",12),f("cleared",function(){C(e);let o=b();return R(o.abortLoading())}),r(1,"input",13),te("ngModelChange",function(o){C(e);let n=b();return ee(n.selectOption,o)||(n.selectOption=o),R(o)}),l(),Ne(2,ot,5,7,"ng-template"),l(),y(3,nt,1,0,"spk-progress-bar",8),y(4,st,4,5,"app-file-tree",14)}if(a&2){let e=b();S("options",e.versionOptions())("isClearable",!1),d(),Z("ngModel",e.selectOption),S("ngModelOptions",Le(6,Ze)),d(2),k(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),k(e.showFileTree()?4:-1)}}var ue=new X,Je=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=p(w);#e=p(P);#o=p(Ve);#n=p(oe);#i=p(h);#s=p(N);#l=p(ie);#a=null;#p=null;#r=_([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=D(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=D(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(J=>J.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,E=o[u];if(this.needsDatabaseRepair()&&(!E||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=D(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#p===n||(this.#p=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Q(this.abortLoading$),O(()=>{this.#p=null})).subscribe(s=>{let u=s.ID;this.#o.waitForTaskToComplete(u).pipe(K(1)).subscribe(()=>{this.#r.update(E=>E.filter(I=>I!==n)),this.loadedVersions.update(E=>(E[n]=!0,E))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#n.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new ge;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-select-files"]],features:[ke([ie])],decls:13,vars:3,consts:()=>{let i;i=$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 o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[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"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",6,0),f("submit",function(){return C(o),R(t.next())}),r(2,"h3",7),g(3,1),l(),y(4,et,1,0,"spk-progress-bar",8)(5,rt,5,7),r(6,"div",9)(7,"button",10),f("click",function(){return C(o),R(t.back())}),F(8,2),c(9,"spk-icon"),m(),l(),r(10,"button",11),F(11,3),c(12,"spk-icon"),m(),l()()()}e&2&&(S("formGroup",t.selectFilesForm),d(4),k(t.versionOptionsLoading()?4:5),d(5),he(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[Ye,V,G,B,x,ze,Y,W,z,ie,xe,se,v,A,Ge,ve],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}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=p(h);#e=p(N);#o=p(oe);#n=p(De);#i=p(w);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=Je();optionsForm=Qe();encryptionForm=He();optionsFormSignal=pe(this.optionsForm.valueChanges);selectFilesFormSignal=pe(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);#s=_("");#l=_(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#p=D(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(!0)}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#n.open(H,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#n.open(H,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#_(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder";return o||n||s||e===0?Te(()=>t):Ee(1e3).pipe(Ce(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(i=!1){let e=this.backupId();this.versionOptionsLoading.set(!0),this.#o.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:e}),this.loadFilesetsWithRetryv2(e)]).pipe(K(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{if(o.Error)throw new Error(o.Error);if(!(t.Backup?.IsTemporary??!0)&&t?.Backup?.DBPathExists===!1){this.#n.open(H,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:s=>{this.#t.navigate(["/backup",e,"database"])}});return}this.versionOptions.set((o.Data??[]).map(s=>({Version:s.Version??-1,IsFullBackup:s.IsFullBackup??void 0,Time:s.Time??"<missing>",FileCount:s.FileCount??void 0,FileSizes:s.FileSizes??void 0}))),this.backup.set(t)},error:t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${t.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(H,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:E=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(fe(3))]).pipe(K(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)}})}#_(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Re({token:a,factory:a.\u0275fac,providedIn:"root"})};var U=new X,Qe=()=>U.group({restoreFrom:U.control("orignal"),restoreFromPath:U.control(""),handleExisting:U.control("overwrite"),permissions:U.control(!1),includeMetadata:U.control(!0)}),Fe=class a{#t=p(P);#e=p(h);#o=p(N);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||a)};static \u0275cmp=M({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let E;E=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let me;me=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let Se;return Se=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,E,I,J,me,Se,[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","enableCreateFolder"],["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","includeMetadata"],["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 o=j();r(0,"form",13,0),f("submit",function(){return C(o),R(t.submit())}),r(2,"h3",14),g(3,1),l(),r(4,"app-toggle-card",15),L(5,16),g(6,2),$(),r(7,"spk-radio",17),F(8,3),c(9,"input",18),m(),l(),r(10,"spk-radio",17),F(11,4),c(12,"input",19),m(),l(),r(13,"app-file-tree",20)(14,"label",21),q(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),L(18,16),g(19,5),$(),r(20,"spk-radio",17),F(21,6),c(22,"input",23),m(),l(),r(23,"spk-radio",17),F(24,7),c(25,"input",24),m(),l()(),r(26,"app-toggle-card"),L(27,16),g(28,8),$(),r(29,"spk-toggle",25),F(30,9),c(31,"input",26),m(),l(),r(32,"spk-toggle",25),F(33,10),c(34,"input",27),m(),l()(),r(35,"div",28)(36,"button",29),f("click",function(){return C(o),R(t.goBack())}),F(37,11),c(38,"spk-icon"),m(),l(),r(39,"button",30),F(40,12),c(41,"spk-icon"),m(),l()()()}if(e&2){let o;S("formGroup",t.optionsForm),d(4),S("disallowToggle",!0),d(9),S("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),S("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[Y,V,G,We,Xe,B,x,W,z,ne,se,Be,we,v,A],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{Qe as a,Fe as b,He as c,_e as d,Je as e,de as f,P as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as x}from"./chunk-QRRKPBY6.js";import{a as Z}from"./chunk-2BX65XJQ.js";import{b as H,d as K}from"./chunk-2W6BEUGU.js";import{b as j,c as W,e as q,g as Y,p as J}from"./chunk-Y5IRBMLB.js";import{h as Q}from"./chunk-DNJOKPEL.js";import{Ab as g,Bb as R,Cb as D,Eb as f,Hc as E,Kb as V,Lb as z,Mb as s,Na as h,Nc as S,Qa as r,Qb as u,Rb as _,Z as N,ab as A,da as C,dc as G,ea as I,ec as F,fc as P,gc as X,mc as B,na as y,nc as U,oc as O,sb as d,tb as p,vb as v,wb as L,xb as m,yb as a,zb as l}from"./chunk-BTMXQPBB.js";function nt(n,e){if(n&1&&F(0),n&2){_();let t=O(0);X(" ",t.Message," ")}}function ot(n,e){if(n&1&&(a(0,"div"),V(1,1),g(2,"a",15),z(),l()),n&2){let t=_();r(2),m("href",t.downloadLink(),h)}}function at(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_(),c=O(0);return I(i.doRepair(c.BackupID))}),s(1,2),l()}}function rt(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_(),c=O(0);return I(i.doDownloadBugreport(c))}),s(1,3),l()}}function lt(n,e){if(n&1&&g(0,"spk-progress-bar",17),n&2){let t,o=_(2);m("value",(t=o.serverState())==null?null:t.UpdateDownloadProgress)}}function ct(n,e){if(n&1){let t=f();a(0,"div",13),R(1),s(2,4),D(),a(3,"a",16),F(4),l(),d(5,lt,1,1,"spk-progress-bar",17),a(6,"button",14),u("click",function(){C(t);let i=_();return I(i.doShowUpdate())}),s(7,5),l()()}if(n&2){let t,o,i=_(),c=O(0);r(3),m("href",(t=i.serverState())==null?null:t.UpdateDownloadLink,h),r(),P(c.Message),r(),p(((o=i.serverState())==null?null:o.UpdaterState)==="Downloading"?5:-1)}}function st(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_(),c=O(0);return I(i.doShowLog(c.BackupID))}),s(1,6),l()}}function _t(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),s(1,7),l()}}function dt(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),s(1,8),l()}}var pt={Error:"error",Warning:"warn",Information:"primary"},M=class n{#t=N(K);#a=N(H);#r=N(q);#e=N(W);#i=N(x);#n=N(Q);#o=y(null);serverState=this.#i.serverState;index=S.required();notification=S.required();downloadLink=E(()=>this.#o()||this.notification().DownloadLink||"");deleteNotificationByIndex(){this.#i.deleteNotification(this.index())}deleteAllNotifications(){this.#i.deleteAllNotifications()}getAlertType(e){return e&&pt[e]||"primary"}doShowLog(e){this.#n.getApiV1BackupByIdIsactive({id:e}).subscribe({next:t=>{this.#t.navigate(["/backup/"+e+"/log"])},error:t=>{if(t.status===404){let o={title:$localize`Error`,message:$localize`The backup is missing, has it been deleted?`,confirmText:$localize`OK`,cancelText:null};parseInt(e)+""!=e&&(o={title:$localize`Error`,message:$localize`The backup was temporary and does not exist anymore, so the log data is lost`,confirmText:$localize`OK`,cancelText:null}),this.#r.open(Z,{maxWidth:"550px",width:"100%",data:o})}else this.#e.error($localize`Failed to find backup: `+t.message)}})}doRepair(e){this.#n.postApiV1BackupByIdRepair({id:e}).subscribe({next:()=>{this.#e.success($localize`Backup repaired`),this.#t.navigate(["./"],{onSameUrlNavigation:"reload",relativeTo:this.#a})},error:t=>{this.#e.error($localize`Failed to repair backup: `+t.message)}})}doShowUpdate(){this.#t.navigate(["/about/changelog"])}doShowLink(e){window.open(e,"_blank")}doDownloadBugreport(e){let t=e.Action.slice(19);this.#n.postApiV1AuthIssuetokenByOperation({operation:"bugreport"}).subscribe({next:o=>{if(!o.Token){this.#e.error("Failed to get bug report URL: No token generated");return}let i
|
|
1
|
+
import{a as x}from"./chunk-QRRKPBY6.js";import{a as Z}from"./chunk-2BX65XJQ.js";import{b as H,d as K}from"./chunk-2W6BEUGU.js";import{b as j,c as W,e as q,g as Y,p as J}from"./chunk-Y5IRBMLB.js";import{h as Q}from"./chunk-DNJOKPEL.js";import{Ab as g,Bb as R,Cb as D,Eb as f,Hc as E,Kb as V,Lb as z,Mb as s,Na as h,Nc as S,Qa as r,Qb as u,Rb as _,Z as N,ab as A,da as C,dc as G,ea as I,ec as F,fc as P,gc as X,mc as B,na as y,nc as U,oc as O,sb as d,tb as p,vb as v,wb as L,xb as m,yb as a,zb as l}from"./chunk-BTMXQPBB.js";function nt(n,e){if(n&1&&F(0),n&2){_();let t=O(0);X(" ",t.Message," ")}}function ot(n,e){if(n&1&&(a(0,"div"),V(1,1),g(2,"a",15),z(),l()),n&2){let t=_();r(2),m("href",t.downloadLink(),h)}}function at(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_(),c=O(0);return I(i.doRepair(c.BackupID))}),s(1,2),l()}}function rt(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_(),c=O(0);return I(i.doDownloadBugreport(c))}),s(1,3),l()}}function lt(n,e){if(n&1&&g(0,"spk-progress-bar",17),n&2){let t,o=_(2);m("value",(t=o.serverState())==null?null:t.UpdateDownloadProgress)}}function ct(n,e){if(n&1){let t=f();a(0,"div",13),R(1),s(2,4),D(),a(3,"a",16),F(4),l(),d(5,lt,1,1,"spk-progress-bar",17),a(6,"button",14),u("click",function(){C(t);let i=_();return I(i.doShowUpdate())}),s(7,5),l()()}if(n&2){let t,o,i=_(),c=O(0);r(3),m("href",(t=i.serverState())==null?null:t.UpdateDownloadLink,h),r(),P(c.Message),r(),p(((o=i.serverState())==null?null:o.UpdaterState)==="Downloading"?5:-1)}}function st(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_(),c=O(0);return I(i.doShowLog(c.BackupID))}),s(1,6),l()}}function _t(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),s(1,7),l()}}function dt(n,e){if(n&1){let t=f();a(0,"button",14),u("click",function(){C(t);let i=_();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),s(1,8),l()}}var pt={Error:"error",Warning:"warn",Information:"primary"},M=class n{#t=N(K);#a=N(H);#r=N(q);#e=N(W);#i=N(x);#n=N(Q);#o=y(null);serverState=this.#i.serverState;index=S.required();notification=S.required();downloadLink=E(()=>this.#o()||this.notification().DownloadLink||"");deleteNotificationByIndex(){this.#i.deleteNotification(this.index())}deleteAllNotifications(){this.#i.deleteAllNotifications()}getAlertType(e){return e&&pt[e]||"primary"}doShowLog(e){this.#n.getApiV1BackupByIdIsactive({id:e}).subscribe({next:t=>{this.#t.navigate(["/backup/"+e+"/log"])},error:t=>{if(t.status===404){let o={title:$localize`Error`,message:$localize`The backup is missing, has it been deleted?`,confirmText:$localize`OK`,cancelText:null};parseInt(e)+""!=e&&(o={title:$localize`Error`,message:$localize`The backup was temporary and does not exist anymore, so the log data is lost`,confirmText:$localize`OK`,cancelText:null}),this.#r.open(Z,{maxWidth:"550px",width:"100%",data:o})}else this.#e.error($localize`Failed to find backup: `+t.message)}})}doRepair(e){this.#n.postApiV1BackupByIdRepair({id:e}).subscribe({next:()=>{this.#e.success($localize`Backup repaired`),this.#t.navigate(["./"],{onSameUrlNavigation:"reload",relativeTo:this.#a})},error:t=>{this.#e.error($localize`Failed to repair backup: `+t.message)}})}doShowUpdate(){this.#t.navigate(["/about/changelog"])}doShowLink(e){window.open(e,"_blank")}doDownloadBugreport(e){let t=e.Action.slice(19);this.#n.postApiV1AuthIssuetokenByOperation({operation:"bugreport"}).subscribe({next:o=>{if(!o.Token){this.#e.error("Failed to get bug report URL: No token generated");return}let i=`${location.origin}/api/v1/bugreport/${t}?token=${o.Token}`;e.DownloadLink=i,this.#o.set(i),this.triggerDownload(i)},error:o=>{this.#e.error(`Failed to get bug report URL: ${o.message}`)}})}triggerDownload(e){let t=document.createElement("a");t.href=e,t.download="",t.style.display="none",document.body.appendChild(t);try{t.click()}catch{}document.body.removeChild(t)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=A({type:n,selectors:[["app-notification"]],inputs:{index:[1,"index"],notification:[1,"notification"]},decls:16,vars:12,consts:()=>{let e;e=$localize`Dismiss`;let t;t=$localize` If the backup file was not downloaded automatically, ${"\uFFFD#2\uFFFD"}:START_LINK:right click and choose "Save as …"${"\uFFFD/#2\uFFFD"}:CLOSE_LINK:`;let o;o=$localize`Repair`;let i;i=$localize`Download`;let c;c=$localize`New update found:`;let k;k=$localize`Show Update`;let w;w=$localize`Show Log`;let $;$=$localize` Show Help `;let b;return b=$localize` Show Help `,[e,t,o,i,c,k,w,$,b,["sparkle-alert-title",""],["sparkle-alert-content","",1,"content"],[1,"actions"],["spk-button","",1,"small","outlined"],[1,"message"],["spk-button","",1,"small","outlined",3,"click"],["target","_blank",3,"href"],[3,"href"],[3,"value"]]},template:function(t,o){if(t&1){let i=f();B(0),a(1,"spk-alert")(2,"div",9),F(3),l(),a(4,"div",10),d(5,nt,1,1),d(6,ot,3,1,"div"),a(7,"div",11),d(8,at,2,0,"button",12),d(9,rt,2,0,"button",12),d(10,ct,8,3,"div",13),d(11,st,2,0,"button",12),d(12,_t,2,0,"button",12),d(13,dt,2,0,"button",12),a(14,"button",14),u("click",function(){return C(i),I(o.deleteNotificationByIndex())}),s(15,0),l()()()()}if(t&2){let i=U(o.notification());r(),G(o.getAlertType(i.Type)),r(2),P(i.Title),r(2),p(i.Action!=="update:new"&&i.Action!=="update:manual"?5:-1),r(),p(o.downloadLink()?6:-1),r(2),p(i.Message!=null&&i.Message.includes("please run repair")?8:-1),r(),p(i.Action!=null&&i.Action.startsWith("bug-report:created:")&&!o.downloadLink()?9:-1),r(),p(i.Action==="update:new"?10:-1),r(),p(i.Action==="backup:show-log"?11:-1),r(),p(i.Action==="config:issue:unencrypted-database"?12:-1),r(),p(i.Action==="config:issue:windows-folder-used"?13:-1)}},dependencies:[J,Y,j],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var Nt=(n,e)=>e.ID;function Tt(n,e){if(n&1&&g(0,"app-notification",1),n&2){let t=e.$implicit,o=e.$index;m("index",o)("notification",t)}}function Ct(n,e){n&1&&(a(0,"div",2)(1,"p"),s(2,0),l()())}var tt=class n{#t=N(x);notificationFilterPredicate=S();notifications=E(()=>{let e=this.notificationFilterPredicate()?.predicate,t=this.#t.notifications();return typeof e!="function"?t:t.filter(e)});static \u0275fac=function(t){return new(t||n)};static \u0275cmp=A({type:n,selectors:[["app-notifications"]],inputs:{notificationFilterPredicate:[1,"notificationFilterPredicate"]},decls:3,vars:1,consts:()=>{let e;return e=$localize`No more notifications`,[e,[3,"index","notification"],[1,"notification-list"]]},template:function(t,o){t&1&&v(0,Tt,1,2,"app-notification",1,Nt,!1,Ct,3,0,"div",2),t&2&&L(o.notifications())},dependencies:[M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}.notification-list[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};export{M as a,tt as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as le}from"./chunk-N57J64DN.js";import{a as se,b as ae}from"./chunk-2G6TVFPZ.js";import{h as ie}from"./chunk-
|
|
1
|
+
import{a as le}from"./chunk-N57J64DN.js";import{a as se,b as ae}from"./chunk-2G6TVFPZ.js";import{h as ie}from"./chunk-ZAFFTZSE.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import{c as Z,e as J,i as ee,k as ne,s as te,t as oe}from"./chunk-NSIELNIY.js";import{b as V,d as q}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{a as Y,g as H,l as Q,t as j}from"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{Ab as g,Eb as M,Hc as k,Kb as S,Lb as O,Mb as r,Oc as W,Qa as p,Qb as I,Rb as c,Z as C,Zb as x,_b as G,ab as K,bc as U,da as P,ea as f,jc as u,kc as d,lc as m,na as v,sb as N,sc as X,tb as F,xb as T,yb as t,zb as i}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var _e=["formRef"],re=()=>["--skip-files-larger-than","dblock-size","encryption-module","no-encryption","--no-encryption","compression-module","--exclude-files-attributes","keep-time","keep-versions","retention-policy"];function pe(s,l){s&1&&(S(0,1,1),g(1,"spk-icon",20),O())}function ce(s,l){s&1&&(t(0,"p",21),r(1,6),i())}function ue(s,l){s&1&&(t(0,"p"),r(1,7),i())}function de(s,l){if(s&1){let n=M();t(0,"p"),r(1,8),i(),t(2,"app-timespan",18),m("ngModelChange",function(a){P(n);let o=c();return d(o.optionsFields.backupRetentionTime,a)||(o.optionsFields.backupRetentionTime=a),f(a)}),t(3,"label",30),r(4,9),i()()}if(s&2){let n=c();p(2),T("customId","backupRetentionTime"),u("ngModel",n.optionsFields.backupRetentionTime)}}function me(s,l){if(s&1){let n=M();t(0,"p"),r(1,10),i(),t(2,"spk-form-field")(3,"label",31),r(4,11),i(),t(5,"input",32),m("ngModelChange",function(a){P(n);let o=c();return d(o.optionsFields.backupRetentionVersions,a)||(o.optionsFields.backupRetentionVersions=a),f(a)}),i()()}if(s&2){let n=c();p(5),u("ngModel",n.optionsFields.backupRetentionVersions)}}function Se(s,l){s&1&&(t(0,"p"),r(1,12),i())}function Oe(s,l){if(s&1){let n=M();t(0,"p"),r(1,13),i(),t(2,"spk-form-field")(3,"p"),r(4,14),i(),t(5,"label",33),r(6,15),i(),t(7,"input",34),m("ngModelChange",function(a){P(n);let o=c();return d(o.optionsFields.backupRetentionCustom,a)||(o.optionsFields.backupRetentionCustom=a),f(a)}),i()()}if(s&2){let n=c();p(7),u("ngModel",n.optionsFields.backupRetentionCustom)}}var Te=["Bytes","KB","MB","GB","TB","PB"],ge=[{value:"all",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],Ce=1024*1024*1024*2,Pe=1024*1024*5,h=class s{#e=C(ie);#n=C(q);#t=C(V);formRef=W.required("formRef");selectedOptions=this.#e.selectedOptions;nonSelectedOptions=this.#e.nonSelectedOptions;isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=v(ge);sizeSplit=k(()=>{let n=this.optionsFields.remoteVolumeSize().match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b)$/i);return{value:n?parseInt(n[1],10):0,unit:n?n[2].toUpperCase():"MB"}});exceededVolumeSize=k(()=>{let l=this.sizeSplit().value,n=this.sizeSplit().unit;if(l==null||n===null||n===void 0)return!1;let e=l*Math.pow(1024,Te.indexOf(n));return e>Ce||e<Pe});goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){this.#e.submit()}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=K({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&x(e.formRef,_e,5),n&2&&G()},decls:30,vars:16,consts:()=>{let l;l=$localize`Options`;let n;n=$localize` Remote volume size ${"\uFFFD*7:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:warning${"\uFFFD/#1:1\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/*7:1\uFFFD"}:CLOSE_BLOCK_IF:`;let e;e=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#11\uFFFD"}:START_LINK: Read more ${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-square-out${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD/#11\uFFFD"}:CLOSE_LINK:`;let a;a=$localize`Backup retention`;let o;o=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let E;E=$localize`${"\uFFFD#29\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `;let b;b=$localize` The chosen size is outside the recommended range. This may cause performance issues, excessively large temporary files or other problems. `;let A;A=$localize`Nothing will be deleted. The backup size will grow with each change.`;let R;R=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let y;y=$localize`Time to keep versions`;let $;$=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let w;w=$localize`Number of versions`;let D;D=$localize` Over time backups will be deleted automatically. There will remain one backup for each of the last 7 days, each of the last 4 weeks, each of the last 12 months. There will always be at least one remaining backup. `;let B;B=$localize` Enter a retention strategy manually. Placeholders are D/W/Y for days/weeks/years and U for unlimited. The syntax is: 7D:1D,4W:1W,36M:1M. This example keeps one backup for each of the next 7 days, one for each of the next 4 weeks, and one for each of the next 36 months. This can also be written as 1W:1D,1M:1W,3Y:1M. `;let L;L=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let z;return z=$localize`Retention expression`,[l,n,e,a,o,E,b,A,R,y,$,w,D,B,L,z,[1,"title-30"],[1,"remote-volume-wrap"],[3,"ngModelChange","customId","ngModel"],["for","size"],[1,"warning"],[1,"warn"],["href","https://forum.duplicati.com/t/choosing-sizes-in-duplicati/17683","target","_blank",1,"spk-primary"],["suffix",""],["value","value","label","name",3,"options","inlineSearch","isClearable"],["type","text",3,"ngModelChange","ngModel"],[3,"optionsChange","options","applicationOptions","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","",1,"raised","primary",3,"click"],["for","backupRetentionTime"],["for","backupRetentionVersions"],["type","number","id","backupRetentionVersions",3,"ngModelChange","ngModel"],["for","backupRetentionCustom"],["type","text","id","backupRetentionCustom",3,"ngModelChange","ngModel"]]},template:function(n,e){n&1&&(t(0,"section")(1,"h3",16),r(2,0),i(),t(3,"div",17)(4,"app-size",18),m("ngModelChange",function(o){return d(e.optionsFields.remoteVolumeSize,o)||(e.optionsFields.remoteVolumeSize=o),o}),t(5,"label",19),S(6,1),N(7,pe,2,0,"spk-icon",20),O(),i()(),N(8,ce,2,0,"p",21),t(9,"p"),S(10,2),t(11,"a",22),g(12,"spk-icon",23),i(),O(),i()(),t(13,"spk-select",24)(14,"label",19),r(15,3),i(),t(16,"input",25),m("ngModelChange",function(o){return d(e.optionsFields.backupRetention,o)||(e.optionsFields.backupRetention=o),o}),i()(),N(17,ue,2,0,"p")(18,de,5,2)(19,me,6,1)(20,Se,2,0,"p")(21,Oe,8,1),t(22,"app-options-list",26),m("optionsChange",function(o){return d(e.settings,o)||(e.settings=o),o}),i(),t(23,"div",27)(24,"button",28),I("click",function(){return e.goBack()}),S(25,4),g(26,"spk-icon"),O(),i(),t(27,"button",29),I("click",function(){return e.submit()}),S(28,5),g(29,"spk-icon"),O(),i()()()),n&2&&(p(4),T("customId","size"),u("ngModel",e.optionsFields.remoteVolumeSize),p(3),F(e.exceededVolumeSize()?7:-1),p(),F(e.exceededVolumeSize()?8:-1),p(5),T("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),p(3),u("ngModel",e.optionsFields.backupRetention),p(),F(e.optionsFields.backupRetention()==="all"?17:e.optionsFields.backupRetention()==="time"?18:e.optionsFields.backupRetention()==="versions"?19:e.optionsFields.backupRetention()==="smart"?20:e.optionsFields.backupRetention()==="custom"?21:-1),p(5),u("options",e.settings),T("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",X(15,re)),p(5),U("loader",e.isSubmitting()))},dependencies:[te,Z,ne,J,ee,oe,le,H,Y,j,se,ae,Q],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}spk-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{h as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as Ee}from"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import{a as fe}from"./chunk-XIOHRQ3X.js";import{h as P}from"./chunk-
|
|
1
|
+
import{a as Ee}from"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import{a as fe}from"./chunk-XIOHRQ3X.js";import{h as P}from"./chunk-ZAFFTZSE.js";import"./chunk-WZNH4JPF.js";import{a as Se}from"./chunk-BCHZRC5K.js";import"./chunk-B26UYXA3.js";import{b as O}from"./chunk-LDIZ5E5Z.js";import{a as le}from"./chunk-WZRDKVOR.js";import"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import{c as se,e as me,f as de,j as pe,n as _e,o as ce,p as ue,q as Ce,r as ge,s as Ne,t as Me}from"./chunk-NSIELNIY.js";import"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{b as q,d as Z,e as J}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{a as Q,e as Y,g as ee,k as te,l as ne,p as oe,t as ie}from"./chunk-Y5IRBMLB.js";import{g as ae,h as re}from"./chunk-DNJOKPEL.js";import"./chunk-UZK7ABRM.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-B6OIHB5W.js";import{Ab as r,Bb as A,Cb as T,Eb as v,Ic as H,Kb as N,Lb as M,Mb as c,Nb as G,Ob as U,Qa as m,Qb as x,Rb as f,Z as _,ab as $,bc as K,da as S,ea as E,jc as w,kc as X,lc as z,na as F,qc as V,rc as W,sb as h,sc as j,tb as b,ub as B,vb as R,wb as y,xb as C,yb as a,zb as n}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var Fe=()=>["backup"];function Ae(l,t){l&1&&r(0,"spk-progress-bar",12)}function Te(l,t){if(l&1&&(a(0,"spk-form-field"),r(1,"input",32),n()),l&2){let e=t.$implicit,s=t.$index;m(),C("id",V("filter-",s))("formControl",e)}}function Oe(l,t){if(l&1){let e=v();a(0,"form",13)(1,"spk-select",14)(2,"label",15),c(3,1),n(),r(4,"input",16),n(),a(5,"spk-form-field")(6,"label",17),c(7,2),n(),r(8,"textarea",18),n(),a(9,"spk-form-field")(10,"label",19),c(11,3),n(),r(12,"textarea",20),n()(),a(13,"spk-divider"),c(14,4),n(),a(15,"form",13)(16,"spk-form-field")(17,"label",21),c(18,5),n(),r(19,"input",22),n(),a(20,"spk-form-field")(21,"label",23),c(22,6),n(),r(23,"input",24),n(),a(24,"app-toggle-card",25),A(25,26),c(26,7),T(),A(27,27),R(28,Te,2,3,"spk-form-field",null,B),T(),n()(),a(30,"p"),N(31,8),r(32,"a",28),M(),n(),a(33,"app-options-list",29),z("optionsChange",function(i){S(e);let u=f();return X(u.settings,i)||(u.settings=i),E(i)}),n(),a(34,"div",30)(35,"button",31),x("click",function(){S(e);let i=f();return E(i.submit())}),N(36,9),r(37,"spk-icon"),M(),n()()}if(l&2){let e=f();C("formGroup",e.baseCmdForm),m(),C("options",e.commandOptions()??j(10,Fe))("inlineSearch",!0),m(14),C("formGroup",e.standardFields),m(9),C("disallowToggle",!0),m(4),y(e.standardFields.controls.filters.controls),m(5),w("options",e.settings),C("hasFreeTextSettings",!0),m(2),K("loader",e.isSubmitting()),m(2),G(e.baseCmdForm.value.command),U(36)}}var d=new ge,Pe=["Bytes","KB","MB","GB","TB","PB"],k=class l{#e=_(P);#t=_(re);#n=_(Z);#o=_(q);#i=_(ae);#a=_(le);#s=_(Y);#r=O(this.#o.params);commandOptions=O(this.#i.getApiV1Commandline());sizeOptions=F(Pe);isSubmitting=F(!1);optionsFields=this.#e.optionsFields;standardFields=d.group({"backup-id":d.control(""),"backup-name":d.control(""),dbpath:d.control(""),filters:d.array([])});baseCmdForm=d.group({command:d.control("backup"),targetUrl:d.control(""),arguments:d.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#m=H(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#t.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup)),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(d.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#a.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",s=t.arguments?.split(`
|
|
2
2
|
`).filter(o=>o.length>0)??[],i=this.standardFields.value,u=i.filters??[],g=[t.command,e,...s,`--backup-name=${i["backup-name"]}`,`--dbpath=${i.dbpath}`,`--backup-id=${i["backup-id"]}`,...u.filter(o=>o).map(o=>o.startsWith("-")?`--exclude=${o?.slice(1)}`:`--include=${o}`),...this.#e.mapFormsToSettings(["backup-id","backup-name","dbpath"]).map(o=>`${o.Name.startsWith("--")?"":"--"}${o.Name}=${o.Value}`),"--disable-module=console-password-input"];this.#t.postApiV1Commandline({requestBody:g}).subscribe(o=>{o.Status==="OK"&&this.#n.navigate(["backup",this.backupId(),"commandline",o.ID])})}mapBaseCmdToForm(t){let e=t.TargetURL??null;e&&this.baseCmdForm.patchValue({targetUrl:e??"",arguments:t.Sources?.join(`
|
|
3
3
|
`)??""})}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=$({type:l,selectors:[["app-commandline"]],features:[W([P])],decls:8,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let e;e=$localize`Command`;let s;s=$localize`TargetUrl`;let i;i=$localize`Commandline Arguments`;let u;u=$localize`Advanced options`;let g;g=$localize`Backup ID`;let o;o=$localize`Backup Name`;let I;I=$localize`Filters`;let D;D=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#32\uFFFD"}:START_LINK:Read more${"\uFFFD/#32\uFFFD"}:CLOSE_LINK:`;let L;return L=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SPK_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,s,i,u,g,o,I,D,L,[1,"back"],["type","button","spk-button","","routerLink","/",1,"small"],[1,"indeterminate","primary"],[3,"formGroup"],["placeholder","Select a command...",3,"options","inlineSearch"],["for","command"],["type","text","id","command","formControlName","command"],["for","targetUrl"],["id","targetUrl","autocomplete","off","formControlName","targetUrl"],["for","arguments"],["id","arguments","autocomplete","off","formControlName","arguments"],["for","backup-id"],["id","backup-id","formControlName","backup-id"],["for","backup-name"],["id","backup-name","formControlName","backup-name"],[3,"disallowToggle"],["title",""],["content","","formGroupName","filters"],["href","#",1,"spk-primary"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["spk-button","",1,"raised","primary",3,"click"],[3,"id","formControl"]]},template:function(e,s){e&1&&(r(0,"app-status-bar"),a(1,"section")(2,"div",10)(3,"button",11),N(4,0),r(5,"spk-icon"),M(),n()(),h(6,Ae,1,0,"spk-progress-bar",12)(7,Oe,38,11),n()),e&2&&(m(6),b(s.finishedLoading()?7:6))},dependencies:[Ne,pe,se,me,de,fe,Ee,Se,Me,_e,ce,Ce,ue,J,ne,ee,te,ie,oe,Q],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;max-width:40rem;padding:2.5rem;gap:1.25rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}"],changeDetection:0})};export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-JA3Y722G.js";import"./chunk-N57J64DN.js";import"./chunk-2G6TVFPZ.js";import"./chunk-WZNH4JPF.js";import"./chunk-BCHZRC5K.js";import"./chunk-LDIZ5E5Z.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import"./chunk-3ZVSHKLD.js";import"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import"./chunk-Y5IRBMLB.js";import"./chunk-DNJOKPEL.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreOptionsForm,b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-EBXKOOS2.js")},{path:"encryption",loadComponent:()=>import("./chunk-F3LCHCDX.js")},{path:"select-files",loadComponent:()=>import("./chunk-EJZXEK6Z.js")},{path:"options",loadComponent:()=>import("./chunk-UKPX2XRO.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-IVBTBJGC.js")}],t=o;export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Y,d as en}from"./chunk-TW56VFHP.js";import{a as nn}from"./chunk-XIOHRQ3X.js";import{a as Ze}from"./chunk-WZRDKVOR.js";import{a as Ye}from"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import{a as Qe}from"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{e as he}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{a as Q,f as Xe,g as we,h as ze,j as Ve,k as Ke,o as Ue,p as je,w as We,x as qe}from"./chunk-Y5IRBMLB.js";import{h as Je}from"./chunk-DNJOKPEL.js";import"./chunk-UZK7ABRM.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-B6OIHB5W.js";import{$b as K,Ab as d,Ac as J,Bb as m,Cb as M,Db as f,Eb as x,H as j,Ic as ve,Kb as s,Lb as u,Mb as T,Nb as A,Ob as R,Pb as W,Qa as _,Qb as $,Rb as p,Z as h,ab as He,bc as H,da as N,ea as D,ec as r,fb as O,fc as Be,gc as E,jc as Le,kc as Ge,lc as be,na as X,pb as xe,qb as ye,sb as C,sc as q,tb as S,tc as P,ub as w,vb as z,wb as V,wc as k,xb as g,xc as y,yb as o,yc as I,zb as t}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var an=()=>[import("./chunk-AFLQOHXV.js").then(n=>n.NgTemplateOutlet),Q,Ve,qe,We,import("./chunk-3JKXOOME.js").then(n=>n.DurationFormatPipe),import("./chunk-HLYFP2CB.js").then(n=>n.BytesPipe),import("./chunk-NS4PAVKI.js").then(n=>n.RelativeTimePipe)],_n=()=>["/add-backup"],ln=()=>["/restore"],on=n=>({$implicit:n}),rn=n=>["/backup",n],cn=n=>["/restore",n],sn=n=>["/backup",n,"export"],un=n=>["/backup",n,"delete"],pn=n=>["/backup",n,"database"],Fn=n=>["/backup",n,"commandline"],dn=n=>["/backup",n,"log"];function gn(n,i){if(n&1){let e=x();o(0,"button",51),$("click",function(){let c=N(e).$implicit,F=p(2);return D(F.sortByColumn.set(c.value))}),T(1,15),t()}if(n&2){let e=i.$implicit,a=p(2);H("active",a.orderBy()===e.value),_(),A(e.label),R(1)}}function Tn(n,i){if(n&1&&(o(0,"spk-menu",52)(1,"button",53),s(2,14),d(3,"strong")(4,"spk-icon"),u(),t(),m(5,54),z(6,gn,2,3,"button",55,w),M(),t()),n&2){let e=p();_(4),A(e.orderBy()),R(2),_(2),V(e.sortOrderOptions())}}function Cn(n,i){if(n&1&&(o(0,"p")(1,"span"),T(2,21),t(),r(3),k(4,"relativeTime"),t()),n&2){let e=p().$implicit,a=p(4);_(3),E(" ",I(4,1,e.Schedule==null?null:e.Schedule.Time,a.timeType()==="actual")," ")}}function Sn(n,i){if(n&1&&(r(0),k(1,"durationFormat")),n&2){let e=p().$implicit,a=p(4);E(" ",I(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupDuration,a.timeType()==="actual")," ")}}function En(n,i){n&1&&(m(0),r(1,"-"),M())}function mn(n,i){if(n&1&&(r(0),k(1,"bytes")),n&2){let e=p().$implicit;E(" ",y(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.SourceFilesSize)," ")}}function Mn(n,i){n&1&&(m(0),r(1,"-"),M())}function On(n,i){if(n&1&&(r(0),k(1,"bytes")),n&2){let e=p().$implicit;E(" ",y(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.TargetFilesSize)," ")}}function kn(n,i){n&1&&(m(0),r(1,"-"),M())}function Nn(n,i){n&1&&f(0)}function Dn(n,i){if(n&1&&(o(0,"div",58)(1,"div",45)(2,"h3"),r(3),o(4,"spk-chip")(5,"spk-icon"),r(6),t(),r(7),t()(),o(8,"p")(9,"span"),T(10,16),t(),r(11),k(12,"relativeTime"),t(),C(13,Cn,5,4,"p"),o(14,"p")(15,"span"),T(16,17),t(),C(17,Sn,2,4)(18,En,2,0,"ng-container"),t(),o(19,"p")(20,"span"),T(21,18),t(),C(22,mn,2,3)(23,Mn,2,0,"ng-container"),t(),o(24,"p")(25,"span"),T(26,19),t(),C(27,On,2,3)(28,kn,2,0,"ng-container"),t()(),o(29,"spk-chip",59),T(30,20),t(),o(31,"div",49),O(32,Nn,1,0,"ng-container",60),t()()),n&2){let e=i.$implicit,a=p(4),c=K(51);_(3),E(" ",(e.Backup==null?null:e.Backup.Name)??a.MISSING_BACKUP_NAME," "),_(3),Be(a.getBackendIcon(e.Backup==null?null:e.Backup.TargetURL)),_(),E(" ",a.getBackendType(e.Backup==null?null:e.Backup.TargetURL)," "),_(4),E(" ",I(12,12,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupFinished,a.timeType()==="actual")," "),_(2),S(e.Schedule!=null&&e.Schedule.Time?13:-1),_(4),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.LastBackupDuration?17:18),_(5),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.SourceFilesSize?22:23),_(5),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.TargetFilesSize?27:28);let F=a.getBackupVersionCount(e);_(3),A(F)(F),R(30),_(2),g("ngTemplateOutlet",c)("ngTemplateOutletContext",P(15,on,e))}}function fn(n,i){if(n&1&&z(0,Dn,33,17,"div",58,w),n&2){let e=p(3);V(e.backups())}}function Pn(n,i){n&1&&(m(0),T(1,22),M())}function $n(n,i){if(n&1&&(o(0,"div",56),C(1,fn,2,0)(2,Pn,2,0,"ng-container"),t()),n&2){let e=p(2);_(),S(e.backups().length?1:2)}}function In(n,i){n&1&&(s(0,23,1),f(1),u())}function An(n,i){n&1&&(s(0,24,1),f(1),u())}function Rn(n,i){n&1&&(s(0,25,1),f(1),u())}function Hn(n,i){n&1&&(s(0,26,1),f(1),u())}function xn(n,i){n&1&&(s(0,27,1),f(1),u())}function yn(n,i){n&1&&(s(0,28,1),f(1),u())}function Bn(n,i){n&1&&(s(0,29,1),f(1),u())}function Ln(n,i){if(n&1&&(r(0),k(1,"relativeTime")),n&2){let e=p().$implicit,a=p(3);E(" ",I(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupDate,a.timeType()==="actual")," ")}}function Gn(n,i){n&1&&(m(0),r(1,"-"),M())}function bn(n,i){if(n&1&&(r(0),k(1,"relativeTime")),n&2){let e=p().$implicit,a=p(3);E(" ",I(1,1,e.Schedule==null?null:e.Schedule.Time,a.timeType()==="actual")," ")}}function vn(n,i){n&1&&(m(0),r(1,"-"),M())}function hn(n,i){if(n&1&&(r(0),k(1,"durationFormat")),n&2){let e=p().$implicit,a=p(3);E(" ",I(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupDuration,a.timeType()==="actual")," ")}}function Xn(n,i){n&1&&(m(0),r(1,"-"),M())}function wn(n,i){if(n&1&&(r(0),k(1,"bytes")),n&2){let e=p().$implicit;E(" ",y(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.SourceFilesSize)," ")}}function zn(n,i){n&1&&(m(0),r(1,"-"),M())}function Vn(n,i){if(n&1&&(r(0),k(1,"bytes")),n&2){let e=p().$implicit;E(" ",y(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.TargetFilesSize)," ")}}function Kn(n,i){n&1&&(m(0),r(1,"-"),M())}function Un(n,i){n&1&&f(0)}function jn(n,i){if(n&1&&(o(0,"tr")(1,"td"),r(2),t(),o(3,"td"),r(4),t(),o(5,"td"),C(6,Ln,2,4)(7,Gn,2,0,"ng-container"),t(),o(8,"td"),C(9,bn,2,4)(10,vn,2,0,"ng-container"),t(),o(11,"td"),C(12,hn,2,4)(13,Xn,2,0,"ng-container"),t(),o(14,"td"),C(15,wn,2,3)(16,zn,2,0,"ng-container"),t(),o(17,"td"),C(18,Vn,2,3)(19,Kn,2,0,"ng-container"),t(),o(20,"td")(21,"span"),T(22,32),t()(),o(23,"td"),O(24,Un,1,0,"ng-container",60),t()()),n&2){let e=i.$implicit,a=p(3),c=K(51);_(2),E(" ",(e.Backup==null?null:e.Backup.Name)??a.MISSING_BACKUP_NAME," "),_(2),E(" ",a.getBackendType(e.Backup==null?null:e.Backup.TargetURL)," "),_(2),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.LastBackupDate?6:7),_(3),S(e.Schedule!=null&&e.Schedule.Time?9:10),_(3),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.LastBackupDuration?12:13),_(3),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.SourceFilesSize?15:16),_(3),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.TargetFilesSize?18:19);let F=a.getBackupVersionCount(e);_(4),A(F)(F),R(22),_(2),g("ngTemplateOutlet",c)("ngTemplateOutletContext",P(11,on,e))}}function Wn(n,i){if(n&1){let e=x();o(0,"spk-table",61),be("sortByColumnChange",function(c){N(e);let F=p(2);return Ge(F.sortByColumn,c)||(F.sortByColumn=c),D(c)}),o(1,"tr",62)(2,"th",63),s(3,23),O(4,In,2,0,"ng-container",64),u(),t(),o(5,"th",65),s(6,24),O(7,An,2,0,"ng-container",64),u(),t(),o(8,"th",66),s(9,25),O(10,Rn,2,0,"ng-container",64),u(),t(),o(11,"th",67),s(12,26),O(13,Hn,2,0,"ng-container",64),u(),t(),o(14,"th",68),s(15,27),O(16,xn,2,0,"ng-container",64),u(),t(),o(17,"th",69),s(18,28),O(19,yn,2,0,"ng-container",64),u(),t(),o(20,"th",70),s(21,29),O(22,Bn,2,0,"ng-container",64),u(),t(),o(23,"th"),T(24,30),t(),o(25,"th"),T(26,31),t()(),z(27,jn,25,13,"tr",null,w),t()}if(n&2){let e=p(2),a=K(53);g("data",e.backups())("loading",e.backupsLoading()),Le("sortByColumn",e.sortByColumn),_(4),g("ngTemplateOutlet",a),_(3),g("ngTemplateOutlet",a),_(3),g("ngTemplateOutlet",a),_(3),g("ngTemplateOutlet",a),_(3),g("ngTemplateOutlet",a),_(3),g("ngTemplateOutlet",a),_(3),g("ngTemplateOutlet",a),_(5),V(e.backups())}}function qn(n,i){if(n&1&&C(0,$n,3,1,"div",56)(1,Wn,29,10,"spk-table",57),n&2){let e=p();S(e.viewMode()==="list"?0:e.viewMode()==="details"?1:-1)}}function Jn(n,i){n&1&&(o(0,"div",71),d(1,"spk-progress-bar",72),o(2,"div",45)(3,"h3"),T(4,33),t()()())}function Qn(n,i){n&1&&T(0,34,1)}function Yn(n,i){n&1&&(o(0,"spk-icon"),r(1,"check"),t())}function Zn(n,i){n&1&&(o(0,"spk-icon"),r(1,"dots-three-vertical"),t())}function et(n,i){if(n&1){let e=x();o(0,"button",73),$("click",function(){let c=N(e).$implicit,F=p();return D(F.startBackup(c.Backup==null?null:c.Backup.ID))}),s(1,34),d(2,"spk-icon"),C(3,Qn,1,0),u(),t(),o(4,"button",74)(5,"spk-icon"),r(6,"pencil-simple"),t()(),o(7,"spk-menu",75)(8,"button",46),C(9,Yn,2,0,"spk-icon")(10,Zn,2,0,"spk-icon"),t(),m(11,54),o(12,"h3",76),r(13,"Operations"),t(),o(14,"button",77),s(15,35),d(16,"spk-icon"),u(),t(),o(17,"button",77),s(18,36),d(19,"spk-icon"),u(),t(),o(20,"button",77),s(21,37),d(22,"spk-icon"),u(),t(),d(23,"spk-divider"),o(24,"h3",76),r(25,"Advanced"),t(),o(26,"button",77),s(27,38),d(28,"spk-icon"),u(),t(),o(29,"button",51),$("click",function(){let c=N(e).$implicit,F=p();return D(F.verifyFiles(c.Backup==null?null:c.Backup.ID))}),s(30,39),d(31,"spk-icon"),u(),t(),o(32,"button",51),$("click",function(){let c=N(e).$implicit,F=p();return D(F.compressBackup(c.Backup==null?null:c.Backup.ID))}),s(33,40),d(34,"spk-icon"),u(),t(),o(35,"button",77),s(36,41),d(37,"spk-icon"),u(),t(),d(38,"spk-divider"),o(39,"h3",76),r(40,"Reporting"),t(),o(41,"button",77),s(42,42),d(43,"spk-icon"),u(),t(),M(),t()}if(n&2){let e=i.$implicit,a=p();H("loader",a.startingBackup()===(e.Backup==null?null:e.Backup.ID)),_(3),S(a.viewMode()==="list"?3:-1),_(),g("routerLink",P(16,rn,e.Backup==null?null:e.Backup.ID)),_(3),g("right",!0),_(),H("loader",a.loadingId()===(e.Backup==null?null:e.Backup.ID))("success",a.successId()===(e.Backup==null?null:e.Backup.ID)),_(),S(a.successId()===(e.Backup==null?null:e.Backup.ID)?9:10),_(5),g("routerLink",P(18,cn,e.Backup==null?null:e.Backup.ID)),_(3),g("routerLink",P(20,sn,e.Backup==null?null:e.Backup.ID)),_(3),g("routerLink",P(22,un,e.Backup==null?null:e.Backup.ID)),_(6),g("routerLink",P(24,pn,e.Backup==null?null:e.Backup.ID)),_(9),g("routerLink",P(26,Fn,e.Backup==null?null:e.Backup.ID)),_(6),g("routerLink",P(28,dn,e.Backup==null?null:e.Backup.ID))}}function nt(n,i){n&1&&(o(0,"spk-icon",78),r(1,"funnel-simple"),t(),o(2,"spk-icon",79),r(3,"sort-ascending"),t(),o(4,"spk-icon",80),r(5,"sort-descending"),t())}var tn={file:{Display:$localize`Local`,Icon:null}},Z=class n{#n=h(Je);#t=h(Ze);#e=h(Ye);MISSING_BACKUP_NAME=$localize`Backup name missing`;sortOrderOptions=this.#e.orderByOptions;orderBy=this.#e.orderBy;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;timeType=this.#e.timeType;viewMode=Qe("viewMode","list");sortByColumn=X(this.#e.orderBy());loadingId=X(null);successId=X(null);sortEffect=ve(()=>this.#e.setOrderBy(this.sortByColumn()));ngOnInit(){this.#e.getBackups(!0)}setOrderBy(i){this.#e.setOrderBy(i)}setTimeType(i){this.#e.setTimeType(i)}startBackup(i){this.#t.resumeDialogCheck(()=>this.#e.startBackup(i))}getBackendIcon(i){if(!i)return"";let e=i.split("://")[0],a=Y(e);return tn[a.key]?.Icon??"database"}getBackendType(i){if(!i)return"";let e=i.split("://")[0],a=Y(e);if(!a)return"";let c=tn[a.key];if(c?.Display)return c.Display;if(a.key==="s3"){let F="http://null?"+i.split("?")[1],B=new URL(F).searchParams.get("s3-server-name")?.toLowerCase()??"";for(let[L,G]of Object.entries(en))if(B.endsWith(L))return G}return a.displayName}getBackupVersionCount(i){return parseInt(i?.Backup?.Metadata?.BackupListCount??"",10)||0}verifyFiles(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdVerify({id:i}).pipe(j(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}compressBackup(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdCompact({id:i}).pipe(j(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=He({type:n,selectors:[["app-home"]],decls:54,vars:11,consts:()=>{let i;i=$localize`Backups`;let e;e=$localize`Backups are stored in the cloud and can be restored at any time.`;let a;a=$localize` Add ${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let c;c=$localize`Restores`;let F;F=$localize`Restores allow you to restore your data from the cloud.`;let U;U=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let B;B=$localize`My backups`;let L;L=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SPK_ICON:rows${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SPK_ICON: List `;let G;G=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SPK_ICON:list${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SPK_ICON: Details `;let ee;ee=$localize` Time: ${"\uFFFD#38\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#39\uFFFD"}:START_TAG_SPK_ICON:clock${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let ne;ne=$localize`Relative time`;let te;te=$localize`Actual time`;let ie;ie=$localize` Order by: ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#4\uFFFD"}:START_TAG_SPK_ICON:arrows-down-up${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let oe;oe=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let ae;ae=$localize`Last successful backup:`;let _e;_e=$localize`Duration:`;let le;le=$localize`Source:`;let re;re=$localize`Destination:`;let b;b=$localize`{VAR_PLURAL, plural, =0 {No version yet} =1 {1 Version} other {{INTERPOLATION} Versions}}`,b=W(b,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let ce;ce=$localize` ${b}:ICU@@6502601490918455200: `;let se;se=$localize`Next scheduled run:`;let ue;ue=$localize`No backups founds`;let pe;pe=$localize` Backup ${"\uFFFD*4:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*4:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Fe;Fe=$localize` Type ${"\uFFFD*7:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*7:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let de;de=$localize` Last backup ${"\uFFFD*10:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*10:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let ge;ge=$localize` Next run ${"\uFFFD*13:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*13:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Te;Te=$localize` Duration ${"\uFFFD*16:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*16:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ce;Ce=$localize` Source ${"\uFFFD*19:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*19:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Se;Se=$localize` Destination ${"\uFFFD*22:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*22:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ee;Ee=$localize`Version`;let me;me=$localize`Actions`;let v;v=$localize`{VAR_PLURAL, plural, =0 {No versions} =1 {1 Version} other {{INTERPOLATION} Versions}}`,v=W(v,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let Me;Me=$localize` ${v}:ICU@@3521773141017690117: `;let Oe;Oe=$localize`Loading backups...`;let ke;ke=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:play-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Start ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:`;let Ne;Ne=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SPK_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SPK_ICON: Restore `;let De;De=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:export${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Export `;let fe;fe=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Delete `;let Pe;Pe=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SPK_ICON:database${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SPK_ICON: Database `;let $e;$e=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SPK_ICON:check-square-offset${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SPK_ICON: Verify files `;let Ie;Ie=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SPK_ICON:file-archive${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SPK_ICON: Compress now `;let Ae;Ae=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SPK_ICON:terminal-window${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SPK_ICON: Commandline `;let Re;return Re=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SPK_ICON:notepad${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SPK_ICON: Log `,[["actions",""],["sortIcons",""],i,e,a,c,F,U,B,L,G,ee,ne,te,ie,oe,ae,_e,le,re,ce,se,ue,pe,Fe,de,ge,Te,Ce,Se,Ee,me,Me,Oe,ke,Ne,De,fe,Pe,$e,Ie,Ae,Re,[1,"type-a",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["type","button","spk-button",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"actions"],[1,"small"],["type","button",3,"click"],[1,"table-overview"],["type","button","spk-button","",1,"small"],["menu",""],["type","button",3,"active"],[1,"backups"],[1,"type-b",3,"data","loading","sortByColumn"],[1,"backup"],[1,"simple","success"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"type-b",3,"sortByColumnChange","data","loading","sortByColumn"],["table-header",""],["spkSort","name"],[4,"ngTemplateOutlet"],["spkSort","type"],["spkSort","lastrun"],["spkSort","nextrun"],["spkSort","duration"],["spkSort","sourcesize"],["spkSort","destinationsize"],[1,"loading-list"],[1,"indeterminate","primary"],["spk-button","",3,"click"],["type","button","spk-button","",3,"routerLink"],[3,"right"],["title",""],["type","button",3,"routerLink"],[1,"filter"],[1,"asc"],[1,"desc"]]},template:function(e,a){if(e&1){let c=x();d(0,"app-status-bar"),o(1,"section")(2,"header")(3,"spk-card",43),d(4,"img",44),o(5,"div",45)(6,"h3"),T(7,2),t(),o(8,"p"),T(9,3),t()(),o(10,"button",46),s(11,4),d(12,"spk-icon"),u(),t()(),o(13,"spk-card",43),d(14,"img",47),o(15,"div",45)(16,"h3"),T(17,5),t(),o(18,"p"),T(19,6),t()(),o(20,"button",46),s(21,7),d(22,"spk-icon"),u(),t()()(),o(23,"div",48)(24,"h2"),m(25),T(26,8),M(),o(27,"div",49)(28,"spk-button-group",50)(29,"button",51),$("click",function(){return N(c),D(a.viewMode.set("list"))}),s(30,9),d(31,"spk-icon"),u(),t(),o(32,"button",51),$("click",function(){return N(c),D(a.viewMode.set("details"))}),s(33,10),d(34,"spk-icon"),u(),t()(),o(35,"spk-menu",52)(36,"button",53),s(37,11),d(38,"strong")(39,"spk-icon"),u(),t(),m(40,54),o(41,"button",51),$("click",function(){return N(c),D(a.setTimeType("relative"))}),T(42,12),t(),o(43,"button",51),$("click",function(){return N(c),D(a.setTimeType("actual"))}),T(44,13),t(),M(),t(),C(45,Tn,8,1,"spk-menu",52),t()(),O(46,qn,2,1)(47,Jn,5,0),xe(48,46,an,null,47),t()(),O(50,et,44,30,"ng-template",null,0,J)(52,nt,6,0,"ng-template",null,1,J)}e&2&&(_(3),g("routerLink",q(9,_n)),_(10),g("routerLink",q(10,ln)),_(16),H("active",a.viewMode()==="list"),_(3),H("active",a.viewMode()==="details"),_(7),A(a.timeType()),R(37),_(6),S(a.viewMode()==="list"?45:-1),_(3),ye(!a.backupsLoading()))},dependencies:[he,nn,ze,we,Q,Ke,Ue,je,Xe],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{padding:0 2rem}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:.5rem}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-12)}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.sortable[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}.sortable[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{margin-left:.5rem;font-size:1rem;justify-self:flex-end;display:none}.sortable[_ngcontent-%COMP%]:not(.sort-asc):not(.sort-desc) spk-icon.filter[_ngcontent-%COMP%]{display:block}.sortable.sort-asc[_ngcontent-%COMP%] spk-icon.asc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.sortable.sort-desc[_ngcontent-%COMP%] spk-icon.desc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}"],changeDetection:0})};export{Z as default};
|
|
1
|
+
import{a as Y,d as en}from"./chunk-AH5TLYN4.js";import{a as nn}from"./chunk-XIOHRQ3X.js";import{a as Ze}from"./chunk-WZRDKVOR.js";import{a as Ye}from"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-6JQM2X3B.js";import"./chunk-WXARH2SG.js";import"./chunk-NSIELNIY.js";import{a as Qe}from"./chunk-7QJG4IIT.js";import"./chunk-3ZVSHKLD.js";import{e as he}from"./chunk-2W6BEUGU.js";import"./chunk-JFOXV66M.js";import{a as Q,f as Xe,g as we,h as ze,j as Ve,k as Ke,o as Ue,p as je,w as We,x as qe}from"./chunk-Y5IRBMLB.js";import{h as Je}from"./chunk-DNJOKPEL.js";import"./chunk-UZK7ABRM.js";import"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import"./chunk-B6OIHB5W.js";import{$b as K,Ab as d,Ac as J,Bb as m,Cb as M,Db as f,Eb as x,H as j,Ic as ve,Kb as s,Lb as u,Mb as T,Nb as A,Ob as R,Pb as W,Qa as _,Qb as $,Rb as p,Z as h,ab as He,bc as H,da as N,ea as D,ec as r,fb as O,fc as Be,gc as E,jc as Le,kc as Ge,lc as be,na as X,pb as xe,qb as ye,sb as C,sc as q,tb as S,tc as P,ub as w,vb as z,wb as V,wc as k,xb as g,xc as y,yb as o,yc as I,zb as t}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var an=()=>[import("./chunk-AFLQOHXV.js").then(n=>n.NgTemplateOutlet),Q,Ve,qe,We,import("./chunk-3JKXOOME.js").then(n=>n.DurationFormatPipe),import("./chunk-HLYFP2CB.js").then(n=>n.BytesPipe),import("./chunk-NS4PAVKI.js").then(n=>n.RelativeTimePipe)],_n=()=>["/add-backup"],ln=()=>["/restore"],on=n=>({$implicit:n}),rn=n=>["/backup",n],cn=n=>["/restore",n],sn=n=>["/backup",n,"export"],un=n=>["/backup",n,"delete"],pn=n=>["/backup",n,"database"],Fn=n=>["/backup",n,"commandline"],dn=n=>["/backup",n,"log"];function gn(n,i){if(n&1){let e=x();o(0,"button",51),$("click",function(){let c=N(e).$implicit,F=p(2);return D(F.sortByColumn.set(c.value))}),T(1,15),t()}if(n&2){let e=i.$implicit,a=p(2);H("active",a.orderBy()===e.value),_(),A(e.label),R(1)}}function Tn(n,i){if(n&1&&(o(0,"spk-menu",52)(1,"button",53),s(2,14),d(3,"strong")(4,"spk-icon"),u(),t(),m(5,54),z(6,gn,2,3,"button",55,w),M(),t()),n&2){let e=p();_(4),A(e.orderBy()),R(2),_(2),V(e.sortOrderOptions())}}function Cn(n,i){if(n&1&&(o(0,"p")(1,"span"),T(2,21),t(),r(3),k(4,"relativeTime"),t()),n&2){let e=p().$implicit,a=p(4);_(3),E(" ",I(4,1,e.Schedule==null?null:e.Schedule.Time,a.timeType()==="actual")," ")}}function Sn(n,i){if(n&1&&(r(0),k(1,"durationFormat")),n&2){let e=p().$implicit,a=p(4);E(" ",I(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupDuration,a.timeType()==="actual")," ")}}function En(n,i){n&1&&(m(0),r(1,"-"),M())}function mn(n,i){if(n&1&&(r(0),k(1,"bytes")),n&2){let e=p().$implicit;E(" ",y(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.SourceFilesSize)," ")}}function Mn(n,i){n&1&&(m(0),r(1,"-"),M())}function On(n,i){if(n&1&&(r(0),k(1,"bytes")),n&2){let e=p().$implicit;E(" ",y(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.TargetFilesSize)," ")}}function kn(n,i){n&1&&(m(0),r(1,"-"),M())}function Nn(n,i){n&1&&f(0)}function Dn(n,i){if(n&1&&(o(0,"div",58)(1,"div",45)(2,"h3"),r(3),o(4,"spk-chip")(5,"spk-icon"),r(6),t(),r(7),t()(),o(8,"p")(9,"span"),T(10,16),t(),r(11),k(12,"relativeTime"),t(),C(13,Cn,5,4,"p"),o(14,"p")(15,"span"),T(16,17),t(),C(17,Sn,2,4)(18,En,2,0,"ng-container"),t(),o(19,"p")(20,"span"),T(21,18),t(),C(22,mn,2,3)(23,Mn,2,0,"ng-container"),t(),o(24,"p")(25,"span"),T(26,19),t(),C(27,On,2,3)(28,kn,2,0,"ng-container"),t()(),o(29,"spk-chip",59),T(30,20),t(),o(31,"div",49),O(32,Nn,1,0,"ng-container",60),t()()),n&2){let e=i.$implicit,a=p(4),c=K(51);_(3),E(" ",(e.Backup==null?null:e.Backup.Name)??a.MISSING_BACKUP_NAME," "),_(3),Be(a.getBackendIcon(e.Backup==null?null:e.Backup.TargetURL)),_(),E(" ",a.getBackendType(e.Backup==null?null:e.Backup.TargetURL)," "),_(4),E(" ",I(12,12,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupFinished,a.timeType()==="actual")," "),_(2),S(e.Schedule!=null&&e.Schedule.Time?13:-1),_(4),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.LastBackupDuration?17:18),_(5),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.SourceFilesSize?22:23),_(5),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.TargetFilesSize?27:28);let F=a.getBackupVersionCount(e);_(3),A(F)(F),R(30),_(2),g("ngTemplateOutlet",c)("ngTemplateOutletContext",P(15,on,e))}}function fn(n,i){if(n&1&&z(0,Dn,33,17,"div",58,w),n&2){let e=p(3);V(e.backups())}}function Pn(n,i){n&1&&(m(0),T(1,22),M())}function $n(n,i){if(n&1&&(o(0,"div",56),C(1,fn,2,0)(2,Pn,2,0,"ng-container"),t()),n&2){let e=p(2);_(),S(e.backups().length?1:2)}}function In(n,i){n&1&&(s(0,23,1),f(1),u())}function An(n,i){n&1&&(s(0,24,1),f(1),u())}function Rn(n,i){n&1&&(s(0,25,1),f(1),u())}function Hn(n,i){n&1&&(s(0,26,1),f(1),u())}function xn(n,i){n&1&&(s(0,27,1),f(1),u())}function yn(n,i){n&1&&(s(0,28,1),f(1),u())}function Bn(n,i){n&1&&(s(0,29,1),f(1),u())}function Ln(n,i){if(n&1&&(r(0),k(1,"relativeTime")),n&2){let e=p().$implicit,a=p(3);E(" ",I(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupDate,a.timeType()==="actual")," ")}}function Gn(n,i){n&1&&(m(0),r(1,"-"),M())}function bn(n,i){if(n&1&&(r(0),k(1,"relativeTime")),n&2){let e=p().$implicit,a=p(3);E(" ",I(1,1,e.Schedule==null?null:e.Schedule.Time,a.timeType()==="actual")," ")}}function vn(n,i){n&1&&(m(0),r(1,"-"),M())}function hn(n,i){if(n&1&&(r(0),k(1,"durationFormat")),n&2){let e=p().$implicit,a=p(3);E(" ",I(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupDuration,a.timeType()==="actual")," ")}}function Xn(n,i){n&1&&(m(0),r(1,"-"),M())}function wn(n,i){if(n&1&&(r(0),k(1,"bytes")),n&2){let e=p().$implicit;E(" ",y(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.SourceFilesSize)," ")}}function zn(n,i){n&1&&(m(0),r(1,"-"),M())}function Vn(n,i){if(n&1&&(r(0),k(1,"bytes")),n&2){let e=p().$implicit;E(" ",y(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.TargetFilesSize)," ")}}function Kn(n,i){n&1&&(m(0),r(1,"-"),M())}function Un(n,i){n&1&&f(0)}function jn(n,i){if(n&1&&(o(0,"tr")(1,"td"),r(2),t(),o(3,"td"),r(4),t(),o(5,"td"),C(6,Ln,2,4)(7,Gn,2,0,"ng-container"),t(),o(8,"td"),C(9,bn,2,4)(10,vn,2,0,"ng-container"),t(),o(11,"td"),C(12,hn,2,4)(13,Xn,2,0,"ng-container"),t(),o(14,"td"),C(15,wn,2,3)(16,zn,2,0,"ng-container"),t(),o(17,"td"),C(18,Vn,2,3)(19,Kn,2,0,"ng-container"),t(),o(20,"td")(21,"span"),T(22,32),t()(),o(23,"td"),O(24,Un,1,0,"ng-container",60),t()()),n&2){let e=i.$implicit,a=p(3),c=K(51);_(2),E(" ",(e.Backup==null?null:e.Backup.Name)??a.MISSING_BACKUP_NAME," "),_(2),E(" ",a.getBackendType(e.Backup==null?null:e.Backup.TargetURL)," "),_(2),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.LastBackupDate?6:7),_(3),S(e.Schedule!=null&&e.Schedule.Time?9:10),_(3),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.LastBackupDuration?12:13),_(3),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.SourceFilesSize?15:16),_(3),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.TargetFilesSize?18:19);let F=a.getBackupVersionCount(e);_(4),A(F)(F),R(22),_(2),g("ngTemplateOutlet",c)("ngTemplateOutletContext",P(11,on,e))}}function Wn(n,i){if(n&1){let e=x();o(0,"spk-table",61),be("sortByColumnChange",function(c){N(e);let F=p(2);return Ge(F.sortByColumn,c)||(F.sortByColumn=c),D(c)}),o(1,"tr",62)(2,"th",63),s(3,23),O(4,In,2,0,"ng-container",64),u(),t(),o(5,"th",65),s(6,24),O(7,An,2,0,"ng-container",64),u(),t(),o(8,"th",66),s(9,25),O(10,Rn,2,0,"ng-container",64),u(),t(),o(11,"th",67),s(12,26),O(13,Hn,2,0,"ng-container",64),u(),t(),o(14,"th",68),s(15,27),O(16,xn,2,0,"ng-container",64),u(),t(),o(17,"th",69),s(18,28),O(19,yn,2,0,"ng-container",64),u(),t(),o(20,"th",70),s(21,29),O(22,Bn,2,0,"ng-container",64),u(),t(),o(23,"th"),T(24,30),t(),o(25,"th"),T(26,31),t()(),z(27,jn,25,13,"tr",null,w),t()}if(n&2){let e=p(2),a=K(53);g("data",e.backups())("loading",e.backupsLoading()),Le("sortByColumn",e.sortByColumn),_(4),g("ngTemplateOutlet",a),_(3),g("ngTemplateOutlet",a),_(3),g("ngTemplateOutlet",a),_(3),g("ngTemplateOutlet",a),_(3),g("ngTemplateOutlet",a),_(3),g("ngTemplateOutlet",a),_(3),g("ngTemplateOutlet",a),_(5),V(e.backups())}}function qn(n,i){if(n&1&&C(0,$n,3,1,"div",56)(1,Wn,29,10,"spk-table",57),n&2){let e=p();S(e.viewMode()==="list"?0:e.viewMode()==="details"?1:-1)}}function Jn(n,i){n&1&&(o(0,"div",71),d(1,"spk-progress-bar",72),o(2,"div",45)(3,"h3"),T(4,33),t()()())}function Qn(n,i){n&1&&T(0,34,1)}function Yn(n,i){n&1&&(o(0,"spk-icon"),r(1,"check"),t())}function Zn(n,i){n&1&&(o(0,"spk-icon"),r(1,"dots-three-vertical"),t())}function et(n,i){if(n&1){let e=x();o(0,"button",73),$("click",function(){let c=N(e).$implicit,F=p();return D(F.startBackup(c.Backup==null?null:c.Backup.ID))}),s(1,34),d(2,"spk-icon"),C(3,Qn,1,0),u(),t(),o(4,"button",74)(5,"spk-icon"),r(6,"pencil-simple"),t()(),o(7,"spk-menu",75)(8,"button",46),C(9,Yn,2,0,"spk-icon")(10,Zn,2,0,"spk-icon"),t(),m(11,54),o(12,"h3",76),r(13,"Operations"),t(),o(14,"button",77),s(15,35),d(16,"spk-icon"),u(),t(),o(17,"button",77),s(18,36),d(19,"spk-icon"),u(),t(),o(20,"button",77),s(21,37),d(22,"spk-icon"),u(),t(),d(23,"spk-divider"),o(24,"h3",76),r(25,"Advanced"),t(),o(26,"button",77),s(27,38),d(28,"spk-icon"),u(),t(),o(29,"button",51),$("click",function(){let c=N(e).$implicit,F=p();return D(F.verifyFiles(c.Backup==null?null:c.Backup.ID))}),s(30,39),d(31,"spk-icon"),u(),t(),o(32,"button",51),$("click",function(){let c=N(e).$implicit,F=p();return D(F.compressBackup(c.Backup==null?null:c.Backup.ID))}),s(33,40),d(34,"spk-icon"),u(),t(),o(35,"button",77),s(36,41),d(37,"spk-icon"),u(),t(),d(38,"spk-divider"),o(39,"h3",76),r(40,"Reporting"),t(),o(41,"button",77),s(42,42),d(43,"spk-icon"),u(),t(),M(),t()}if(n&2){let e=i.$implicit,a=p();H("loader",a.startingBackup()===(e.Backup==null?null:e.Backup.ID)),_(3),S(a.viewMode()==="list"?3:-1),_(),g("routerLink",P(16,rn,e.Backup==null?null:e.Backup.ID)),_(3),g("right",!0),_(),H("loader",a.loadingId()===(e.Backup==null?null:e.Backup.ID))("success",a.successId()===(e.Backup==null?null:e.Backup.ID)),_(),S(a.successId()===(e.Backup==null?null:e.Backup.ID)?9:10),_(5),g("routerLink",P(18,cn,e.Backup==null?null:e.Backup.ID)),_(3),g("routerLink",P(20,sn,e.Backup==null?null:e.Backup.ID)),_(3),g("routerLink",P(22,un,e.Backup==null?null:e.Backup.ID)),_(6),g("routerLink",P(24,pn,e.Backup==null?null:e.Backup.ID)),_(9),g("routerLink",P(26,Fn,e.Backup==null?null:e.Backup.ID)),_(6),g("routerLink",P(28,dn,e.Backup==null?null:e.Backup.ID))}}function nt(n,i){n&1&&(o(0,"spk-icon",78),r(1,"funnel-simple"),t(),o(2,"spk-icon",79),r(3,"sort-ascending"),t(),o(4,"spk-icon",80),r(5,"sort-descending"),t())}var tn={file:{Display:$localize`Local`,Icon:null}},Z=class n{#n=h(Je);#t=h(Ze);#e=h(Ye);MISSING_BACKUP_NAME=$localize`Backup name missing`;sortOrderOptions=this.#e.orderByOptions;orderBy=this.#e.orderBy;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;timeType=this.#e.timeType;viewMode=Qe("viewMode","list");sortByColumn=X(this.#e.orderBy());loadingId=X(null);successId=X(null);sortEffect=ve(()=>this.#e.setOrderBy(this.sortByColumn()));ngOnInit(){this.#e.getBackups(!0)}setOrderBy(i){this.#e.setOrderBy(i)}setTimeType(i){this.#e.setTimeType(i)}startBackup(i){this.#t.resumeDialogCheck(()=>this.#e.startBackup(i))}getBackendIcon(i){if(!i)return"";let e=i.split("://")[0],a=Y(e);return tn[a.key]?.Icon??"database"}getBackendType(i){if(!i)return"";let e=i.split("://")[0],a=Y(e);if(!a)return"";let c=tn[a.key];if(c?.Display)return c.Display;if(a.key==="s3"){let F="http://null?"+i.split("?")[1],B=new URL(F).searchParams.get("s3-server-name")?.toLowerCase()??"";for(let[L,G]of Object.entries(en))if(B.endsWith(L))return G}return a.displayName}getBackupVersionCount(i){return parseInt(i?.Backup?.Metadata?.BackupListCount??"",10)||0}verifyFiles(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdVerify({id:i}).pipe(j(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}compressBackup(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdCompact({id:i}).pipe(j(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=He({type:n,selectors:[["app-home"]],decls:54,vars:11,consts:()=>{let i;i=$localize`Backups`;let e;e=$localize`Backups are stored in the cloud and can be restored at any time.`;let a;a=$localize` Add ${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let c;c=$localize`Restores`;let F;F=$localize`Restores allow you to restore your data from the cloud.`;let U;U=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let B;B=$localize`My backups`;let L;L=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SPK_ICON:rows${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SPK_ICON: List `;let G;G=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SPK_ICON:list${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SPK_ICON: Details `;let ee;ee=$localize` Time: ${"\uFFFD#38\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#39\uFFFD"}:START_TAG_SPK_ICON:clock${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let ne;ne=$localize`Relative time`;let te;te=$localize`Actual time`;let ie;ie=$localize` Order by: ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#4\uFFFD"}:START_TAG_SPK_ICON:arrows-down-up${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let oe;oe=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let ae;ae=$localize`Last successful backup:`;let _e;_e=$localize`Duration:`;let le;le=$localize`Source:`;let re;re=$localize`Destination:`;let b;b=$localize`{VAR_PLURAL, plural, =0 {No version yet} =1 {1 Version} other {{INTERPOLATION} Versions}}`,b=W(b,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let ce;ce=$localize` ${b}:ICU@@6502601490918455200: `;let se;se=$localize`Next scheduled run:`;let ue;ue=$localize`No backups founds`;let pe;pe=$localize` Backup ${"\uFFFD*4:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*4:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Fe;Fe=$localize` Type ${"\uFFFD*7:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*7:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let de;de=$localize` Last backup ${"\uFFFD*10:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*10:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let ge;ge=$localize` Next run ${"\uFFFD*13:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*13:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Te;Te=$localize` Duration ${"\uFFFD*16:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*16:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ce;Ce=$localize` Source ${"\uFFFD*19:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*19:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Se;Se=$localize` Destination ${"\uFFFD*22:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*22:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ee;Ee=$localize`Version`;let me;me=$localize`Actions`;let v;v=$localize`{VAR_PLURAL, plural, =0 {No versions} =1 {1 Version} other {{INTERPOLATION} Versions}}`,v=W(v,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let Me;Me=$localize` ${v}:ICU@@3521773141017690117: `;let Oe;Oe=$localize`Loading backups...`;let ke;ke=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:play-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Start ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:`;let Ne;Ne=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SPK_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SPK_ICON: Restore `;let De;De=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:export${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Export `;let fe;fe=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Delete `;let Pe;Pe=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SPK_ICON:database${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SPK_ICON: Database `;let $e;$e=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SPK_ICON:check-square-offset${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SPK_ICON: Verify files `;let Ie;Ie=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SPK_ICON:file-archive${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SPK_ICON: Compress now `;let Ae;Ae=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SPK_ICON:terminal-window${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SPK_ICON: Commandline `;let Re;return Re=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SPK_ICON:notepad${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SPK_ICON: Log `,[["actions",""],["sortIcons",""],i,e,a,c,F,U,B,L,G,ee,ne,te,ie,oe,ae,_e,le,re,ce,se,ue,pe,Fe,de,ge,Te,Ce,Se,Ee,me,Me,Oe,ke,Ne,De,fe,Pe,$e,Ie,Ae,Re,[1,"type-a",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["type","button","spk-button",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"actions"],[1,"small"],["type","button",3,"click"],[1,"table-overview"],["type","button","spk-button","",1,"small"],["menu",""],["type","button",3,"active"],[1,"backups"],[1,"type-b",3,"data","loading","sortByColumn"],[1,"backup"],[1,"simple","success"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"type-b",3,"sortByColumnChange","data","loading","sortByColumn"],["table-header",""],["spkSort","name"],[4,"ngTemplateOutlet"],["spkSort","type"],["spkSort","lastrun"],["spkSort","nextrun"],["spkSort","duration"],["spkSort","sourcesize"],["spkSort","destinationsize"],[1,"loading-list"],[1,"indeterminate","primary"],["spk-button","",3,"click"],["type","button","spk-button","",3,"routerLink"],[3,"right"],["title",""],["type","button",3,"routerLink"],[1,"filter"],[1,"asc"],[1,"desc"]]},template:function(e,a){if(e&1){let c=x();d(0,"app-status-bar"),o(1,"section")(2,"header")(3,"spk-card",43),d(4,"img",44),o(5,"div",45)(6,"h3"),T(7,2),t(),o(8,"p"),T(9,3),t()(),o(10,"button",46),s(11,4),d(12,"spk-icon"),u(),t()(),o(13,"spk-card",43),d(14,"img",47),o(15,"div",45)(16,"h3"),T(17,5),t(),o(18,"p"),T(19,6),t()(),o(20,"button",46),s(21,7),d(22,"spk-icon"),u(),t()()(),o(23,"div",48)(24,"h2"),m(25),T(26,8),M(),o(27,"div",49)(28,"spk-button-group",50)(29,"button",51),$("click",function(){return N(c),D(a.viewMode.set("list"))}),s(30,9),d(31,"spk-icon"),u(),t(),o(32,"button",51),$("click",function(){return N(c),D(a.viewMode.set("details"))}),s(33,10),d(34,"spk-icon"),u(),t()(),o(35,"spk-menu",52)(36,"button",53),s(37,11),d(38,"strong")(39,"spk-icon"),u(),t(),m(40,54),o(41,"button",51),$("click",function(){return N(c),D(a.setTimeType("relative"))}),T(42,12),t(),o(43,"button",51),$("click",function(){return N(c),D(a.setTimeType("actual"))}),T(44,13),t(),M(),t(),C(45,Tn,8,1,"spk-menu",52),t()(),O(46,qn,2,1)(47,Jn,5,0),xe(48,46,an,null,47),t()(),O(50,et,44,30,"ng-template",null,0,J)(52,nt,6,0,"ng-template",null,1,J)}e&2&&(_(3),g("routerLink",q(9,_n)),_(10),g("routerLink",q(10,ln)),_(16),H("active",a.viewMode()==="list"),_(3),H("active",a.viewMode()==="details"),_(7),A(a.timeType()),R(37),_(6),S(a.viewMode()==="list"?45:-1),_(3),ye(!a.backupsLoading()))},dependencies:[he,nn,ze,we,Q,Ke,Ue,je,Xe],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{padding:0 2rem}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:.5rem}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-12)}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.sortable[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}.sortable[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{margin-left:.5rem;font-size:1rem;justify-self:flex-end;display:none}.sortable[_ngcontent-%COMP%]:not(.sort-asc):not(.sort-desc) spk-icon.filter[_ngcontent-%COMP%]{display:block}.sortable.sort-asc[_ngcontent-%COMP%] spk-icon.asc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.sortable.sort-desc[_ngcontent-%COMP%] spk-icon.desc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}"],changeDetection:0})};export{Z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ut}from"./chunk-WZNH4JPF.js";import{a as Oe}from"./chunk-BCHZRC5K.js";import{a as rt,b as Ke,c as _t}from"./chunk-B26UYXA3.js";import{b as re}from"./chunk-LDIZ5E5Z.js";import{a as ot}from"./chunk-2BX65XJQ.js";import{a as Te}from"./chunk-6JQM2X3B.js";import{b as fe,c as Q,d as Ae,e as Z,f as he,h as st,i as le,j as Pe,k as Ne,n as lt,o as De,p as at,q as Me,r as ye,s as ae,t as Re}from"./chunk-NSIELNIY.js";import{b as oe,d as H}from"./chunk-2W6BEUGU.js";import{A as Ee,C as nt,a as j,b as Je,e as et,g as se,l as q,p as tt,t as Y}from"./chunk-Y5IRBMLB.js";import{h as it}from"./chunk-DNJOKPEL.js";import{$b as xe,Ab as C,Bb as B,Cb as v,Eb as x,H as ke,Hc as I,Ic as ie,Kb as m,Lb as F,Mb as A,Mc as ve,Nc as Ve,Oc as Se,Pb as Ge,Qa as _,Qb as E,Rb as u,U as ge,Z as M,Zb as Ce,_b as me,ab as z,bc as Fe,da as p,ea as d,ec as U,fb as Ye,fc as be,gc as Ze,jc as w,kc as $,lc as k,na as g,rb as Qe,sb as y,sc as Be,tb as R,ub as Ie,vb as Le,wb as Ue,xb as f,yb as l,zb as a}from"./chunk-BTMXQPBB.js";import{a as G,b as W}from"./chunk-EUDKD2JW.js";var we=class s{fromString(t){if(!t)return null;let e=t.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(t,e){return`${t}${e}`}static \u0275fac=function(e){return new(e||s)};static \u0275prov=ge({token:s,factory:s.\u0275fac,providedIn:"root"})};function Ct(s,t){if(s&1){let e=x();l(0,"div",24)(1,"spk-form-field")(2,"label",25),A(3,7),a(),l(4,"input",26,0),k("ngModelChange",function(i){p(e);let o=u();return $(o.scheduleFields.nextTime().time,i)||(o.scheduleFields.nextTime().time=i),d(i)}),E("focus",function(){p(e);let i=xe(5);return d(i.showPicker())}),a(),l(6,"spk-icon",27),U(7,"clock"),a()(),l(8,"spk-form-field"),C(9,"label",28),l(10,"input",29,1),k("ngModelChange",function(i){p(e);let o=u();return $(o.scheduleFields.nextTime().date,i)||(o.scheduleFields.nextTime().date=i),d(i)}),E("focus",function(){p(e);let i=xe(11);return d(i.showPicker())}),a(),l(12,"spk-icon",27),U(13,"calendar"),a()()(),l(14,"div",24)(15,"spk-form-field")(16,"label",30),A(17,8),a(),l(18,"input",31),k("ngModelChange",function(i){p(e);let o=u();return $(o.scheduleFields.runAgain().repeatValue,i)||(o.scheduleFields.runAgain().repeatValue=i),d(i)}),a()(),l(19,"spk-select",32)(20,"input",33),k("ngModelChange",function(i){p(e);let o=u();return $(o.scheduleFields.runAgain().repeatUnit,i)||(o.scheduleFields.runAgain().repeatUnit=i),d(i)}),a()()(),l(21,"app-toggle-card",34),B(22,35),A(23,9),v(),l(24,"div",36)(25,"spk-toggle",19),m(26,10),l(27,"input",20),k("ngModelChange",function(i){p(e);let o=u();return $(o.scheduleFields.runAgain().allowedDays.mon,i)||(o.scheduleFields.runAgain().allowedDays.mon=i),d(i)}),a(),F(),a(),l(28,"spk-toggle",19),m(29,11),l(30,"input",20),k("ngModelChange",function(i){p(e);let o=u();return $(o.scheduleFields.runAgain().allowedDays.tue,i)||(o.scheduleFields.runAgain().allowedDays.tue=i),d(i)}),a(),F(),a(),l(31,"spk-toggle",19),m(32,12),l(33,"input",20),k("ngModelChange",function(i){p(e);let o=u();return $(o.scheduleFields.runAgain().allowedDays.wed,i)||(o.scheduleFields.runAgain().allowedDays.wed=i),d(i)}),a(),F(),a(),l(34,"spk-toggle",19),m(35,13),l(36,"input",20),k("ngModelChange",function(i){p(e);let o=u();return $(o.scheduleFields.runAgain().allowedDays.thu,i)||(o.scheduleFields.runAgain().allowedDays.thu=i),d(i)}),a(),F(),a(),l(37,"spk-toggle",19),m(38,14),l(39,"input",20),k("ngModelChange",function(i){p(e);let o=u();return $(o.scheduleFields.runAgain().allowedDays.fri,i)||(o.scheduleFields.runAgain().allowedDays.fri=i),d(i)}),a(),F(),a(),l(40,"spk-toggle",19),m(41,15),l(42,"input",20),k("ngModelChange",function(i){p(e);let o=u();return $(o.scheduleFields.runAgain().allowedDays.sat,i)||(o.scheduleFields.runAgain().allowedDays.sat=i),d(i)}),a(),F(),a(),l(43,"spk-toggle",19),m(44,16),l(45,"input",20),k("ngModelChange",function(i){p(e);let o=u();return $(o.scheduleFields.runAgain().allowedDays.sun,i)||(o.scheduleFields.runAgain().allowedDays.sun=i),d(i)}),a(),F(),a()()()}if(s&2){let e=u();_(4),w("ngModel",e.scheduleFields.nextTime().time),_(6),w("ngModel",e.scheduleFields.nextTime().date),_(8),w("ngModel",e.scheduleFields.runAgain().repeatValue),_(),f("options",e.unitOptions)("isClearable",!1),_(),w("ngModel",e.scheduleFields.runAgain().repeatUnit),_(),f("disallowToggle",!0),_(6),w("ngModel",e.scheduleFields.runAgain().allowedDays.mon),_(3),w("ngModel",e.scheduleFields.runAgain().allowedDays.tue),_(3),w("ngModel",e.scheduleFields.runAgain().allowedDays.wed),_(3),w("ngModel",e.scheduleFields.runAgain().allowedDays.thu),_(3),w("ngModel",e.scheduleFields.runAgain().allowedDays.fri),_(3),w("ngModel",e.scheduleFields.runAgain().allowedDays.sat),_(3),w("ngModel",e.scheduleFields.runAgain().allowedDays.sun)}}var mt=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],te={autoRun:!0,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}},Xe=class s{#e=M(J);#t=M(H);#i=M(oe);unitOptions=mt;scheduleFields=this.#e.scheduleFields;goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=z({type:s,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let t;t=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let n;n=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let r;r=$localize`Next time`;let c;c=$localize`Run again every`;let T;T=$localize`Allowed days`;let S;S=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let O;O=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let P;P=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let b;b=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let X;return X=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],t,e,n,i,o,r,c,T,S,O,P,L,K,b,X,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(l(0,"h3",17),A(1,2),a(),l(2,"div",18)(3,"spk-toggle",19),m(4,3),l(5,"input",20),k("ngModelChange",function(o){return $(n.scheduleFields.autoRun,o)||(n.scheduleFields.autoRun=o),o}),a(),F(),a(),l(6,"p"),A(7,4),a()(),y(8,Ct,46,14),l(9,"div",21)(10,"button",22),E("click",function(){return n.goBack()}),m(11,5),C(12,"spk-icon"),F(),a(),l(13,"button",23),E("click",function(){return n.next()}),m(14,6),C(15,"spk-icon"),F(),a()()),e&2&&(_(5),w("ngModel",n.scheduleFields.autoRun),_(3),R(n.scheduleFields.autoRun()?8:-1))},dependencies:[ae,Q,Ne,fe,Z,le,q,Ee,j,se,Y,Oe],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function Ft(s,t){if(s&1&&(B(0,4),U(1),v()),s&2){let e,n=u();_(),be((e=n.currentExpressionOption())==null?null:e.startsWith)}}function St(s,t){if(s&1&&(B(0,5),U(1),v()),s&2){let e,n=u();_(),be((e=n.currentExpressionOption())==null?null:e.endsWith)}}var Et=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Excludes file group",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],$e=class s{path=Ve.required();osType=Ve();pathChange=ve();remove=ve();internalPath=g("");pathType=g("-Expression");currentExpressionOption=I(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});expressionOptions=I(()=>{let e=this.osType()==="Windows"?"\\":"/";return Et.map(n=>n.value==="-Folder"||n.value==="+Folder"?W(G({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?W(G({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?W(G({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?W(G({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?W(G({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?W(G({},n),{startsWith:"*.",endsWith:""}):W(G({},n),{startsWith:"",endsWith:""}))});pathEffect=ie(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",o=i?"\\":"/";e.startsWith("%")&&e.endsWith(o)||i&&e.slice(2).startsWith(o)&&e.endsWith(o)||e.startsWith(o)&&e.endsWith(o)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${o}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${o}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e))});updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${t}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=z({type:s,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:9,vars:6,consts:()=>{let t;return t=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"expression-input"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""],[1,"filter-removal",3,"click"],[1,"spk-primary"]]},template:function(e,n){if(e&1&&(l(0,"spk-select",0)(1,"input",1),k("ngModelChange",function(o){return $(n.pathType,o)||(n.pathType=o),o}),E("ngModelChange",function(){return n.updateFilter()}),a()(),l(2,"spk-form-field",2)(3,"input",3),k("ngModelChange",function(o){return $(n.internalPath,o)||(n.internalPath=o),o}),E("ngModelChange",function(){return n.updateFilter()}),a(),y(4,Ft,2,1,"ng-container",4),y(5,St,2,1,"ng-container",5),a(),l(6,"div",6),E("click",function(){return n.removeFilter()}),l(7,"spk-icon",7),U(8,"x-circle"),a()()),e&2){let i,o;f("options",n.expressionOptions())("isClearable",!1),_(),w("ngModel",n.pathType),_(2),w("ngModel",n.internalPath),_(),R(!((i=n.currentExpressionOption())==null||i.startsWith==null)&&i.startsWith.length?4:-1),_(),R(!((o=n.currentExpressionOption())==null||o.endsWith==null)&&o.endsWith.length?5:-1)}},dependencies:[ae,Q,Z,le,Y,q,j],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Tt=["formRef"],ct=()=>({standalone:!0});function ft(s,t){if(s&1){let e=x();l(0,"spk-form-field",42)(1,"input",43),k("ngModelChange",function(i){p(e);let o=u(2);return $(o.editingPath,i)||(o.editingPath=i),d(i)}),a()(),l(2,"button",44),E("click",function(){p(e);let i=u(2);return d(i.updatePath())}),l(3,"spk-icon"),U(4,"floppy-disk"),a()(),l(5,"button",44),E("click",function(){p(e);let i=u(2);return d(i.cancelEditPath())}),l(6,"spk-icon"),U(7,"x-bold"),a()()}if(s&2){let e=u(2);_(),w("ngModel",e.editingPath),f("ngModelOptions",Be(2,ct))}}function At(s,t){if(s&1){let e=x();l(0,"spk-form-field",42),C(1,"input",45),a(),l(2,"button",44),E("click",function(){p(e);let i=u().$implicit,o=u();return d(o.editPath(i))}),l(3,"spk-icon"),U(4,"pen"),a()(),l(5,"button",44),E("click",function(){p(e);let i=u().$implicit,o=u();return d(o.removePath(i))}),l(6,"spk-icon"),U(7,"trash-simple"),a()()}if(s&2){let e=u().$implicit;Qe("readonly",!0),_(),f("ngModel",e)("ngModelOptions",Be(3,ct))}}function ht(s,t){if(s&1&&(l(0,"div",30),y(1,ft,8,3)(2,At,8,4),a()),s&2){let e=t.$implicit,n=u();_(),R(n.oldPath()===e?1:2)}}function Pt(s,t){if(s&1){let e=x();l(0,"app-new-filter",47),E("pathChange",function(i){let o=p(e).$index,r=u(2);return d(r.patchPathAt(i,o))})("remove",function(){let i=p(e).$index,o=u(2);return d(o.removePathAt(i))}),a()}if(s&2){let e=t.$implicit,n=u(2);f("path",e)("osType",n.osType()??"")}}function Nt(s,t){if(s&1&&Le(0,Pt,1,2,"app-new-filter",46,Ie),s&2){let e=u();Ue(e.pathArray())}}function Dt(s,t){if(s&1&&(l(0,"div",41)(1,"spk-form-field"),C(2,"input",48),a(),l(3,"spk-select",49),C(4,"input",50),a()()),s&2){let e=u();_(3),f("options",e.sizeOptions())("isClearable",!1)}}var V=new ye,Mt=["Bytes","KB","MB","GB","TB","PB"],pt=(s={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>V.group({path:V.control(s.path),excludes:V.group({hidden:V.control(s.excludes.hidden),system:V.control(s.excludes.system),temporary:V.control(s.excludes.temporary),filesLargerThan:V.group({size:V.control(null),unit:V.control(null)})})}),He=class s{#e=M(J);#t=M(H);#i=M(oe);formRef=Se.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new st("");filesLargerThan=I(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=g(Mt);osType=this.#e.osType;pathSignal=re(this.sourceDataForm.controls.path.valueChanges);pathArray=I(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=I(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=g(null);editingPath=g(null);addingNewPath=g(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let n=(this.sourceDataForm.controls.path.value??"").split("\0"),i=n.indexOf(t);if(i===-1)return;n.splice(i,1);let o=n.filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}addFilter(t="-*"){let n=[this.sourceDataForm.controls.path.value,t].filter(i=>i&&i!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}patchPathAt(t,e){let i=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),o=this.pathArray().map((c,T)=>T===e?`${t}`:`${c}`).join("\0"),r=[i,o].filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(r)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(r=>!r.startsWith("-")&&!r.startsWith("+")).join("\0"),i=this.pathArray().filter((r,c)=>c!==t).join("\0"),o=[n,i].filter(r=>r&&r!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,n=t?.split("\0")||[];e&&!n.includes(e)&&n.push(e);let i=n.filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=z({type:s,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&Ce(n.formRef,Tt,5),e&2&&me()},decls:56,vars:12,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Add a direct path`;let n;n=$localize`Hidden files`;let i;i=$localize`System files`;let o;o=$localize`Temporary files`;let r;r=$localize`Source Data`;let c;c=$localize`Folder path`;let T;T=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let S;S=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let O;O=$localize`Paths`;let P;P=$localize`Add a path directly from your machine.`;let L;L=$localize`Filters`;let K;K=$localize`Customize your filters.`;let b;b=$localize`Add filter`;let X;X=$localize`Exclude`;let D;D=$localize`Choose if there’s any files you want to exclude.`;let ee;ee=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ce;ce=$localize` Files larger than `;let h;h=$localize`Edit path`;let qe;return qe=$localize`Select an option...`,[["formRef",""],r,c,T,S,O,P,L,K,b,X,D,ee,_e,ue,ce,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["spk-button","","type","button",1,"raised","primary",3,"click"],["type","button","spk-button","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",n,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",o,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[1,"small"],["type","text","placeholder",h,3,"ngModelChange","ngModel","ngModelOptions"],["spk-button","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],["type","number","formControlName","size"],[3,"options","isClearable"],["type","text","formControlName","unit","placeholder",qe]]},template:function(e,n){if(e&1){let i=x();l(0,"form",16,0),E("submit",function(){return p(i),d(n.next())}),l(2,"div",17)(3,"h3",18),A(4,1),a(),l(5,"app-file-tree",19)(6,"label",20),A(7,2),a(),C(8,"input",21),a(),l(9,"div",22)(10,"button",23),E("click",function(){return p(i),d(n.goBack())}),m(11,3),C(12,"spk-icon"),F(),a(),l(13,"button",24),m(14,4),C(15,"spk-icon"),F(),a()()(),l(16,"div",25)(17,"app-toggle-card",26),B(18,27),A(19,5),v(),l(20,"p",28),A(21,6),a(),l(22,"div",29),Le(23,ht,3,1,"div",30,Ie),l(25,"div",31)(26,"spk-form-field"),C(27,"input",32),a(),l(28,"button",33),E("click",function(){return p(i),d(n.addNewPath())}),l(29,"spk-icon"),U(30,"plus"),a()()()()(),l(31,"app-toggle-card",26),B(32,27),A(33,7),v(),l(34,"p",28),A(35,8),a(),l(36,"button",34),E("click",function(){return p(i),d(n.addFilter())}),A(37,9),a(),y(38,Nt,2,0),a(),l(39,"app-toggle-card",35),B(40,27),A(41,10),v(),l(42,"p",28),A(43,11),a(),l(44,"spk-toggle",36),m(45,12),C(46,"input",37),F(),a(),l(47,"spk-toggle",36),m(48,13),C(49,"input",38),F(),a(),l(50,"spk-toggle",36),m(51,14),C(52,"input",39),F(),a(),l(53,"spk-toggle",40),E("click",function(){return p(i),d(n.toggleFilesLargerThan())}),A(54,15),a(),y(55,Dt,5,2,"div",41),a()()()}if(e&2){let i;f("formGroup",n.sourceDataForm),_(5),f("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),_(12),f("disallowToggle",!0),_(6),Ue(n.nonFilterPaths()),_(4),f("formControl",n.newPathCtrl),_(4),f("disallowToggle",!0),_(7),R((i=n.pathSignal())!=null&&i.length?38:-1),_(),f("disallowToggle",!0),_(14),Fe("active",n.filesLargerThan()),_(2),R(n.filesLargerThan()?55:-1)}},dependencies:[ae,Pe,Q,Ne,fe,Z,he,le,Re,lt,De,Me,at,q,j,se,Ee,Y,$e,ut,Oe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}spk-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var dt="1W:1D,4W:1W,12M:1M",J=class s{#e=M(H);#t=M(Te);#i=M(et);#n=M(it);#s=M(we);generalForm=gt();sourceDataForm=pt();scheduleFields={autoRun:g(te.autoRun),nextTime:g(te.nextTime),runAgain:g(te.runAgain)};settings=g([]);optionsFields={remoteVolumeSize:g("50MB"),backupRetention:g("all"),backupRetentionTime:g(""),backupRetentionVersions:g(0),backupRetentionCustom:g("")};targetUrlModel=g(null);backupMetadata=g(null);isDraft=g(!1);backupId=g(null);backupName=I(()=>this.generalFormSignal()?.name??"");isSubmitting=g(!1);finishedLoading=g(!1);backupDefaults=g(null);applicationOptions=g(null);isNew=I(()=>this.backupId()==="new");osType=I(()=>this.#t.systemInfo()?.OSType);selectedOptions=g([]);sourceDataFormSignal=re(this.sourceDataForm.valueChanges);generalFormSignal=re(this.generalForm.valueChanges);encryptionFieldSignal=re(this.generalForm.controls.encryption.valueChanges);advancedOptions=I(()=>this.#t.systemInfo()?.Options?.map(this.#_)??[]);#o=g("");#l=g(null);#a=null;testSignal=this.#o.asReadonly();testErrorMessage=this.#l.asReadonly();#p=ie(()=>{let t=this.targetUrlModel(),e=this.#o(),n=this.#a;this.#a=t,!(e==="testing"||n===null||n===t)&&(this.#o.set(""),this.#l.set(null))});setTestState(t,e){this.#o.set(t),this.#l.set(e??null)}#_(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=I(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[de,...t]});nonSelectedOptions=I(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0);let e=this.#u(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe(ke(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{t||this.exit(!1)},error:i=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe(ke(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{t||this.exit(!1)},error:i=>{}})}exit(t){if(!t){this.#r(),this.#e.navigate(["/"]);return}this.#i.open(ot,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#r(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(c=>`${c.Include?"":"-"}${c.Expression}`)??[],i=t.Settings?.find(c=>c.Name==="--exclude-files-attributes")?.Value??"",o=t.Settings?.find(c=>c.Name==="--skip-files-larger-than")??null,r={path:[...e,...n].join("\0"),excludes:{hiddenFiles:i.includes("hidden"),systemFiles:i.includes("system"),tempFiles:i.includes("temporary"),filesLargerThan:o?.Value?.toUpperCase()??null}};this.sourceDataForm.patchValue(r)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(S=>S.Name==="encryption-module"),o=t.Settings?.find(S=>S.Name==="passphrase")?.Value??"",r=i?.Value&&i.Value.length?i.Value:"",c=t.Settings?.find(S=>S.Name==="compression-module")?.Value??"",T={name:t.Name??"",description:t.Description??""};e&&e!==""&&(T.name=e),n&&n!==""&&(T.description=n),r&&r!==""&&(T.encryption=r),o&&o!==""&&(T.password=o,T.repeatPassword=o),c&&c!==""&&(T.compression=c),this.generalForm.patchValue(T)}mapScheduleToForm(t){if(!t){this.scheduleFields.autoRun.set(!1);return}let e=this.#s.fromString(t.Repeat)??null,n=this.#c(t.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(i=>G(G({},i),n)),this.scheduleFields.runAgain.set({repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:t.AllowedDays?.includes("mon")??!1,tue:t.AllowedDays?.includes("tue")??!1,wed:t.AllowedDays?.includes("wed")??!1,thu:t.AllowedDays?.includes("thu")??!1,fri:t.AllowedDays?.includes("fri")??!1,sat:t.AllowedDays?.includes("sat")??!1,sun:t.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(t){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],n=t.Settings?.filter(r=>!e.includes(r.Name)),i=t.Settings?.filter(r=>e.includes(r.Name));this.settings.set(n??[]),n?.forEach(r=>{if(r.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(r.Value??"")});var o="all";i?.forEach(r=>{if(r.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(r.Value??"50MB"),r.Name==="keep-time"&&(r.Value??"")!=="")return o="time",this.optionsFields.backupRetentionTime.set(r.Value??"");if(r.Name==="keep-versions"&&(r.Value??"")!=="")return o="versions",this.optionsFields.backupRetentionVersions.set(r.Value?parseInt(r.Value):null);if(r.Name==="retention-policy"&&(r.Value??"")!=="")if(r.Value===dt)o="smart";else return o="custom",this.optionsFields.backupRetentionCustom.set(r.Value??"")}),this.optionsFields.backupRetention.set(o)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#u(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),o=null;e.runAgain?.repeatUnit&&e.runAgain?.repeatValue&&(o=this.#s.toString(e.runAgain.repeatValue,e.runAgain.repeatUnit));let r=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([P,L])=>L).map(([P,L])=>P):[],c=n.path?.split("\0")??[],T=this.mapFormsToSettings(),S=Object.entries(n.excludes??{}).filter(([P,L])=>L&&P!=="filesLargerThan").map(([P])=>P),O=n.excludes?.filesLargerThan;return S.length&&T.push({Name:"--exclude-files-attributes",Value:S.join(",")}),O&&O.size!==null&&O.unit!==null&&T.push({Name:"--skip-files-larger-than",Value:`${O.size}${O.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:c.filter(P=>!P.startsWith("-")),Settings:T,Filters:c.filter(P=>P.startsWith("-")).map((P,L)=>({Order:L,Include:!1,Expression:P.slice(1)}))},Schedule:e.autoRun?{Repeat:o,Time:e.nextTime?.date?new Date(`${e.nextTime.date}T${e.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:r}:null}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],i=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==de.Key&&(i=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let o=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(o=[]);let r=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":r.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":r.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":r.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":r.push({Name:"retention-policy",Value:dt});break}let c=[...t,...n],T=this.settings().filter(S=>!c.includes(S.Name)).map(S=>{let O=S.Value;return typeof S.Value=="number"&&(O=S.Value.toString()),typeof S.Value=="boolean"&&(O=S.Value?"True":"False"),{Name:S.Name?.startsWith("--")?S.Name:`--${S.Name}`,Value:O}});return[...i,...o,...r,...T]}#c(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}setTargetUrl(t){this.targetUrlModel.set(t)}#r(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set(te.autoRun),this.scheduleFields.nextTime.set(te.nextTime),this.scheduleFields.runAgain.set(te.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=ge({token:s,factory:s.\u0275fac,providedIn:"root"})};var yt=["formRef"];function Rt(s,t){s&1&&(l(0,"spk-alert",17),m(1,5),C(2,"spk-icon",26),F(),a())}function Ot(s,t){if(s&1&&U(0),s&2){let e=t.$implicit;Ze(" ",e.DisplayName," ")}}function wt(s,t){if(s&1&&C(0,"spk-progress-bar",40),s&2){let e=u(3);Fe("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),f("value",e.calculatePasswordStrength()*(100/5))}}function $t(s,t){s&1&&(l(0,"span",35),A(1,10),a())}function kt(s,t){s&1&&(m(0,8,1),C(1,"spk-icon"),F())}function It(s,t){s&1&&(m(0,8,2),C(1,"spk-icon"),F())}function Lt(s,t){s&1&&(m(0,11,1),C(1,"spk-icon",42),F())}function Ut(s,t){s&1&&(m(0,11,2),C(1,"spk-icon"),F())}function Gt(s,t){if(s&1){let e=x();l(0,"button",41),E("click",function(){p(e);let i=u(3);return d(i.copyPassword())}),m(1,11),y(2,Lt,2,0)(3,Ut,2,0),F(),a()}if(s&2){let e=u(3);_(2),R(e.copiedPassword()?2:3)}}function xt(s,t){s&1&&(l(0,"spk-alert",39),A(1,12),a())}function bt(s,t){if(s&1){let e=x();l(0,"div",30)(1,"spk-form-field")(2,"label",31),m(3,7),C(4,"sup"),F(),a(),C(5,"input",32),a(),y(6,wt,1,9,"spk-progress-bar",33),l(7,"spk-form-field"),C(8,"input",34),y(9,$t,2,0,"span",35),a(),l(10,"div",36)(11,"button",37),E("click",function(){p(e);let i=u(2);return d(i.showPassword.set(!i.showPassword()))}),m(12,8),y(13,kt,2,0)(14,It,2,0),F(),a(),l(15,"button",37),E("click",function(){p(e);let i=u(2);return d(i.generatePassword())}),m(16,9),C(17,"spk-icon"),F(),a(),y(18,Gt,4,1,"button",38),a(),y(19,xt,2,0,"spk-alert",39),a()}if(s&2){let e=u(2);_(5),f("type",e.showPassword()?"text":"password"),_(),R(e.generalForm.value.password?6:-1),_(2),f("type",e.showPassword()?"text":"password"),_(),R(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),_(4),R(e.showPassword()?13:14),_(5),R(e.showCopyPassword()?18:-1),_(),R(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Bt(s,t){if(s&1&&(l(0,"spk-select",27)(1,"label",28),A(2,6),a(),C(3,"input",29),Ye(4,Ot,1,1,"ng-template"),a(),y(5,bt,20,7,"div",30)),s&2){let e=u();f("options",e.encryptionOptions())("isClearable",!1),_(5),R(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function vt(s,t){if(s&1&&(l(0,"button",24),m(1,13),C(2,"spk-icon"),F(),a()),s&2){let e=u();f("disabled",e.nameAndDescriptionValid()===!1)}}function Vt(s,t){if(s&1&&(l(0,"button",25),m(1,14),C(2,"spk-icon"),F(),a()),s&2){let e=u();f("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var ne=new ye,gt=(s={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>ne.group({name:ne.control(s.name,[Ae.required]),description:ne.control(s.description),encryption:ne.control(s.encryption,[_t()]),password:ne.control(s.password,[Ke(t=>t?.value.encryption!=="",[Ae.required])]),repeatPassword:ne.control(s.repeatPassword,[Ke(t=>t?.value.encryption!=="",[Ae.required])]),compression:ne.control(s.compression)}),de={Key:"-",DisplayName:"None"},je=class s{#e=M(H);#t=M(oe);#i=M(rt);#n=M(J);#s=M(Te);formRef=Se.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=g(!1);copiedPassword=g(!1);showCopyPassword=g(!1);noneOptionKey=de.Key;encryptionEffect=ie(()=>{this.encryptionFieldSignal()===de.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=I(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=I(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#n.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#o(t??""),this.copiedPassword.set(!0)}async#o(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#i.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#n.isNew()||this.#n.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=z({type:s,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&Ce(n.formRef,yt,5),e&2&&me()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let i;i=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let r;r=$localize`Backup description`;let c;c=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let T;T=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Encrypted backup `;let S;S=$localize`Encryption`;let O;O=$localize`Encryption`;let P;P=$localize`Password`;let L;L=$localize`Repeat password`;let K;K=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let b;b=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,b=Ge(b);let X;X=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let D;D=$localize`Passwords do not match`;let ee;ee=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,ee=Ge(ee);let _e;_e=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let ue;ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let ce;return ce=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],i,o,r,c,T,O,K,b,X,D,ee,_e,ue,ce,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],["spk-button","","type","submit","spkTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",S,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",P,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",L,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(e,n){if(e&1){let i=x();l(0,"form",15,0),E("submit",function(){return p(i),d(n.next())}),l(2,"h3",16),A(3,1),a(),y(4,Rt,3,0,"spk-alert",17),l(5,"spk-form-field")(6,"label",18),m(7,2),C(8,"sup"),F(),a(),C(9,"input",19),a(),l(10,"spk-form-field")(11,"label",20),A(12,3),a(),C(13,"textarea",21),a(),y(14,Bt,6,3),l(15,"div",22)(16,"button",23),E("click",function(){return p(i),d(n.exit())}),m(17,4),C(18,"spk-icon"),F(),a(),y(19,vt,3,1,"button",24)(20,Vt,3,1,"button",25),a()()}if(e&2){let i;f("formGroup",n.generalForm),_(4),R(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),_(10),R(n.isNew()?14:-1),_(5),R(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[Re,Pe,Q,Z,he,De,Me,q,Y,se,j,tt,Je,nt],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{gt as a,de as b,je as c,te as d,Xe as e,pt as f,He as g,J as h};
|
package/index.html
CHANGED
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
<body>
|
|
64
64
|
<app-root></app-root>
|
|
65
65
|
<div class="loading">Connecting ...</div>
|
|
66
|
-
<link rel="modulepreload" href="chunk-V5YSQG4X.js"><link rel="modulepreload" href="chunk-QRRKPBY6.js"><link rel="modulepreload" href="chunk-WZRDKVOR.js"><link rel="modulepreload" href="chunk-ULLALJQ2.js"><link rel="modulepreload" href="chunk-J6BHRR34.js"><link rel="modulepreload" href="chunk-2BX65XJQ.js"><link rel="modulepreload" href="chunk-RHW5QVAY.js"><link rel="modulepreload" href="chunk-6JQM2X3B.js"><link rel="modulepreload" href="chunk-WXARH2SG.js"><link rel="modulepreload" href="chunk-7QJG4IIT.js"><script src="polyfills-COBLRUJG.js" type="module"></script><script src="main-
|
|
66
|
+
<link rel="modulepreload" href="chunk-V5YSQG4X.js"><link rel="modulepreload" href="chunk-QRRKPBY6.js"><link rel="modulepreload" href="chunk-WZRDKVOR.js"><link rel="modulepreload" href="chunk-ULLALJQ2.js"><link rel="modulepreload" href="chunk-J6BHRR34.js"><link rel="modulepreload" href="chunk-2BX65XJQ.js"><link rel="modulepreload" href="chunk-RHW5QVAY.js"><link rel="modulepreload" href="chunk-6JQM2X3B.js"><link rel="modulepreload" href="chunk-WXARH2SG.js"><link rel="modulepreload" href="chunk-7QJG4IIT.js"><script src="polyfills-COBLRUJG.js" type="module"></script><script src="main-A5QFJ7CT.js" type="module"></script></body>
|
|
67
67
|
</html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as be,c as Ce}from"./chunk-V5YSQG4X.js";import{a as he}from"./chunk-QRRKPBY6.js";import{a as I}from"./chunk-WZRDKVOR.js";import"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import{a as P}from"./chunk-RHW5QVAY.js";import{a as L}from"./chunk-6JQM2X3B.js";import{a as de}from"./chunk-WXARH2SG.js";import"./chunk-7QJG4IIT.js";import{a as b,b as C,c as ue,d as E}from"./chunk-3ZVSHKLD.js";import{c as ie,d as ae,g as pe,h as ce}from"./chunk-2W6BEUGU.js";import{a as ee}from"./chunk-JFOXV66M.js";import{c as le}from"./chunk-Y5IRBMLB.js";import{a as te,b as oe,d as ne,e as re,f as se,i as me}from"./chunk-DNJOKPEL.js";import{a as ge}from"./chunk-UZK7ABRM.js";import{la as Y,qa as Z}from"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{a as ye}from"./chunk-AM7RYTIO.js";import{b as fe}from"./chunk-B6OIHB5W.js";import{A as x,Ab as z,B as G,Cc as q,Dc as X,H as w,Ic as Q,N as J,P as R,R as B,U as k,X as $,Z as s,ab as _,f as j,ha as K,i as D,n as F,na as d,o as U,r as S}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var M=class e{#o=s(b);#s=s(C);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=_({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ie],encapsulation:2})};var Se={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var h=new $("ENVIRONMENT");var A=class e{#o=s(me);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(B(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=k({token:e,factory:e.\u0275fac,providedIn:"root"})};var Me=()=>{let e=s(E);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?F(!0):e.refreshToken().pipe(S(()=>!0))))},Ae=()=>{let e=s(C),t=s(I),o=s(K),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Re=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-V77N2OUE.js")},{path:"logout",loadComponent:()=>import("./chunk-ZI2XNFAW.js")},{path:"",canActivate:[Me],children:[{path:"",canActivate:[Ae],loadComponent:()=>import("./chunk-
|
|
1
|
+
import{b as be,c as Ce}from"./chunk-V5YSQG4X.js";import{a as he}from"./chunk-QRRKPBY6.js";import{a as I}from"./chunk-WZRDKVOR.js";import"./chunk-ULLALJQ2.js";import"./chunk-J6BHRR34.js";import"./chunk-2BX65XJQ.js";import{a as P}from"./chunk-RHW5QVAY.js";import{a as L}from"./chunk-6JQM2X3B.js";import{a as de}from"./chunk-WXARH2SG.js";import"./chunk-7QJG4IIT.js";import{a as b,b as C,c as ue,d as E}from"./chunk-3ZVSHKLD.js";import{c as ie,d as ae,g as pe,h as ce}from"./chunk-2W6BEUGU.js";import{a as ee}from"./chunk-JFOXV66M.js";import{c as le}from"./chunk-Y5IRBMLB.js";import{a as te,b as oe,d as ne,e as re,f as se,i as me}from"./chunk-DNJOKPEL.js";import{a as ge}from"./chunk-UZK7ABRM.js";import{la as Y,qa as Z}from"./chunk-CWLTHXVS.js";import"./chunk-WIDMAJIO.js";import{a as ye}from"./chunk-AM7RYTIO.js";import{b as fe}from"./chunk-B6OIHB5W.js";import{A as x,Ab as z,B as G,Cc as q,Dc as X,H as w,Ic as Q,N as J,P as R,R as B,U as k,X as $,Z as s,ab as _,f as j,ha as K,i as D,n as F,na as d,o as U,r as S}from"./chunk-BTMXQPBB.js";import"./chunk-EUDKD2JW.js";var M=class e{#o=s(b);#s=s(C);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=_({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ie],encapsulation:2})};var Se={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var h=new $("ENVIRONMENT");var A=class e{#o=s(me);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(B(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=k({token:e,factory:e.\u0275fac,providedIn:"root"})};var Me=()=>{let e=s(E);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?F(!0):e.refreshToken().pipe(S(()=>!0))))},Ae=()=>{let e=s(C),t=s(I),o=s(K),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Re=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-V77N2OUE.js")},{path:"logout",loadComponent:()=>import("./chunk-ZI2XNFAW.js")},{path:"",canActivate:[Me],children:[{path:"",canActivate:[Ae],loadComponent:()=>import("./chunk-E4GCCYDQ.js"),children:[{path:"",loadComponent:()=>import("./chunk-WPGKMLVU.js")},{path:"add-backup",loadComponent:()=>import("./chunk-NHAGSIVX.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-IZXB2EWT.js")},{path:"backup/import",loadComponent:()=>import("./chunk-64ZU74CD.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-C26ZMSTR.js"),loadChildren:()=>import("./chunk-EQAVG2TR.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-C26ZMSTR.js"),loadChildren:()=>import("./chunk-EQAVG2TR.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-KSQIUDEA.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-H2PTENA3.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-N7RSCHJF.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-6DSLFJ4T.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-NZ2KKCDC.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-2D26BDYB.js")},{path:"from-config",loadComponent:()=>import("./chunk-QBJGIKPM.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-FTFVEVRT.js"),loadChildren:()=>import("./chunk-VLBSM6YW.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-FTFVEVRT.js"),loadChildren:()=>import("./chunk-VLBSM6YW.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-FTFVEVRT.js"),loadChildren:()=>import("./chunk-VLBSM6YW.js")},{path:"settings",loadComponent:()=>import("./chunk-RCKA5DTC.js")},{path:"about",loadComponent:()=>import("./chunk-CCA5ZCEA.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-MMPTX6PS.js")},{path:"changelog",loadComponent:()=>import("./chunk-DBD6FOQL.js")},{path:"libraries",loadComponent:()=>import("./chunk-XBJRRUMO.js")},{path:"system-info",loadComponent:()=>import("./chunk-QVEGV6V6.js")},{path:"server-settings",loadComponent:()=>import("./chunk-EKP3ML6M.js")},{path:"logs",loadChildren:()=>import("./chunk-IBG5YOFG.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-WRWIBPXL.js")}]}]}]}]}];var V=null,Te=(e,t)=>{let o=s(E),n=s(ae),i=s(b),l=s(h),r=i.getItem("locale"),u=s(le),a=be(r),p=e.url==="/api/v1/auth/login",m=e.url==="/api/v1/auth/refresh",v=e.url==="/api/v1/progressstate",g=e.url==="/api/v1/remoteoperation/test",y=e.url==="/api/v1/filesystem/validate",T=e.url.startsWith("/api/v2/"),N=o.token(),H=e,W=e.headers.has("custom-proxy-check")||N===ue;if(N&&e.url.startsWith(l.baseUrl)&&!W){let c=e.headers.set("Authorization",`Bearer ${N}`);r&&r!=="en-US"&&(c=c.set("X-Ui-Language",a)),H=e.clone({headers:c})}return t(H).pipe(S(c=>{if(c.type===4&&c.status===200&&T){let f=c.body;if(f?.Success===!1)throw{status:200,message:f?.Error??"Unknown error",error:{Error:f?.Error??"Unknown error"},body:f}}return c}),G(c=>{let f=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!W&&(v&&c.status===404||g||y||u.error(f),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!p&&!m&&c.status===401)?(o.clearSessionToken(),V??=o.refreshToken().pipe(J()),V.pipe(R(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),w(()=>V=null))):U(()=>({error:c,message:f}))}))};var Oe="1.0.0",we=`portal-proxy-client-${P()}`,Ne=1,O=class e{#o=1e3;#s=s(h);#t=d("disconnected");#l=d(this.#o);#i=d(!1);#n=d(!1);#a=d(null);isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#t.asReadonly();#p=[];#r={};#e=null;#m=new TextDecoder("utf-8");#c=null;#d=Q(()=>{let t=this.#i(),o=this.#l(),n=this.#a();if(!n||!t||!o||o<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},o)});utf8Atob(t){let o=Uint8Array.from(atob(t),i=>i.charCodeAt(0)),n=this.#m.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,i=this.wsState();(i==="disconnected"||i==="error"||n)&&(this.#e?.close(),this.#e=null),!this.#e&&(this.#e=new WebSocket(this.#s.machineServerUrl),this.#t.set("connecting"),this.#e.onopen=()=>{this.#t.set("connect"),this.#n.set(!0),this.#i.set(!1),this.#a.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#n.set(!1),this.#a.set(t),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=l=>{let r=JSON.parse(l.data);if(this.wsState()==="connect"){if(r.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${r.type}'`);return}let a={token:t,publicKey:"",clientVersion:Oe,protocolVersion:Ne},p=this.createResponse(r,"authportal",a);this.#t.set("welcome"),this.#e?.send(p)}else if(this.wsState()==="welcome"){if(r.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${r.type}'`);return}var u=JSON.parse(r.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let a=this.#p.pop();a&&this.#r[a.messageId]&&this.activateCommand(a)}}else if(this.wsState()==="authenticated"){if(r.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${r.type}'`);return}let a=this.#r[r.messageId];if(a){if(r.errorMessage){a.reject(r.errorMessage);return}else{let p=JSON.parse(r.payload??"");p.body=p?.body==null?null:this.utf8Atob(p.body),a.resolve(p)}delete this.#r[r.messageId],window.clearTimeout(a.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let i={from:we,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(t,o,n,i,l,r,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((a,p)=>{let m=P(),g={from:we,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,body:l,headers:r})},y={resolve:a,reject:p,timer:window.setTimeout(()=>{let T=this.#r[m];T&&(delete this.#r[m],T.reject("Timeout"))},u)};this.#r[m]=y,this.#n()?this.activateCommand(g):this.#p.push(g)})}activateCommand(t){this.#e?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=k({token:e,factory:e.\u0275fac,providedIn:"root"})};function xe(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function ke(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let i=xe(t.body),l={};t.headers.keys().forEach(p=>{l[p]=t.headers.get(p)??""});let r=t.headers.get("timeout"),u=r!==null?parseInt(r):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let a=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,i,l,u);return new j(p=>{a.then(m=>{let v=new te;l!=null&&Object.keys(l).forEach(y=>{v.set(y,l[y])});let g=new oe({body:m.body,status:m.code,statusText:"OK",headers:v});p.next(g),p.complete()})})}var Ee=(e,t)=>{let o={relayconfigState:s(C),defaultTimeout:s(h).defaultTimeout,relayWebsocket:s(O)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let i=new D;return o.relayconfigState.configLoaded.subscribe(l=>{l&&ke(o,e,t).subscribe(i)}),i}return ke(o,e,t)};var Ie={providers:[q(),pe(Re,ce()),ne(se(),re([Ee,Te])),b,{provide:h,useValue:Se},{provide:X,useValue:Ce()},he,I,fe,Z,de,Y,ge,ye]};ee(M,Ie);
|
package/package.json
CHANGED