@duplicati/ngclient 0.0.16 → 0.0.17

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.
@@ -1 +1 @@
1
- import{a as Y}from"./chunk-MMEIXMDW.js";import{a as J}from"./chunk-QX7KUJGE.js";import{a as R}from"./chunk-GSP4D4JM.js";import{a as $,e as A,f as V,h as z,k as j}from"./chunk-EYBBW4ID.js";import{d as N}from"./chunk-IGECPMHY.js";import"./chunk-L2WWHQPN.js";import"./chunk-PY26LA4W.js";import{$a as m,Db as e,Fb as u,La as p,Mb as D,Nb as B,Ob as S,Rb as M,Sb as I,Tb as H,U as _,W as v,Z as y,Za as s,ea as f,eb as d,fa as g,fb as P,gb as O,hb as E,ib as a,jb as o,kb as x,lb as F,mb as w,ob as T,oc as L,pb as b,qb as c}from"./chunk-FKB7BVQE.js";import"./chunk-7CGTOI24.js";var C=class t{#t=_(J);transform(l,...n){if(!l)return"";let i=l.split(".")[0],r=parseInt(i.split(":")[0])??0,k=parseInt(i.split(":")[1])??0,q=parseInt(i.split(":")[2])??0;return this.#t.duration({hours:r,minutes:k,seconds:q}).humanize()}static \u0275fac=function(n){return new(n||t)};static \u0275pipe=y({name:"durationFormat",type:t,pure:!0,standalone:!0})};var K=()=>["/add-backup"],Q=()=>["/restore"],U=t=>["/backup",t],W=t=>["/backup",t,"export"];function X(t,l){if(t&1&&(e(0),M(1,"durationFormat")),t&2){let n=c().$implicit;u(" - (took ",I(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration),") ")}}function Z(t,l){t&1&&e(0," N/A ")}function tt(t,l){if(t&1&&e(0),t&2){let n=c().$implicit;u(" ",n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceSizeString," ")}}function et(t,l){t&1&&e(0," N/A ")}function nt(t,l){if(t&1&&e(0),t&2){let n=c().$implicit;u(" ",n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.TargetSizeString," ")}}function it(t,l){t&1&&e(0," N/A ")}function at(t,l){if(t&1&&(a(0,"spk-chip",9),e(1),o()),t&2){let n=c().$implicit;p(),u("",n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.BackupListCount," Version")}}function ot(t,l){t&1&&(a(0,"spk-chip",10),e(1,"No version yet"),o())}function lt(t,l){if(t&1){let n=T();a(0,"div",8)(1,"div",3)(2,"h3"),e(3),a(4,"spk-icon"),e(5,"database"),o()(),a(6,"p")(7,"span"),e(8,"Last successful backup:"),o(),e(9),M(10,"date"),s(11,X,2,3)(12,Z,1,0),o(),a(13,"p")(14,"span"),e(15,"Source:"),o(),s(16,tt,1,1)(17,et,1,0),o(),a(18,"p")(19,"span"),e(20,"Destination:"),o(),s(21,nt,1,1)(22,it,1,0),o()(),s(23,at,2,1,"spk-chip",9)(24,ot,2,0,"spk-chip",10),a(25,"div",11)(26,"button",12),b("click",function(){let r=f(n).$implicit,k=c(2);return g(k.startBackup(r.Backup==null?null:r.Backup.ID))}),a(27,"spk-icon"),e(28,"play-circle"),o(),e(29," Start "),o(),a(30,"button",13)(31,"spk-icon"),e(32,"pencil-simple"),o()(),a(33,"spk-menu",14)(34,"button",4)(35,"spk-icon"),e(36,"dots-three-vertical"),o()(),F(37,15),a(38,"button",16,0),e(40," Export "),a(41,"spk-icon"),e(42,"export"),o()(),a(43,"button",17,0),b("click",function(){let r=f(n).$implicit,k=c(2);return g(k.deleteBackup(r.Backup==null?null:r.Backup.ID))}),e(45," Delete "),a(46,"spk-icon"),e(47,"x-circle"),o()(),w(),o()()()}if(t&2){let n,i=l.$implicit;p(3),u(" ",(n=i.Backup==null?null:i.Backup.Name)!==null&&n!==void 0?n:"Backup name missing"," "),p(6),u(" ",H(10,9,i.Backup==null||i.Backup.Metadata==null?null:i.Backup.Metadata.LastBackupDate,"short")," "),p(2),d(!(i.Backup==null||i.Backup.Metadata==null)&&i.Backup.Metadata.LastBackupDuration?11:12),p(5),d(!(i.Backup==null||i.Backup.Metadata==null)&&i.Backup.Metadata.SourceSizeString?16:17),p(5),d(!(i.Backup==null||i.Backup.Metadata==null)&&i.Backup.Metadata.TargetSizeString?21:22),p(2),d(!(i.Backup==null||i.Backup.Metadata==null)&&i.Backup.Metadata.BackupListCount?23:24),p(7),m("routerLink",S(12,U,i.Backup==null?null:i.Backup.ID)),p(3),m("right",!0),p(5),m("routerLink",S(14,W,i.Backup==null?null:i.Backup.ID))}}function pt(t,l){if(t&1&&O(0,lt,48,16,"div",8,P),t&2){let n=c();E(n.backups())}}function ct(t,l){t&1&&e(0," No backups founds ")}var h=class t{#t=_(R);backups=this.#t.backups;backupsLoading=this.#t.backupsLoading;ngOnInit(){this.#t.getBackups(!0)}startBackup(l){this.#t.startBackup(l)}deleteBackup(l){l&&window.confirm("Are you sure you want to delete this backup?")&&this.#t.deleteBackup(l)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=v({type:t,selectors:[["app-home"]],standalone:!0,features:[D],decls:31,vars:5,consts:[["option",""],[1,"type-a",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["spk-button",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"backups"],[1,"backup"],[1,"simple","success"],[1,"simple"],[1,"actions"],["spk-button","",3,"click"],["spk-button","",3,"routerLink"],[3,"right"],["menu",""],[3,"routerLink"],[3,"click"]],template:function(n,i){n&1&&(x(0,"app-status-bar"),a(1,"section")(2,"header")(3,"spk-card",1),x(4,"img",2),a(5,"div",3)(6,"h3"),e(7,"Backups"),o(),a(8,"p"),e(9,"Backups are stored in the cloud and can be restored at any time."),o()(),a(10,"button",4),e(11," Add "),a(12,"spk-icon"),e(13,"plus"),o()()(),a(14,"spk-card",1),x(15,"img",5),a(16,"div",3)(17,"h3"),e(18,"Restores"),o(),a(19,"p"),e(20,"Restores are stored in the cloud and can be restored at any time."),o()(),a(21,"button",4),e(22," Start "),a(23,"spk-icon"),e(24,"arrow-right"),o()()()(),a(25,"div",6)(26,"h2"),e(27,"My backups"),o(),a(28,"div",7),s(29,pt,2,0)(30,ct,1,0),o()()()),n&2&&(p(3),m("routerLink",B(3,K)),p(11),m("routerLink",B(4,Q)),p(15),d(i.backups().length?29:30))},dependencies:[N,Y,V,A,$,z,j,L,C],styles:["[_nghost-%COMP%]{display:block}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;padding:0 2rem;gap:1rem}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1)}.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-level-60)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-level-60)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-level-70)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{h as default};
1
+ import{a as Y}from"./chunk-YL6USNFS.js";import{a as J}from"./chunk-QX7KUJGE.js";import{a as R}from"./chunk-GSP4D4JM.js";import{a as $,e as A,f as V,h as z,k as j}from"./chunk-EYBBW4ID.js";import{d as N}from"./chunk-IGECPMHY.js";import"./chunk-L2WWHQPN.js";import"./chunk-PY26LA4W.js";import{$a as m,Db as e,Fb as u,La as p,Mb as D,Nb as B,Ob as S,Rb as M,Sb as I,Tb as H,U as _,W as v,Z as y,Za as s,ea as f,eb as d,fa as g,fb as P,gb as O,hb as E,ib as a,jb as o,kb as x,lb as F,mb as w,ob as T,oc as L,pb as b,qb as c}from"./chunk-FKB7BVQE.js";import"./chunk-7CGTOI24.js";var C=class t{#t=_(J);transform(l,...n){if(!l)return"";let i=l.split(".")[0],r=parseInt(i.split(":")[0])??0,k=parseInt(i.split(":")[1])??0,q=parseInt(i.split(":")[2])??0;return this.#t.duration({hours:r,minutes:k,seconds:q}).humanize()}static \u0275fac=function(n){return new(n||t)};static \u0275pipe=y({name:"durationFormat",type:t,pure:!0,standalone:!0})};var K=()=>["/add-backup"],Q=()=>["/restore"],U=t=>["/backup",t],W=t=>["/backup",t,"export"];function X(t,l){if(t&1&&(e(0),M(1,"durationFormat")),t&2){let n=c().$implicit;u(" - (took ",I(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration),") ")}}function Z(t,l){t&1&&e(0," N/A ")}function tt(t,l){if(t&1&&e(0),t&2){let n=c().$implicit;u(" ",n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceSizeString," ")}}function et(t,l){t&1&&e(0," N/A ")}function nt(t,l){if(t&1&&e(0),t&2){let n=c().$implicit;u(" ",n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.TargetSizeString," ")}}function it(t,l){t&1&&e(0," N/A ")}function at(t,l){if(t&1&&(a(0,"spk-chip",9),e(1),o()),t&2){let n=c().$implicit;p(),u("",n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.BackupListCount," Version")}}function ot(t,l){t&1&&(a(0,"spk-chip",10),e(1,"No version yet"),o())}function lt(t,l){if(t&1){let n=T();a(0,"div",8)(1,"div",3)(2,"h3"),e(3),a(4,"spk-icon"),e(5,"database"),o()(),a(6,"p")(7,"span"),e(8,"Last successful backup:"),o(),e(9),M(10,"date"),s(11,X,2,3)(12,Z,1,0),o(),a(13,"p")(14,"span"),e(15,"Source:"),o(),s(16,tt,1,1)(17,et,1,0),o(),a(18,"p")(19,"span"),e(20,"Destination:"),o(),s(21,nt,1,1)(22,it,1,0),o()(),s(23,at,2,1,"spk-chip",9)(24,ot,2,0,"spk-chip",10),a(25,"div",11)(26,"button",12),b("click",function(){let r=f(n).$implicit,k=c(2);return g(k.startBackup(r.Backup==null?null:r.Backup.ID))}),a(27,"spk-icon"),e(28,"play-circle"),o(),e(29," Start "),o(),a(30,"button",13)(31,"spk-icon"),e(32,"pencil-simple"),o()(),a(33,"spk-menu",14)(34,"button",4)(35,"spk-icon"),e(36,"dots-three-vertical"),o()(),F(37,15),a(38,"button",16,0),e(40," Export "),a(41,"spk-icon"),e(42,"export"),o()(),a(43,"button",17,0),b("click",function(){let r=f(n).$implicit,k=c(2);return g(k.deleteBackup(r.Backup==null?null:r.Backup.ID))}),e(45," Delete "),a(46,"spk-icon"),e(47,"x-circle"),o()(),w(),o()()()}if(t&2){let n,i=l.$implicit;p(3),u(" ",(n=i.Backup==null?null:i.Backup.Name)!==null&&n!==void 0?n:"Backup name missing"," "),p(6),u(" ",H(10,9,i.Backup==null||i.Backup.Metadata==null?null:i.Backup.Metadata.LastBackupDate,"short")," "),p(2),d(!(i.Backup==null||i.Backup.Metadata==null)&&i.Backup.Metadata.LastBackupDuration?11:12),p(5),d(!(i.Backup==null||i.Backup.Metadata==null)&&i.Backup.Metadata.SourceSizeString?16:17),p(5),d(!(i.Backup==null||i.Backup.Metadata==null)&&i.Backup.Metadata.TargetSizeString?21:22),p(2),d(!(i.Backup==null||i.Backup.Metadata==null)&&i.Backup.Metadata.BackupListCount?23:24),p(7),m("routerLink",S(12,U,i.Backup==null?null:i.Backup.ID)),p(3),m("right",!0),p(5),m("routerLink",S(14,W,i.Backup==null?null:i.Backup.ID))}}function pt(t,l){if(t&1&&O(0,lt,48,16,"div",8,P),t&2){let n=c();E(n.backups())}}function ct(t,l){t&1&&e(0," No backups founds ")}var h=class t{#t=_(R);backups=this.#t.backups;backupsLoading=this.#t.backupsLoading;ngOnInit(){this.#t.getBackups(!0)}startBackup(l){this.#t.startBackup(l)}deleteBackup(l){l&&window.confirm("Are you sure you want to delete this backup?")&&this.#t.deleteBackup(l)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=v({type:t,selectors:[["app-home"]],standalone:!0,features:[D],decls:31,vars:5,consts:[["option",""],[1,"type-a",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["spk-button",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"backups"],[1,"backup"],[1,"simple","success"],[1,"simple"],[1,"actions"],["spk-button","",3,"click"],["spk-button","",3,"routerLink"],[3,"right"],["menu",""],[3,"routerLink"],[3,"click"]],template:function(n,i){n&1&&(x(0,"app-status-bar"),a(1,"section")(2,"header")(3,"spk-card",1),x(4,"img",2),a(5,"div",3)(6,"h3"),e(7,"Backups"),o(),a(8,"p"),e(9,"Backups are stored in the cloud and can be restored at any time."),o()(),a(10,"button",4),e(11," Add "),a(12,"spk-icon"),e(13,"plus"),o()()(),a(14,"spk-card",1),x(15,"img",5),a(16,"div",3)(17,"h3"),e(18,"Restores"),o(),a(19,"p"),e(20,"Restores are stored in the cloud and can be restored at any time."),o()(),a(21,"button",4),e(22," Start "),a(23,"spk-icon"),e(24,"arrow-right"),o()()()(),a(25,"div",6)(26,"h2"),e(27,"My backups"),o(),a(28,"div",7),s(29,pt,2,0)(30,ct,1,0),o()()()),n&2&&(p(3),m("routerLink",B(3,K)),p(11),m("routerLink",B(4,Q)),p(15),d(i.backups().length?29:30))},dependencies:[N,Y,V,A,$,z,j,L,C],styles:["[_nghost-%COMP%]{display:block}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;padding:0 2rem;gap:1rem}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1)}.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-level-60)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-level-60)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-level-70)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{h as default};
@@ -1 +1 @@
1
- import{n as m}from"./chunk-5FBRBL44.js";import"./chunk-RNBIMN7E.js";import{a as D}from"./chunk-AN53EBZI.js";import{a as I}from"./chunk-MMEIXMDW.js";import"./chunk-QX7KUJGE.js";import"./chunk-DNHLTHLR.js";import"./chunk-BX543SH4.js";import"./chunk-DE7MHNNM.js";import"./chunk-GSP4D4JM.js";import{l as _,m as L,q as B}from"./chunk-EYBBW4ID.js";import{a as v,b as C,d as h,e as y}from"./chunk-IGECPMHY.js";import"./chunk-L2WWHQPN.js";import"./chunk-PY26LA4W.js";import{$a as s,Db as c,La as a,Lb as S,Mb as g,Pb as u,U as d,W as l,Za as f,eb as b,ib as o,jb as r,kb as i}from"./chunk-FKB7BVQE.js";import"./chunk-7CGTOI24.js";var E=(e,t)=>[e,t,"general"],O=(e,t)=>[e,t,"destination"],P=(e,t)=>[e,t,"source-data"],M=(e,t)=>[e,t,"schedule"],R=(e,t)=>[e,t,"options"];function w(e,t){e&1&&i(0,"spk-progress-bar",1)}function A(e,t){e&1&&(o(0,"section"),i(1,"router-outlet"),r())}var k=class e{#t=d(v);#e=d(m);#n=d(D);isDraft=this.#e.isDraft;backupId=this.#e.backupId;loadingBackup=this.#e.loadingBackup;sysinfoLoaded=this.#n.isLoaded;ngOnInit(){let t=this.#t.snapshot,p=!!t.url.find(F=>F.path==="backup-draft"),n=t.params.id;this.#e.init(n,p)}static \u0275fac=function(p){return new(p||e)};static \u0275cmp=l({type:e,selectors:[["app-backup"]],standalone:!0,features:[S([m]),g],decls:19,vars:21,consts:[["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]],template:function(p,n){p&1&&(i(0,"app-status-bar"),o(1,"spk-stepper")(2,"div",0),i(3,"spk-radio"),c(4," General "),r(),o(5,"div",0),i(6,"spk-radio"),c(7," Destination "),r(),o(8,"div",0),i(9,"spk-radio"),c(10," Source Data "),r(),o(11,"div",0),i(12,"spk-radio"),c(13," Schedule "),r(),o(14,"div",0),i(15,"spk-radio"),c(16," Options "),r()(),f(17,w,1,0,"spk-progress-bar",1)(18,A,2,0,"section")),p&2&&(a(2),s("routerLink",u(6,E,n.isDraft()?"/backup-draft":"/backup",n.backupId())),a(3),s("routerLink",u(9,O,n.isDraft()?"/backup-draft":"/backup",n.backupId())),a(3),s("routerLink",u(12,P,n.isDraft()?"/backup-draft":"/backup",n.backupId())),a(3),s("routerLink",u(15,M,n.isDraft()?"/backup-draft":"/backup",n.backupId())),a(3),s("routerLink",u(18,R,n.isDraft()?"/backup-draft":"/backup",n.backupId())),a(3),b(n.loadingBackup()&&!n.sysinfoLoaded()?17:18))},dependencies:[C,h,y,I,L,B,_],styles:["[_nghost-%COMP%]{display:block}spk-stepper[_ngcontent-%COMP%]{max-width:32.5rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:32.5rem;margin:0 auto 2.5rem}"],changeDetection:0})};export{k as default};
1
+ import{n as m}from"./chunk-5FBRBL44.js";import"./chunk-RNBIMN7E.js";import{a as D}from"./chunk-AN53EBZI.js";import{a as I}from"./chunk-YL6USNFS.js";import"./chunk-QX7KUJGE.js";import"./chunk-DNHLTHLR.js";import"./chunk-BX543SH4.js";import"./chunk-DE7MHNNM.js";import"./chunk-GSP4D4JM.js";import{l as _,m as L,q as B}from"./chunk-EYBBW4ID.js";import{a as v,b as C,d as h,e as y}from"./chunk-IGECPMHY.js";import"./chunk-L2WWHQPN.js";import"./chunk-PY26LA4W.js";import{$a as s,Db as c,La as a,Lb as S,Mb as g,Pb as u,U as d,W as l,Za as f,eb as b,ib as o,jb as r,kb as i}from"./chunk-FKB7BVQE.js";import"./chunk-7CGTOI24.js";var E=(e,t)=>[e,t,"general"],O=(e,t)=>[e,t,"destination"],P=(e,t)=>[e,t,"source-data"],M=(e,t)=>[e,t,"schedule"],R=(e,t)=>[e,t,"options"];function w(e,t){e&1&&i(0,"spk-progress-bar",1)}function A(e,t){e&1&&(o(0,"section"),i(1,"router-outlet"),r())}var k=class e{#t=d(v);#e=d(m);#n=d(D);isDraft=this.#e.isDraft;backupId=this.#e.backupId;loadingBackup=this.#e.loadingBackup;sysinfoLoaded=this.#n.isLoaded;ngOnInit(){let t=this.#t.snapshot,p=!!t.url.find(F=>F.path==="backup-draft"),n=t.params.id;this.#e.init(n,p)}static \u0275fac=function(p){return new(p||e)};static \u0275cmp=l({type:e,selectors:[["app-backup"]],standalone:!0,features:[S([m]),g],decls:19,vars:21,consts:[["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]],template:function(p,n){p&1&&(i(0,"app-status-bar"),o(1,"spk-stepper")(2,"div",0),i(3,"spk-radio"),c(4," General "),r(),o(5,"div",0),i(6,"spk-radio"),c(7," Destination "),r(),o(8,"div",0),i(9,"spk-radio"),c(10," Source Data "),r(),o(11,"div",0),i(12,"spk-radio"),c(13," Schedule "),r(),o(14,"div",0),i(15,"spk-radio"),c(16," Options "),r()(),f(17,w,1,0,"spk-progress-bar",1)(18,A,2,0,"section")),p&2&&(a(2),s("routerLink",u(6,E,n.isDraft()?"/backup-draft":"/backup",n.backupId())),a(3),s("routerLink",u(9,O,n.isDraft()?"/backup-draft":"/backup",n.backupId())),a(3),s("routerLink",u(12,P,n.isDraft()?"/backup-draft":"/backup",n.backupId())),a(3),s("routerLink",u(15,M,n.isDraft()?"/backup-draft":"/backup",n.backupId())),a(3),s("routerLink",u(18,R,n.isDraft()?"/backup-draft":"/backup",n.backupId())),a(3),b(n.loadingBackup()&&!n.sysinfoLoaded()?17:18))},dependencies:[C,h,y,I,L,B,_],styles:["[_nghost-%COMP%]{display:block}spk-stepper[_ngcontent-%COMP%]{max-width:32.5rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:32.5rem;margin:0 auto 2.5rem}"],changeDetection:0})};export{k as default};
@@ -1 +1 @@
1
- import{a as me}from"./chunk-SHLX3F4G.js";import{a as ae}from"./chunk-SGVVLQ22.js";import{a as W}from"./chunk-AN53EBZI.js";import"./chunk-AM4UDAZB.js";import{a as se}from"./chunk-MMEIXMDW.js";import"./chunk-QX7KUJGE.js";import{b as $}from"./chunk-BX543SH4.js";import{b as q,d as z,e as j,f as H,h as J,i as K,j as Q,l as X,m as Y,n as Z,o as ee,p as te,q as ne}from"./chunk-DE7MHNNM.js";import"./chunk-GSP4D4JM.js";import{e as ie,i as oe,m as re,o as le}from"./chunk-EYBBW4ID.js";import{a as L}from"./chunk-PY26LA4W.js";import{$a as S,Db as r,Eb as E,Fb as b,I as v,Ia as D,La as s,Mb as A,Ra as h,U as y,W as I,Za as O,bb as M,c as F,cc as G,ea as u,eb as C,ec as B,fa as d,fb as x,gb as T,hb as k,ib as n,jb as o,kb as p,lb as R,mb as w,ob as _,p as U,pb as m,qb as c,tb as N}from"./chunk-FKB7BVQE.js";import"./chunk-7CGTOI24.js";function ue(a,e){if(a&1){let t=_();n(0,"spk-form-field",28),p(1,"input",29),o(),n(2,"button",30),m("click",function(){u(t);let l=c(2);return d(l.beginRemoteRegistration())}),r(3," Register for remote control "),o()}}function de(a,e){if(a&1&&(n(0,"div",26)(1,"label"),r(2,"Machine is now registered, open this link to add it to your account:"),o(),n(3,"a",31),r(4),o()()),a&2){let t=c(2);s(3),N("href",t.remoteControlClaimUrl(),D),s(),E(t.remoteControlClaimUrl())}}function ge(a,e){a&1&&(n(0,"div",26)(1,"label"),r(2,"Registering, please wait..."),o()())}function Ce(a,e){if(a&1){let t=_();n(0,"button",30),m("click",function(){u(t);let l=c(2);return d(l.cancelRemoteRegistration())}),r(1," Cancel registration "),o()}}function _e(a,e){if(a&1){let t=_();n(0,"button",30),m("click",function(){u(t);let l=c(2);return d(l.disableRemoteControl())}),r(1," Disable remote control "),o()}}function fe(a,e){if(a&1){let t=_();n(0,"button",30),m("click",function(){u(t);let l=c(2);return d(l.enableRemoteControl())}),r(1," Enable remote control "),o(),n(2,"button",32),m("click",function(){u(t);let l=c(2);return d(l.deleteRemoteControl())}),r(3," Delete remote control setup "),o()}}function Se(a,e){if(a&1&&(n(0,"div",5),O(1,ue,4,0)(2,de,5,2,"div",26)(3,ge,3,0,"div",26)(4,Ce,2,0,"button",27)(5,_e,2,0,"button",27)(6,fe,4,0),o()),a&2){let t=c();s(),C(t.remoteControlState()==="inactive"?1:-1),s(),C(t.remoteControlState()==="registered"?2:-1),s(),C(t.remoteControlState()==="registering"?3:-1),s(),C(t.remoteControlState()==="registering"||t.remoteControlState()==="registeringfaulted"||t.remoteControlState()==="registered"?4:-1),s(),C(t.remoteControlState()==="connected"||t.remoteControlState()==="enabled"?5:-1),s(),C(t.remoteControlState()==="disabled"?6:-1)}}function he(a,e){if(a&1){let t=_();n(0,"option",33),m("click",function(){let l=u(t).$implicit,g=c();return d(g.pauseSettings.controls.timeType.setValue(l.value))}),r(1),o()}if(a&2){let t=e.$implicit;S("value",t.value),s(),b(" ",t.label," ")}}function be(a,e){if(a&1){let t=_();n(0,"option",33),m("click",function(){let l=u(t).$implicit,g=c();return d(g.pauseSettings.controls.time.setValue(l))}),r(1),o()}if(a&2){let t=e.$implicit;S("value",t),s(),E(t)}}function ve(a,e){if(a&1){let t=_();n(0,"option",33),m("click",function(){let l=u(t).$implicit,g=c();return d(g.settingsForm.controls.usageStatistics.setValue(l.value))}),r(1),o()}if(a&2){let t=e.$implicit;S("value",t.value),s(),b(" ",t.label," ")}}var f=new ee,pe=[{value:"s",label:"Seconds"},{value:"m",label:"Minutes"},{value:"h",label:"Hours"}],V=[{value:"en",label:"English"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"it",label:"Italian"}],ce=[{value:"",label:"System default (information)"},{value:"information",label:"Usage statistics, warnings, errors, and crashes"},{value:"warning",label:"Warnings, errors and crashes"},{value:"error",label:"Errors and crashes"},{value:"crash",label:"Crashes only"},{value:"none",label:"None / disabled"}],P=class a{#i=y(ae);#o=y(W);#e=y(L);sysinfo=this.#o.systemInfo;isDarkMode=this.#i.isDarkMode;editAs=h("list");settingsForm=f.group({pauseSettings:f.group({time:f.control(0),timeType:f.control("s")}),language:f.control("en"),usageStatistics:f.control(""),updateChannel:f.control(""),remoteControlRegisterUrl:f.control("")});remoteControlState=h("unknown");remoteControlClaimUrl=h(null);sysInfoEffect=B(()=>{this.settingsForm.controls.remoteControlRegisterUrl.patchValue(this.sysinfo()?.RemoteControlRegistrationUrl??"")},{allowSignalWrites:!0});get pauseSettings(){return this.settingsForm.controls.pauseSettings}langSignal=$(this.settingsForm.controls.language.valueChanges);timeTypeOptions=h(pe);timeOptions=me([this.pauseSettings.controls.timeType.valueChanges.pipe(v("s")),this.pauseSettings.controls.time.valueChanges.pipe(v(null))],F(U(([e,t])=>{let i=this.#r(e);return t!==null?i.filter(l=>l.toString().includes(t.toString())):i}),v([])));languageOptions=G(()=>this.langSignal()?V.filter(e=>e.value===this.langSignal()):V);usageStatisticsOptions=h(ce);ngOnInit(){this.refreshRemoteControlStatus(),this.getServerSettings()}submit(){let e=`${this.pauseSettings.controls.time.value}${this.pauseSettings.controls.timeType.value}`;this.#e.patchApiV1Serversettings({requestBody:{"usage-reporter-level":this.settingsForm.controls.usageStatistics.value,"startup-delay":e==="0s"?"":e,"update-channel":this.settingsForm.controls.updateChannel.value}}).subscribe({next:t=>{console.log("res",t)},error:t=>{console.error("err",t)}})}getServerSettings(){return this.#e.getApiV1Serversettings().subscribe({next:e=>{let t=e["startup-delay"];this.settingsForm.patchValue({pauseSettings:{time:parseInt(t.substring(0,t.length-1)==""?"0":t.substring(0,t.length-1)),timeType:t.substring(-1)===""?"s":t.substring(-1)},usageStatistics:e["usage-reporter-level"],updateChannel:e["update-channel"]})}})}languageDisplay(e){return e?V.find(t=>t.value===e)?.label??null:null}typeDisplay(e){return e==null?null:pe.find(t=>t.value===e)?.label??null}usageDisplay(e){return typeof e!="string"?null:ce.find(t=>t.value===e)?.label??null}setDarkMode(){this.#i.setDarkMode()}setLightMode(){this.#i.setLightMode()}#r(e){let t=e==="h"?25:61;return new Array(t).fill(0).map((i,l)=>l)}repeatRegisterTimer=null;#t(e){e.RegistrationUrl&&this.remoteControlClaimUrl.set(e.RegistrationUrl),console.log(e),e.IsConnected?this.remoteControlState.set("connected"):e.IsEnabled?this.remoteControlState.set("enabled"):e.CanEnable?this.remoteControlState.set("disabled"):e.IsRegisteringFaulted?this.remoteControlState.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.remoteControlState.set("registered"):this.remoteControlState.set("registering"):this.remoteControlState.set("inactive");let t=this.remoteControlState();console.log(t),this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),t==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#e.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:""}}).subscribe({next:i=>{this.#t(i)},error:i=>{this.#n(i)}})},5e3)),(t==="enabled"||t==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#e.getApiV1RemotecontrolStatus().subscribe({next:i=>{this.#t(i)},error:i=>{this.#n(i)}})},5e3)),e.IsRegistering&&e.CanEnable&&this.#e.deleteApiV1RemotecontrolRegister().subscribe({next:i=>{this.#t(i)}})}#n(e){this.#e.getApiV1RemotecontrolStatus().subscribe({next:t=>{this.#t(t)}})}refreshRemoteControlStatus(){this.#e.getApiV1RemotecontrolStatus().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}beginRemoteRegistration(){this.remoteControlState.set("registering");let e=this.settingsForm.controls.remoteControlRegisterUrl.value;this.#e.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:e}}).subscribe({next:t=>{this.#t(t)},error:t=>{this.#n(t)}})}cancelRemoteRegistration(){this.#e.deleteApiV1RemotecontrolRegister().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}enableRemoteControl(){this.#e.postApiV1RemotecontrolEnable().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}disableRemoteControl(){this.#e.postApiV1RemotecontrolDisable().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}deleteRemoteControl(){let e=this;confirm("Are you sure you want to delete the remote control registration?")&&e.#e.deleteApiV1RemotecontrolRegistration().subscribe({next:t=>{e.#t(t)},error:t=>{e.#n(t)}})}getRemoteControlStatusText(){let e=this.remoteControlState();return e==="enabled"?"Remote control is enabled but not connected":e==="connected"?"Remote control is connected":e==="registering"?"Registering machine...":e==="registeringfaulted"?"Registration failed":e==="registered"?"Registered, waiting for accept":e==="disabled"?"Remote control is configured but not enabled":e==="unknown"?"...loading...":"Remote control is not set up"}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=I({type:a,selectors:[["app-settings"]],standalone:!0,features:[A],decls:100,vars:11,consts:[[1,"content",3,"submit","formGroup"],[1,"title"],["type","submit","spk-button","",1,"raised","primary"],[1,"left"],[1,"right","remote-control"],[1,"field-row"],[1,"right"],["formGroupName","pauseSettings",1,"field-row"],[3,"displayValue"],["type","text","formControlName","timeType"],["options",""],[3,"value"],["type","search","formControlName","time"],[1,"themes"],["src","assets/images/light-theme.png","alt","light theme",3,"click"],["src","assets/images/dark-theme.png","alt","dark theme",3,"click"],[1,"right","radios"],[1,"radio-option",3,"click"],[1,"outlined","primary"],["type","radio","name","updateChannel","value","","formControlName","updateChannel"],["type","radio","name","updateChannel","value","stable","formControlName","updateChannel"],["type","radio","name","updateChannel","value","beta","formControlName","updateChannel"],["type","radio","name","updateChannel","value","experimental","formControlName","updateChannel"],["type","radio","name","updateChannel","value","canary","formControlName","updateChannel"],["href","#"],["type","text","formControlName","usageStatistics"],[1,"field-col"],["type","button","spk-button","",1,"raised"],["label","Registration URL","for","remoteControlRegisterUrl"],["type","text","spk-input","","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl","formControlName","remoteControlRegisterUrl"],["type","button","spk-button","",1,"raised",3,"click"],["target","_blank",3,"href"],["type","button","spk-button","",1,"raised","warn",3,"click"],[3,"click","value"]],template:function(t,i){if(t&1&&(p(0,"app-status-bar"),n(1,"form",0),m("submit",function(){return i.submit()}),n(2,"header")(3,"div",1)(4,"h2"),r(5,"Settings"),o(),n(6,"p"),r(7,"Configure your backup settings."),o()(),n(8,"button",2),r(9,"Save changes"),o()(),n(10,"section")(11,"div",3)(12,"h3"),r(13,"Remote access control"),o(),n(14,"p"),r(15),o()(),n(16,"div",4),O(17,Se,7,6,"div",5),o()(),n(18,"section")(19,"div",3)(20,"h3"),r(21,"Pause after startup or hibernation"),o(),n(22,"p"),r(23," Duplicati will run when started, but will remain in paused state for the duration. Duplicati will occupy minimal system resources and no backups will be run. "),o()(),n(24,"div",6)(25,"div",7)(26,"spk-select",8),p(27,"input",9),R(28,10),T(29,he,2,2,"option",11,x),w(),o(),n(31,"spk-select"),p(32,"input",12),R(33,10),T(34,be,2,2,"option",11,x),w(),o()()()(),n(36,"section")(37,"div",3)(38,"h3"),r(39,"Color theme"),o(),n(40,"p"),r(41,"Customize your application theme"),o()(),n(42,"div",6)(43,"div",13)(44,"img",14),m("click",function(){return i.setLightMode()}),o(),n(45,"img",15),m("click",function(){return i.setDarkMode()}),o()()()(),n(46,"section")(47,"div",3)(48,"h3"),r(49,"Update channel"),o(),n(50,"p"),r(51,"Lorem ipsum dolor sit amet, consectetur adipiscing elit."),o()(),n(52,"div",16)(53,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("")}),n(54,"spk-radio",18),r(55),p(56,"input",19),o(),n(57,"p"),r(58),o()(),n(59,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("stable")}),n(60,"spk-radio",18),r(61," Stable "),p(62,"input",20),o(),n(63,"p"),r(64,"Official releases"),o()(),n(65,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("beta")}),n(66,"spk-radio",18),r(67," Beta "),p(68,"input",21),o(),n(69,"p"),r(70," Try out the new features that we are working on. Currently the most stable version available. Test Restore data before using this in production environments. "),o()(),n(71,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("experimental")}),n(72,"spk-radio",18),r(73," Experimental "),p(74,"input",22),o(),n(75,"p"),r(76,"Specific builds for developers only. Not for use with important data."),o()(),n(77,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("canary")}),n(78,"spk-radio",18),r(79," Canary "),p(80,"input",23),o(),n(81,"p"),r(82,"Individual builds for developers only. Not for use with important data."),o()()()(),n(83,"section")(84,"div",3)(85,"h3"),r(86,"Usage statistics"),o(),n(87,"p"),r(88," Usage reports help us improve the user experience and evaluate impact of new features. We use them to generate "),n(89,"a",24),r(90,"public usage statistics."),o(),p(91,"br")(92,"br"),r(93," All usage reports are sent anonymously and do not contain any personal information. They contain information about hardware and operating system, the type of backend, backup duration, overall size of source data and similar data. They do not contain paths, filenames, usernames, passwords or similar sensitive information. "),o()(),n(94,"div",6)(95,"spk-select",8),p(96,"input",25),R(97,10),T(98,ve,2,2,"option",11,x),w(),o()()()()),t&2){let l,g;s(),S("formGroup",i.settingsForm),s(14),E(i.getRemoteControlStatusText()),s(2),C(i.remoteControlState()!=="unknown"?17:-1),s(9),S("displayValue",i.typeDisplay(i.settingsForm.value.pauseSettings==null?null:i.settingsForm.value.pauseSettings.timeType)),s(3),k(i.timeTypeOptions()),s(5),k(i.timeOptions()),s(10),M("active",!i.isDarkMode()),s(),M("active",i.isDarkMode()),s(10),b(" Default (",(l=i.sysinfo())==null?null:l.DefaultUpdateChannel,") "),s(3),b("Same as the base install version: ",(g=i.sysinfo())==null?null:g.ServerVersionType,""),s(37),S("displayValue",i.usageDisplay(i.settingsForm.controls.usageStatistics.value)),s(3),k(i.usageStatisticsOptions())}},dependencies:[te,H,Y,Z,q,J,z,j,ne,K,X,Q,se,ie,re,oe,le],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem 2rem}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem 0}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:2rem 0;border-top:1px solid var(--base-level-40)}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;align-items:flex-start}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] spk-button-group[_ngcontent-%COMP%]{margin-top:.25rem}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;width:50%}.themes[_ngcontent-%COMP%]{display:flex;gap:.5rem}.themes[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:240px;border-radius:var(--shape-3);cursor:pointer}.themes[_ngcontent-%COMP%] img.active[_ngcontent-%COMP%]{border:2px solid var(--primary-500)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.radio-option[_ngcontent-%COMP%]{cursor:pointer}.radio-option[_ngcontent-%COMP%] spk-radio[_ngcontent-%COMP%]{color:var(--base-level-60);margin-bottom:.25rem}.radio-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;color:var(--base-level-60R)}.field-col[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] spk-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] spk-select[_ngcontent-%COMP%]{flex:1 0}.remote-control[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap}"],changeDetection:0})};export{P as default};
1
+ import{a as me}from"./chunk-SHLX3F4G.js";import{a as ae}from"./chunk-SGVVLQ22.js";import{a as W}from"./chunk-AN53EBZI.js";import"./chunk-AM4UDAZB.js";import{a as se}from"./chunk-YL6USNFS.js";import"./chunk-QX7KUJGE.js";import{b as $}from"./chunk-BX543SH4.js";import{b as q,d as z,e as j,f as H,h as J,i as K,j as Q,l as X,m as Y,n as Z,o as ee,p as te,q as ne}from"./chunk-DE7MHNNM.js";import"./chunk-GSP4D4JM.js";import{e as ie,i as oe,m as re,o as le}from"./chunk-EYBBW4ID.js";import{a as L}from"./chunk-PY26LA4W.js";import{$a as S,Db as r,Eb as E,Fb as b,I as v,Ia as D,La as s,Mb as A,Ra as h,U as y,W as I,Za as O,bb as M,c as F,cc as G,ea as u,eb as C,ec as B,fa as d,fb as x,gb as T,hb as k,ib as n,jb as o,kb as p,lb as R,mb as w,ob as _,p as U,pb as m,qb as c,tb as N}from"./chunk-FKB7BVQE.js";import"./chunk-7CGTOI24.js";function ue(a,e){if(a&1){let t=_();n(0,"spk-form-field",28),p(1,"input",29),o(),n(2,"button",30),m("click",function(){u(t);let l=c(2);return d(l.beginRemoteRegistration())}),r(3," Register for remote control "),o()}}function de(a,e){if(a&1&&(n(0,"div",26)(1,"label"),r(2,"Machine is now registered, open this link to add it to your account:"),o(),n(3,"a",31),r(4),o()()),a&2){let t=c(2);s(3),N("href",t.remoteControlClaimUrl(),D),s(),E(t.remoteControlClaimUrl())}}function ge(a,e){a&1&&(n(0,"div",26)(1,"label"),r(2,"Registering, please wait..."),o()())}function Ce(a,e){if(a&1){let t=_();n(0,"button",30),m("click",function(){u(t);let l=c(2);return d(l.cancelRemoteRegistration())}),r(1," Cancel registration "),o()}}function _e(a,e){if(a&1){let t=_();n(0,"button",30),m("click",function(){u(t);let l=c(2);return d(l.disableRemoteControl())}),r(1," Disable remote control "),o()}}function fe(a,e){if(a&1){let t=_();n(0,"button",30),m("click",function(){u(t);let l=c(2);return d(l.enableRemoteControl())}),r(1," Enable remote control "),o(),n(2,"button",32),m("click",function(){u(t);let l=c(2);return d(l.deleteRemoteControl())}),r(3," Delete remote control setup "),o()}}function Se(a,e){if(a&1&&(n(0,"div",5),O(1,ue,4,0)(2,de,5,2,"div",26)(3,ge,3,0,"div",26)(4,Ce,2,0,"button",27)(5,_e,2,0,"button",27)(6,fe,4,0),o()),a&2){let t=c();s(),C(t.remoteControlState()==="inactive"?1:-1),s(),C(t.remoteControlState()==="registered"?2:-1),s(),C(t.remoteControlState()==="registering"?3:-1),s(),C(t.remoteControlState()==="registering"||t.remoteControlState()==="registeringfaulted"||t.remoteControlState()==="registered"?4:-1),s(),C(t.remoteControlState()==="connected"||t.remoteControlState()==="enabled"?5:-1),s(),C(t.remoteControlState()==="disabled"?6:-1)}}function he(a,e){if(a&1){let t=_();n(0,"option",33),m("click",function(){let l=u(t).$implicit,g=c();return d(g.pauseSettings.controls.timeType.setValue(l.value))}),r(1),o()}if(a&2){let t=e.$implicit;S("value",t.value),s(),b(" ",t.label," ")}}function be(a,e){if(a&1){let t=_();n(0,"option",33),m("click",function(){let l=u(t).$implicit,g=c();return d(g.pauseSettings.controls.time.setValue(l))}),r(1),o()}if(a&2){let t=e.$implicit;S("value",t),s(),E(t)}}function ve(a,e){if(a&1){let t=_();n(0,"option",33),m("click",function(){let l=u(t).$implicit,g=c();return d(g.settingsForm.controls.usageStatistics.setValue(l.value))}),r(1),o()}if(a&2){let t=e.$implicit;S("value",t.value),s(),b(" ",t.label," ")}}var f=new ee,pe=[{value:"s",label:"Seconds"},{value:"m",label:"Minutes"},{value:"h",label:"Hours"}],V=[{value:"en",label:"English"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"it",label:"Italian"}],ce=[{value:"",label:"System default (information)"},{value:"information",label:"Usage statistics, warnings, errors, and crashes"},{value:"warning",label:"Warnings, errors and crashes"},{value:"error",label:"Errors and crashes"},{value:"crash",label:"Crashes only"},{value:"none",label:"None / disabled"}],P=class a{#i=y(ae);#o=y(W);#e=y(L);sysinfo=this.#o.systemInfo;isDarkMode=this.#i.isDarkMode;editAs=h("list");settingsForm=f.group({pauseSettings:f.group({time:f.control(0),timeType:f.control("s")}),language:f.control("en"),usageStatistics:f.control(""),updateChannel:f.control(""),remoteControlRegisterUrl:f.control("")});remoteControlState=h("unknown");remoteControlClaimUrl=h(null);sysInfoEffect=B(()=>{this.settingsForm.controls.remoteControlRegisterUrl.patchValue(this.sysinfo()?.RemoteControlRegistrationUrl??"")},{allowSignalWrites:!0});get pauseSettings(){return this.settingsForm.controls.pauseSettings}langSignal=$(this.settingsForm.controls.language.valueChanges);timeTypeOptions=h(pe);timeOptions=me([this.pauseSettings.controls.timeType.valueChanges.pipe(v("s")),this.pauseSettings.controls.time.valueChanges.pipe(v(null))],F(U(([e,t])=>{let i=this.#r(e);return t!==null?i.filter(l=>l.toString().includes(t.toString())):i}),v([])));languageOptions=G(()=>this.langSignal()?V.filter(e=>e.value===this.langSignal()):V);usageStatisticsOptions=h(ce);ngOnInit(){this.refreshRemoteControlStatus(),this.getServerSettings()}submit(){let e=`${this.pauseSettings.controls.time.value}${this.pauseSettings.controls.timeType.value}`;this.#e.patchApiV1Serversettings({requestBody:{"usage-reporter-level":this.settingsForm.controls.usageStatistics.value,"startup-delay":e==="0s"?"":e,"update-channel":this.settingsForm.controls.updateChannel.value}}).subscribe({next:t=>{console.log("res",t)},error:t=>{console.error("err",t)}})}getServerSettings(){return this.#e.getApiV1Serversettings().subscribe({next:e=>{let t=e["startup-delay"];this.settingsForm.patchValue({pauseSettings:{time:parseInt(t.substring(0,t.length-1)==""?"0":t.substring(0,t.length-1)),timeType:t.substring(-1)===""?"s":t.substring(-1)},usageStatistics:e["usage-reporter-level"],updateChannel:e["update-channel"]})}})}languageDisplay(e){return e?V.find(t=>t.value===e)?.label??null:null}typeDisplay(e){return e==null?null:pe.find(t=>t.value===e)?.label??null}usageDisplay(e){return typeof e!="string"?null:ce.find(t=>t.value===e)?.label??null}setDarkMode(){this.#i.setDarkMode()}setLightMode(){this.#i.setLightMode()}#r(e){let t=e==="h"?25:61;return new Array(t).fill(0).map((i,l)=>l)}repeatRegisterTimer=null;#t(e){e.RegistrationUrl&&this.remoteControlClaimUrl.set(e.RegistrationUrl),console.log(e),e.IsConnected?this.remoteControlState.set("connected"):e.IsEnabled?this.remoteControlState.set("enabled"):e.CanEnable?this.remoteControlState.set("disabled"):e.IsRegisteringFaulted?this.remoteControlState.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.remoteControlState.set("registered"):this.remoteControlState.set("registering"):this.remoteControlState.set("inactive");let t=this.remoteControlState();console.log(t),this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),t==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#e.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:""}}).subscribe({next:i=>{this.#t(i)},error:i=>{this.#n(i)}})},5e3)),(t==="enabled"||t==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#e.getApiV1RemotecontrolStatus().subscribe({next:i=>{this.#t(i)},error:i=>{this.#n(i)}})},5e3)),e.IsRegistering&&e.CanEnable&&this.#e.deleteApiV1RemotecontrolRegister().subscribe({next:i=>{this.#t(i)}})}#n(e){this.#e.getApiV1RemotecontrolStatus().subscribe({next:t=>{this.#t(t)}})}refreshRemoteControlStatus(){this.#e.getApiV1RemotecontrolStatus().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}beginRemoteRegistration(){this.remoteControlState.set("registering");let e=this.settingsForm.controls.remoteControlRegisterUrl.value;this.#e.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:e}}).subscribe({next:t=>{this.#t(t)},error:t=>{this.#n(t)}})}cancelRemoteRegistration(){this.#e.deleteApiV1RemotecontrolRegister().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}enableRemoteControl(){this.#e.postApiV1RemotecontrolEnable().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}disableRemoteControl(){this.#e.postApiV1RemotecontrolDisable().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}deleteRemoteControl(){let e=this;confirm("Are you sure you want to delete the remote control registration?")&&e.#e.deleteApiV1RemotecontrolRegistration().subscribe({next:t=>{e.#t(t)},error:t=>{e.#n(t)}})}getRemoteControlStatusText(){let e=this.remoteControlState();return e==="enabled"?"Remote control is enabled but not connected":e==="connected"?"Remote control is connected":e==="registering"?"Registering machine...":e==="registeringfaulted"?"Registration failed":e==="registered"?"Registered, waiting for accept":e==="disabled"?"Remote control is configured but not enabled":e==="unknown"?"...loading...":"Remote control is not set up"}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=I({type:a,selectors:[["app-settings"]],standalone:!0,features:[A],decls:100,vars:11,consts:[[1,"content",3,"submit","formGroup"],[1,"title"],["type","submit","spk-button","",1,"raised","primary"],[1,"left"],[1,"right","remote-control"],[1,"field-row"],[1,"right"],["formGroupName","pauseSettings",1,"field-row"],[3,"displayValue"],["type","text","formControlName","timeType"],["options",""],[3,"value"],["type","search","formControlName","time"],[1,"themes"],["src","assets/images/light-theme.png","alt","light theme",3,"click"],["src","assets/images/dark-theme.png","alt","dark theme",3,"click"],[1,"right","radios"],[1,"radio-option",3,"click"],[1,"outlined","primary"],["type","radio","name","updateChannel","value","","formControlName","updateChannel"],["type","radio","name","updateChannel","value","stable","formControlName","updateChannel"],["type","radio","name","updateChannel","value","beta","formControlName","updateChannel"],["type","radio","name","updateChannel","value","experimental","formControlName","updateChannel"],["type","radio","name","updateChannel","value","canary","formControlName","updateChannel"],["href","#"],["type","text","formControlName","usageStatistics"],[1,"field-col"],["type","button","spk-button","",1,"raised"],["label","Registration URL","for","remoteControlRegisterUrl"],["type","text","spk-input","","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl","formControlName","remoteControlRegisterUrl"],["type","button","spk-button","",1,"raised",3,"click"],["target","_blank",3,"href"],["type","button","spk-button","",1,"raised","warn",3,"click"],[3,"click","value"]],template:function(t,i){if(t&1&&(p(0,"app-status-bar"),n(1,"form",0),m("submit",function(){return i.submit()}),n(2,"header")(3,"div",1)(4,"h2"),r(5,"Settings"),o(),n(6,"p"),r(7,"Configure your backup settings."),o()(),n(8,"button",2),r(9,"Save changes"),o()(),n(10,"section")(11,"div",3)(12,"h3"),r(13,"Remote access control"),o(),n(14,"p"),r(15),o()(),n(16,"div",4),O(17,Se,7,6,"div",5),o()(),n(18,"section")(19,"div",3)(20,"h3"),r(21,"Pause after startup or hibernation"),o(),n(22,"p"),r(23," Duplicati will run when started, but will remain in paused state for the duration. Duplicati will occupy minimal system resources and no backups will be run. "),o()(),n(24,"div",6)(25,"div",7)(26,"spk-select",8),p(27,"input",9),R(28,10),T(29,he,2,2,"option",11,x),w(),o(),n(31,"spk-select"),p(32,"input",12),R(33,10),T(34,be,2,2,"option",11,x),w(),o()()()(),n(36,"section")(37,"div",3)(38,"h3"),r(39,"Color theme"),o(),n(40,"p"),r(41,"Customize your application theme"),o()(),n(42,"div",6)(43,"div",13)(44,"img",14),m("click",function(){return i.setLightMode()}),o(),n(45,"img",15),m("click",function(){return i.setDarkMode()}),o()()()(),n(46,"section")(47,"div",3)(48,"h3"),r(49,"Update channel"),o(),n(50,"p"),r(51,"Lorem ipsum dolor sit amet, consectetur adipiscing elit."),o()(),n(52,"div",16)(53,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("")}),n(54,"spk-radio",18),r(55),p(56,"input",19),o(),n(57,"p"),r(58),o()(),n(59,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("stable")}),n(60,"spk-radio",18),r(61," Stable "),p(62,"input",20),o(),n(63,"p"),r(64,"Official releases"),o()(),n(65,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("beta")}),n(66,"spk-radio",18),r(67," Beta "),p(68,"input",21),o(),n(69,"p"),r(70," Try out the new features that we are working on. Currently the most stable version available. Test Restore data before using this in production environments. "),o()(),n(71,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("experimental")}),n(72,"spk-radio",18),r(73," Experimental "),p(74,"input",22),o(),n(75,"p"),r(76,"Specific builds for developers only. Not for use with important data."),o()(),n(77,"div",17),m("click",function(){return i.settingsForm.controls.updateChannel.setValue("canary")}),n(78,"spk-radio",18),r(79," Canary "),p(80,"input",23),o(),n(81,"p"),r(82,"Individual builds for developers only. Not for use with important data."),o()()()(),n(83,"section")(84,"div",3)(85,"h3"),r(86,"Usage statistics"),o(),n(87,"p"),r(88," Usage reports help us improve the user experience and evaluate impact of new features. We use them to generate "),n(89,"a",24),r(90,"public usage statistics."),o(),p(91,"br")(92,"br"),r(93," All usage reports are sent anonymously and do not contain any personal information. They contain information about hardware and operating system, the type of backend, backup duration, overall size of source data and similar data. They do not contain paths, filenames, usernames, passwords or similar sensitive information. "),o()(),n(94,"div",6)(95,"spk-select",8),p(96,"input",25),R(97,10),T(98,ve,2,2,"option",11,x),w(),o()()()()),t&2){let l,g;s(),S("formGroup",i.settingsForm),s(14),E(i.getRemoteControlStatusText()),s(2),C(i.remoteControlState()!=="unknown"?17:-1),s(9),S("displayValue",i.typeDisplay(i.settingsForm.value.pauseSettings==null?null:i.settingsForm.value.pauseSettings.timeType)),s(3),k(i.timeTypeOptions()),s(5),k(i.timeOptions()),s(10),M("active",!i.isDarkMode()),s(),M("active",i.isDarkMode()),s(10),b(" Default (",(l=i.sysinfo())==null?null:l.DefaultUpdateChannel,") "),s(3),b("Same as the base install version: ",(g=i.sysinfo())==null?null:g.ServerVersionType,""),s(37),S("displayValue",i.usageDisplay(i.settingsForm.controls.usageStatistics.value)),s(3),k(i.usageStatisticsOptions())}},dependencies:[te,H,Y,Z,q,J,z,j,ne,K,X,Q,se,ie,re,oe,le],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem 2rem}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem 0}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:2rem 0;border-top:1px solid var(--base-level-40)}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;align-items:flex-start}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] spk-button-group[_ngcontent-%COMP%]{margin-top:.25rem}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;width:50%}.themes[_ngcontent-%COMP%]{display:flex;gap:.5rem}.themes[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:240px;border-radius:var(--shape-3);cursor:pointer}.themes[_ngcontent-%COMP%] img.active[_ngcontent-%COMP%]{border:2px solid var(--primary-500)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.radio-option[_ngcontent-%COMP%]{cursor:pointer}.radio-option[_ngcontent-%COMP%] spk-radio[_ngcontent-%COMP%]{color:var(--base-level-60);margin-bottom:.25rem}.radio-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;color:var(--base-level-60R)}.field-col[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] spk-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] spk-select[_ngcontent-%COMP%]{flex:1 0}.remote-control[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap}"],changeDetection:0})};export{P as default};
@@ -1 +1 @@
1
- import{a as f}from"./chunk-MMEIXMDW.js";import"./chunk-QX7KUJGE.js";import"./chunk-GSP4D4JM.js";import{a as u,e as g,f as k}from"./chunk-EYBBW4ID.js";import{d as l}from"./chunk-IGECPMHY.js";import"./chunk-L2WWHQPN.js";import"./chunk-PY26LA4W.js";import{$a as p,Db as t,La as o,Mb as s,Nb as r,W as d,ib as e,jb as n,kb as a}from"./chunk-FKB7BVQE.js";import"./chunk-7CGTOI24.js";var b=()=>["/backup/new"],x=()=>["/backup/import"],c=class m{static \u0275fac=function(i){return new(i||m)};static \u0275cmp=d({type:m,selectors:[["app-add-backup"]],standalone:!0,features:[s],decls:25,vars:4,consts:[[1,"backup-types"],[1,"type-a"],["src","assets/images/new-backup.png"],["spk-button","",1,"raised","primary",3,"routerLink"]],template:function(i,S){i&1&&(a(0,"app-status-bar"),e(1,"section")(2,"h2"),t(3,"Add a new backup"),n(),e(4,"div",0)(5,"spk-card",1),a(6,"img",2),e(7,"h3"),t(8,"New backup"),n(),e(9,"p"),t(10,"Configure a new backup. Choose your destination, source data and schedule."),n(),e(11,"button",3),t(12," Add a new backup "),e(13,"spk-icon"),t(14,"plus"),n()()(),e(15,"spk-card",1),a(16,"img",2),e(17,"h3"),t(18,"Import from file"),n(),e(19,"p"),t(20,"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod."),n(),e(21,"button",3),t(22," Import from file "),e(23,"spk-icon"),t(24,"upload-simple"),n()()()()()),i&2&&(o(11),p("routerLink",r(2,b)),o(10),p("routerLink",r(3,x)))},dependencies:[f,g,k,u,l],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:2rem;padding:2rem 0}div.backup-types[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;max-width:700px}spk-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding-bottom:3rem}spk-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:300px}spk-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;text-align:center;width:75%}"],changeDetection:0})};export{c as default};
1
+ import{a as f}from"./chunk-YL6USNFS.js";import"./chunk-QX7KUJGE.js";import"./chunk-GSP4D4JM.js";import{a as u,e as g,f as k}from"./chunk-EYBBW4ID.js";import{d as l}from"./chunk-IGECPMHY.js";import"./chunk-L2WWHQPN.js";import"./chunk-PY26LA4W.js";import{$a as p,Db as t,La as o,Mb as s,Nb as r,W as d,ib as e,jb as n,kb as a}from"./chunk-FKB7BVQE.js";import"./chunk-7CGTOI24.js";var b=()=>["/backup/new"],x=()=>["/backup/import"],c=class m{static \u0275fac=function(i){return new(i||m)};static \u0275cmp=d({type:m,selectors:[["app-add-backup"]],standalone:!0,features:[s],decls:25,vars:4,consts:[[1,"backup-types"],[1,"type-a"],["src","assets/images/new-backup.png"],["spk-button","",1,"raised","primary",3,"routerLink"]],template:function(i,S){i&1&&(a(0,"app-status-bar"),e(1,"section")(2,"h2"),t(3,"Add a new backup"),n(),e(4,"div",0)(5,"spk-card",1),a(6,"img",2),e(7,"h3"),t(8,"New backup"),n(),e(9,"p"),t(10,"Configure a new backup. Choose your destination, source data and schedule."),n(),e(11,"button",3),t(12," Add a new backup "),e(13,"spk-icon"),t(14,"plus"),n()()(),e(15,"spk-card",1),a(16,"img",2),e(17,"h3"),t(18,"Import from file"),n(),e(19,"p"),t(20,"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod."),n(),e(21,"button",3),t(22," Import from file "),e(23,"spk-icon"),t(24,"upload-simple"),n()()()()()),i&2&&(o(11),p("routerLink",r(2,b)),o(10),p("routerLink",r(3,x)))},dependencies:[f,g,k,u,l],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:2rem;padding:2rem 0}div.backup-types[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;max-width:700px}spk-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding-bottom:3rem}spk-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:300px}spk-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;text-align:center;width:75%}"],changeDetection:0})};export{c as default};
@@ -1 +1 @@
1
- import{a as P}from"./chunk-MMEIXMDW.js";import"./chunk-QX7KUJGE.js";import{a as I}from"./chunk-GSP4D4JM.js";import{a as M,e as D,f as R,l as O}from"./chunk-EYBBW4ID.js";import{d as v}from"./chunk-IGECPMHY.js";import"./chunk-L2WWHQPN.js";import{a as y}from"./chunk-PY26LA4W.js";import{$a as k,Db as r,Fb as B,Gb as S,La as l,Mb as b,Ob as h,U as s,W as m,Za as d,eb as f,fb as g,gb as C,hb as _,ib as i,jb as p,kb as c,qb as x}from"./chunk-FKB7BVQE.js";import"./chunk-7CGTOI24.js";var w=e=>["/restore-flow",e];function L(e,o){e&1&&c(0,"spk-progress-bar",0)}function T(e,o){if(e&1&&(i(0,"spk-card",1),c(1,"img",2),i(2,"div",3)(3,"h3"),r(4),p(),i(5,"p"),r(6),p()(),i(7,"button",4),r(8," Restore "),i(9,"spk-icon"),r(10,"arrow-right"),p()()()),e&2){let t,a,n=o.$implicit;l(4),B("Restore ",(t=n.Backup==null?null:n.Backup.Name)!==null&&t!==void 0?t:"Backup name missing",""),l(2),S(" ",(a=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceSizeString)!==null&&a!==void 0?a:"-"," / ",(a=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.BackupListCount)!==null&&a!==void 0?a:"-"," "),l(),k("routerLink",h(4,w,n.Backup==null?null:n.Backup.ID))}}function E(e,o){if(e&1&&C(0,T,11,6,"spk-card",1,g),e&2){let t=x();_(t.backups())}}function N(e,o){e&1&&r(0," No backups found ")}var u=class e{#e=s(I);#t=s(y);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups()}restoreNow(o){this.#t.postApiV1BackupByIdRestore({id:o.Backup?.ID,requestBody:{}})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=m({type:e,selectors:[["app-restore"]],standalone:!0,features:[b],decls:7,vars:1,consts:[[1,"indeterminate","primary"],[1,"type-a"],["src","assets/images/folder.png","alt","","width","48px"],[1,"text"],["spk-button","",3,"routerLink"]],template:function(t,a){t&1&&(c(0,"app-status-bar"),i(1,"section")(2,"h2"),r(3,"Where do you want to restore from?"),p(),d(4,L,1,0,"spk-progress-bar",0)(5,E,2,0)(6,N,1,0),p()),t&2&&(l(4),f(a.backupsLoading()?4:a.backups().length?5:6))},dependencies:[P,R,D,M,O,v],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{font:var(--title-30);text-align:center;padding:2rem}section[_ngcontent-%COMP%]{max-width:43.75rem;margin:0 auto;padding:2rem 0;display:flex;flex-direction:column;gap:1rem}spk-divider[_ngcontent-%COMP%]{color:var(--base-level-60)}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;--card-padding: 2rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}"],changeDetection:0})};export{u as default};
1
+ import{a as P}from"./chunk-YL6USNFS.js";import"./chunk-QX7KUJGE.js";import{a as I}from"./chunk-GSP4D4JM.js";import{a as M,e as D,f as R,l as O}from"./chunk-EYBBW4ID.js";import{d as v}from"./chunk-IGECPMHY.js";import"./chunk-L2WWHQPN.js";import{a as y}from"./chunk-PY26LA4W.js";import{$a as k,Db as r,Fb as B,Gb as S,La as l,Mb as b,Ob as h,U as s,W as m,Za as d,eb as f,fb as g,gb as C,hb as _,ib as i,jb as p,kb as c,qb as x}from"./chunk-FKB7BVQE.js";import"./chunk-7CGTOI24.js";var w=e=>["/restore-flow",e];function L(e,o){e&1&&c(0,"spk-progress-bar",0)}function T(e,o){if(e&1&&(i(0,"spk-card",1),c(1,"img",2),i(2,"div",3)(3,"h3"),r(4),p(),i(5,"p"),r(6),p()(),i(7,"button",4),r(8," Restore "),i(9,"spk-icon"),r(10,"arrow-right"),p()()()),e&2){let t,a,n=o.$implicit;l(4),B("Restore ",(t=n.Backup==null?null:n.Backup.Name)!==null&&t!==void 0?t:"Backup name missing",""),l(2),S(" ",(a=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceSizeString)!==null&&a!==void 0?a:"-"," / ",(a=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.BackupListCount)!==null&&a!==void 0?a:"-"," "),l(),k("routerLink",h(4,w,n.Backup==null?null:n.Backup.ID))}}function E(e,o){if(e&1&&C(0,T,11,6,"spk-card",1,g),e&2){let t=x();_(t.backups())}}function N(e,o){e&1&&r(0," No backups found ")}var u=class e{#e=s(I);#t=s(y);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups()}restoreNow(o){this.#t.postApiV1BackupByIdRestore({id:o.Backup?.ID,requestBody:{}})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=m({type:e,selectors:[["app-restore"]],standalone:!0,features:[b],decls:7,vars:1,consts:[[1,"indeterminate","primary"],[1,"type-a"],["src","assets/images/folder.png","alt","","width","48px"],[1,"text"],["spk-button","",3,"routerLink"]],template:function(t,a){t&1&&(c(0,"app-status-bar"),i(1,"section")(2,"h2"),r(3,"Where do you want to restore from?"),p(),d(4,L,1,0,"spk-progress-bar",0)(5,E,2,0)(6,N,1,0),p()),t&2&&(l(4),f(a.backupsLoading()?4:a.backups().length?5:6))},dependencies:[P,R,D,M,O,v],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{font:var(--title-30);text-align:center;padding:2rem}section[_ngcontent-%COMP%]{max-width:43.75rem;margin:0 auto;padding:2rem 0;display:flex;flex-direction:column;gap:1rem}spk-divider[_ngcontent-%COMP%]{color:var(--base-level-60)}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;--card-padding: 2rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}"],changeDetection:0})};export{u as default};
@@ -0,0 +1 @@
1
+ import{a as N}from"./chunk-QX7KUJGE.js";import{a as M}from"./chunk-GSP4D4JM.js";import{l as L}from"./chunk-EYBBW4ID.js";import{a as V,b as O}from"./chunk-PY26LA4W.js";import{$a as x,D as S,Db as p,Gb as k,J as D,La as u,Mb as A,O as I,Ra as i,Rb as E,Sb as R,U as r,W as y,Z as C,Za as _,cc as c,eb as T,ec as v,ib as l,jb as o,kb as w,l as b,p as B,qb as h}from"./chunk-FKB7BVQE.js";import{a as f,b as g}from"./chunk-7CGTOI24.js";var m=class a{#t=r(N);transform(e,...t){return this.#t(e).fromNow()}static \u0275fac=function(t){return new(t||a)};static \u0275pipe=C({name:"appRelativeTime",type:a,pure:!0,standalone:!0})};var d=class a{#t=1e3;#d=r(O);#o=r(V);#n=r(M);#e=i(!1);#i=i(!1);#u=i(this.#t);#p=i(null);#r=i(!1);#s=i(!1);#a=i(null);#f=i(!1);statusData=this.#p.asReadonly();serverState=c(()=>{let e=this.#a();return e?(e.ProposedSchedule=e?.ProposedSchedule?.map(t=>{let s=t.Item1?this.#n.getBackupById(t.Item1):null;return g(f({},t),{backup:s})}),e):null});isFetching=this.#i.asReadonly();#l=null;#g=v(()=>{let e=this.#e(),t=this.#u();if(!e||!t||t<this.#t){this.#l&&window.clearInterval(this.#l);return}this.#l=window.setInterval(()=>{this.#m()},t)});start(){this.#r.set(!0),this.#c()}stop(){this.#r.set(!1)}startPollingProgress(){this.#m(),this.#e.set(!0)}stopPollingProgress(){this.#e.set(!1)}setProgressStatePollingInterval(e){if(e<this.#t){console.error(`Polling interval must be at least ${this.#t}ms`);return}this.#u.set(e)}serverStateEffect=v(()=>{if(this.#f()){this.stopPollingProgress();return}!this.#s()&&this.#r()?setTimeout(()=>{this.startPollingProgress(),this.#c()},1e3):this.stopPollingProgress()},{allowSignalWrites:!0});#c(){if(this.#s())return;this.#s.set(!0);let e=this.#a()?.LastEventID,t=e==null?{}:{lastEventId:e,longpoll:!0,duration:"299s"};this.#o.getApiV1Serverstate(t).pipe(S(()=>this.#s.set(!1))).subscribe({next:s=>{this.#a()?.LastDataUpdateID!==s.LastDataUpdateID&&this.#n.getBackups(),this.#a.set(s)}})}#m(){this.#i.set(!0),this.#d.getApiV1Progressstate().pipe(D(e=>{let t=e.TaskID??null;return t===null?b(e):this.#o.getApiV1TaskByTaskid({taskid:t}).pipe(B(s=>g(f({},e),{task:s??null})))}),S(()=>this.#i.set(!1))).subscribe({next:e=>{let t=e.TaskID??null,s=e.BackupID??null;if(t!==null&&s!==null){let n=this.#n.getBackupById(s);e.backup=n}e.task?.Status==="Completed"?this.#e.set(!1):this.#e.set(!0),this.#p.set(e)},error:e=>{e.status===404&&this.#e.set(!1)}})}static \u0275fac=function(t){return new(t||a)};static \u0275prov=I({token:a,factory:a.\u0275fac,providedIn:"root"})};function G(a,e){if(a&1&&(l(0,"div",2),p(1),o(),w(2,"spk-progress-bar",3)),a&2){let t,s,n=h();u(),k("",(t=n.statusData())==null||t.task==null?null:t.task.Status," - ",(t=n.statusData())==null||t.backup==null||t.backup.Backup==null?null:t.backup.Backup.Name,""),u(),x("value",(s=n.statusData())!=null&&s.OverallProgress?((s=n.statusData())==null?null:s.OverallProgress)*100:3)}}function F(a,e){if(a&1&&(l(0,"div",2),p(1),E(2,"appRelativeTime"),o()),a&2){let t,s=h();u(),k("",(t=s.nextBackup().backup)==null||t.Backup==null?null:t.Backup.Name," - ",R(2,2,s.nextBackup().time),"")}}function J(a,e){a&1&&(l(0,"div",2),p(1,"No scheduled tasks"),o())}function U(a,e){a&1&&(l(0,"div",2),p(1,"Loading..."),o())}var P=class a{#t=r(d);statusData=this.#t.statusData;serverState=this.#t.serverState;nextBackup=c(()=>({backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}));ngOnInit(){this.#t.start()}ngOnDestroy(){this.#t.stop()}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=y({type:a,selectors:[["app-status-bar"]],standalone:!0,features:[A],decls:6,vars:1,consts:[[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"raised","primary",3,"value"]],template:function(t,s){if(t&1&&(l(0,"div",0)(1,"div",1),_(2,G,3,3)(3,F,3,4,"div",2)(4,J,2,0,"div",2)(5,U,2,0,"div",2),o()()),t&2){let n;u(2),T(!((n=s.statusData())==null||n.task==null)&&n.task.Status&&((n=s.statusData())==null||n.task==null?null:n.task.Status)!=="Completed"?2:s.nextBackup()?3:!s.statusData()||((n=s.statusData())==null||n.task==null?null:n.task.Status)==="Completed"?4:5)}},dependencies:[L,m],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-level-40)}.current-backup[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{P as a};
package/index.html CHANGED
@@ -20,5 +20,5 @@
20
20
  <style>:root{--font-size:16px;font-size:var(--font-size)}html body{--sparkle-light:initial;--sparkle-dark: ;color-scheme:light dark;--primary-50:#eff6ff;--primary-rgb-50:239,246,255;--primary-contrast-50:var(--dark-primary-text);--primary-100:#dbeafe;--primary-rgb-100:219,234,254;--primary-contrast-100:var(--dark-primary-text);--primary-200:#bfdbfe;--primary-rgb-200:191,219,254;--primary-contrast-200:var(--dark-primary-text);--primary-300:#93c5fd;--primary-rgb-300:147,197,253;--primary-contrast-300:var(--dark-primary-text);--primary-400:#60a5fa;--primary-rgb-400:96,165,250;--primary-contrast-400:var(--dark-primary-text);--primary-500:#3b82f6;--primary-rgb-500:59,130,246;--primary-contrast-500:var(--light-primary-text);--primary-600:#2563eb;--primary-rgb-600:37,99,235;--primary-contrast-600:var(--light-primary-text);--primary-700:#1d4ed8;--primary-rgb-700:29,78,216;--primary-contrast-700:var(--light-primary-text);--primary-800:#1e40af;--primary-rgb-800:30,64,175;--primary-contrast-800:var(--light-primary-text);--primary-900:#1e3a8a;--primary-rgb-900:30,58,138;--primary-contrast-900:var(--light-primary-text);--primary-950:#172554;--primary-rgb-950:23,37,84;--primary-contrast-950:var(--light-primary-text);--accent-50:#f5f3ff;--accent-rgb-50:245,243,255;--accent-contrast-50:var(--dark-primary-text);--accent-100:#ede9fe;--accent-rgb-100:237,233,254;--accent-contrast-100:var(--dark-primary-text);--accent-200:#ddd6fe;--accent-rgb-200:221,214,254;--accent-contrast-200:var(--dark-primary-text);--accent-300:#c4b5fd;--accent-rgb-300:196,181,253;--accent-contrast-300:var(--dark-primary-text);--accent-400:#a78bfa;--accent-rgb-400:167,139,250;--accent-contrast-400:var(--dark-primary-text);--accent-500:#8b5cf6;--accent-rgb-500:139,92,246;--accent-contrast-500:var(--light-primary-text);--accent-600:#7c3aed;--accent-rgb-600:124,58,237;--accent-contrast-600:var(--light-primary-text);--accent-700:#6d28d9;--accent-rgb-700:109,40,217;--accent-contrast-700:var(--light-primary-text);--accent-800:#5b21b6;--accent-rgb-800:91,33,182;--accent-contrast-800:var(--light-primary-text);--accent-900:#4c1d95;--accent-rgb-900:76,29,149;--accent-contrast-900:var(--light-primary-text);--accent-950:#2e1065;--accent-rgb-950:46,16,101;--accent-contrast-950:var(--light-primary-text);--tertiary-50:#fffbeb;--tertiary-rgb-50:255,251,235;--tertiary-contrast-50:var(--dark-primary-text);--tertiary-100:#fef3c7;--tertiary-rgb-100:254,243,199;--tertiary-contrast-100:var(--dark-primary-text);--tertiary-200:#fde68a;--tertiary-rgb-200:253,230,138;--tertiary-contrast-200:var(--dark-primary-text);--tertiary-300:#fcd34d;--tertiary-rgb-300:252,211,77;--tertiary-contrast-300:var(--dark-primary-text);--tertiary-400:#fbbf24;--tertiary-rgb-400:251,191,36;--tertiary-contrast-400:var(--light-primary-text);--tertiary-500:#f59e0b;--tertiary-rgb-500:245,158,11;--tertiary-contrast-500:var(--light-primary-text);--tertiary-600:#d97706;--tertiary-rgb-600:217,119,6;--tertiary-contrast-600:var(--light-primary-text);--tertiary-700:#b45309;--tertiary-rgb-700:180,83,9;--tertiary-contrast-700:var(--light-primary-text);--tertiary-800:#92400e;--tertiary-rgb-800:146,64,14;--tertiary-contrast-800:var(--light-primary-text);--tertiary-900:#78350f;--tertiary-rgb-900:120,53,15;--tertiary-contrast-900:var(--light-primary-text);--tertiary-950:#451a03;--tertiary-rgb-950:69,26,3;--tertiary-contrast-950:var(--light-primary-text);--grey-50:#fafafa;--grey-rgb-50:250,250,250;--grey-contrast-50:var(--dark-primary-text);--grey-100:#f4f4f5;--grey-rgb-100:244,244,245;--grey-contrast-100:var(--dark-primary-text);--grey-200:#e4e4e7;--grey-rgb-200:228,228,231;--grey-contrast-200:var(--dark-primary-text);--grey-300:#d4d4d8;--grey-rgb-300:212,212,216;--grey-contrast-300:var(--dark-primary-text);--grey-400:#a1a1aa;--grey-rgb-400:161,161,170;--grey-contrast-400:var(--dark-primary-text);--grey-500:#71717a;--grey-rgb-500:113,113,122;--grey-contrast-500:var(--light-primary-text);--grey-600:#52525b;--grey-rgb-600:82,82,91;--grey-contrast-600:var(--light-primary-text);--grey-700:#3f3f46;--grey-rgb-700:63,63,70;--grey-contrast-700:var(--light-primary-text);--grey-750:#2f2f31;--grey-rgb-750:47,47,49;--grey-contrast-750:var(--light-primary-text);--grey-800:#27272a;--grey-rgb-800:39,39,42;--grey-contrast-800:var(--light-primary-text);--grey-900:#18181b;--grey-rgb-900:24,24,27;--grey-contrast-900:var(--light-primary-text);--grey-950:#09090b;--grey-rgb-950:9,9,11;--grey-contrast-950:var(--light-primary-text);--warn-50:#fef2f2;--warn-rgb-50:254,242,242;--warn-contrast-50:var(--dark-primary-text);--warn-100:#fee2e2;--warn-rgb-100:254,226,226;--warn-contrast-100:var(--dark-primary-text);--warn-200:#fecaca;--warn-rgb-200:254,202,202;--warn-contrast-200:var(--dark-primary-text);--warn-300:#fca5a5;--warn-rgb-300:252,165,165;--warn-contrast-300:var(--dark-primary-text);--warn-400:#f87171;--warn-rgb-400:248,113,113;--warn-contrast-400:var(--light-primary-text);--warn-500:#ef4444;--warn-rgb-500:239,68,68;--warn-contrast-500:var(--light-primary-text);--warn-600:#dc2626;--warn-rgb-600:220,38,38;--warn-contrast-600:var(--light-primary-text);--warn-700:#b91c1c;--warn-rgb-700:185,28,28;--warn-contrast-700:var(--light-primary-text);--warn-800:#991b1b;--warn-rgb-800:153,27,27;--warn-contrast-800:var(--light-primary-text);--warn-900:#7f1d1d;--warn-rgb-900:127,29,29;--warn-contrast-900:var(--light-primary-text);--warn-950:#450a0a;--warn-rgb-950:69,10,10;--warn-contrast-950:var(--light-primary-text);--success-50:#ecfdf5;--success-rgb-50:236,253,245;--success-contrast-50:var(--dark-primary-text);--success-100:#d1fae5;--success-rgb-100:209,250,229;--success-contrast-100:var(--dark-primary-text);--success-200:#a7f3d0;--success-rgb-200:167,243,208;--success-contrast-200:var(--dark-primary-text);--success-300:#6ee7b7;--success-rgb-300:110,231,183;--success-contrast-300:var(--dark-primary-text);--success-400:#34d399;--success-rgb-400:52,211,153;--success-contrast-400:var(--light-primary-text);--success-500:#10b981;--success-rgb-500:16,185,129;--success-contrast-500:var(--light-primary-text);--success-600:#059669;--success-rgb-600:5,150,105;--success-contrast-600:var(--light-primary-text);--success-700:#047857;--success-rgb-700:4,120,87;--success-contrast-700:var(--light-primary-text);--success-800:#065f46;--success-rgb-800:6,95,70;--success-contrast-800:var(--light-primary-text);--success-900:#064e3b;--success-rgb-900:6,78,59;--success-contrast-900:var(--light-primary-text);--success-950:#022c22;--success-rgb-950:2,44,34;--success-contrast-950:var(--light-primary-text);--display-10:600 5rem / normal Inter Tight, sans-serif;--display-20:600 4.5rem / normal Inter Tight, sans-serif;--display-30:600 4rem / normal Inter Tight, sans-serif;--display-40:600 3.5rem / normal Inter Tight, sans-serif;--display-50:600 3rem / normal Inter Tight, sans-serif;--title-10:500 2.5rem / normal Inter Tight, sans-serif;--title-20:500 2rem / normal Inter Tight, sans-serif;--title-30:500 1.5rem / normal Inter Tight, sans-serif;--title-10B:600 2.5rem / normal Inter Tight, sans-serif;--title-20B:600 2rem / normal Inter Tight, sans-serif;--title-30B:600 1.5rem / normal Inter Tight, sans-serif;--paragraph-10:500 1.125rem / normal Inter Tight, sans-serif;--paragraph-20:500 1rem / normal Inter Tight, sans-serif;--paragraph-30:500 .875rem / normal Inter Tight, sans-serif;--paragraph-40:500 .75rem / normal Inter Tight, sans-serif;--paragraph-10B:600 1.125rem / normal Inter Tight, sans-serif;--paragraph-20B:600 1rem / normal Inter Tight, sans-serif;--paragraph-30B:600 .875rem / normal Inter Tight, sans-serif;--paragraph-40B:600 .75rem / normal Inter Tight, sans-serif;--shape-1:.25rem;--shape-2:.5rem;--shape-3:.75rem;--shape-4:1rem;--shape-5:1.25rem;--box-shadow-10:0 1px 2px 0 rgba(18, 18, 23, .07);--box-shadow-20:0 1px 3px 0 rgba(18, 18, 23, .1);--box-shadow-30:0 1px 4px -1px rgba(18, 18, 23, .08);--box-shadow-35:0 4px 6px -1px rgba(18, 18, 23, .08);--box-shadow-40:0 10px 15px -3px rgba(18, 18, 23, .08);--box-shadow-50:0 20px 25px -5px rgba(18, 18, 23, .1);--box-shadow-60:0 25px 50px -12px rgba(18, 18, 23, .25);--base-level-10:var(--sparkle-light, #fff) var(--sparkle-dark, var(--grey-950));--base-level-20:var(--sparkle-light, var(--grey-50)) var(--sparkle-dark, var(--grey-900));--base-level-30:var(--sparkle-light, var(--grey-100)) var(--sparkle-dark, var(--grey-900));--base-level-30R:var(--sparkle-light, var(--grey-900)) var(--sparkle-dark, var(--grey-100));--base-level-40:var(--sparkle-light, var(--grey-200)) var(--sparkle-dark, var(--grey-700));--base-level-50:var(--sparkle-light, var(--grey-300)) var(--sparkle-dark, var(--grey-800));--base-level-60:var(--sparkle-light, var(--grey-500)) var(--sparkle-dark, var(--grey-400));--base-level-60R:var(--sparkle-light, var(--grey-400)) var(--sparkle-dark, var(--grey-500));--base-level-70:var(--sparkle-light, var(--grey-900)) var(--sparkle-dark, #fff);--base-level-70R:var(--sparkle-light, #fff) var(--sparkle-dark, var(--grey-900));--base-gradient-20:linear-gradient(180deg, var(--grey-400) 0%, var(--grey-500) 50%);--base-gradient-30:linear-gradient(180deg, var(--grey-300) 0%, var(--grey-500) 50%);--base-gradient-60:linear-gradient(180deg, var(--grey-700) 0%, var(--grey-900) 50%);--base-gradient-70:linear-gradient(180deg, var(--grey-600) 0%, var(--grey-900) 50%);--primary-level-20:var(--sparkle-light, var(--primary-50)) var(--sparkle-dark, var(--primary-950));--primary-level-30:var(--sparkle-light, var(--primary-100)) var(--sparkle-dark, var(--primary-900));--primary-level-40:var(--sparkle-light, var(--primary-200)) var(--sparkle-dark, var(--primary-800));--primary-level-50:var(--sparkle-light, var(--primary-300)) var(--sparkle-dark, var(--primary-800));--primary-level-50R:var(--sparkle-light, var(--primary-800)) var(--sparkle-dark, var(--primary-300));--primary-level-80:var(--sparkle-light, var(--primary-900)) var(--sparkle-dark, var(--primary-300));--primary-gradient-20:linear-gradient(180deg, var(--primary-400) 0%, var(--primary-500) 50%);--primary-gradient-30:linear-gradient(180deg, var(--primary-300) 0%, var(--primary-500) 50%);--accent-level-20:var(--sparkle-light, var(--accent-50)) var(--sparkle-dark, var(--accent-950));--accent-level-30:var(--sparkle-light, var(--accent-100)) var(--sparkle-dark, var(--accent-900));--accent-level-40:var(--sparkle-light, var(--accent-200)) var(--sparkle-dark, var(--accent-800));--accent-level-50:var(--sparkle-light, var(--accent-300)) var(--sparkle-dark, var(--accent-800));--accent-level-50R:var(--sparkle-light, var(--accent-800)) var(--sparkle-dark, var(--accent-300));--accent-level-80:var(--sparkle-light, var(--accent-900)) var(--sparkle-dark, var(--accent-300));--accent-gradient-20:linear-gradient(180deg, var(--accent-400) 0%, var(--accent-500) 50%);--accent-gradient-30:linear-gradient(180deg, var(--accent-300) 0%, var(--accent-500) 50%);--tertiary-level-20:var(--sparkle-light, var(--tertiary-50)) var(--sparkle-dark, var(--tertiary-950));--tertiary-level-30:var(--sparkle-light, var(--tertiary-100)) var(--sparkle-dark, var(--tertiary-900));--tertiary-level-40:var(--sparkle-light, var(--tertiary-200)) var(--sparkle-dark, var(--tertiary-800));--tertiary-level-50:var(--sparkle-light, var(--tertiary-300)) var(--sparkle-dark, var(--tertiary-800));--tertiary-level-50R:var(--sparkle-light, var(--tertiary-800)) var(--sparkle-dark, var(--tertiary-300));--tertiary-level-80:var(--sparkle-light, var(--tertiary-900)) var(--sparkle-dark, var(--tertiary-300));--tertiary-gradient-20:linear-gradient(180deg, var(--tertiary-400) 0%, var(--tertiary-500) 50%);--tertiary-gradient-30:linear-gradient(180deg, var(--tertiary-300) 0%, var(--tertiary-500) 50%);--warn-level-20:var(--sparkle-light, var(--warn-50)) var(--sparkle-dark, var(--warn-950));--warn-level-30:var(--sparkle-light, var(--warn-100)) var(--sparkle-dark, var(--warn-900));--warn-level-40:var(--sparkle-light, var(--warn-200)) var(--sparkle-dark, var(--warn-800));--warn-level-50:var(--sparkle-light, var(--warn-300)) var(--sparkle-dark, var(--warn-800));--warn-level-50R:var(--sparkle-light, var(--warn-800)) var(--sparkle-dark, var(--warn-300));--warn-level-80:var(--sparkle-light, var(--warn-900)) var(--sparkle-dark, var(--warn-300));--warn-gradient-20:linear-gradient(180deg, var(--warn-400) 0%, var(--warn-500) 50%);--warn-gradient-30:linear-gradient(180deg, var(--warn-300) 0%, var(--warn-500) 50%);--success-level-20:var(--sparkle-light, var(--success-50)) var(--sparkle-dark, var(--success-950));--success-level-30:var(--sparkle-light, var(--success-100)) var(--sparkle-dark, var(--success-900));--success-level-40:var(--sparkle-light, var(--success-200)) var(--sparkle-dark, var(--success-800));--success-level-50:var(--sparkle-light, var(--success-300)) var(--sparkle-dark, var(--success-800));--success-level-50R:var(--sparkle-light, var(--success-800)) var(--sparkle-dark, var(--success-300));--success-level-80:var(--sparkle-light, var(--success-900)) var(--sparkle-dark, var(--success-300));--success-gradient-20:linear-gradient(180deg, var(--success-400) 0%, var(--success-500) 50%);--success-gradient-30:linear-gradient(180deg, var(--success-300) 0%, var(--success-500) 50%);--dark-primary-text:var(--grey-900);--light-primary-text:#fff}*{box-sizing:border-box}html,body,app-root{width:100vw;min-height:100vh;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-color:var(--base-level-20)}body{margin:0;font:var(--paragraph-30);color:var(--base-level-70)}</style><link rel="stylesheet" href="styles-EYLEETOZ.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-EYLEETOZ.css"></noscript></head>
21
21
  <body>
22
22
  <app-root></app-root>
23
- <link rel="modulepreload" href="chunk-4UKPKNC6.js"><link rel="modulepreload" href="chunk-AN53EBZI.js"><link rel="modulepreload" href="chunk-AM4UDAZB.js"><link rel="modulepreload" href="chunk-QX7KUJGE.js"><link rel="modulepreload" href="chunk-BX543SH4.js"><link rel="modulepreload" href="chunk-EYBBW4ID.js"><link rel="modulepreload" href="chunk-IGECPMHY.js"><link rel="modulepreload" href="chunk-L2WWHQPN.js"><link rel="modulepreload" href="chunk-PY26LA4W.js"><link rel="modulepreload" href="chunk-FKB7BVQE.js"><script src="main-QHMQQJS2.js" type="module"></script></body>
23
+ <link rel="modulepreload" href="chunk-4UKPKNC6.js"><link rel="modulepreload" href="chunk-AN53EBZI.js"><link rel="modulepreload" href="chunk-AM4UDAZB.js"><link rel="modulepreload" href="chunk-QX7KUJGE.js"><link rel="modulepreload" href="chunk-BX543SH4.js"><link rel="modulepreload" href="chunk-EYBBW4ID.js"><link rel="modulepreload" href="chunk-IGECPMHY.js"><link rel="modulepreload" href="chunk-L2WWHQPN.js"><link rel="modulepreload" href="chunk-PY26LA4W.js"><link rel="modulepreload" href="chunk-FKB7BVQE.js"><script src="main-RANS7OVF.js" type="module"></script></body>
24
24
  </html>
@@ -1 +1 @@
1
- import{a as R}from"./chunk-4UKPKNC6.js";import{a as k}from"./chunk-AN53EBZI.js";import{a as S}from"./chunk-AM4UDAZB.js";import{b as q}from"./chunk-QX7KUJGE.js";import"./chunk-BX543SH4.js";import{c as G}from"./chunk-EYBBW4ID.js";import{a as K,b as B,c as b,f as _,g as z}from"./chunk-IGECPMHY.js";import{a as $}from"./chunk-L2WWHQPN.js";import"./chunk-PY26LA4W.js";import{J as M,Mb as P,O as C,R as x,Ra as l,U as s,W as L,_b as j,d as E,ec as F,kb as V,m as N,uc as H,vc as D,x as O,xc as U,yc as J,zc as W}from"./chunk-FKB7BVQE.js";import"./chunk-7CGTOI24.js";var Z={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var m=new x("ENVIRONMENT");var Q=[{path:"",children:[{path:"login",canActivate:[()=>s(R).token()!==null?s(b).navigate(["/"]):!0],loadComponent:()=>import("./chunk-3KWRGL6H.js")},{path:"logout",loadComponent:()=>import("./chunk-YPNP3GF5.js")},{path:"",loadComponent:()=>import("./chunk-ZNDBPUVN.js"),children:[{path:"",loadComponent:()=>import("./chunk-WIIXITKP.js")},{path:"add-backup",loadComponent:()=>import("./chunk-YV6J6EAD.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-NQ2MPIB6.js")},{path:"backup/import",loadComponent:()=>import("./chunk-CTPVCKDU.js")},{path:"backup-draft/:id",canActivate:[()=>s(k).sysInfoObservable()],loadComponent:()=>import("./chunk-FCPLQRRC.js"),loadChildren:()=>import("./chunk-5L4ZOFYT.js")},{path:"backup/:id",canActivateChild:[()=>s(k).sysInfoObservable()],loadComponent:()=>import("./chunk-FCPLQRRC.js"),loadChildren:()=>import("./chunk-5L4ZOFYT.js")},{path:"restore",loadComponent:()=>import("./chunk-LI2AEH4X.js")},{path:"restore-flow/:id",loadComponent:()=>import("./chunk-RODVNO2L.js"),children:[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"select-files",loadComponent:()=>import("./chunk-WNQNTT5I.js")},{path:"options",loadComponent:()=>import("./chunk-6T7HOYTW.js")}]},{path:"settings",loadComponent:()=>import("./chunk-ZYFED5UB.js")},{path:"about",loadComponent:()=>import("./chunk-IPONHS64.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-VLWUJXM4.js")},{path:"changelog",loadComponent:()=>import("./chunk-RIQNVCIL.js")},{path:"libraries",loadComponent:()=>import("./chunk-2VM3Z6G6.js")},{path:"system-info",loadComponent:()=>import("./chunk-CZTXCP6Y.js")},{path:"logs",loadComponent:()=>import("./chunk-DFNMN5CZ.js")}]}]}]}];var g=0,X=(o,e)=>{let t=s(R),r=s(b),c=s(m),i=s(G),p=o;return t.tokenSetTime()&&Date.now()-t.tokenSetTime()>15*60*1e3&&g<1?(g++,t.refreshToken().pipe(M(n=>(p=o.clone({headers:o.headers.set("Authorization",`Bearer ${n.AccessToken}`)}),e(p))))):(t.token()&&o.url.startsWith(c.baseUrl)&&(p=o.clone({headers:o.headers.set("Authorization",`Bearer ${t.token()}`)})),e(p).pipe(O(n=>{if(i.error(n.message),n.status===401&&g<1)return g++,t.refreshToken().pipe(M(()=>e(o.clone({headers:o.headers.set("Authorization",`Bearer ${t.token()}`)}))));n.status===401&&(r.navigate(["/logout"]),g=0);let a=`Error Code: ${n.status}, Message: ${n.message}`;return N(()=>a)})))};var ne="1.0.0",Y="portal-proxy-client",re=1,w=class o{#o=1e3;#n=s(m);#e=l("disconnected");#l=l(this.#o);#i=l(!1);#r=l(!1);#a=l(null);isConnectedToMachineServer=this.#r.asReadonly();wsState=this.#e.asReadonly();#c=[];#s={};#t=null;#m=new TextDecoder("utf-8");#p=null;#d=F(()=>{let e=this.#i(),t=this.#l(),r=this.#a();if(!r||!e||!t||t<this.#o){this.#p&&window.clearInterval(this.#p);return}this.#p=window.setInterval(()=>{this.connectToMachineServer(r)},t)});utf8Atob(e){let t=Uint8Array.from(atob(e),c=>c.charCodeAt(0)),r=this.#m.decode(t);return r?JSON.parse(r):null}connectToMachineServer(e,t){let r=t?.reconnect??!1;this.#t&&this.wsState()==="authenticated"&&!r||(this.#t&&this.wsState()!=="authenticated"&&this.#t.close(),this.#t=new WebSocket(this.#n.machineServerUrl),this.#t.onopen=()=>{this.#e.set("connect"),this.#r.set(!0),this.#i.set(!1),this.#a.set(null)},this.#t.onclose=()=>{this.#e.set("disconnected"),this.#r.set(!1),this.#a.set(e),this.#i.set(!0)},this.#t.onerror=()=>{this.#e.set("error")},this.#t.onmessage=c=>{let i=JSON.parse(c.data);if(this.wsState()==="connect"){if(i.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${i.type}'`);return}let n={token:e,publicKey:"",clientVersion:ne,protocolVersion:re},a=this.createResponse(i,"authportal",n);this.#e.set("welcome"),this.#t?.send(a)}else if(this.wsState()==="welcome"){if(i.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${i.type}'`);return}var p=JSON.parse(i.payload??"");if(p.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#e.set("authenticated"),this.#r.set(!0);this.#c.length>0;){let n=this.#c.pop();n&&this.#s[n.messageId]&&this.activateCommand(n)}}else if(this.wsState()==="authenticated"){if(i.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${i.type}'`);return}let n=this.#s[i.messageId];if(n){if(i.errorMessage){n.reject(i.errorMessage);return}else{let a=JSON.parse(i.payload??"");a.body=a?.body==null?null:this.utf8Atob(a.body),n.resolve(a)}delete this.#s[i.messageId],window.clearTimeout(n.timer)}}})}disconnectFromMachineServer(e=null){e&&console.error(e),this.#t?.close(),this.#t=null,this.#e.set("disconnected"),this.#r.set(!1)}createResponse(e,t,r){let c={from:Y,to:e.from,type:t,messageId:e.messageId,payload:JSON.stringify(r)};return JSON.stringify(c)}sendCommand(e,t,r,c,i,p,n=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(e),new Promise((a,I)=>{let d=crypto.randomUUID(),f={from:Y,to:t,type:"command",messageId:d,payload:JSON.stringify({method:r,path:c,body:i,headers:p})},y={resolve:a,reject:I,timer:window.setTimeout(()=>{let v=this.#s[d];v&&(delete this.#s[d],v.reject("Timeout"))},n)};this.#s[d]=y,this.#r()?this.activateCommand(f):this.#c.push(f)})}activateCommand(e){this.#t?.send(JSON.stringify(e))}static \u0275fac=function(t){return new(t||o)};static \u0275prov=C({token:o,factory:o.\u0275fac,providedIn:"root"})};var u=class o{#o=l(null);config=this.#o.asReadonly();parentIframeListner=null;parentOrigin="*";fetchConfig(){this.#e(),this.parentIframeListner=new AbortController,this.#n("connected"),window.addEventListener("message",e=>{if(e.data.startsWith("access:")){let t=e.data.replace("access:",""),r=JSON.parse(t);if(!r?.accessToken||!r?.clientId){this.#n("error:invalid-config");return}if(typeof r.clientId!="string"){this.#n("error:invalid-config");return}if(typeof r.accessToken!="string"){this.#n("error:invalid-config");return}console.info("postMessage config set"),this.#o.set(r)}},{signal:this.parentIframeListner.signal})}#n(e){window.parent.postMessage(e,"*")}#e(){this.parentIframeListner&&(this.parentIframeListner.abort(),this.parentIframeListner=null)}setConfig(e){this.#o.set(e)}clearConfig(){this.#o.set(null)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=C({token:o,factory:o.\u0275fac,providedIn:"root"})};function se(o){if(typeof o!="string")return null;let t=new TextEncoder().encode(o);return window.btoa(String.fromCharCode(...t))}var te=(o,e)=>{let r=s(u).config(),c=s(m);if(r===null)return e(o);let i=s(w),p=se(o.body),n={};o.headers.keys().forEach(h=>{n[h]=o.headers.get(h)??""});let a=o.headers.get("timeout"),I=a!==null?parseInt(a):c.defaultTimeout,d=i.sendCommand(r.accessToken,r.clientId,o.method,o.url,p,n,I);return new E(h=>{d.then(f=>{let y=new H;n!=null&&Object.keys(n).forEach(A=>{y.set(A,n[A])});let v=new D({body:f.body,status:f.code,statusText:"OK",headers:y});h.next(v),h.complete()})})};var oe={providers:[j(),_(Q,z()),U(W(),J([te,X])),S,{provide:m,useValue:Z},q]};var T=class o{#o=s(S);#n=s(K);#e=s(u);sub=null;ngOnInit(){this.#e.fetchConfig(),this.sub=this.#n.queryParams.subscribe(({accessToken:e,clientId:t})=>{e?.length&&t?.length&&this.#e.setConfig({accessToken:e,clientId:t})}),this.#o.clearAllNotCurrentVersion()}ngOnDestroy(){this.sub?.unsubscribe()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=L({type:o,selectors:[["app-root"]],standalone:!0,features:[P],decls:1,vars:0,template:function(t,r){t&1&&V(0,"router-outlet")},dependencies:[B],encapsulation:2})};$(T,oe).catch(o=>console.error(o));
1
+ import{a as R}from"./chunk-4UKPKNC6.js";import{a as k}from"./chunk-AN53EBZI.js";import{a as S}from"./chunk-AM4UDAZB.js";import{b as q}from"./chunk-QX7KUJGE.js";import"./chunk-BX543SH4.js";import{c as G}from"./chunk-EYBBW4ID.js";import{a as K,b as B,c as b,f as _,g as z}from"./chunk-IGECPMHY.js";import{a as $}from"./chunk-L2WWHQPN.js";import"./chunk-PY26LA4W.js";import{J as M,Mb as P,O as C,R as x,Ra as l,U as s,W as L,_b as j,d as E,ec as F,kb as V,m as N,uc as H,vc as D,x as O,xc as U,yc as J,zc as W}from"./chunk-FKB7BVQE.js";import"./chunk-7CGTOI24.js";var Z={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var m=new x("ENVIRONMENT");var Q=[{path:"",children:[{path:"login",canActivate:[()=>s(R).token()!==null?s(b).navigate(["/"]):!0],loadComponent:()=>import("./chunk-3KWRGL6H.js")},{path:"logout",loadComponent:()=>import("./chunk-YPNP3GF5.js")},{path:"",loadComponent:()=>import("./chunk-ZNDBPUVN.js"),children:[{path:"",loadComponent:()=>import("./chunk-6DRN2RKF.js")},{path:"add-backup",loadComponent:()=>import("./chunk-V2UAC7MF.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-NQ2MPIB6.js")},{path:"backup/import",loadComponent:()=>import("./chunk-CTPVCKDU.js")},{path:"backup-draft/:id",canActivate:[()=>s(k).sysInfoObservable()],loadComponent:()=>import("./chunk-BD2SAUIV.js"),loadChildren:()=>import("./chunk-5L4ZOFYT.js")},{path:"backup/:id",canActivateChild:[()=>s(k).sysInfoObservable()],loadComponent:()=>import("./chunk-BD2SAUIV.js"),loadChildren:()=>import("./chunk-5L4ZOFYT.js")},{path:"restore",loadComponent:()=>import("./chunk-VIVSHAAZ.js")},{path:"restore-flow/:id",loadComponent:()=>import("./chunk-RODVNO2L.js"),children:[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"select-files",loadComponent:()=>import("./chunk-WNQNTT5I.js")},{path:"options",loadComponent:()=>import("./chunk-6T7HOYTW.js")}]},{path:"settings",loadComponent:()=>import("./chunk-OUSJF6ZB.js")},{path:"about",loadComponent:()=>import("./chunk-IPONHS64.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-VLWUJXM4.js")},{path:"changelog",loadComponent:()=>import("./chunk-RIQNVCIL.js")},{path:"libraries",loadComponent:()=>import("./chunk-2VM3Z6G6.js")},{path:"system-info",loadComponent:()=>import("./chunk-CZTXCP6Y.js")},{path:"logs",loadComponent:()=>import("./chunk-DFNMN5CZ.js")}]}]}]}];var g=0,X=(o,e)=>{let t=s(R),r=s(b),c=s(m),i=s(G),p=o;return t.tokenSetTime()&&Date.now()-t.tokenSetTime()>15*60*1e3&&g<1?(g++,t.refreshToken().pipe(M(n=>(p=o.clone({headers:o.headers.set("Authorization",`Bearer ${n.AccessToken}`)}),e(p))))):(t.token()&&o.url.startsWith(c.baseUrl)&&(p=o.clone({headers:o.headers.set("Authorization",`Bearer ${t.token()}`)})),e(p).pipe(O(n=>{if(i.error(n.message),n.status===401&&g<1)return g++,t.refreshToken().pipe(M(()=>e(o.clone({headers:o.headers.set("Authorization",`Bearer ${t.token()}`)}))));n.status===401&&(r.navigate(["/logout"]),g=0);let a=`Error Code: ${n.status}, Message: ${n.message}`;return N(()=>a)})))};var ne="1.0.0",Y="portal-proxy-client",re=1,w=class o{#o=1e3;#n=s(m);#e=l("disconnected");#l=l(this.#o);#i=l(!1);#r=l(!1);#a=l(null);isConnectedToMachineServer=this.#r.asReadonly();wsState=this.#e.asReadonly();#c=[];#s={};#t=null;#m=new TextDecoder("utf-8");#p=null;#d=F(()=>{let e=this.#i(),t=this.#l(),r=this.#a();if(!r||!e||!t||t<this.#o){this.#p&&window.clearInterval(this.#p);return}this.#p=window.setInterval(()=>{this.connectToMachineServer(r)},t)});utf8Atob(e){let t=Uint8Array.from(atob(e),c=>c.charCodeAt(0)),r=this.#m.decode(t);return r?JSON.parse(r):null}connectToMachineServer(e,t){let r=t?.reconnect??!1;this.#t&&this.wsState()==="authenticated"&&!r||(this.#t&&this.wsState()!=="authenticated"&&this.#t.close(),this.#t=new WebSocket(this.#n.machineServerUrl),this.#t.onopen=()=>{this.#e.set("connect"),this.#r.set(!0),this.#i.set(!1),this.#a.set(null)},this.#t.onclose=()=>{this.#e.set("disconnected"),this.#r.set(!1),this.#a.set(e),this.#i.set(!0)},this.#t.onerror=()=>{this.#e.set("error")},this.#t.onmessage=c=>{let i=JSON.parse(c.data);if(this.wsState()==="connect"){if(i.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${i.type}'`);return}let n={token:e,publicKey:"",clientVersion:ne,protocolVersion:re},a=this.createResponse(i,"authportal",n);this.#e.set("welcome"),this.#t?.send(a)}else if(this.wsState()==="welcome"){if(i.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${i.type}'`);return}var p=JSON.parse(i.payload??"");if(p.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#e.set("authenticated"),this.#r.set(!0);this.#c.length>0;){let n=this.#c.pop();n&&this.#s[n.messageId]&&this.activateCommand(n)}}else if(this.wsState()==="authenticated"){if(i.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${i.type}'`);return}let n=this.#s[i.messageId];if(n){if(i.errorMessage){n.reject(i.errorMessage);return}else{let a=JSON.parse(i.payload??"");a.body=a?.body==null?null:this.utf8Atob(a.body),n.resolve(a)}delete this.#s[i.messageId],window.clearTimeout(n.timer)}}})}disconnectFromMachineServer(e=null){e&&console.error(e),this.#t?.close(),this.#t=null,this.#e.set("disconnected"),this.#r.set(!1)}createResponse(e,t,r){let c={from:Y,to:e.from,type:t,messageId:e.messageId,payload:JSON.stringify(r)};return JSON.stringify(c)}sendCommand(e,t,r,c,i,p,n=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(e),new Promise((a,I)=>{let d=crypto.randomUUID(),f={from:Y,to:t,type:"command",messageId:d,payload:JSON.stringify({method:r,path:c,body:i,headers:p})},y={resolve:a,reject:I,timer:window.setTimeout(()=>{let v=this.#s[d];v&&(delete this.#s[d],v.reject("Timeout"))},n)};this.#s[d]=y,this.#r()?this.activateCommand(f):this.#c.push(f)})}activateCommand(e){this.#t?.send(JSON.stringify(e))}static \u0275fac=function(t){return new(t||o)};static \u0275prov=C({token:o,factory:o.\u0275fac,providedIn:"root"})};var u=class o{#o=l(null);config=this.#o.asReadonly();parentIframeListner=null;parentOrigin="*";fetchConfig(){this.#e(),this.parentIframeListner=new AbortController,this.#n("connected"),window.addEventListener("message",e=>{if(e.data.startsWith("access:")){let t=e.data.replace("access:",""),r=JSON.parse(t);if(!r?.accessToken||!r?.clientId){this.#n("error:invalid-config");return}if(typeof r.clientId!="string"){this.#n("error:invalid-config");return}if(typeof r.accessToken!="string"){this.#n("error:invalid-config");return}console.info("postMessage config set"),this.#o.set(r)}},{signal:this.parentIframeListner.signal})}#n(e){window.parent.postMessage(e,"*")}#e(){this.parentIframeListner&&(this.parentIframeListner.abort(),this.parentIframeListner=null)}setConfig(e){this.#o.set(e)}clearConfig(){this.#o.set(null)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=C({token:o,factory:o.\u0275fac,providedIn:"root"})};function se(o){if(typeof o!="string")return null;let t=new TextEncoder().encode(o);return window.btoa(String.fromCharCode(...t))}var te=(o,e)=>{let r=s(u).config(),c=s(m);if(r===null)return e(o);let i=s(w),p=se(o.body),n={};o.headers.keys().forEach(h=>{n[h]=o.headers.get(h)??""});let a=o.headers.get("timeout"),I=a!==null?parseInt(a):c.defaultTimeout,d=i.sendCommand(r.accessToken,r.clientId,o.method,o.url,p,n,I);return new E(h=>{d.then(f=>{let y=new H;n!=null&&Object.keys(n).forEach(A=>{y.set(A,n[A])});let v=new D({body:f.body,status:f.code,statusText:"OK",headers:y});h.next(v),h.complete()})})};var oe={providers:[j(),_(Q,z()),U(W(),J([te,X])),S,{provide:m,useValue:Z},q]};var T=class o{#o=s(S);#n=s(K);#e=s(u);sub=null;ngOnInit(){this.#e.fetchConfig(),this.sub=this.#n.queryParams.subscribe(({accessToken:e,clientId:t})=>{e?.length&&t?.length&&this.#e.setConfig({accessToken:e,clientId:t})}),this.#o.clearAllNotCurrentVersion()}ngOnDestroy(){this.sub?.unsubscribe()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=L({type:o,selectors:[["app-root"]],standalone:!0,features:[P],decls:1,vars:0,template:function(t,r){t&1&&V(0,"router-outlet")},dependencies:[B],encapsulation:2})};$(T,oe).catch(o=>console.error(o));
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.16",
2
+ "version": "0.0.17",
3
3
  "name": "@duplicati/ngclient",
4
4
  "license": "MIT",
5
5
  "contributors": [
package/chunk-MMEIXMDW.js DELETED
@@ -1 +0,0 @@
1
- import{a as N}from"./chunk-QX7KUJGE.js";import{a as M}from"./chunk-GSP4D4JM.js";import{l as L}from"./chunk-EYBBW4ID.js";import{a as V,b as O}from"./chunk-PY26LA4W.js";import{$a as p,D as h,Db as m,Gb as b,J as I,La as l,Mb as A,O as C,Ra as i,Rb as E,Sb as R,U as r,W as _,Z as x,Za as T,cc as d,eb as w,ec as P,ib as o,jb as u,kb as c,l as B,p as D,qb as v}from"./chunk-FKB7BVQE.js";import{a as k,b as S}from"./chunk-7CGTOI24.js";var f=class a{#t=r(N);transform(e,...t){return this.#t(e).fromNow()}static \u0275fac=function(t){return new(t||a)};static \u0275pipe=x({name:"appRelativeTime",type:a,pure:!0,standalone:!0})};var g=class a{#t=1e3;#d=r(O);#o=r(V);#n=r(M);#e=i(!1);#i=i(!1);#u=i(this.#t);#p=i(null);#r=i(!1);#s=i(!1);#a=i(null);#f=i(!1);statusData=this.#p.asReadonly();serverState=d(()=>{let e=this.#a();return e?(e.ProposedSchedule=e?.ProposedSchedule?.map(t=>{let s=t.Item1?this.#n.getBackupById(t.Item1):null;return S(k({},t),{backup:s})}),e):null});isFetching=this.#i.asReadonly();#l=null;#g=P(()=>{let e=this.#e(),t=this.#u();if(!e||!t||t<this.#t){this.#l&&window.clearInterval(this.#l);return}this.#l=window.setInterval(()=>{this.#m()},t)});start(){this.#r.set(!0),this.#c()}stop(){this.#r.set(!1)}startPollingProgress(){this.#m(),this.#e.set(!0)}stopPollingProgress(){this.#e.set(!1)}setProgressStatePollingInterval(e){if(e<this.#t){console.error(`Polling interval must be at least ${this.#t}ms`);return}this.#u.set(e)}serverStateEffect=P(()=>{if(this.#f()){this.stopPollingProgress();return}!this.#s()&&this.#r()?setTimeout(()=>{this.startPollingProgress(),this.#c()},1e3):this.stopPollingProgress()},{allowSignalWrites:!0});#c(){if(this.#s())return;this.#s.set(!0);let e=this.#a()?.LastEventID,t=e==null?{}:{lastEventId:e,longpoll:!0,duration:"299s"};this.#o.getApiV1Serverstate(t).pipe(h(()=>this.#s.set(!1))).subscribe({next:s=>{this.#a()?.LastDataUpdateID!==s.LastDataUpdateID&&this.#n.getBackups(),this.#a.set(s)}})}#m(){this.#i.set(!0),this.#d.getApiV1Progressstate().pipe(I(e=>{let t=e.TaskID??null;return t===null?B(e):this.#o.getApiV1TaskByTaskid({taskid:t}).pipe(D(s=>S(k({},e),{task:s??null})))}),h(()=>this.#i.set(!1))).subscribe({next:e=>{let t=e.TaskID??null,s=e.BackupID??null;if(t!==null&&s!==null){let n=this.#n.getBackupById(s);e.backup=n}e.task?.Status==="Completed"?this.#e.set(!1):this.#e.set(!0),this.#p.set(e)},error:e=>{e.status===404&&this.#e.set(!1)}})}static \u0275fac=function(t){return new(t||a)};static \u0275prov=C({token:a,factory:a.\u0275fac,providedIn:"root"})};function G(a,e){if(a&1&&(o(0,"div",2),m(1),u(),c(2,"spk-progress-bar",3)),a&2){let t,s,n=v();l(),b("",(t=n.statusData())==null||t.task==null?null:t.task.Status," - ",(t=n.statusData())==null||t.backup==null||t.backup.Backup==null?null:t.backup.Backup.Name,""),l(),p("value",(s=n.statusData())!=null&&s.OverallProgress?((s=n.statusData())==null?null:s.OverallProgress)*100:3)}}function F(a,e){if(a&1&&(o(0,"div",2),m(1),E(2,"appRelativeTime"),u(),c(3,"spk-progress-bar",4)),a&2){let t,s=v();l(),b("",(t=s.nextBackup().backup)==null||t.Backup==null?null:t.Backup.Name," - ",R(2,3,s.nextBackup().time),""),l(2),p("value",3)}}function J(a,e){a&1&&(o(0,"div",2),m(1,"No scheduled tasks"),u(),c(2,"spk-progress-bar",4)),a&2&&(l(2),p("value",3))}function U(a,e){a&1&&(o(0,"div",2),m(1,"Loading..."),u(),c(2,"spk-progress-bar",4)),a&2&&(l(2),p("value",3))}var y=class a{#t=r(g);statusData=this.#t.statusData;serverState=this.#t.serverState;nextBackup=d(()=>({backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}));ngOnInit(){this.#t.start()}ngOnDestroy(){this.#t.stop()}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=_({type:a,selectors:[["app-status-bar"]],standalone:!0,features:[A],decls:6,vars:1,consts:[[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"raised","primary",3,"value"],[1,"raised",3,"value"]],template:function(t,s){if(t&1&&(o(0,"div",0)(1,"div",1),T(2,G,3,3)(3,F,4,5)(4,J,3,1)(5,U,3,1),u()()),t&2){let n;l(2),w(!((n=s.statusData())==null||n.task==null)&&n.task.Status&&((n=s.statusData())==null||n.task==null?null:n.task.Status)!=="Completed"?2:s.nextBackup()?3:!s.statusData()||((n=s.statusData())==null||n.task==null?null:n.task.Status)==="Completed"?4:5)}},dependencies:[L,f],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--base-level-40)}.current-backup[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{y as a};