@duplicati/ngclient 0.0.142 → 0.0.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunk-2NU5Y4V7.js +1 -0
- package/{chunk-LIJJPCCP.js → chunk-36RDZAZ4.js} +1 -1
- package/{chunk-JB75BUPF.js → chunk-3UN32GIC.js} +1 -1
- package/{chunk-Z2U5JI53.js → chunk-5AENPWCF.js} +1 -1
- package/{chunk-GFSWKDRL.js → chunk-5PSLWJTF.js} +1 -1
- package/{chunk-OWAZS6AA.js → chunk-66BSPEOQ.js} +1 -1
- package/chunk-6BCYG4Y6.js +1 -0
- package/{chunk-3L3SGYRX.js → chunk-6GC5VKTI.js} +1 -1
- package/{chunk-UBFQDZB5.js → chunk-6WWCFRZ5.js} +1 -1
- package/{chunk-65QCOV7I.js → chunk-6XBSQDXR.js} +1 -1
- package/{chunk-PEWNHZLZ.js → chunk-7X7K5IXS.js} +1 -1
- package/chunk-AB2L3URR.js +1 -0
- package/{chunk-O2RJYKE4.js → chunk-AO4O42CM.js} +1 -1
- package/{chunk-DUKSWBLV.js → chunk-ARXKB7WH.js} +1 -1
- package/{chunk-PWV3UKIW.js → chunk-BGUKMOKY.js} +1 -1
- package/{chunk-VMNRHHVY.js → chunk-BIETD4DI.js} +1 -1
- package/{chunk-JA5QSJM3.js → chunk-BSP6AKSZ.js} +1 -1
- package/{chunk-3BODZQHK.js → chunk-BXRW2LGW.js} +1 -1
- package/{chunk-QIQH4ASK.js → chunk-CFNP4FBG.js} +1 -1
- package/{chunk-ZTHT3VVI.js → chunk-CTEFMU6N.js} +1 -1
- package/chunk-ETCRT3EV.js +1 -0
- package/{chunk-WEAHBXR2.js → chunk-FFY3NRCC.js} +1 -1
- package/{chunk-ERIXY2FW.js → chunk-GDWLKG6V.js} +1 -1
- package/{chunk-HBKQWKW7.js → chunk-GHFYBZHQ.js} +1 -1
- package/{chunk-X5ISYEI2.js → chunk-GO22DJ44.js} +1 -1
- package/{chunk-SWLG7DS7.js → chunk-HBTRQAXQ.js} +1 -1
- package/{chunk-GXARFIQG.js → chunk-HDQRG3ZZ.js} +1 -1
- package/chunk-HKZX6OB5.js +1 -0
- package/{chunk-2G6UXMJB.js → chunk-IGOZJJE3.js} +1 -1
- package/{chunk-C32RWSXV.js → chunk-J2MHNGNQ.js} +1 -1
- package/{chunk-QM6X5ZEC.js → chunk-J3BBLPAD.js} +1 -1
- package/{chunk-BMYQZKPC.js → chunk-J5PSMGKZ.js} +1 -1
- package/{chunk-QC2NBFUR.js → chunk-JA7OQSO3.js} +1 -1
- package/{chunk-EDW3WHAP.js → chunk-JIHMT35A.js} +1 -1
- package/{chunk-UV3WAAEX.js → chunk-K3ZQ67VT.js} +1 -1
- package/{chunk-QD2VHHZY.js → chunk-KGJAK6OP.js} +1 -1
- package/{chunk-LAUG2PZW.js → chunk-KUPXKQHP.js} +1 -1
- package/chunk-LSVMEMXJ.js +1 -0
- package/{chunk-OAW2NFZX.js → chunk-M2RYJ73O.js} +1 -1
- package/{chunk-X6QMUQPK.js → chunk-MBBEXLIJ.js} +1 -1
- package/{chunk-PHIECUWX.js → chunk-NTA2CULM.js} +1 -1
- package/chunk-ODVCGM2O.js +1 -0
- package/{chunk-PMZGBC4U.js → chunk-OTMW34HV.js} +1 -1
- package/{chunk-P2DII6CV.js → chunk-OXOOR7I4.js} +1 -1
- package/{chunk-V7UTQSCX.js → chunk-PT7UQJD4.js} +1 -1
- package/chunk-QNOIURSX.js +1 -0
- package/{chunk-BVEALUGN.js → chunk-QY6E755W.js} +1 -1
- package/{chunk-CNUHBPET.js → chunk-SCOG2I64.js} +1 -1
- package/{chunk-OBJPWKDY.js → chunk-TJOWPBPB.js} +1 -1
- package/{chunk-UCZV35IF.js → chunk-UT6XGEMV.js} +1 -1
- package/chunk-UUODEERG.js +1 -0
- package/{chunk-OICFVPYU.js → chunk-UW4GBMEP.js} +1 -1
- package/{chunk-VC6TE2B6.js → chunk-WWFNG47J.js} +1 -1
- package/{chunk-PJBVFTZK.js → chunk-WZ23D2R7.js} +1 -1
- package/{chunk-ZGU7OKMF.js → chunk-X3IA226Q.js} +1 -1
- package/{chunk-TAPLSJ2K.js → chunk-XHUUCB2W.js} +1 -1
- package/{chunk-LT2T7TXS.js → chunk-XLE2TW65.js} +1 -1
- package/{chunk-5SPGCYAQ.js → chunk-XNVRJH42.js} +1 -1
- package/{chunk-YIV6PKM7.js → chunk-XQ4CAUD4.js} +1 -1
- package/{chunk-7765XHNC.js → chunk-YHNIGBHB.js} +1 -1
- package/{chunk-47WDRGVN.js → chunk-ZGAC2JKG.js} +1 -1
- package/index.html +1 -1
- package/locale/messages.cs.json +1 -0
- package/locale/messages.da.json +3 -20
- package/locale/messages.de.json +126 -104
- package/locale/messages.en_GB.json +1 -0
- package/locale/messages.es.json +1 -0
- package/locale/messages.fi.json +1 -0
- package/locale/messages.fr.json +1 -0
- package/locale/messages.hu.json +1 -0
- package/locale/messages.it.json +144 -112
- package/locale/messages.ja_JP.json +1 -0
- package/locale/messages.nl_NL.json +7 -106
- package/locale/messages.pl.json +29 -0
- package/locale/messages.pt.json +1 -0
- package/locale/messages.pt_BR.json +1 -0
- package/locale/messages.ru.json +1 -0
- package/locale/messages.sr_RS.json +1 -0
- package/locale/messages.sv_SE.json +1 -0
- package/locale/messages.zh-Hans.json +3 -97
- package/locale/messages.zh_CN.json +1 -88
- package/locale/messages.zh_TW.json +2 -0
- package/main-SFGPSKNZ.js +1 -0
- package/package.json +1 -1
- package/chunk-4URGDROZ.js +0 -1
- package/chunk-5DO6JZVF.js +0 -1
- package/chunk-5OIM6PRU.js +0 -1
- package/chunk-5SH42EY6.js +0 -1
- package/chunk-ATYS35R4.js +0 -1
- package/chunk-E6UP7FUD.js +0 -1
- package/chunk-JF4IGUR6.js +0 -1
- package/chunk-R3OYJX7V.js +0 -1
- package/chunk-YCTTQQ6B.js +0 -1
- package/main-TVE62AWE.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as R}from"./chunk-
|
|
1
|
+
import{a as R}from"./chunk-WWFNG47J.js";import{b}from"./chunk-QGFC5ZUR.js";import"./chunk-XNVRJH42.js";import"./chunk-3UN32GIC.js";import"./chunk-OXOOR7I4.js";import"./chunk-GUH5TMOS.js";import"./chunk-RHW5QVAY.js";import"./chunk-66BSPEOQ.js";import"./chunk-CWBEE627.js";import"./chunk-USU2EHJV.js";import"./chunk-ZGAC2JKG.js";import"./chunk-ETCRT3EV.js";import{b as N,e as B}from"./chunk-L2EO4M4B.js";import"./chunk-4YL5DZVH.js";import{a as A,g as O}from"./chunk-WRNQOX5R.js";import{h}from"./chunk-J3BBLPAD.js";import"./chunk-B5FUQFEQ.js";import"./chunk-WJPLJKPQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-73RDJP55.js";import{Ab as F,Bb as a,Cb as _,Oc as M,Qb as c,Ra as i,Rb as d,Sb as l,Vb as T,Wb as I,_ as D,bb as f,lc as E,nc as L,oa as r,ub as s,vb as u,wb as g,xb as S,yb as p}from"./chunk-QDFCX6XE.js";import"./chunk-EUDKD2JW.js";function $(e,t){e&1&&l(0,2,1)}function k(e,t){e&1&&l(0,2,2)}function P(e,t){e&1&&l(0,2,3)}function v(e,t){e&1&&l(0,2,4)}function U(e,t){if(e&1&&(E(0),_(1,"br")),e&2){let n=t.$implicit;L(" ",n," ")}}var C=class e{#t=D(h);#e=D(N);#n=b(this.#e.params);runId=M(()=>this.#n()?.runId);offset=r(0);status=r("starting");messageLog=r([]);interval=setInterval(()=>{this.#t.getApiV1CommandlineByRunid({runid:this.runId(),offset:this.offset(),pagesize:100}).subscribe(t=>{this.offset.set(t.Count),this.evalStatus(t),this.messageLog.update(n=>[...n,...t.Items])})},1e3);evalStatus(t){t.Started===!0&&t.Finished===!0&&(this.status.set("finished"),clearInterval(this.interval)),t.Started===!0&&t.Finished===!1&&this.status.set("started")}abort(){this.#t.postApiV1CommandlineByRunidAbort({runid:this.runId()}).subscribe({next:t=>{this.status.set("aborted"),clearInterval(this.interval)}})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=f({type:e,selectors:[["app-commandline-result"]],decls:18,vars:4,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;n=$localize` Running commandline task... ${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON:Abort${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_BUTTON:`;let o;return o=$localize`${"\uFFFD*11:1\uFFFD"}:START_BLOCK_IF: Starting... ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*12:2\uFFFD"}:START_BLOCK_IF_1: Started! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*13:3\uFFFD"}:START_BLOCK_IF_2: Finished! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*14:4\uFFFD"}:START_BLOCK_IF_3: Aborted! ${"[\uFFFD/*11:1\uFFFD|\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD|\uFFFD/*14:4\uFFFD]"}:CLOSE_BLOCK_IF:`,o=T(o),[t,n,o,[1,"back"],["type","button","shButton","","routerLink","../",1,"small"],["type","button","shButton","",1,"small",3,"click"],[1,"status"]]},template:function(n,o){n&1&&(_(0,"app-status-bar"),F(1,"section")(2,"div",3)(3,"button",4),c(4,0),_(5,"sh-icon"),d(),a()(),F(6,"h3"),c(7,1),F(8,"button",5),I("click",function(){return o.abort()}),a(),d(),a(),F(9,"div",6),c(10,2),s(11,$,1,0),s(12,k,1,0),s(13,P,1,0),s(14,v,1,0),d(),a(),F(15,"code"),S(16,U,2,1,null,null,g),a()()),n&2&&(i(11),u(o.status()==="starting"?11:-1),i(),u(o.status()==="started"?12:-1),i(),u(o.status()==="finished"?13:-1),i(),u(o.status()==="aborted"?14:-1),i(2),p(o.messageLog()))},dependencies:[R,A,O,B],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;padding:2.5rem;gap:1.25rem}code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}"],changeDetection:0})};export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-TJOWPBPB.js";import"./chunk-K3ZQ67VT.js";import"./chunk-CZLLEVMJ.js";import"./chunk-QY6E755W.js";import"./chunk-UACX27D3.js";import"./chunk-QGFC5ZUR.js";import"./chunk-OXOOR7I4.js";import"./chunk-GUH5TMOS.js";import"./chunk-66BSPEOQ.js";import"./chunk-CWBEE627.js";import"./chunk-USU2EHJV.js";import"./chunk-ETCRT3EV.js";import"./chunk-L2EO4M4B.js";import"./chunk-4YL5DZVH.js";import"./chunk-WRNQOX5R.js";import"./chunk-J3BBLPAD.js";import"./chunk-WJPLJKPQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-QDFCX6XE.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreOptionsForm,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ie}from"./chunk-GUH5TMOS.js";import{a as Re}from"./chunk-OWAZS6AA.js";import{c as ke,e as Le,i as Ae,s as $e}from"./chunk-USU2EHJV.js";import{A as we,a as Me,d as ve,e as Ne,f as Se,l as Oe,n as xe,p as ye}from"./chunk-WRNQOX5R.js";import{h as De}from"./chunk-QM6X5ZEC.js";import{ea as be}from"./chunk-WJPLJKPQ.js";import{Ab as d,Ac as j,B as le,Bb as g,Bc as Te,Cb as H,H as Q,Hc as Fe,Ib as U,Jb as L,Oc as $,Pc as W,Qb as he,Ra as m,Rb as pe,Sb as A,Tb as ue,Tc as ie,Ub as _e,Uc as E,Vc as ne,Wb as y,Yb as u,Zb as ge,_ as V,_b as G,bb as ae,ea as b,ec as J,fa as M,fc as fe,gb as K,gc as Y,hc as me,ic as x,lc as F,mc as Ce,n as re,nc as Pe,oa as O,qc as Z,r as B,rc as ee,sc as te,ub as v,vb as N,x as se,xb as ce,yb as de,zb as k,zc as Ee}from"./chunk-QDFCX6XE.js";import{a as X,b as q}from"./chunk-EUDKD2JW.js";var je=["treeContainer"],ze=["formRef"],Xe=[[["label"]],[["label"]],[["input"]]],qe=["label","label","input"],Qe=o=>({children:o,level:0}),We=o=>({$implicit:o}),Ke=(o,t)=>({children:o,level:t}),Ue=()=>({maxWidth:"700px",width:"100%"}),Je=(o,t)=>t.id;function Ye(o,t){if(o&1){let e=L();d(0,"sh-button-group")(1,"button",19),y("click",function(){b(e);let n=u();return M(n.pathDiscoveryMethod.set("browse"))}),A(2,4),g(),d(3,"button",19),y("click",function(){b(e);let n=u();return M(n.pathDiscoveryMethod.set("path"))}),A(4,5),g()()}if(o&2){let e=u();m(),x("active",e.pathDiscoveryMethod()==="browse"),m(2),x("active",e.pathDiscoveryMethod()==="path")}}function Ze(o,t){o&1&&H(0,"sh-progress-bar",12)}function et(o,t){o&1&&(d(0,"sh-icon",24),F(1,"caret-down"),g())}function tt(o,t){o&1&&H(0,"sh-icon",24)}function it(o,t){o&1&&(d(0,"sh-icon",24),F(1,"caret-right"),g())}function nt(o,t){o&1&&(d(0,"sh-icon",22),F(1,"folder-open"),g())}function ot(o,t){o&1&&(d(0,"sh-icon",22),F(1,"folder-user"),g())}function rt(o,t){o&1&&(d(0,"sh-icon",22),F(1,"file"),g())}function st(o,t){o&1&&(d(0,"sh-icon",22),F(1,"folder"),g())}function lt(o,t){if(o&1&&(v(0,et,2,0,"sh-icon",24)(1,tt,1,0,"sh-icon",24)(2,it,2,0,"sh-icon",24),v(3,nt,2,0,"sh-icon",22)(4,ot,2,0,"sh-icon",22)(5,rt,2,0,"sh-icon",22)(6,st,2,0,"sh-icon",22)),o&2){let e=u(2).$implicit;N(e.children.length?0:e.cls==="file"?1:2),m(3),N(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function at(o,t){o&1&&(d(0,"sh-icon",22),F(1,"desktop-tower"),g())}function ct(o,t){o&1&&U(0)}function dt(o,t){if(o&1&&K(0,ct,1,0,"ng-container",13),o&2){let e=u(2).$implicit,i=u().$implicit;u();let n=Y(7);k("ngTemplateOutlet",n)("ngTemplateOutletContext",j(5,We,Te(2,Ke,e.children,i.level+1)))}}function ht(o,t){if(o&1){let e=L();d(0,"div",20,3),y("click",function(){b(e);let n=u().$implicit,r=u(2);return M(r.toggleNode(n.id,n))}),d(2,"div",21),v(3,lt,7,2)(4,at,2,0,"sh-icon",22),g(),d(5,"div",23),y("click",function(n){b(e);let r=u().$implicit,a=u(2);return M(a.toggleSelectedNode(n,r))}),F(6),g()(),v(7,dt,1,7,"ng-container")}if(o&2){let e=u().$implicit,i=u().$implicit,n=u();x("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",i.level===0),m(2),x("file",e.cls==="file"),m(),N(e.id!=="/"?3:4),m(3),Pe(" ",e.text," "),m(),N(e.children.length>0?7:-1)}}function pt(o,t){if(o&1&&v(0,ht,8,17),o&2){let e=t.$implicit,i=u(2);N(e.hidden&&i._showHiddenNodes()||!e.hidden?0:-1)}}function ut(o,t){if(o&1&&(d(0,"sh-list"),ce(1,pt,1,1,null,null,Je),g()),o&2){let e=t.$implicit;me("padding-left",e.level*.25,"rem"),m(),de(e.children)}}function _t(o,t){o&1&&U(0)}function gt(o,t){if(o&1){let e=L();d(0,"sh-toggle",25),y("click",function(){b(e);let n=u();return M(n._showHiddenNodes.set(!n._showHiddenNodes()))}),A(1,6),g()}if(o&2){let e=u();x("active",e._showHiddenNodes()),m(),ue(e.showFiles()?"files":"folders"),_e(1)}}function ft(o,t){if(o&1){let e=L();d(0,"button",26),y("click",function(){b(e);let n=u();return M(n.openCreateFolderDialog())}),A(1,7),g()}if(o&2){let e=u();k("disabled",!e.isCurrentPathFolder())}}function mt(o,t){if(o&1){let e=L();d(0,"sh-dialog",27),te("isOpenChange",function(n){b(e);let r=u();return ee(r.createFolderDialogOpen,n)||(r.createFolderDialogOpen=n),M(n)}),d(1,"header",28)(2,"h2"),A(3,8),g()(),d(4,"div",29)(5,"div"),F(6," Folder will be created under "),d(7,"pre"),F(8),g()(),d(9,"sh-form-field")(10,"textarea",30),te("ngModelChange",function(n){b(e);let r=u();return ee(r.createFolderPath,n)||(r.createFolderPath=n),M(n)}),g()()(),d(11,"footer",31)(12,"button",32),y("click",function(){b(e);let n=u();return M(n.closeCreateFolderDialog(!1))}),F(13,"Cancel"),g(),d(14,"button",33),y("click",function(){b(e);let n=u();return M(n.closeCreateFolderDialog(!0))}),he(15,9),H(16,"sh-icon"),pe(),g()()()}if(o&2){let e,i=u();Z("isOpen",i.createFolderDialogOpen),k("options",Ee(5,Ue)),m(8),Ce(i.currentPath()),m(2),Z("ngModel",i.createFolderPath),m(4),k("disabled",!((e=i.createFolderPath())!=null&&e.length))}}var Be=(r=>(r[r.ExcludedByParent=-2]="ExcludedByParent",r[r.Excluded=-1]="Excluded",r[r.None=0]="None",r[r.Included=1]="Included",r[r.IncludedByParent=2]="IncludedByParent",r))(Be||{}),T="/",oe=class o{#t=V(De);#n=V(Re);#d=V(Ne);multiSelect=E(!1);disabled=E(!1);showFiles=E(!1);selectFiles=E(!1);accepts=E(null);startingPath=E(null);rootPaths=E([]);initialNodes=E([]);backupSettings=E(null);pathRefreshTrigger=E(!1);showHiddenNodes=E(!1);enableCreateFolder=E(!1);hideShortcuts=E(!1);includes=ie();excludes=ie();_showHiddenNodes=O(!1);createFolderDialogOpen=O(!1);createFolderPath=O(null);treeContainerRef=ne("treeContainer");formRef=ne("formRef");pathDiscoveryMethod=O("browse");isLoading=O(!1);currentPath=O("/");#o=O(null);treeSearchQuery=O("");treeNodes=O([]);isWindows=$(()=>this.#n.systemInfo()?.OSType==="Windows");pathDelimiter=$(()=>this.isWindows()?"\\":"/");filterGroups=this.#n.filterGroups();isByBackupSettings=$(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=$(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=Be;treeStructure=$(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==T),i=structuredClone(e);for(let l=0;l<i.length;l++){let f=i[l].slice(1);if(f.startsWith("{")&&f.endsWith("}")){let _=f.slice(1,-1),c=this.filterGroups?.FilterGroups[_];if(c&&c.length){let S=c.map(C=>`-${C}`);i.splice(l,1,...S)}}}let n=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),p=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let h=this.#s(i,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:h,isIndeterminate:!1,cls:this.#e(l,p)?"folder":"file"}}):s=[{id:T,resolvedpath:T,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let h=new Map,f=l?.id;a&&(l.accepted=!0),h.set(l.id,l);let _=r.length>0?n.filter(c=>c.parentPath.startsWith(l.id)):n;for(let c of _){let C=(r.length>0?c.id.replace(f??"",""):c.id).split(p).filter(Boolean),P="",w=l;for(let R of C){if(P+=R+p,!h.has(P)){let z=c.hidden===!0&&t?0:this.#s(i,c.id,c.cls,w),D={id:c.id,isIndeterminate:this.isIndeterminate(i,c.id),evalState:z,parentPath:P,resolvedpath:c.cls=="folder"?this.#r(c.resolvedpath):P,hidden:c.hidden,text:c.text,cls:c.cls,children:[]};a&&(D.accepted=this.matchAccepts(a,D)),h.set(P,D),w.children.push(D)}w=h.get(P)}}return l}),s});#r(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===T?t:t+e:T}#s(t,e,i,n){if(n&&n.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),p=t.filter(h=>!h.startsWith("-")&&!h.startsWith("+")),s=t.filter(h=>h.startsWith("-")||h.startsWith("+")),l=this.multiSelect();if(p.length===0)return r;for(let h=0;h<p.length;h++){let f=p[h];if(e===f){r=1;break}if(!l||!this.#e(f,a))continue;if(e?.startsWith(f)){r=1;break}}if(s.length===0)return r;for(let h=0;h<s.length;h++){let f=s[h],_=f.slice(1),c=f.startsWith("-")?-1:1;if(this.#e(_,a)){if(i!=="folder")continue;if(e===_){r=c;break}}if(_.startsWith("*")&&_.endsWith(`*${a}`)){if(i!=="folder")continue;let C=_.slice(1,-2);if(C==="")break;if(e?.includes(C+a)){r=c;break}}if(_.startsWith("[.*")&&_.endsWith(`[^\\${a}]*]`)){if(i!=="file")continue;let C=_.slice(3,-7);if(new RegExp(C).test(e)){r=c;break}}if(_.startsWith("[")&&_.endsWith("]")){let C=_.slice(1,-1),P=this.translateCSharpRegex(C);if(new RegExp(`${P}`).test(e)){r=c;break}}if(_.startsWith("*.")){if(i!=="file"||_.replace("*.","").length===0)continue;if(this.#l(e,_,!0)){r=c;break}}if(_==="")continue;if(_===e){r=c;break}if(this.#l(e,_,!0)){r=c;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let i=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(i,(n,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(i=>!i.startsWith("-")&&this.#e(i,this.pathDelimiter())).some(i=>i.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#l(t,e,i=!1){let n=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${n}${i?"$":""}`).test(t)}showHiddenNodesEffect=W(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=W(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===T)return!0;let i=t.split(",");if(i.length===0)return!0;let n="."+e.id.slice(e.id.indexOf("."));return n?i.some(r=>n.endsWith(r)):!1}currentPathEffect=W(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=W(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#h(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#_(t);else{let e=this.rootPaths(),i=this.initialNodes();e&&e.length>0?(i&&i.length>0&&this.treeNodes.set(i.map(n=>({id:n.id,leaf:n.leaf,cls:n.cls,text:n.text,iconCls:n.iconCls,fileSize:n.fileSize,resolvedpath:n.resolvedpath,parentPath:this.getParentPath(n.id??"")}))),this.#i(null,e[0])):this.#i(null,T)}}getParentPath(t){let e=this.pathDelimiter(),i=t.split(e);return i.length<=1?T:(i.pop(),i.length!==0&&i.pop(),i.join(e)+e)}toggleSelectedNode(t,e){if(e.id===T||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let n=this.currentPath().split("\0").filter(s=>s!==""&&s!==T),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,p=this.#e(e.id,this.pathDelimiter());if(this.multiSelect())if(n.includes(e.id))this.currentPath.set(n.filter(s=>s!==e.id&&!(p&&s.startsWith(a))).join("\0"));else if(n.some(s=>s==a))this.currentPath.set(n.filter(s=>s!==a).join("\0"));else{let s=p?n.filter(l=>!l.startsWith(e.id)):n;this.currentPath.set([...s,a].join("\0"))}else n.includes(e.id)?this.currentPath.set(n.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(i=>i!==""&&i!==T&&this.#e(i,this.pathDelimiter())).some(i=>t.id?.startsWith(i)||`-${t.id}`.startsWith(i))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(i=>i.filter(n=>!n.id?.startsWith(e.id)||n.id===e.id)):this.#i(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let i=this.currentPath(),n=this.#r(e),r=i+n;this.#t.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#i(null,i),setTimeout(()=>{this.#a()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let p=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=p?p[1]:a?.message||$localize`An error occurred while trying to create the folder.`;this.#d.open(Ie,{data:{title:$localize`Cannot create folder`,message:s,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#a(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#h(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#p(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#u(t){let e=this.backupSettings();if(this.#n.hasV2ListOperations())return this.#t.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0}}).pipe(B(i=>i.Data??[]));{let i={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#t.getApiV1BackupByIdFiles(i).pipe(B(n=>n.Files??[]))}}#c(t){return this.isByBackupSettings()?this.#u(t):this.#p(t)}#_(t){let e=this.pathDelimiter(),i=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),n=t.split("\0").filter(s=>!s.startsWith("-")).filter(Boolean),r=n.map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[T];r.forEach(s=>{s.forEach((l,h)=>{let f=s.slice(0,h+1).join(e);f!==""&&(a.includes(f)||a.push(f))})}),this.isLoading.set(!0);let p=a.map(s=>this.#c(s).pipe(B(l=>({status:"success",value:l,url:s})),le(l=>re({status:"error",value:l,url:s}))));se(p).pipe(Q(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(f=>f.status==="success"),h=s.filter(f=>f.status==="error");this.treeNodes.update(f=>{let _=l.flatMap(S=>S.value.map(C=>{let P=C.id,w=C.id.startsWith("%")&&C.id.endsWith("%")?C.resolvedpath+e:C.id,R=P&&P.split(e).filter(Boolean).slice(0,-1).join(e),z=P&&P.split(e).filter(Boolean).join(e),D=e+z,Ve=n.findIndex(I=>this.multiSelect()?D.startsWith(I):D===I)>-1,He=n.findIndex(I=>I===P)>-1,Ge=i.findIndex(I=>I===D)>-1;return q(X({},C),{cls:this.#e(w,e)||w==T?"folder":"file",parentPath:R.startsWith("%")?R:e+R,isSelected:Ve&&!Ge||He})})),c=[...new Map([...f,..._].map(S=>[S.id,S])).values()];return this.#a(),this.hideShortcuts()?c.filter(S=>!S.id.startsWith("%")):c})}})}#e(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#i(t=null,e=T){let i=this.pathDelimiter();this.isLoading.set(!0),this.#c(e).pipe(Q(()=>this.isLoading.set(!1))).subscribe({next:n=>{let r=this.isByBackupSettings()?n.map(a=>({text:a.Path.split(i).filter(p=>p!=="").pop(),id:a.Path,cls:this.#e(a.Path,i)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):n;this.treeNodes.update(a=>{let p=r.map(l=>{let h=this.#e(l.id,i)?"folder":"file";return q(X({},l),{cls:h,parentPath:e})}),s=[...new Map([...a,...p].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=ae({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,i){e&1&&(J(i.treeContainerRef,je,5),J(i.formRef,ze,5)),e&2&&fe(2)},hostVars:2,hostBindings:function(e,i){e&2&&x("disabled",i.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:qe,decls:18,vars:17,consts:()=>{let t;t=$localize` Browse path `;let e;e=$localize` Manually type path `;let i;i=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let n;n=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,i,n,r,a,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,i){if(e&1&&(ge(Xe),v(0,Ye,5,4,"sh-button-group"),d(1,"div",10),G(2,0,["ngProjectAs","label",5,["label"]]),d(3,"div",11,0),v(5,Ze,1,0,"sh-progress-bar",12),K(6,ut,3,2,"ng-template",null,1,Fe)(8,_t,1,0,"ng-container",13),g(),d(9,"div",14),v(10,gt,2,3,"sh-toggle",15),v(11,ft,2,1,"button",16),g()(),d(12,"div",17,2)(14,"sh-form-field"),G(15,1,["ngProjectAs","label",5,["label"]]),G(16,2,["ngProjectAs","input",5,["input"]]),g()(),v(17,mt,17,6,"sh-dialog",18)),e&2){let n=Y(7);N(i.multiSelect()?-1:0),m(),x("hidden",i.pathDiscoveryMethod()!=="browse"),m(2),x("visualize-accepted",i.accepts()),m(2),N(i.isLoading()?5:-1),m(3),k("ngTemplateOutlet",n)("ngTemplateOutletContext",j(15,We,j(13,Qe,i.treeStructure()))),m(2),N(!i.accepts()&&!i.isByBackupSettings()?10:-1),m(),N(i.enableCreateFolder()?11:-1),m(),x("hidden",i.pathDiscoveryMethod()!=="path"),m(5),N(i.createFolderDialogOpen()?17:-1)}},dependencies:[Se,we,Me,Oe,xe,ye,ve,be,$e,ke,Le,Ae],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}'],changeDetection:0})};export{oe as a};
|
|
1
|
+
import{a as Ie}from"./chunk-GUH5TMOS.js";import{a as Re}from"./chunk-66BSPEOQ.js";import{c as ke,e as Le,i as Ae,s as $e}from"./chunk-USU2EHJV.js";import{A as we,a as Me,d as ve,e as Ne,f as Se,l as Oe,n as xe,p as ye}from"./chunk-WRNQOX5R.js";import{h as De}from"./chunk-J3BBLPAD.js";import{ea as be}from"./chunk-WJPLJKPQ.js";import{Ab as d,Ac as j,B as le,Bb as g,Bc as Te,Cb as H,H as Q,Hc as Fe,Ib as U,Jb as L,Oc as $,Pc as W,Qb as he,Ra as m,Rb as pe,Sb as A,Tb as ue,Tc as ie,Ub as _e,Uc as E,Vc as ne,Wb as y,Yb as u,Zb as ge,_ as V,_b as G,bb as ae,ea as b,ec as J,fa as M,fc as fe,gb as K,gc as Y,hc as me,ic as x,lc as F,mc as Ce,n as re,nc as Pe,oa as O,qc as Z,r as B,rc as ee,sc as te,ub as v,vb as N,x as se,xb as ce,yb as de,zb as k,zc as Ee}from"./chunk-QDFCX6XE.js";import{a as X,b as q}from"./chunk-EUDKD2JW.js";var je=["treeContainer"],ze=["formRef"],Xe=[[["label"]],[["label"]],[["input"]]],qe=["label","label","input"],Qe=o=>({children:o,level:0}),We=o=>({$implicit:o}),Ke=(o,t)=>({children:o,level:t}),Ue=()=>({maxWidth:"700px",width:"100%"}),Je=(o,t)=>t.id;function Ye(o,t){if(o&1){let e=L();d(0,"sh-button-group")(1,"button",19),y("click",function(){b(e);let n=u();return M(n.pathDiscoveryMethod.set("browse"))}),A(2,4),g(),d(3,"button",19),y("click",function(){b(e);let n=u();return M(n.pathDiscoveryMethod.set("path"))}),A(4,5),g()()}if(o&2){let e=u();m(),x("active",e.pathDiscoveryMethod()==="browse"),m(2),x("active",e.pathDiscoveryMethod()==="path")}}function Ze(o,t){o&1&&H(0,"sh-progress-bar",12)}function et(o,t){o&1&&(d(0,"sh-icon",24),F(1,"caret-down"),g())}function tt(o,t){o&1&&H(0,"sh-icon",24)}function it(o,t){o&1&&(d(0,"sh-icon",24),F(1,"caret-right"),g())}function nt(o,t){o&1&&(d(0,"sh-icon",22),F(1,"folder-open"),g())}function ot(o,t){o&1&&(d(0,"sh-icon",22),F(1,"folder-user"),g())}function rt(o,t){o&1&&(d(0,"sh-icon",22),F(1,"file"),g())}function st(o,t){o&1&&(d(0,"sh-icon",22),F(1,"folder"),g())}function lt(o,t){if(o&1&&(v(0,et,2,0,"sh-icon",24)(1,tt,1,0,"sh-icon",24)(2,it,2,0,"sh-icon",24),v(3,nt,2,0,"sh-icon",22)(4,ot,2,0,"sh-icon",22)(5,rt,2,0,"sh-icon",22)(6,st,2,0,"sh-icon",22)),o&2){let e=u(2).$implicit;N(e.children.length?0:e.cls==="file"?1:2),m(3),N(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function at(o,t){o&1&&(d(0,"sh-icon",22),F(1,"desktop-tower"),g())}function ct(o,t){o&1&&U(0)}function dt(o,t){if(o&1&&K(0,ct,1,0,"ng-container",13),o&2){let e=u(2).$implicit,i=u().$implicit;u();let n=Y(7);k("ngTemplateOutlet",n)("ngTemplateOutletContext",j(5,We,Te(2,Ke,e.children,i.level+1)))}}function ht(o,t){if(o&1){let e=L();d(0,"div",20,3),y("click",function(){b(e);let n=u().$implicit,r=u(2);return M(r.toggleNode(n.id,n))}),d(2,"div",21),v(3,lt,7,2)(4,at,2,0,"sh-icon",22),g(),d(5,"div",23),y("click",function(n){b(e);let r=u().$implicit,a=u(2);return M(a.toggleSelectedNode(n,r))}),F(6),g()(),v(7,dt,1,7,"ng-container")}if(o&2){let e=u().$implicit,i=u().$implicit,n=u();x("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",i.level===0),m(2),x("file",e.cls==="file"),m(),N(e.id!=="/"?3:4),m(3),Pe(" ",e.text," "),m(),N(e.children.length>0?7:-1)}}function pt(o,t){if(o&1&&v(0,ht,8,17),o&2){let e=t.$implicit,i=u(2);N(e.hidden&&i._showHiddenNodes()||!e.hidden?0:-1)}}function ut(o,t){if(o&1&&(d(0,"sh-list"),ce(1,pt,1,1,null,null,Je),g()),o&2){let e=t.$implicit;me("padding-left",e.level*.25,"rem"),m(),de(e.children)}}function _t(o,t){o&1&&U(0)}function gt(o,t){if(o&1){let e=L();d(0,"sh-toggle",25),y("click",function(){b(e);let n=u();return M(n._showHiddenNodes.set(!n._showHiddenNodes()))}),A(1,6),g()}if(o&2){let e=u();x("active",e._showHiddenNodes()),m(),ue(e.showFiles()?"files":"folders"),_e(1)}}function ft(o,t){if(o&1){let e=L();d(0,"button",26),y("click",function(){b(e);let n=u();return M(n.openCreateFolderDialog())}),A(1,7),g()}if(o&2){let e=u();k("disabled",!e.isCurrentPathFolder())}}function mt(o,t){if(o&1){let e=L();d(0,"sh-dialog",27),te("isOpenChange",function(n){b(e);let r=u();return ee(r.createFolderDialogOpen,n)||(r.createFolderDialogOpen=n),M(n)}),d(1,"header",28)(2,"h2"),A(3,8),g()(),d(4,"div",29)(5,"div"),F(6," Folder will be created under "),d(7,"pre"),F(8),g()(),d(9,"sh-form-field")(10,"textarea",30),te("ngModelChange",function(n){b(e);let r=u();return ee(r.createFolderPath,n)||(r.createFolderPath=n),M(n)}),g()()(),d(11,"footer",31)(12,"button",32),y("click",function(){b(e);let n=u();return M(n.closeCreateFolderDialog(!1))}),F(13,"Cancel"),g(),d(14,"button",33),y("click",function(){b(e);let n=u();return M(n.closeCreateFolderDialog(!0))}),he(15,9),H(16,"sh-icon"),pe(),g()()()}if(o&2){let e,i=u();Z("isOpen",i.createFolderDialogOpen),k("options",Ee(5,Ue)),m(8),Ce(i.currentPath()),m(2),Z("ngModel",i.createFolderPath),m(4),k("disabled",!((e=i.createFolderPath())!=null&&e.length))}}var Be=(r=>(r[r.ExcludedByParent=-2]="ExcludedByParent",r[r.Excluded=-1]="Excluded",r[r.None=0]="None",r[r.Included=1]="Included",r[r.IncludedByParent=2]="IncludedByParent",r))(Be||{}),T="/",oe=class o{#t=V(De);#n=V(Re);#d=V(Ne);multiSelect=E(!1);disabled=E(!1);showFiles=E(!1);selectFiles=E(!1);accepts=E(null);startingPath=E(null);rootPaths=E([]);initialNodes=E([]);backupSettings=E(null);pathRefreshTrigger=E(!1);showHiddenNodes=E(!1);enableCreateFolder=E(!1);hideShortcuts=E(!1);includes=ie();excludes=ie();_showHiddenNodes=O(!1);createFolderDialogOpen=O(!1);createFolderPath=O(null);treeContainerRef=ne("treeContainer");formRef=ne("formRef");pathDiscoveryMethod=O("browse");isLoading=O(!1);currentPath=O("/");#o=O(null);treeSearchQuery=O("");treeNodes=O([]);isWindows=$(()=>this.#n.systemInfo()?.OSType==="Windows");pathDelimiter=$(()=>this.isWindows()?"\\":"/");filterGroups=this.#n.filterGroups();isByBackupSettings=$(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=$(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=Be;treeStructure=$(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==T),i=structuredClone(e);for(let l=0;l<i.length;l++){let f=i[l].slice(1);if(f.startsWith("{")&&f.endsWith("}")){let _=f.slice(1,-1),c=this.filterGroups?.FilterGroups[_];if(c&&c.length){let S=c.map(C=>`-${C}`);i.splice(l,1,...S)}}}let n=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),p=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let h=this.#s(i,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:h,isIndeterminate:!1,cls:this.#e(l,p)?"folder":"file"}}):s=[{id:T,resolvedpath:T,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let h=new Map,f=l?.id;a&&(l.accepted=!0),h.set(l.id,l);let _=r.length>0?n.filter(c=>c.parentPath.startsWith(l.id)):n;for(let c of _){let C=(r.length>0?c.id.replace(f??"",""):c.id).split(p).filter(Boolean),P="",w=l;for(let R of C){if(P+=R+p,!h.has(P)){let z=c.hidden===!0&&t?0:this.#s(i,c.id,c.cls,w),D={id:c.id,isIndeterminate:this.isIndeterminate(i,c.id),evalState:z,parentPath:P,resolvedpath:c.cls=="folder"?this.#r(c.resolvedpath):P,hidden:c.hidden,text:c.text,cls:c.cls,children:[]};a&&(D.accepted=this.matchAccepts(a,D)),h.set(P,D),w.children.push(D)}w=h.get(P)}}return l}),s});#r(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===T?t:t+e:T}#s(t,e,i,n){if(n&&n.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),p=t.filter(h=>!h.startsWith("-")&&!h.startsWith("+")),s=t.filter(h=>h.startsWith("-")||h.startsWith("+")),l=this.multiSelect();if(p.length===0)return r;for(let h=0;h<p.length;h++){let f=p[h];if(e===f){r=1;break}if(!l||!this.#e(f,a))continue;if(e?.startsWith(f)){r=1;break}}if(s.length===0)return r;for(let h=0;h<s.length;h++){let f=s[h],_=f.slice(1),c=f.startsWith("-")?-1:1;if(this.#e(_,a)){if(i!=="folder")continue;if(e===_){r=c;break}}if(_.startsWith("*")&&_.endsWith(`*${a}`)){if(i!=="folder")continue;let C=_.slice(1,-2);if(C==="")break;if(e?.includes(C+a)){r=c;break}}if(_.startsWith("[.*")&&_.endsWith(`[^\\${a}]*]`)){if(i!=="file")continue;let C=_.slice(3,-7);if(new RegExp(C).test(e)){r=c;break}}if(_.startsWith("[")&&_.endsWith("]")){let C=_.slice(1,-1),P=this.translateCSharpRegex(C);if(new RegExp(`${P}`).test(e)){r=c;break}}if(_.startsWith("*.")){if(i!=="file"||_.replace("*.","").length===0)continue;if(this.#l(e,_,!0)){r=c;break}}if(_==="")continue;if(_===e){r=c;break}if(this.#l(e,_,!0)){r=c;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let i=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(i,(n,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(i=>!i.startsWith("-")&&this.#e(i,this.pathDelimiter())).some(i=>i.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#l(t,e,i=!1){let n=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${n}${i?"$":""}`).test(t)}showHiddenNodesEffect=W(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=W(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===T)return!0;let i=t.split(",");if(i.length===0)return!0;let n="."+e.id.slice(e.id.indexOf("."));return n?i.some(r=>n.endsWith(r)):!1}currentPathEffect=W(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=W(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#h(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#_(t);else{let e=this.rootPaths(),i=this.initialNodes();e&&e.length>0?(i&&i.length>0&&this.treeNodes.set(i.map(n=>({id:n.id,leaf:n.leaf,cls:n.cls,text:n.text,iconCls:n.iconCls,fileSize:n.fileSize,resolvedpath:n.resolvedpath,parentPath:this.getParentPath(n.id??"")}))),this.#i(null,e[0])):this.#i(null,T)}}getParentPath(t){let e=this.pathDelimiter(),i=t.split(e);return i.length<=1?T:(i.pop(),i.length!==0&&i.pop(),i.join(e)+e)}toggleSelectedNode(t,e){if(e.id===T||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let n=this.currentPath().split("\0").filter(s=>s!==""&&s!==T),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,p=this.#e(e.id,this.pathDelimiter());if(this.multiSelect())if(n.includes(e.id))this.currentPath.set(n.filter(s=>s!==e.id&&!(p&&s.startsWith(a))).join("\0"));else if(n.some(s=>s==a))this.currentPath.set(n.filter(s=>s!==a).join("\0"));else{let s=p?n.filter(l=>!l.startsWith(e.id)):n;this.currentPath.set([...s,a].join("\0"))}else n.includes(e.id)?this.currentPath.set(n.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(i=>i!==""&&i!==T&&this.#e(i,this.pathDelimiter())).some(i=>t.id?.startsWith(i)||`-${t.id}`.startsWith(i))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(i=>i.filter(n=>!n.id?.startsWith(e.id)||n.id===e.id)):this.#i(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let i=this.currentPath(),n=this.#r(e),r=i+n;this.#t.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#i(null,i),setTimeout(()=>{this.#a()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let p=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=p?p[1]:a?.message||$localize`An error occurred while trying to create the folder.`;this.#d.open(Ie,{data:{title:$localize`Cannot create folder`,message:s,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#a(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#h(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#p(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#u(t){let e=this.backupSettings();if(this.#n.hasV2ListOperations())return this.#t.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0}}).pipe(B(i=>i.Data??[]));{let i={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#t.getApiV1BackupByIdFiles(i).pipe(B(n=>n.Files??[]))}}#c(t){return this.isByBackupSettings()?this.#u(t):this.#p(t)}#_(t){let e=this.pathDelimiter(),i=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),n=t.split("\0").filter(s=>!s.startsWith("-")).filter(Boolean),r=n.map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[T];r.forEach(s=>{s.forEach((l,h)=>{let f=s.slice(0,h+1).join(e);f!==""&&(a.includes(f)||a.push(f))})}),this.isLoading.set(!0);let p=a.map(s=>this.#c(s).pipe(B(l=>({status:"success",value:l,url:s})),le(l=>re({status:"error",value:l,url:s}))));se(p).pipe(Q(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(f=>f.status==="success"),h=s.filter(f=>f.status==="error");this.treeNodes.update(f=>{let _=l.flatMap(S=>S.value.map(C=>{let P=C.id,w=C.id.startsWith("%")&&C.id.endsWith("%")?C.resolvedpath+e:C.id,R=P&&P.split(e).filter(Boolean).slice(0,-1).join(e),z=P&&P.split(e).filter(Boolean).join(e),D=e+z,Ve=n.findIndex(I=>this.multiSelect()?D.startsWith(I):D===I)>-1,He=n.findIndex(I=>I===P)>-1,Ge=i.findIndex(I=>I===D)>-1;return q(X({},C),{cls:this.#e(w,e)||w==T?"folder":"file",parentPath:R.startsWith("%")?R:e+R,isSelected:Ve&&!Ge||He})})),c=[...new Map([...f,..._].map(S=>[S.id,S])).values()];return this.#a(),this.hideShortcuts()?c.filter(S=>!S.id.startsWith("%")):c})}})}#e(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#i(t=null,e=T){let i=this.pathDelimiter();this.isLoading.set(!0),this.#c(e).pipe(Q(()=>this.isLoading.set(!1))).subscribe({next:n=>{let r=this.isByBackupSettings()?n.map(a=>({text:a.Path.split(i).filter(p=>p!=="").pop(),id:a.Path,cls:this.#e(a.Path,i)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):n;this.treeNodes.update(a=>{let p=r.map(l=>{let h=this.#e(l.id,i)?"folder":"file";return q(X({},l),{cls:h,parentPath:e})}),s=[...new Map([...a,...p].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=ae({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,i){e&1&&(J(i.treeContainerRef,je,5),J(i.formRef,ze,5)),e&2&&fe(2)},hostVars:2,hostBindings:function(e,i){e&2&&x("disabled",i.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:qe,decls:18,vars:17,consts:()=>{let t;t=$localize` Browse path `;let e;e=$localize` Manually type path `;let i;i=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let n;n=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,i,n,r,a,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,i){if(e&1&&(ge(Xe),v(0,Ye,5,4,"sh-button-group"),d(1,"div",10),G(2,0,["ngProjectAs","label",5,["label"]]),d(3,"div",11,0),v(5,Ze,1,0,"sh-progress-bar",12),K(6,ut,3,2,"ng-template",null,1,Fe)(8,_t,1,0,"ng-container",13),g(),d(9,"div",14),v(10,gt,2,3,"sh-toggle",15),v(11,ft,2,1,"button",16),g()(),d(12,"div",17,2)(14,"sh-form-field"),G(15,1,["ngProjectAs","label",5,["label"]]),G(16,2,["ngProjectAs","input",5,["input"]]),g()(),v(17,mt,17,6,"sh-dialog",18)),e&2){let n=Y(7);N(i.multiSelect()?-1:0),m(),x("hidden",i.pathDiscoveryMethod()!=="browse"),m(2),x("visualize-accepted",i.accepts()),m(2),N(i.isLoading()?5:-1),m(3),k("ngTemplateOutlet",n)("ngTemplateOutletContext",j(15,We,j(13,Qe,i.treeStructure()))),m(2),N(!i.accepts()&&!i.isByBackupSettings()?10:-1),m(),N(i.enableCreateFolder()?11:-1),m(),x("hidden",i.pathDiscoveryMethod()!=="path"),m(5),N(i.createFolderDialogOpen()?17:-1)}},dependencies:[Se,we,Me,Oe,xe,ye,ve,be,$e,ke,Le,Ae],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}'],changeDetection:0})};export{oe as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as R}from"./chunk-
|
|
1
|
+
import{a as R}from"./chunk-GO22DJ44.js";import{a as A,n as D,x as F}from"./chunk-WRNQOX5R.js";import{la as k}from"./chunk-WJPLJKPQ.js";import{Ab as o,Bb as i,Cb as P,Dc as y,Fc as $,Jb as N,Pc as b,Ra as l,Sb as m,Uc as L,Wb as w,Yb as d,_ as x,bb as M,ea as E,fa as O,hc as G,ic as v,lc as s,mc as u,nc as _,oa as I,ub as g,vb as p,wb as C,xb as f,yb as S,zb as T}from"./chunk-QDFCX6XE.js";function V(n,t){n&1&&(o(0,"div",4),m(1,0),i())}function B(n,t){if(n&1&&(o(0,"li"),s(1),i()),n&2){let e=t.$implicit;l(),u(e)}}function U(n,t){if(n&1&&(o(0,"code")(1,"ol",15),f(2,B,2,1,"li",null,C),i()()),n&2){let e=d(2).$implicit,a=d(2);l(2),S(a.breakIntoLines(e.Exception))}}function X(n,t){if(n&1&&(o(0,"li"),s(1),i()),n&2){let e=t.$implicit;l(),u(e)}}function z(n,t){if(n&1&&(o(0,"code")(1,"ol",15),f(2,X,2,1,"li",null,C),i()()),n&2){let e=d(2).$implicit,a=d(2);l(2),S(a.breakIntoLines(e.Message))}}function W(n,t){if(n&1&&(o(0,"tr")(1,"td",12)(2,"sh-list",13)(3,"div",14),s(4),i(),o(5,"div",14),s(6),i(),o(7,"div",14),s(8),i(),o(9,"div",14),s(10),i(),o(11,"div",14),s(12),i()(),g(13,U,4,0,"code"),g(14,z,4,0,"code"),i()()),n&2){let e=d().$implicit;l(4),_("ID: ",e.ID),l(2),_("Type: ",e.Type),l(2),_("Tag: ",e.Tag),l(2),_("TaskID: ",e.TaskID),l(2),_("MessageID: ",e.MessageID),l(),p(e.Exception?13:-1),l(),p(e.Message?14:-1)}}function j(n,t){if(n&1){let e=N();o(0,"tr",10),w("click",function(){let r=E(e).$index,c=d(2);return O(c.toggleRow(r))}),o(1,"td"),s(2),y(3,"date"),i(),o(4,"td"),s(5),i(),o(6,"td",8)(7,"button",11)(8,"sh-icon"),s(9,"caret-down"),i()()()(),g(10,W,15,7,"tr")}if(n&2){let e=t.$implicit,a=t.$index,r=d(2);l(2),u($(3,5,e.When,"medium")),l(3),u(r.subStringMessage(e.Message)),l(2),v("rotated-icon",a===r.openRowIndex()),l(3),p(a===r.openRowIndex()?10:-1)}}function H(n,t){if(n&1&&(o(0,"sh-table",6)(1,"tr",7)(2,"th"),m(3,1),i(),o(4,"th"),m(5,2),i(),P(6,"th",8),i(),f(7,j,11,8,null,null,C),o(9,"div",9),m(10,3),i()()),n&2){let e=d();G("grid-template-columns","auto 1fr auto"),v("type-b",e.asSimpleList()),T("data",e.logs())("loading",e.logsLoading()),l(7),S(e.logs())}}var h=class n{#e=x(R);whenFilter=L();backupIdFilter=L();asSimpleList=L();polling=L();logLevel=this.#e.logLevel;logLevelByLabel=this.#e.logLevelByLabel;logs=this.#e.logs;logsLoading=this.#e.logsLoading;pollingEffect=b(()=>{let t=this.polling()??!1;this.#e.isPolling.set(t)});openRowIndex=I(null);whenEffect=b(()=>{let t=this.whenFilter()??null;this.#e.setWhenFilter(t),this.#e.logLevel.set(t?"Verbose":"Disabled")});backupIdEffect=b(()=>{let t=this.backupIdFilter()??null;this.#e.setBackupIdFilter(t),this.#e.logLevel.set(t?"Verbose":"Disabled")});toggleRow(t){this.openRowIndex.set(t===this.openRowIndex()?null:t)}breakIntoLines(t){return t?t.split(`
|
|
2
2
|
`):[]}subStringMessage(t){return t?t.substring(0,80)+"...":""}ngOnDestroy(){this.#e.destroy()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-logs-live"]],hostVars:2,hostBindings:function(e,a){e&2&&v("simple-list",a.asSimpleList())},inputs:{whenFilter:[1,"whenFilter"],backupIdFilter:[1,"backupIdFilter"],asSimpleList:[1,"asSimpleList"],polling:[1,"polling"]},decls:2,vars:1,consts:()=>{let t;t=$localize`Live logs are disabled`;let e;e=$localize`When`;let a;a=$localize`Message`;let r;return r=$localize`No data available`,[t,e,a,r,[1,"live-view-disabled"],[3,"type-b","data","loading","grid-template-columns"],[3,"data","loading"],["table-header",""],[1,"sticky-end"],["table-no-rows",""],[3,"click"],["shButton","","type","button",1,"outlined","small"],[1,"expanded-cell"],[1,"primary"],["item",""],[1,"line-numbers-ol"]]},template:function(e,a){e&1&&g(0,V,2,0,"div",4)(1,H,11,6,"sh-table",5),e&2&&p(a.logLevel()==="Disabled"?0:1)},dependencies:[F,A,D,k],styles:["[_nghost-%COMP%]{display:block}.simple-list[_nghost-%COMP%] sh-table[_ngcontent-%COMP%]{--table-td-bg: var(--base-2);height:100%}.live-view-disabled[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:18.75rem;width:100%;background-color:var(--base-2);border:1px solid var(--base-3);border-radius:var(--shape-2);font:var(--paragraph-20)}.expanded-cell[_ngcontent-%COMP%]{height:auto;grid-column:1/-1;white-space:pre-wrap;display:flex;flex-direction:column}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}sh-table[_ngcontent-%COMP%]{--table-columns: auto auto 1fr auto}sh-table[_ngcontent-%COMP%] td.id[_ngcontent-%COMP%]{justify-content:center}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code){padding:1rem .75rem;overflow:hidden}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code) code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre;max-width:100%}"],changeDetection:0})};export{h as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ue}from"./chunk-UV3WAAEX.js";import{a as se}from"./chunk-BVEALUGN.js";import{a as ne}from"./chunk-UACX27D3.js";import{b as pe}from"./chunk-QGFC5ZUR.js";import{a as Ve}from"./chunk-P2DII6CV.js";import{a as K}from"./chunk-GUH5TMOS.js";import{a as oe}from"./chunk-OWAZS6AA.js";import{a as xe}from"./chunk-CWBEE627.js";import{b as We,c as G,e as B,f as x,i as ze,j as V,l as Xe,o as W,q as z,r as X,s as Ye,t as Y}from"./chunk-USU2EHJV.js";import{b as R,d as N}from"./chunk-L2EO4M4B.js";import{A as Be,a as A,e as ve,g as k,l as Ae,p as ke,q as we,t as Ge}from"./chunk-WRNQOX5R.js";import{h as w}from"./chunk-QM6X5ZEC.js";import{la as ie}from"./chunk-WJPLJKPQ.js";import{Ab as r,B as Oe,Bb as l,Cb as c,Dc as ae,Ec as $e,F as H,Fc as De,Gb as L,H as O,Hb as $,Jb as j,L as fe,Oc as le,P as he,Pc as v,Q,Qb as m,Ra as d,Rb as g,Sb as S,Tb as Ne,Ub as Pe,V as Ce,Wb as f,Yb as D,_ as p,bb as M,ea as h,fa as C,gb as Re,i as Se,ic as Ie,lc as q,nc as Me,o as Te,oa as _,oc as ye,qc as Z,rc as ee,sc as te,ub as y,vb as b,x as re,y as Ee,yc as be,zb as F,zc as Le}from"./chunk-QDFCX6XE.js";var He=new X,Ke=()=>He.group({passphrase:He.control("")}),_e=class a{#t=p(w);#e=p(P);#o=p(N);#n=p(R);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#o.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["destination"],{relativeTo:this.#n.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),f("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),S(3,0),l(),c(4,"input",6),l(),r(5,"app-toggle-card"),L(6,7),S(7,1),$(),r(8,"app-options-list",8),te("optionsChange",function(n){return ee(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),f("click",function(){return t.back()}),m(11,2),c(12,"sh-icon"),g(),l(),r(13,"button",11),m(14,3),c(15,"sh-icon"),g(),l()()()),e&2&&(F("formGroup",t.encryptionForm),d(8),Z("options",t.settings),F("hasFreeTextSettings",!0))},dependencies:[Y,V,G,B,x,W,z,Ae,A,k,ne,Ue],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var Ze=()=>({standalone:!0});function et(a,i){a&1&&c(0,"sh-progress-bar",8)}function tt(a,i){if(a&1&&(q(0),ae(1,"bytes")),a&2){let e=D().$implicit;Me(" (",$e(1,1,e.FileSizes),") ")}}function it(a,i){a&1&&(r(0,"span",16),S(1,4),l())}function ot(a,i){if(a&1&&(r(0,"div",15),q(1),ae(2,"date"),y(3,tt,2,3),y(4,it,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),ye(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),b(e.FileSizes?3:-1),d(),b(e.IsFullBackup===!1?4:-1)}}function nt(a,i){a&1&&c(0,"sh-progress-bar",8)}function st(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),S(2,5),l(),c(3,"input",18),l()),a&2){let e=D(2);F("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function rt(a,i){if(a&1){let e=j();r(0,"sh-select",12),f("cleared",function(){h(e);let o=D();return C(o.abortLoading())}),r(1,"input",13),te("ngModelChange",function(o){h(e);let n=D();return ee(n.selectOption,o)||(n.selectOption=o),C(o)}),l(),Re(2,ot,5,7,"ng-template"),l(),y(3,nt,1,0,"sh-progress-bar",8),y(4,st,4,5,"app-file-tree",14)}if(a&2){let e=D();F("options",e.versionOptions())("isClearable",!1),d(),Z("ngModel",e.selectOption),F("ngModelOptions",Le(6,Ze)),d(2),b(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),b(e.showFileTree()?4:-1)}}var ue=new X,Je=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=p(w);#e=p(P);#o=p(Ve);#n=p(oe);#i=p(N);#s=p(R);#l=p(ie);#a=null;#p=null;#r=_([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=v(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=v(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(J=>J.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,E=o[u];if(this.needsDatabaseRepair()&&(!E||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=v(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#p===n||(this.#p=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Q(this.abortLoading$),O(()=>{this.#p=null})).subscribe(s=>{let u=s.ID;this.#o.waitForTaskToComplete(u).pipe(H(1)).subscribe(()=>{this.#r.update(E=>E.filter(I=>I!==n)),this.loadedVersions.update(E=>(E[n]=!0,E))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#n.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Se;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-select-files"]],features:[be([ie])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",6,0),f("submit",function(){return h(o),C(t.next())}),r(2,"h3",7),S(3,1),l(),y(4,et,1,0,"sh-progress-bar",8)(5,rt,5,7),r(6,"div",9)(7,"button",10),f("click",function(){return h(o),C(t.back())}),m(8,2),c(9,"sh-icon"),g(),l(),r(10,"button",11),m(11,3),c(12,"sh-icon"),g(),l()()()}e&2&&(F("formGroup",t.selectFilesForm),d(4),b(t.versionOptionsLoading()?4:5),d(5),Ne(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[Ye,V,G,B,x,ze,Y,W,z,se,k,A,Ge,ke,ie,xe],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=p(N);#e=p(R);#o=p(oe);#n=p(ve);#i=p(w);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=Je();optionsForm=Qe();encryptionForm=Ke();optionsFormSignal=pe(this.optionsForm.valueChanges);selectFilesFormSignal=pe(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);#s=_("");#l=_(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#p=v(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(!0)}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#n.open(K,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#n.open(K,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#_(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder";return o||n||s||e===0?Te(()=>t):Ee(1e3).pipe(he(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(i=!1){let e=this.backupId();this.versionOptionsLoading.set(!0),this.#o.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:e}),this.loadFilesetsWithRetryv2(e)]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{if(o.Error)throw new Error(o.Error);if(!(t.Backup?.IsTemporary??!0)&&t?.Backup?.DBPathExists===!1){this.#n.open(K,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:s=>{this.#t.navigate(["/backup",e,"database"])}});return}this.versionOptions.set((o.Data??[]).map(s=>({Version:s.Version??-1,IsFullBackup:s.IsFullBackup??void 0,Time:s.Time??"<missing>",FileCount:s.FileCount??void 0,FileSizes:s.FileSizes??void 0}))),this.backup.set(t)},error:t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${t.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(K,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:E=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(fe(3))]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)}})}#_(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};var U=new X,Qe=()=>U.group({restoreFrom:U.control("orignal"),restoreFromPath:U.control(""),handleExisting:U.control("overwrite"),permissions:U.control(!1),includeMetadata:U.control(!0)}),me=class a{#t=p(P);#e=p(N);#o=p(R);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let E;E=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let Fe;return Fe=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,E,I,J,ge,Fe,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",13,0),f("submit",function(){return h(o),C(t.submit())}),r(2,"h3",14),S(3,1),l(),r(4,"app-toggle-card",15),L(5,16),S(6,2),$(),r(7,"sh-radio",17),m(8,3),c(9,"input",18),g(),l(),r(10,"sh-radio",17),m(11,4),c(12,"input",19),g(),l(),r(13,"app-file-tree",20)(14,"label",21),q(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),L(18,16),S(19,5),$(),r(20,"sh-radio",17),m(21,6),c(22,"input",23),g(),l(),r(23,"sh-radio",17),m(24,7),c(25,"input",24),g(),l()(),r(26,"app-toggle-card"),L(27,16),S(28,8),$(),r(29,"sh-toggle",25),m(30,9),c(31,"input",26),g(),l(),r(32,"sh-toggle",25),m(33,10),c(34,"input",27),g(),l()(),r(35,"div",28)(36,"button",29),f("click",function(){return h(o),C(t.goBack())}),m(37,11),c(38,"sh-icon"),g(),l(),r(39,"button",30),m(40,12),c(41,"sh-icon"),g(),l()()()}if(e&2){let o;F("formGroup",t.optionsForm),d(4),F("disallowToggle",!0),d(9),F("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),F("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[Y,V,G,We,Xe,B,x,W,z,ne,se,Be,we,k,A],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{Qe as a,me as b,Ke as c,_e as d,Je as e,de as f,P as g};
|
|
1
|
+
import{a as Ue}from"./chunk-K3ZQ67VT.js";import{a as se}from"./chunk-QY6E755W.js";import{a as ne}from"./chunk-UACX27D3.js";import{b as pe}from"./chunk-QGFC5ZUR.js";import{a as Ve}from"./chunk-OXOOR7I4.js";import{a as K}from"./chunk-GUH5TMOS.js";import{a as oe}from"./chunk-66BSPEOQ.js";import{a as xe}from"./chunk-CWBEE627.js";import{b as We,c as G,e as B,f as x,i as ze,j as V,l as Xe,o as W,q as z,r as X,s as Ye,t as Y}from"./chunk-USU2EHJV.js";import{b as R,d as N}from"./chunk-L2EO4M4B.js";import{A as Be,a as A,e as ve,g as k,l as Ae,p as ke,q as we,t as Ge}from"./chunk-WRNQOX5R.js";import{h as w}from"./chunk-J3BBLPAD.js";import{la as ie}from"./chunk-WJPLJKPQ.js";import{Ab as r,B as Oe,Bb as l,Cb as c,Dc as ae,Ec as $e,F as H,Fc as De,Gb as L,H as O,Hb as $,Jb as j,L as fe,Oc as le,P as he,Pc as v,Q,Qb as m,Ra as d,Rb as g,Sb as S,Tb as Ne,Ub as Pe,V as Ce,Wb as f,Yb as D,_ as p,bb as M,ea as h,fa as C,gb as Re,i as Se,ic as Ie,lc as q,nc as Me,o as Te,oa as _,oc as ye,qc as Z,rc as ee,sc as te,ub as y,vb as b,x as re,y as Ee,yc as be,zb as F,zc as Le}from"./chunk-QDFCX6XE.js";var He=new X,Ke=()=>He.group({passphrase:He.control("")}),_e=class a{#t=p(w);#e=p(P);#o=p(N);#n=p(R);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#o.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["destination"],{relativeTo:this.#n.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),f("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),S(3,0),l(),c(4,"input",6),l(),r(5,"app-toggle-card"),L(6,7),S(7,1),$(),r(8,"app-options-list",8),te("optionsChange",function(n){return ee(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),f("click",function(){return t.back()}),m(11,2),c(12,"sh-icon"),g(),l(),r(13,"button",11),m(14,3),c(15,"sh-icon"),g(),l()()()),e&2&&(F("formGroup",t.encryptionForm),d(8),Z("options",t.settings),F("hasFreeTextSettings",!0))},dependencies:[Y,V,G,B,x,W,z,Ae,A,k,ne,Ue],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var Ze=()=>({standalone:!0});function et(a,i){a&1&&c(0,"sh-progress-bar",8)}function tt(a,i){if(a&1&&(q(0),ae(1,"bytes")),a&2){let e=D().$implicit;Me(" (",$e(1,1,e.FileSizes),") ")}}function it(a,i){a&1&&(r(0,"span",16),S(1,4),l())}function ot(a,i){if(a&1&&(r(0,"div",15),q(1),ae(2,"date"),y(3,tt,2,3),y(4,it,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),ye(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),b(e.FileSizes?3:-1),d(),b(e.IsFullBackup===!1?4:-1)}}function nt(a,i){a&1&&c(0,"sh-progress-bar",8)}function st(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),S(2,5),l(),c(3,"input",18),l()),a&2){let e=D(2);F("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function rt(a,i){if(a&1){let e=j();r(0,"sh-select",12),f("cleared",function(){h(e);let o=D();return C(o.abortLoading())}),r(1,"input",13),te("ngModelChange",function(o){h(e);let n=D();return ee(n.selectOption,o)||(n.selectOption=o),C(o)}),l(),Re(2,ot,5,7,"ng-template"),l(),y(3,nt,1,0,"sh-progress-bar",8),y(4,st,4,5,"app-file-tree",14)}if(a&2){let e=D();F("options",e.versionOptions())("isClearable",!1),d(),Z("ngModel",e.selectOption),F("ngModelOptions",Le(6,Ze)),d(2),b(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),b(e.showFileTree()?4:-1)}}var ue=new X,Je=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=p(w);#e=p(P);#o=p(Ve);#n=p(oe);#i=p(N);#s=p(R);#l=p(ie);#a=null;#p=null;#r=_([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=v(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=v(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(J=>J.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,E=o[u];if(this.needsDatabaseRepair()&&(!E||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=v(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#p===n||(this.#p=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Q(this.abortLoading$),O(()=>{this.#p=null})).subscribe(s=>{let u=s.ID;this.#o.waitForTaskToComplete(u).pipe(H(1)).subscribe(()=>{this.#r.update(E=>E.filter(I=>I!==n)),this.loadedVersions.update(E=>(E[n]=!0,E))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#n.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Q(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Se;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-select-files"]],features:[be([ie])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",6,0),f("submit",function(){return h(o),C(t.next())}),r(2,"h3",7),S(3,1),l(),y(4,et,1,0,"sh-progress-bar",8)(5,rt,5,7),r(6,"div",9)(7,"button",10),f("click",function(){return h(o),C(t.back())}),m(8,2),c(9,"sh-icon"),g(),l(),r(10,"button",11),m(11,3),c(12,"sh-icon"),g(),l()()()}e&2&&(F("formGroup",t.selectFilesForm),d(4),b(t.versionOptionsLoading()?4:5),d(5),Ne(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[Ye,V,G,B,x,ze,Y,W,z,se,k,A,Ge,ke,ie,xe],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=p(N);#e=p(R);#o=p(oe);#n=p(ve);#i=p(w);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=Je();optionsForm=Qe();encryptionForm=Ke();optionsFormSignal=pe(this.optionsForm.valueChanges);selectFilesFormSignal=pe(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);#s=_("");#l=_(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#p=v(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(!0)}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#n.open(K,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#n.open(K,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#_(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder";return o||n||s||e===0?Te(()=>t):Ee(1e3).pipe(he(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(i=!1){let e=this.backupId();this.versionOptionsLoading.set(!0),this.#o.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:e}),this.loadFilesetsWithRetryv2(e)]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{if(o.Error)throw new Error(o.Error);if(!(t.Backup?.IsTemporary??!0)&&t?.Backup?.DBPathExists===!1){this.#n.open(K,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:s=>{this.#t.navigate(["/backup",e,"database"])}});return}this.versionOptions.set((o.Data??[]).map(s=>({Version:s.Version??-1,IsFullBackup:s.IsFullBackup??void 0,Time:s.Time??"<missing>",FileCount:s.FileCount??void 0,FileSizes:s.FileSizes??void 0}))),this.backup.set(t)},error:t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${t.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(K,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:E=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(fe(3))]).pipe(H(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)}})}#_(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=Ce({token:a,factory:a.\u0275fac,providedIn:"root"})};var U=new X,Qe=()=>U.group({restoreFrom:U.control("orignal"),restoreFromPath:U.control(""),handleExisting:U.control("overwrite"),permissions:U.control(!1),includeMetadata:U.control(!0)}),me=class a{#t=p(P);#e=p(N);#o=p(R);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let E;E=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let Fe;return Fe=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,E,I,J,ge,Fe,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=j();r(0,"form",13,0),f("submit",function(){return h(o),C(t.submit())}),r(2,"h3",14),S(3,1),l(),r(4,"app-toggle-card",15),L(5,16),S(6,2),$(),r(7,"sh-radio",17),m(8,3),c(9,"input",18),g(),l(),r(10,"sh-radio",17),m(11,4),c(12,"input",19),g(),l(),r(13,"app-file-tree",20)(14,"label",21),q(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),L(18,16),S(19,5),$(),r(20,"sh-radio",17),m(21,6),c(22,"input",23),g(),l(),r(23,"sh-radio",17),m(24,7),c(25,"input",24),g(),l()(),r(26,"app-toggle-card"),L(27,16),S(28,8),$(),r(29,"sh-toggle",25),m(30,9),c(31,"input",26),g(),l(),r(32,"sh-toggle",25),m(33,10),c(34,"input",27),g(),l()(),r(35,"div",28)(36,"button",29),f("click",function(){return h(o),C(t.goBack())}),m(37,11),c(38,"sh-icon"),g(),l(),r(39,"button",30),m(40,12),c(41,"sh-icon"),g(),l()()()}if(e&2){let o;F("formGroup",t.optionsForm),d(4),F("disallowToggle",!0),d(9),F("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),F("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[Y,V,G,We,Xe,B,x,W,z,ne,se,Be,we,k,A],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{Qe as a,me as b,Ke as c,_e as d,Je as e,de as f,P as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as P}from"./chunk-
|
|
1
|
+
import{d as P}from"./chunk-ETCRT3EV.js";import"./chunk-L2EO4M4B.js";import"./chunk-4YL5DZVH.js";import{g as b}from"./chunk-WRNQOX5R.js";import"./chunk-J3BBLPAD.js";import"./chunk-WJPLJKPQ.js";import"./chunk-FPPZ4BUR.js";import{Ab as i,Bb as a,Db as r,Eb as l,Fb as d,Ra as C,Sb as c,Zb as h,_,_b as m,bb as g,lc as M,ub as f,vb as O}from"./chunk-QDFCX6XE.js";import"./chunk-EUDKD2JW.js";var E=["*",[["","footer",""]]],y=["*","[footer]"],s=class t{static \u0275fac=function(e){return new(e||t)};static \u0275cmp=g({type:t,selectors:[["app-custom-card"]],ngContentSelectors:y,decls:11,vars:0,consts:[[1,"card"],["src","/assets/noise/auth-noise.svg",1,"noise"],[1,"header-title"],["src","/assets/duplicati/duplicati.svg","alt",""],[1,"bg"]],template:function(e,o){e&1&&(h(E),r(0,"div",0),d(1,"img",1),r(2,"header")(3,"div",2),d(4,"img",3),M(5," Duplicati "),l()(),r(6,"main"),m(7),r(8,"footer"),m(9,1),l()()(),d(10,"div",4))},styles:['[_nghost-%COMP%]{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center;background-color:var(--base-2)}body.dark [_nghost-%COMP%] .card[_ngcontent-%COMP%]:before{background:radial-gradient(rgba(var(--primary-rgb-900),1),#0000 60%)}.card[_ngcontent-%COMP%]{max-width:30rem;width:100%;position:relative;z-index:100;background-color:var(--base-1);border-radius:var(--shape-5);box-shadow:var(--box-shadow-40);border:1px solid var(--base-3);overflow:hidden}.card[_ngcontent-%COMP%]:before{content:"";position:absolute;height:30rem;transform:translateY(-17.8125rem);left:0;right:0;z-index:-2;background:radial-gradient(rgba(var(--primary-rgb-100),1),#0000 60%)}.card[_ngcontent-%COMP%] img.noise[_ngcontent-%COMP%]{position:absolute;height:30rem;width:100%;transform:translateY(-17.8125rem);left:0;right:0;z-index:-1;-webkit-mask-image:radial-gradient(#000,#0000 60%);mask-image:radial-gradient(#000,#0000 60%)}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:2rem 2rem 0;gap:.75rem;position:relative;z-index:10}.header-title[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;gap:.625rem}.header-title[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:1.75rem;filter:drop-shadow(0 2px 3px rgba(0,0,0,.3))}main[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding:2rem;gap:2.5rem;position:relative;z-index:10}main[_ngcontent-%COMP%] footer[_ngcontent-%COMP%]{font:var(--paragraph-40);color:var(--base-9);text-align:center;text-wrap:balance}.bg[_ngcontent-%COMP%]{position:fixed;inset:0;width:100vw;height:100vh;background-image:url(/assets/backgrounds/base-bg.svg);background-size:cover;background-position:center;background-repeat:no-repeat}body.dark[_ngcontent-%COMP%] .bg[_ngcontent-%COMP%]{opacity:1}footer[_ngcontent-%COMP%]:empty{display:none}'],changeDetection:0})};function S(t,n){t&1&&(i(0,"h3"),c(1,0),a())}function L(t,n){t&1&&(i(0,"h3"),c(1,1),a(),i(2,"button",3),c(3,2),a())}var p=class t{#e=_(P);isLoggingOut=this.#e.isLoggingOut;ngOnInit(){this.#e.logout()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=g({type:t,selectors:[["app-logout"]],decls:3,vars:1,consts:()=>{let n;n=$localize`Logging out...`;let e;e=$localize`You have successfully logged out your being redirected to login page.`;let o;return o=$localize`Go to login page`,[n,e,o,["shButton","","routerLink","/",1,"raised","primary"]]},template:function(e,o){e&1&&(i(0,"app-custom-card"),f(1,S,2,0,"h3")(2,L,4,0),a()),e&2&&(C(),O(o.isLoggingOut()?1:2))},dependencies:[s,b],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-EUDKD2JW.js";var o=[{path:"",loadComponent:()=>import("./chunk-X3IA226Q.js"),children:[{path:"",redirectTo:"stored",pathMatch:"full"},{path:"stored",loadComponent:()=>import("./chunk-CFNP4FBG.js")},{path:"live",loadComponent:()=>import("./chunk-AB2L3URR.js")}]}],t=o;export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as S}from"./chunk-
|
|
1
|
+
import{a as S}from"./chunk-WWFNG47J.js";import"./chunk-XNVRJH42.js";import"./chunk-3UN32GIC.js";import"./chunk-OXOOR7I4.js";import"./chunk-GUH5TMOS.js";import"./chunk-RHW5QVAY.js";import"./chunk-66BSPEOQ.js";import"./chunk-CWBEE627.js";import"./chunk-USU2EHJV.js";import"./chunk-ZGAC2JKG.js";import"./chunk-ETCRT3EV.js";import{c as O,e as C,f as d}from"./chunk-L2EO4M4B.js";import"./chunk-4YL5DZVH.js";import{y as M}from"./chunk-WRNQOX5R.js";import"./chunk-J3BBLPAD.js";import"./chunk-B5FUQFEQ.js";import"./chunk-WJPLJKPQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-73RDJP55.js";import{Ab as e,Bb as t,Cb as l,Sb as n,bb as A}from"./chunk-QDFCX6XE.js";import"./chunk-EUDKD2JW.js";var s=class a{static \u0275fac=function(o){return new(o||a)};static \u0275cmp=A({type:a,selectors:[["app-about"]],decls:19,vars:0,consts:()=>{let _;_=$localize`General`;let o;o=$localize`Changelog`;let r;r=$localize`Libraries`;let g;g=$localize`System info`;let u;u=$localize`Server settings`;let T;T=$localize`Logs`;let c;return c=$localize`Crash log`,[_,o,r,g,u,T,c,[1,"content"],[1,"primary"],["tab","","routerLink","/about/general","routerLinkActive","active"],["tab","","routerLink","/about/changelog","routerLinkActive","active"],["tab","","routerLink","/about/libraries","routerLinkActive","active"],["tab","","routerLink","/about/system-info","routerLinkActive","active"],["tab","","routerLink","/about/server-settings","routerLinkActive","active"],["tab","","routerLink","/about/logs","routerLinkActive","active"],["tab","","routerLink","/about/crashlogs","routerLinkActive","active"]]},template:function(o,r){o&1&&(l(0,"app-status-bar"),e(1,"div",7)(2,"sh-tabs",8)(3,"button",9),n(4,0),t(),e(5,"button",10),n(6,1),t(),e(7,"button",11),n(8,2),t(),e(9,"button",12),n(10,3),t(),e(11,"button",13),n(12,4),t(),e(13,"button",14),n(14,5),t(),e(15,"button",15),n(16,6),t()(),e(17,"section"),l(18,"router-outlet"),t()())},dependencies:[S,M,O,C,d],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:0}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:1rem 0}.content[_ngcontent-%COMP%] sh-tabs[_ngcontent-%COMP%]{margin:0 2rem}.content[_ngcontent-%COMP%] section[_ngcontent-%COMP%]{padding-left:2rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem}"],changeDetection:0})};export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ce}from"./chunk-5SPGCYAQ.js";import{a as ge}from"./chunk-JB75BUPF.js";import{a as me}from"./chunk-P2DII6CV.js";import{a as Te}from"./chunk-OWAZS6AA.js";import{c as Ee,e as Oe,i as fe,k as Ae,s as G}from"./chunk-USU2EHJV.js";import{b as oe}from"./chunk-4URGDROZ.js";import{a as ae,b as se,e as le,g as re,i as _e,l as ue,p as pe,q as Se,s as ce,t as de}from"./chunk-WRNQOX5R.js";import{h as A}from"./chunk-QM6X5ZEC.js";import{a as Pe}from"./chunk-B5FUQFEQ.js";import{la as ie}from"./chunk-WJPLJKPQ.js";import{Ab as s,Bb as l,Cb as C,Dc as H,Ec as te,Fc as ne,H as k,Jb as R,Oc as U,Qb as E,Ra as r,Rb as O,Sb as p,Tc as x,Vb as Q,Wb as S,Yb as T,_ as d,bb as f,ea as N,fa as M,hc as ee,ic as m,lc as g,nc as L,oa as c,oc as z,qc as b,rc as B,sc as y,ub as F,vb as D,wb as Z,xb as q,yb as J,zb as I}from"./chunk-QDFCX6XE.js";function Re(a,n){if(a&1){let i=R();s(0,"sh-radio",10),S("click",function(){let t=N(i).$implicit,o=T();return M(o.pauseOption.set(t.value))}),g(1),l()}if(a&2){let i=n.$implicit,e=T();m("active",e.pauseOption()===i.value),r(),L(" ",i.label," ")}}var be=[{label:$localize`5 minutes`,value:"5m"},{label:$localize`10 minutes`,value:"10m"},{label:$localize`15 minutes`,value:"15m"},{label:$localize`30 minutes`,value:"30m"},{label:$localize`1 hour`,value:"1h"},{label:$localize`4 hours`,value:"4h"},{label:$localize`8 hours`,value:"8h"},{label:$localize`24 hours`,value:"24h"},{label:$localize`Until resumed`,value:void 0}],$=class a{#e=d(A);pauseOptions=c(be);closed=x();isSubmitting=c(!1);pauseTransfers=c(!1);pauseOption=c(void 0);submit(){this.isSubmitting.set(!0);let n=this.pauseTransfers()||null,i=this.pauseOption();this.#e.postApiV1ServerstatePause({duration:i,pauseTransfers:n}).pipe(k(()=>this.isSubmitting.set(!1))).subscribe({next:e=>{this.closed.emit()}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["app-pause-dialog"]],outputs:{closed:"closed"},decls:17,vars:4,consts:()=>{let n;n=$localize`Pause settings`;let i;i=$localize` Also pause transfers `;let e;e=$localize`If you pause transfers they could time out and cause retries or failures.`;let t;t=$localize`Cancel`;let o;return o=$localize` Update settings `,[n,i,e,t,o,["header",""],["content",""],[1,"radios"],[1,"primary","raised",3,"active"],[1,"check-wrap"],[1,"primary","raised",3,"click"],["type","warning"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header",5)(1,"h3"),p(2,0),l()(),s(3,"div",6)(4,"div",7),q(5,Re,2,3,"sh-radio",8,Z),l(),s(7,"div",9)(8,"sh-checkbox",10),S("click",function(){return e.pauseTransfers.set(!e.pauseTransfers())}),p(9,1),l(),s(10,"sh-alert",11),p(11,2),l()()(),s(12,"footer",12)(13,"button",13),S("click",function(){return e.closed.emit()}),p(14,3),l(),s(15,"button",14),S("click",function(){return e.submit()}),p(16,4),l()()),i&2&&(r(5),J(e.pauseOptions()),r(3),m("active",e.pauseTransfers()),r(7),m("loader",e.isSubmitting()))},dependencies:[G,Se,_e,se],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.check-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:2rem 0 0}"],changeDetection:0})};var Me={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},Be=["mbps","gbps"],Fe=8,W=1024,w=W*1024,K=w*1024,Y=K*1024,De=Y*1024,ye={B:1,KB:W,MB:w,GB:K,TB:Y,PB:De},Ue=1e3,V=Ue*1e3,X=V*1e3,ve=[{threshold:De,unitPrefix:"PByte"},{threshold:Y,unitPrefix:"TByte"},{threshold:K,unitPrefix:"GByte"},{threshold:w,unitPrefix:"MByte"},{threshold:W,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],v=class a{#e=d(A);closed=x();isSubmitting=c(!1);sizeOptions=c([...Be]);maxUpload=c(0);maxDownload=c(0);maxUploadUnit=c("mbps");maxDownloadUnit=c("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(n,i){let t=n*(ye[i.toUpperCase()]||w)*Fe;return t===0?{value:0,unit:"mbps"}:t>=X?{value:parseFloat((t/X).toFixed(2)),unit:"gbps"}:{value:parseFloat((t/V).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(n,i){let e=0;switch(i){case"gbps":e=n*X;break;case"mbps":e=n*V;break}let t=e/Fe;if(t===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:o,unitPrefix:_}of ve)if(t>=o)return{valueForApi:Math.round(t/o),unitPrefixForApi:_};return{valueForApi:Math.round(t),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:n=>{let i=n?.["max-upload-speed"],e=n?.["max-download-speed"];if(i&&i!==""){let t=i.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),_=t[2],u=this.convertToBitsPerSecondUnits(o,_);this.maxUpload.set(u.value),this.maxUploadUnit.set(u.unit)}else console.warn("Unexpected max-upload-speed format from API:",i),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let t=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),_=t[2],u=this.convertToBitsPerSecondUnits(o,_);this.maxDownload.set(u.value),this.maxDownloadUnit.set(u.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:n=>{console.error("Failed to get server settings:",n),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(n){if([".",","].includes(n.key))return n.preventDefault()}cleanupInputAfterPasting(n){n.preventDefault();let i=n.clipboardData?.getData("text/plain");if(!i)return;let e=i.replaceAll(/[\.,]/g,"");n.target.value=e}submit(){this.isSubmitting.set(!0);let n="",i="",e=this.maxUpload()??0,t=this.maxUploadUnit(),o=this.maxDownload()??0,_=this.maxDownloadUnit();if(e>0){let{valueForApi:u,unitPrefixForApi:P}=this.convertFromBitsPerSecondUnits(e,t),h=Me[P];h?n=`${u}${h}`:console.error(`Invalid unit prefix for API submission (upload): ${P}. Defaulting to empty string.`)}if(o){let{valueForApi:u,unitPrefixForApi:P}=this.convertFromBitsPerSecondUnits(o,_),h=Me[P];h?i=`${u}${h}`:console.error(`Invalid unit prefix for API submission (download): ${P}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":n,"max-download-speed":i}}).pipe(k(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:u=>{console.error("Failed to submit throttle settings:",u)}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let n;n=$localize`Throttle network speed`;let i;i=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let t;t=$localize`Max download speed`;let o;o=$localize`Cancel`;let _;return _=$localize` Update settings `,[n,i,e,t,o,_,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header")(1,"h3"),p(2,0),l(),s(3,"p"),p(4,1),l()(),s(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),p(9,2),l(),s(10,"sh-form-field")(11,"input",9),S("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),y("ngModelChange",function(o){return B(e.maxUpload,o)||(e.maxUpload=o),o}),l()(),s(12,"sh-select",10)(13,"input",11),y("ngModelChange",function(o){return B(e.maxUploadUnit,o)||(e.maxUploadUnit=o),o}),l()()(),s(14,"div",8)(15,"label"),p(16,3),l(),s(17,"sh-form-field")(18,"input",9),S("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),y("ngModelChange",function(o){return B(e.maxDownload,o)||(e.maxDownload=o),o}),l()(),s(19,"sh-select",10)(20,"input",11),y("ngModelChange",function(o){return B(e.maxDownloadUnit,o)||(e.maxDownloadUnit=o),o}),l()()()()(),s(21,"footer",12)(22,"button",13),S("click",function(){return e.closed.emit(!1)}),p(23,4),l(),s(24,"button",14),S("click",function(){return e.submit()}),p(25,5),l()()),i&2&&(r(11),b("ngModel",e.maxUpload),r(),I("isClearable",!1)("options",e.sizeOptions()),r(),b("ngModel",e.maxUploadUnit),r(5),b("ngModel",e.maxDownload),r(),I("isClearable",!1)("options",e.sizeOptions()),r(),b("ngModel",e.maxDownloadUnit),r(4),m("loader",e.isSubmitting()))},dependencies:[G,Ee,Ae,Oe,fe,ue,de],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function ke(a,n){if(a&1&&(s(0,"div"),g(1),l(),C(2,"sh-progress-bar",11)),a&2){let i=T();r(),z("",i.statusData().actionText," - ",i.statusData().statusText),r(),I("value",i.statusData().progress*100)}}function Le(a,n){if(a&1&&(s(0,"div",7),g(1),s(2,"sh-icon"),g(3,"clock"),l(),g(4),H(5,"relativeTime"),H(6,"date"),l()),a&2){let i,e=T();r(),L(" ",(i=e.nextBackup().backup)==null||i.Backup==null?null:i.Backup.Name," - "),r(3),z(" ",te(5,3,e.nextBackup().time)," at ",ne(6,5,e.nextBackup().time,"shortTime")," ")}}function xe(a,n){a&1&&(s(0,"div",7),p(1,1),l())}function Ge(a,n){a&1&&(s(0,"div",8),E(1,2),C(2,"sh-spinner"),O(),l()),a&2&&(r(2),ee("--spinner-size","12px")("--spinner-thickness","2px"))}function $e(a,n){if(a&1){let i=R();s(0,"button",10),S("click",function(){N(i);let t=T(2);return M(t.abort())}),E(1,3),C(2,"sh-icon"),O(),l()}}function we(a,n){if(a&1){let i=R();s(0,"button",10),S("click",function(){N(i);let t=T(2);return M(t.stop())}),E(1,4),C(2,"sh-icon"),O(),l()}}function ze(a,n){if(a&1&&F(0,$e,3,0,"button",12)(1,we,3,0,"button",12),a&2){let i=T();D(i.isStopping()?0:1)}}function He(a,n){a&1&&(E(0,0,1),C(1,"sh-icon"),O())}function Xe(a,n){a&1&&(E(0,0,2),C(1,"sh-icon"),O())}var Ie=new Date,j=class a{#e=d(A);#t=d(Ce);#n=d(le);#a=d(ge);#s=d(oe);#l=d(Te);#i=d(me);minsAgo=Ie.setMinutes(Ie.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=U(()=>this.#i.serverState()?.ActiveTask?.Item1);isStopping=U(()=>this.runningTask()==this.#o());#o=c(-1);pgState=U(()=>this.#i.serverState());nextBackup=U(()=>{let n=this.#a.backups();return{backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}});openThrottleSettingsDialog(){this.#n.open(v,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open($,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let n=this.runningTask();n&&(this.#o.set(n),this.#e.postApiV1TaskByTaskidStop({taskid:n}).subscribe())}abort(){let n=this.runningTask();n&&this.#e.postApiV1TaskByTaskidAbort({taskid:n}).subscribe()}ngAfterViewInit(){let n=this.#s.relayIsEnabled()||!this.#l.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(n)}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["app-status-bar"]],decls:15,vars:5,consts:()=>{let n;n=$localize`${"\uFFFD*10:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*10:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*11:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Start ${"\uFFFD/*11:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=Q(n);let i;i=$localize`No scheduled tasks`;let e;e=$localize` Loading ${"\uFFFD#2\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let o;return o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[n,i,e,t,o,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"label","label-loading"],[1,"current-backup-actions"],["shButton","",3,"click"],[1,"raised","primary",3,"value"],["shButton",""]]},template:function(i,e){if(i&1&&(s(0,"div",5)(1,"div",6),F(2,ke,3,3)(3,Le,7,8,"div",7)(4,xe,2,0,"div",7)(5,Ge,3,4,"div",8),l(),s(6,"div",9),F(7,ze,2,1),s(8,"button",10),S("click",function(){return e.pauseResume()}),E(9,0),F(10,He,2,0)(11,Xe,2,0),O(),l(),s(12,"button",10),S("click",function(){return e.openThrottleSettingsDialog()}),s(13,"sh-icon"),g(14,"speedometer"),l()()()()),i&2){let t;r(2),D((t=e.serverState())!=null&&t.ActiveTask&&(!((t=e.statusData())==null||t.task==null)&&t.task.Status)&&((t=e.statusData())==null||t.task==null?null:t.task.Status)!=="Completed"?2:e.nextBackup().backup||e.nextBackup().time?3:(t=e.serverState())!=null&&t.ActiveTask?5:4),r(5),D(e.runningTask()?7:-1),r(),m("loader",e.isResuming()),r(2),D(e.clientIsRunning()?10:11)}},dependencies:[pe,ae,re,ce,Pe,ie],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem}.current-backup-progress[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.label-loading[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}"],changeDetection:0})};export{j as a};
|
|
1
|
+
import{a as Ce}from"./chunk-XNVRJH42.js";import{a as ge}from"./chunk-3UN32GIC.js";import{a as me}from"./chunk-OXOOR7I4.js";import{a as Te}from"./chunk-66BSPEOQ.js";import{c as Ee,e as Oe,i as fe,k as Ae,s as G}from"./chunk-USU2EHJV.js";import{b as oe}from"./chunk-ETCRT3EV.js";import{a as ae,b as se,e as le,g as re,i as _e,l as ue,p as pe,q as Se,s as ce,t as de}from"./chunk-WRNQOX5R.js";import{h as A}from"./chunk-J3BBLPAD.js";import{a as Pe}from"./chunk-B5FUQFEQ.js";import{la as ie}from"./chunk-WJPLJKPQ.js";import{Ab as s,Bb as l,Cb as C,Dc as H,Ec as te,Fc as ne,H as k,Jb as R,Oc as U,Qb as E,Ra as r,Rb as O,Sb as p,Tc as x,Vb as Q,Wb as S,Yb as T,_ as d,bb as f,ea as N,fa as M,hc as ee,ic as m,lc as g,nc as L,oa as c,oc as z,qc as b,rc as B,sc as y,ub as F,vb as D,wb as Z,xb as q,yb as J,zb as I}from"./chunk-QDFCX6XE.js";function Re(a,n){if(a&1){let i=R();s(0,"sh-radio",10),S("click",function(){let t=N(i).$implicit,o=T();return M(o.pauseOption.set(t.value))}),g(1),l()}if(a&2){let i=n.$implicit,e=T();m("active",e.pauseOption()===i.value),r(),L(" ",i.label," ")}}var be=[{label:$localize`5 minutes`,value:"5m"},{label:$localize`10 minutes`,value:"10m"},{label:$localize`15 minutes`,value:"15m"},{label:$localize`30 minutes`,value:"30m"},{label:$localize`1 hour`,value:"1h"},{label:$localize`4 hours`,value:"4h"},{label:$localize`8 hours`,value:"8h"},{label:$localize`24 hours`,value:"24h"},{label:$localize`Until resumed`,value:void 0}],$=class a{#e=d(A);pauseOptions=c(be);closed=x();isSubmitting=c(!1);pauseTransfers=c(!1);pauseOption=c(void 0);submit(){this.isSubmitting.set(!0);let n=this.pauseTransfers()||null,i=this.pauseOption();this.#e.postApiV1ServerstatePause({duration:i,pauseTransfers:n}).pipe(k(()=>this.isSubmitting.set(!1))).subscribe({next:e=>{this.closed.emit()}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["app-pause-dialog"]],outputs:{closed:"closed"},decls:17,vars:4,consts:()=>{let n;n=$localize`Pause settings`;let i;i=$localize` Also pause transfers `;let e;e=$localize`If you pause transfers they could time out and cause retries or failures.`;let t;t=$localize`Cancel`;let o;return o=$localize` Update settings `,[n,i,e,t,o,["header",""],["content",""],[1,"radios"],[1,"primary","raised",3,"active"],[1,"check-wrap"],[1,"primary","raised",3,"click"],["type","warning"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header",5)(1,"h3"),p(2,0),l()(),s(3,"div",6)(4,"div",7),q(5,Re,2,3,"sh-radio",8,Z),l(),s(7,"div",9)(8,"sh-checkbox",10),S("click",function(){return e.pauseTransfers.set(!e.pauseTransfers())}),p(9,1),l(),s(10,"sh-alert",11),p(11,2),l()()(),s(12,"footer",12)(13,"button",13),S("click",function(){return e.closed.emit()}),p(14,3),l(),s(15,"button",14),S("click",function(){return e.submit()}),p(16,4),l()()),i&2&&(r(5),J(e.pauseOptions()),r(3),m("active",e.pauseTransfers()),r(7),m("loader",e.isSubmitting()))},dependencies:[G,Se,_e,se],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.check-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:2rem 0 0}"],changeDetection:0})};var Me={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},Be=["mbps","gbps"],Fe=8,W=1024,w=W*1024,K=w*1024,Y=K*1024,De=Y*1024,ye={B:1,KB:W,MB:w,GB:K,TB:Y,PB:De},Ue=1e3,V=Ue*1e3,X=V*1e3,ve=[{threshold:De,unitPrefix:"PByte"},{threshold:Y,unitPrefix:"TByte"},{threshold:K,unitPrefix:"GByte"},{threshold:w,unitPrefix:"MByte"},{threshold:W,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],v=class a{#e=d(A);closed=x();isSubmitting=c(!1);sizeOptions=c([...Be]);maxUpload=c(0);maxDownload=c(0);maxUploadUnit=c("mbps");maxDownloadUnit=c("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(n,i){let t=n*(ye[i.toUpperCase()]||w)*Fe;return t===0?{value:0,unit:"mbps"}:t>=X?{value:parseFloat((t/X).toFixed(2)),unit:"gbps"}:{value:parseFloat((t/V).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(n,i){let e=0;switch(i){case"gbps":e=n*X;break;case"mbps":e=n*V;break}let t=e/Fe;if(t===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:o,unitPrefix:_}of ve)if(t>=o)return{valueForApi:Math.round(t/o),unitPrefixForApi:_};return{valueForApi:Math.round(t),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:n=>{let i=n?.["max-upload-speed"],e=n?.["max-download-speed"];if(i&&i!==""){let t=i.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),_=t[2],u=this.convertToBitsPerSecondUnits(o,_);this.maxUpload.set(u.value),this.maxUploadUnit.set(u.unit)}else console.warn("Unexpected max-upload-speed format from API:",i),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let t=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),_=t[2],u=this.convertToBitsPerSecondUnits(o,_);this.maxDownload.set(u.value),this.maxDownloadUnit.set(u.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:n=>{console.error("Failed to get server settings:",n),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(n){if([".",","].includes(n.key))return n.preventDefault()}cleanupInputAfterPasting(n){n.preventDefault();let i=n.clipboardData?.getData("text/plain");if(!i)return;let e=i.replaceAll(/[\.,]/g,"");n.target.value=e}submit(){this.isSubmitting.set(!0);let n="",i="",e=this.maxUpload()??0,t=this.maxUploadUnit(),o=this.maxDownload()??0,_=this.maxDownloadUnit();if(e>0){let{valueForApi:u,unitPrefixForApi:P}=this.convertFromBitsPerSecondUnits(e,t),h=Me[P];h?n=`${u}${h}`:console.error(`Invalid unit prefix for API submission (upload): ${P}. Defaulting to empty string.`)}if(o){let{valueForApi:u,unitPrefixForApi:P}=this.convertFromBitsPerSecondUnits(o,_),h=Me[P];h?i=`${u}${h}`:console.error(`Invalid unit prefix for API submission (download): ${P}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":n,"max-download-speed":i}}).pipe(k(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:u=>{console.error("Failed to submit throttle settings:",u)}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let n;n=$localize`Throttle network speed`;let i;i=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let t;t=$localize`Max download speed`;let o;o=$localize`Cancel`;let _;return _=$localize` Update settings `,[n,i,e,t,o,_,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header")(1,"h3"),p(2,0),l(),s(3,"p"),p(4,1),l()(),s(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),p(9,2),l(),s(10,"sh-form-field")(11,"input",9),S("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),y("ngModelChange",function(o){return B(e.maxUpload,o)||(e.maxUpload=o),o}),l()(),s(12,"sh-select",10)(13,"input",11),y("ngModelChange",function(o){return B(e.maxUploadUnit,o)||(e.maxUploadUnit=o),o}),l()()(),s(14,"div",8)(15,"label"),p(16,3),l(),s(17,"sh-form-field")(18,"input",9),S("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),y("ngModelChange",function(o){return B(e.maxDownload,o)||(e.maxDownload=o),o}),l()(),s(19,"sh-select",10)(20,"input",11),y("ngModelChange",function(o){return B(e.maxDownloadUnit,o)||(e.maxDownloadUnit=o),o}),l()()()()(),s(21,"footer",12)(22,"button",13),S("click",function(){return e.closed.emit(!1)}),p(23,4),l(),s(24,"button",14),S("click",function(){return e.submit()}),p(25,5),l()()),i&2&&(r(11),b("ngModel",e.maxUpload),r(),I("isClearable",!1)("options",e.sizeOptions()),r(),b("ngModel",e.maxUploadUnit),r(5),b("ngModel",e.maxDownload),r(),I("isClearable",!1)("options",e.sizeOptions()),r(),b("ngModel",e.maxDownloadUnit),r(4),m("loader",e.isSubmitting()))},dependencies:[G,Ee,Ae,Oe,fe,ue,de],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function ke(a,n){if(a&1&&(s(0,"div"),g(1),l(),C(2,"sh-progress-bar",11)),a&2){let i=T();r(),z("",i.statusData().actionText," - ",i.statusData().statusText),r(),I("value",i.statusData().progress*100)}}function Le(a,n){if(a&1&&(s(0,"div",7),g(1),s(2,"sh-icon"),g(3,"clock"),l(),g(4),H(5,"relativeTime"),H(6,"date"),l()),a&2){let i,e=T();r(),L(" ",(i=e.nextBackup().backup)==null||i.Backup==null?null:i.Backup.Name," - "),r(3),z(" ",te(5,3,e.nextBackup().time)," at ",ne(6,5,e.nextBackup().time,"shortTime")," ")}}function xe(a,n){a&1&&(s(0,"div",7),p(1,1),l())}function Ge(a,n){a&1&&(s(0,"div",8),E(1,2),C(2,"sh-spinner"),O(),l()),a&2&&(r(2),ee("--spinner-size","12px")("--spinner-thickness","2px"))}function $e(a,n){if(a&1){let i=R();s(0,"button",10),S("click",function(){N(i);let t=T(2);return M(t.abort())}),E(1,3),C(2,"sh-icon"),O(),l()}}function we(a,n){if(a&1){let i=R();s(0,"button",10),S("click",function(){N(i);let t=T(2);return M(t.stop())}),E(1,4),C(2,"sh-icon"),O(),l()}}function ze(a,n){if(a&1&&F(0,$e,3,0,"button",12)(1,we,3,0,"button",12),a&2){let i=T();D(i.isStopping()?0:1)}}function He(a,n){a&1&&(E(0,0,1),C(1,"sh-icon"),O())}function Xe(a,n){a&1&&(E(0,0,2),C(1,"sh-icon"),O())}var Ie=new Date,j=class a{#e=d(A);#t=d(Ce);#n=d(le);#a=d(ge);#s=d(oe);#l=d(Te);#i=d(me);minsAgo=Ie.setMinutes(Ie.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=U(()=>this.#i.serverState()?.ActiveTask?.Item1);isStopping=U(()=>this.runningTask()==this.#o());#o=c(-1);pgState=U(()=>this.#i.serverState());nextBackup=U(()=>{let n=this.#a.backups();return{backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}});openThrottleSettingsDialog(){this.#n.open(v,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open($,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let n=this.runningTask();n&&(this.#o.set(n),this.#e.postApiV1TaskByTaskidStop({taskid:n}).subscribe())}abort(){let n=this.runningTask();n&&this.#e.postApiV1TaskByTaskidAbort({taskid:n}).subscribe()}ngAfterViewInit(){let n=this.#s.relayIsEnabled()||!this.#l.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(n)}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["app-status-bar"]],decls:15,vars:5,consts:()=>{let n;n=$localize`${"\uFFFD*10:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*10:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*11:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Start ${"\uFFFD/*11:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=Q(n);let i;i=$localize`No scheduled tasks`;let e;e=$localize` Loading ${"\uFFFD#2\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let o;return o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[n,i,e,t,o,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"label","label-loading"],[1,"current-backup-actions"],["shButton","",3,"click"],[1,"raised","primary",3,"value"],["shButton",""]]},template:function(i,e){if(i&1&&(s(0,"div",5)(1,"div",6),F(2,ke,3,3)(3,Le,7,8,"div",7)(4,xe,2,0,"div",7)(5,Ge,3,4,"div",8),l(),s(6,"div",9),F(7,ze,2,1),s(8,"button",10),S("click",function(){return e.pauseResume()}),E(9,0),F(10,He,2,0)(11,Xe,2,0),O(),l(),s(12,"button",10),S("click",function(){return e.openThrottleSettingsDialog()}),s(13,"sh-icon"),g(14,"speedometer"),l()()()()),i&2){let t;r(2),D((t=e.serverState())!=null&&t.ActiveTask&&(!((t=e.statusData())==null||t.task==null)&&t.task.Status)&&((t=e.statusData())==null||t.task==null?null:t.task.Status)!=="Completed"?2:e.nextBackup().backup||e.nextBackup().time?3:(t=e.serverState())!=null&&t.ActiveTask?5:4),r(5),D(e.runningTask()?7:-1),r(),m("loader",e.isResuming()),r(2),D(e.clientIsRunning()?10:11)}},dependencies:[pe,ae,re,ce,Pe,ie],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem;flex:1 0}.current-backup-progress[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{max-width:18.75rem;width:100%}.current-backup-progress[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.label-loading[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}"],changeDetection:0})};export{j as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as h}from"./chunk-
|
|
1
|
+
import{g as h}from"./chunk-TJOWPBPB.js";import"./chunk-K3ZQ67VT.js";import"./chunk-CZLLEVMJ.js";import{a as w}from"./chunk-WWFNG47J.js";import{h as k}from"./chunk-36RDZAZ4.js";import"./chunk-QY6E755W.js";import"./chunk-UACX27D3.js";import"./chunk-VC72SWC4.js";import{b as T}from"./chunk-QGFC5ZUR.js";import"./chunk-XNVRJH42.js";import"./chunk-3UN32GIC.js";import"./chunk-OXOOR7I4.js";import"./chunk-GUH5TMOS.js";import"./chunk-RHW5QVAY.js";import"./chunk-66BSPEOQ.js";import"./chunk-CWBEE627.js";import"./chunk-USU2EHJV.js";import"./chunk-ZGAC2JKG.js";import"./chunk-ETCRT3EV.js";import{a as L,b as M,c as N,d as I,e as G,f as W}from"./chunk-L2EO4M4B.js";import"./chunk-4YL5DZVH.js";import{q as v,v as y}from"./chunk-WRNQOX5R.js";import"./chunk-J3BBLPAD.js";import"./chunk-B5FUQFEQ.js";import"./chunk-WJPLJKPQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-73RDJP55.js";import{Ab as i,Ac as p,Bb as n,Cb as s,Pc as $,Qb as F,Ra as r,Rb as l,Yb as O,_ as u,bb as D,ic as P,oa as C,ub as g,vb as E,yc as A,zb as _,zc as R}from"./chunk-QDFCX6XE.js";import"./chunk-EUDKD2JW.js";var b=()=>["/restore-from-files/destination"],x=()=>["/restore-from-files/encryption"],H=()=>["/restore-from-files/select-files"],X=()=>["/restore-from-files/options"],z=t=>["/restore",t,"select-files"],B=t=>["/restore",t,"options"];function U(t,o){t&1&&(i(0,"div",6),F(1,0),s(2,"sh-radio"),l(),n(),i(3,"div",6),F(4,1),s(5,"sh-radio"),l(),n(),i(6,"div",6),F(7,2),s(8,"sh-radio"),l(),n(),i(9,"div",6),F(10,3),s(11,"sh-radio"),l(),n()),t&2&&(_("routerLink",R(4,b)),r(3),_("routerLink",R(5,x)),r(3),_("routerLink",R(6,H)),r(3),_("routerLink",R(7,X)))}function j(t,o){if(t&1&&(i(0,"div",6),F(1,4),s(2,"sh-radio"),l(),n(),i(3,"div",6),F(4,5),s(5,"sh-radio"),l(),n()),t&2){let e=O(2);_("routerLink",p(2,z,e.backupId())),r(3),_("routerLink",p(4,B,e.backupId()))}}function V(t,o){if(t&1&&(i(0,"sh-stepper"),g(1,U,12,8)(2,j,6,6),n()),t&2){let e=O();r(),E(e.isFileRestore()?1:2)}}var m=class t{#e=u(M);#o=u(I);#t=u(h);#i=T(this.#e.params);#n=T(this.#e.url);#s=T(this.#e.children[0].url);backupId=this.#t.backupId;isFileRestore=this.#t.isFileRestore;isProgressPage=C(!1);paramsChanged=$(()=>{let o=this.#s(),e=this.#i()?.id,a=!!this.#n()?.find(d=>d.path==="restore-from-files"),c=!!o?.find(d=>d.path==="progress");this.isProgressPage.set(c),this.#t.init(e,a)});ngOnInit(){this.#o.events.subscribe(o=>{if(o instanceof L){let e=o.urlAfterRedirects;this.isProgressPage.set(e.includes("progress"))}})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=D({type:t,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(e,a){e&2&&P("full-width",a.isProgressPage())},features:[A([h,k])],decls:4,vars:1,consts:()=>{let o;o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Encryption `;let a;a=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let c;c=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `;let d;d=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_RADIO: Select files `;let f;return f=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[o,e,a,c,d,f,["step","","routerLinkActive","active",3,"routerLink"]]},template:function(e,a){e&1&&(s(0,"app-status-bar"),g(1,V,3,1,"sh-stepper"),i(2,"section"),s(3,"router-outlet"),n()),e&2&&(r(),E(a.isProgressPage()?-1:1))},dependencies:[y,v,w,N,G,W],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}sh-stepper[_ngcontent-%COMP%]{max-width:31.25rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}"],changeDetection:0})};export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as z}from"./chunk-
|
|
1
|
+
import{a as z}from"./chunk-GO22DJ44.js";import{a as x,c as B,d as w,e as U,f as k}from"./chunk-L2EO4M4B.js";import"./chunk-4YL5DZVH.js";import{a as X,f as H,o as V}from"./chunk-WRNQOX5R.js";import"./chunk-J3BBLPAD.js";import"./chunk-WJPLJKPQ.js";import"./chunk-FPPZ4BUR.js";import{Ab as i,Bb as t,Cb as _,Gb as f,Hb as P,Jb as R,Qb as l,Ra as O,Rb as s,Sb as b,Tb as v,Ub as y,Wb as u,Yb as c,_ as T,bb as D,ea as a,fa as S,oa as $,ub as N,vb as G,zb as M}from"./chunk-QDFCX6XE.js";import"./chunk-EUDKD2JW.js";function W(g,F){if(g&1){let n=R();i(0,"sh-menu",15)(1,"button",16),b(2,2),t(),f(3,17),i(4,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Disabled"))}),l(5,3),_(6,"sh-icon"),s(),t(),i(7,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Verbose"))}),l(8,4),_(9,"sh-icon"),s(),t(),i(10,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("ExplicitOnly"))}),l(11,5),_(12,"sh-icon"),s(),t(),i(13,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Profiling"))}),l(14,6),_(15,"sh-icon"),s(),t(),i(16,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Retry"))}),l(17,7),_(18,"sh-icon"),s(),t(),i(19,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Information"))}),l(20,8),_(21,"sh-icon"),s(),t(),i(22,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("DryRun"))}),l(23,9),_(24,"sh-icon"),s(),t(),i(25,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Warning"))}),l(26,10),_(27,"sh-icon"),s(),t(),i(28,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Error"))}),l(29,11),_(30,"sh-icon"),s(),t(),P(),t()}if(g&2){let n=c();M("openIndicator",!0),O(2),v(n.logLevelByLabel()),y(2)}}var C=class g{#n=T(w);#e=T(z);logLevel=this.#e.logLevel;logLevelByLabel=this.#e.logLevelByLabel;currentUrl=$(this.#n.url);constructor(){this.#n.events.subscribe(F=>{F instanceof x&&this.currentUrl.set(F.urlAfterRedirects)})}updateLogLevel(F){this.#e.isPolling.set(!0),this.#e.updateLogLevel(F)}static \u0275fac=function(n){return new(n||g)};static \u0275cmp=D({type:g,selectors:[["app-logs"]],decls:10,vars:1,consts:()=>{let F;F=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:archive${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: Stored `;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:play${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Live `;let o;o=$localize`Log level: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:bell-simple-slash${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON: Disabled `;let L;L=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:megaphone-simple${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: Verbose `;let d;d=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:flow-arrow${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Explicit only `;let h;h=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:speedometer${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Profiling `;let I;I=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-arc-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Retry `;let E;E=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Information `;let A;A=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:person-simple-run${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Dry run `;let m;m=$localize`${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON: Warning `;let p;return p=$localize`${"\uFFFD#30\uFFFD"}:START_TAG_SH_ICON:warning-octagon${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_SH_ICON: Error `,[F,n,o,e,L,d,h,I,E,A,m,p,[1,"filters"],["type","button","routerLink","/about/logs/stored","routerLinkActive","active"],["type","button","routerLink","/about/logs/live","routerLinkActive","active"],[3,"openIndicator"],["shButton","","type","button"],["menu",""],["shButton","","type","button",1,"small",3,"click"]]},template:function(n,o){n&1&&(i(0,"div",12)(1,"sh-button-group")(2,"button",13),l(3,0),_(4,"sh-icon"),s(),t(),i(5,"button",14),l(6,1),_(7,"sh-icon"),s(),t()(),N(8,W,31,2,"sh-menu",15),t(),_(9,"router-outlet")),n&2&&(O(8),G(o.currentUrl().startsWith("/about/logs/live")?8:-1))},dependencies:[H,X,V,B,k,U],styles:["[_nghost-%COMP%]{display:block}.filters[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:0 2rem;margin-bottom:1.25rem}"],changeDetection:0})};export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _}from"./chunk-
|
|
1
|
+
import{a as _}from"./chunk-6GC5VKTI.js";import"./chunk-QGFC5ZUR.js";import"./chunk-J3BBLPAD.js";import{oa as l}from"./chunk-WJPLJKPQ.js";import"./chunk-FPPZ4BUR.js";import{Db as n,Dc as g,Eb as i,Ec as d,Ra as a,Sb as p,_ as s,bb as S,lc as c,mc as m}from"./chunk-QDFCX6XE.js";import"./chunk-EUDKD2JW.js";var o=class r{#e=s(_);serverSettings=this.#e.serverSettings;static \u0275fac=function(e){return new(e||r)};static \u0275cmp=S({type:r,selectors:[["app-server-settings"]],decls:6,vars:3,consts:()=>{let t;return t=$localize`System settings`,[t]},template:function(e,f){e&1&&(n(0,"h3"),p(1,0),i(),n(2,"code")(3,"pre"),c(4),g(5,"json"),i()()),e&2&&(a(4),m(d(5,1,f.serverSettings())))},dependencies:[l],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}h3[_ngcontent-%COMP%]{font:var(--title-30)}code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:1rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}"],changeDetection:0})};export{o as default};
|