@duplicati/ngclient 0.0.181 → 0.0.183
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-PCFTQ4BE.js → chunk-4GDXGM4L.js} +1 -1
- package/{chunk-3U36LG4E.js → chunk-5Y3YA4IZ.js} +1 -1
- package/chunk-6K3PRIYO.js +1 -0
- package/{chunk-JGQOVZKK.js → chunk-AESH2EML.js} +1 -1
- package/{chunk-YEYDDZIG.js → chunk-AEVJZNUY.js} +1 -1
- package/{chunk-H4TNKM4Y.js → chunk-APZXLYUU.js} +1 -1
- package/{chunk-NDPFWL4Y.js → chunk-BNQSW4G5.js} +1 -1
- package/{chunk-SBWCJMHH.js → chunk-BXWAVFI6.js} +1 -1
- package/{chunk-KSMDO4WE.js → chunk-CRIAZIHV.js} +1 -1
- package/{chunk-XADL5RYU.js → chunk-CU5GQUSX.js} +1 -1
- package/{chunk-TT4FAVLM.js → chunk-D3VVL4NK.js} +1 -1
- package/{chunk-6AJQBDVV.js → chunk-DH6M7Y7C.js} +1 -1
- package/{chunk-XKHIN6T2.js → chunk-DNHCL3D4.js} +1 -1
- package/{chunk-5YSRDRTE.js → chunk-EYIHDNRT.js} +1 -1
- package/{chunk-LMCAVLBO.js → chunk-FNIOBDFO.js} +1 -1
- package/{chunk-LDLSFKM4.js → chunk-FPKRDCQ6.js} +1 -1
- package/chunk-FRN7G2XC.js +1 -0
- package/{chunk-4NN5ZM73.js → chunk-FVZOIWTT.js} +1 -1
- package/{chunk-JJJ5UALU.js → chunk-G4BVOKDI.js} +1 -1
- package/{chunk-FQYMMYS4.js → chunk-G4PJG5YL.js} +1 -1
- package/{chunk-3BGJPVDV.js → chunk-GCL5YZGN.js} +1 -1
- package/{chunk-LX37357J.js → chunk-GG3FXQPK.js} +1 -1
- package/{chunk-JW4235US.js → chunk-GXYICCA6.js} +1 -1
- package/{chunk-6ALGXRIS.js → chunk-KTLT4LKY.js} +1 -1
- package/{chunk-PAMKTLG5.js → chunk-LWJ6FCGJ.js} +1 -1
- package/{chunk-ZHTPSBYJ.js → chunk-MLTHWDBE.js} +1 -1
- package/{chunk-LFISHZZP.js → chunk-ODTXKOWN.js} +1 -1
- package/{chunk-MXH4QJKB.js → chunk-OQ3SKNS2.js} +1 -1
- package/{chunk-PUV7YKEQ.js → chunk-QGD6TGTI.js} +1 -1
- package/{chunk-YV32N6PE.js → chunk-QQOFLIJG.js} +1 -1
- package/{chunk-ETAHWUMY.js → chunk-TAFKX5F2.js} +1 -1
- package/{chunk-4N3AWKEK.js → chunk-U7ABTEOS.js} +1 -1
- package/chunk-UGATCU55.js +1 -0
- package/{chunk-QG566HCB.js → chunk-VLHMURFN.js} +1 -1
- package/{chunk-4BAHV6VO.js → chunk-WHT6WK7V.js} +1 -1
- package/{chunk-EBQRGLJL.js → chunk-WUK4ABE5.js} +1 -1
- package/{chunk-5QAV2WXY.js → chunk-XFKT7HQ4.js} +1 -1
- package/{chunk-2JD6CIZ4.js → chunk-XFTFZ5UD.js} +1 -1
- package/{chunk-RXVG6AZW.js → chunk-YFWXKCXL.js} +1 -1
- package/{chunk-QHQQ5BDV.js → chunk-Z6QCNSVI.js} +1 -1
- package/{chunk-TEGY2W63.js → chunk-ZCSLL22M.js} +1 -1
- package/{chunk-DI73L7JI.js → chunk-ZTXNJMNP.js} +1 -1
- package/index.html +1 -2
- package/{main-RYFYCW3E.js → main-DLNJU5L6.js} +1 -1
- package/package.json +1 -1
- package/chunk-4QGMMHYT.js +0 -1
- package/chunk-AABUGLWU.js +0 -1
- package/chunk-VW35MTSI.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Me,c as Ie}from"./chunk-VEWX3KXN.js";import{a as Re}from"./chunk-ETAHWUMY.js";import{a as Ee}from"./chunk-KRXQDBGB.js";import{a as k}from"./chunk-PAMKTLG5.js";import{a as Te}from"./chunk-FOQJA6X2.js";import{b as we}from"./chunk-VHOAXFIJ.js";import"./chunk-4NN5ZM73.js";import{a as D}from"./chunk-6Q6SSTBK.js";import{a as ve}from"./chunk-FK7JFD5B.js";import"./chunk-5DJAX2HH.js";import"./chunk-QZRRXR3V.js";import"./chunk-AABUGLWU.js";import{a as H}from"./chunk-TELPJYLN.js";import{a as h,b as S,c as Se,d as I}from"./chunk-5QZIKR6A.js";import{v as ye,x as be}from"./chunk-HPNLQHW6.js";import{a as T,d as Ce}from"./chunk-BGTK25UG.js";import{c as me,d as de,g as ue,h as he,i as fe,j as ge}from"./chunk-A4LPGPDU.js";import{a as re}from"./chunk-PKPBSTZA.js";import{a as se,b as ie,c as ae,e as pe,f as ce,g as le}from"./chunk-QPTSKQZ2.js";import{fa as oe,ka as ne}from"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{Bb as Z,E as M,I as K,Ic as ee,Jc as te,K as w,M as q,R as v,U as z,W as s,cb as Y,da as _,ea as X,f as F,g as $,l as B,la as d,m as G,na as Q,p as R,y as L,z as J}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";function Ue(){try{let t=document.querySelector('meta[name="duplicati-proxy-config"]');if(t){let e=(t.getAttribute("content")||"").trim();if(e&&e.startsWith("/"))return e}}catch(t){console.warn("Failed to read proxy configuration from meta tag:",t)}return null}function ke(){let t=Ue();if(t&&t.length>0){let e=t;e.startsWith("/")||(e=`/${e}`),e.endsWith("/")&&(e=e.slice(0,-1)),T.BASE=e}else T.BASE=""}var A=class t{#e=s(h);#a=s(S);ngOnInit(){ke(),this.#a.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=Y({type:t,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&Z(0,"router-outlet")},dependencies:[me],encapsulation:2})};var Ae={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new z("ENVIRONMENT");var O=class t{#e=s(Ce);isLoaded=d(!1);webmodules=d(null);preload(e=!1){let o=this.#e.getApiV1Webmodules().pipe(q(n=>this.webmodules.set(n)),M(()=>this.isLoaded.set(!0)));if(e)return o;o.subscribe()}static \u0275fac=function(o){return new(o||t)};static \u0275prov=v({token:t,factory:t.\u0275fac,providedIn:"root"})};var We=()=>{let t=s(I);return t.token()?!0:t.checkProxyAuthed().pipe(w(e=>e?B(!0):t.refreshToken().pipe(R(()=>!0))))},je=()=>{let t=s(S),e=s(k),o=s(_),n=t.relayIsEnabled()?"longpoll":"websocket",a=[o.get(H).preload(!0),o.get(H).preloadFilterGroups(!0),o.get(O).preload(!0)];return t.configLoaded===null?L(a).pipe(R(()=>n)):t.configLoaded?.pipe(w(()=>L(a)))},Fe=()=>!0,Oe={path:"connect/:typeParam",loadComponent:()=>import("./chunk-KSMDO4WE.js")},$e=()=>{let t=s(h);return!t.getItem("locale")&&navigator.language&&t.setItem("locale",navigator.language),!0},Ne=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-XZ35H3QB.js")},{path:"logout",loadComponent:()=>import("./chunk-NJ2XZSM6.js")},{path:"",canActivate:[We],children:[{path:"",canActivate:[je,Fe,$e],children:[{path:"welcome",loadComponent:()=>import("./chunk-ZXVCNNR6.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-4BAHV6VO.js")},Oe]},{path:"",loadComponent:()=>import("./chunk-LMCAVLBO.js"),children:[{path:"",loadComponent:()=>import("./chunk-QHQQ5BDV.js")},Oe,{path:"add-backup",loadComponent:()=>import("./chunk-TT4FAVLM.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-YEYDDZIG.js")},{path:"backup/import",loadComponent:()=>import("./chunk-6AJQBDVV.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-NDPFWL4Y.js"),loadChildren:()=>import("./chunk-4QGMMHYT.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-NDPFWL4Y.js"),loadChildren:()=>import("./chunk-4QGMMHYT.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-JGQOVZKK.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-EBQRGLJL.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-LDLSFKM4.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-PUV7YKEQ.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-RXVG6AZW.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-JW4235US.js")},{path:"from-config",loadComponent:()=>import("./chunk-FQZFKTPW.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-DI73L7JI.js"),loadChildren:()=>import("./chunk-VW35MTSI.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-DI73L7JI.js"),loadChildren:()=>import("./chunk-VW35MTSI.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-DI73L7JI.js"),loadChildren:()=>import("./chunk-VW35MTSI.js")},{path:"settings",loadComponent:()=>import("./chunk-XKHIN6T2.js")},{path:"about",loadComponent:()=>import("./chunk-LX37357J.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-JJJ5UALU.js")},{path:"changelog",loadComponent:()=>import("./chunk-T7WSF7RL.js")},{path:"libraries",loadComponent:()=>import("./chunk-B2Y54P3R.js")},{path:"system-info",loadComponent:()=>import("./chunk-SFR3XMV4.js")},{path:"server-settings",loadComponent:()=>import("./chunk-FQYMMYS4.js")},{path:"logs",loadChildren:()=>import("./chunk-MRAKGZE6.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-7XS6T6TX.js")}]}]}]}]}]}];var U=null,xe=(t,e)=>{let o=s(I),n=s(de),a=s(h),p=s(f),i=a.getItem("locale"),u=s(be),c=Me(i),r=T.BASE||"",m=t.url===`${r}/api/v1/auth/login`,y=t.url===`${r}/api/v1/auth/refresh`,b=t.url===`${r}/api/v1/progressstate`,C=t.url===`${r}/api/v1/remoteoperation/test`,E=t.url===`${r}/api/v1/filesystem/validate`,Ve=t.url.startsWith(`${r}/api/v2/`),P=o.token(),W=t,j=t.headers.has("custom-proxy-check")||P===Se;if(P&&t.url.startsWith(r+p.baseUrl)&&!j){let l=t.headers.set("Authorization",`Bearer ${P}`);i&&i!=="en-US"&&(l=l.set("X-Ui-Language",c)),W=t.clone({headers:l})}return e(W).pipe(R(l=>{if(l.type===4&&l.status===200&&Ve){let g=l.body;if(g?.Success===!1)throw{status:200,message:g?.Error??"Unknown error",error:{Error:g?.Error??"Unknown error"},requestBody:g}}return l}),J(l=>{let g=l.error?.Error||`Error Code: ${l.status}, Message: ${l.message}`;return!j&&(b&&l.status===404||C||E||u.error(g),y&&l.status===401&&(o.logout(),n.navigate(["/logout"])),!m&&!y&&l.status===401)?(U??=o.refreshToken().pipe(K()),U.pipe(w(()=>e(t.clone({headers:t.headers.set("Authorization",`Bearer ${o.token()}`)}))),M(()=>U=null))):G(()=>({error:l,message:g}))}))};var N=class t{#e=s(X);showError(e){let o=this.#e.querySelector("body > .loading");if(!o)return;o.classList.add("has-error"),o.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let a=this.#e.createElement("div");a.classList.add("loading-error"),a.textContent=e||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),o.append(n,a,p)}static \u0275fac=function(o){return new(o||t)};static \u0275prov=v({token:t,factory:t.\u0275fac,providedIn:"root"})};var Be="1.0.0",Pe=`portal-proxy-client-${D()}`,Ge=1,x=class t{#e=1e3;#a=s(f);#d=s(N);#o=d("disconnected");#u=d(this.#e);#p=d(!1);#n=d(!1);#c=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#l=[];#r={};#t=null;#h=new TextDecoder("utf-8");#m=null;#g=Q(()=>{let e=this.#p(),o=this.#u(),n=this.#c();if(!n||!e||!o||o<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n)},o)});#i(e){this.#s||(this.#s=!0,this.#d.showError(e||"Unable to connect to the server."))}#f(){this.#s||(this.#s=!0)}utf8Atob(e){let o=Uint8Array.from(atob(e),a=>a.charCodeAt(0)),n=this.#h.decode(o);return n?JSON.parse(n):null}connectToMachineServer(e,o){let n=o?.reconnect??!1,a=this.wsState();(a==="disconnected"||a==="error"||n)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(this.#a.machineServerUrl),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#p.set(!1),this.#c.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#c.set(e),this.#p.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=p=>{let i=JSON.parse(p.data);if(this.wsState()==="connect"){if(i.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${i.type}'`);return}let c={token:e,publicKey:"",clientVersion:Be,protocolVersion:Ge},r=this.createResponse(i,"authportal",c);this.#o.set("welcome"),this.#t?.send(r)}else if(this.wsState()==="welcome"){if(i.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${i.type}'`);return}var u=JSON.parse(i.payload??"");if(u.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#l.length>0;){let c=this.#l.pop();c&&this.#r[c.messageId]&&this.activateCommand(c)}}else if(this.wsState()==="authenticated"){if(i.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${i.type}'`);return}let c=this.#r[i.messageId];if(c){if(i.errorMessage)this.#i(i.errorMessage),c.reject(i.errorMessage);else{let r=JSON.parse(i.payload??"");r.statusCode>=400?this.#i(r.body||`Initial request failed with status code ${r.statusCode}`):this.#f(),r.body=r?.body==null?null:this.utf8Atob(r.body),c.resolve(r)}delete this.#r[i.messageId],window.clearTimeout(c.timer)}}})}disconnectFromMachineServer(e=null){e&&console.error(e),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(e,o,n){let a={from:Pe,to:e.from,type:o,messageId:e.messageId,payload:JSON.stringify(n)};return JSON.stringify(a)}sendCommand(e,o,n,a,p,i,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(e),new Promise((c,r)=>{let m=D(),b={from:Pe,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:a,body:p,headers:i})},C={resolve:c,reject:r,timer:window.setTimeout(()=>{let E=this.#r[m];E&&(delete this.#r[m],this.#i("The request timed out before receiving a response."),E.reject("Timeout"))},u)};this.#r[m]=C,this.#n()?this.activateCommand(b):this.#l.push(b)})}activateCommand(e){this.#t?.send(JSON.stringify(e))}static \u0275fac=function(o){return new(o||t)};static \u0275prov=v({token:t,factory:t.\u0275fac,providedIn:"root"})};function Je(t){if(typeof t!="string")return null;let o=new TextEncoder().encode(t);return window.btoa(String.fromCharCode(...o))}function Le(t,e,o){let n=t.relayconfigState.config();if(n===null)return o(e);let a=Je(e.body),p={};e.headers.keys().forEach(r=>{p[r]=e.headers.get(r)??""});let i=e.headers.get("timeout"),u=i!==null?parseInt(i):t.defaultTimeout;e.url.startsWith("/api/v1/serverstate")&&e.url.includes("longpoll=true")&&(u=1e3*99);let c=t.relayWebsocket.sendCommand(n.accessToken,n.clientId,e.method,e.url,a,p,u);return new F(r=>{c.then(m=>{let y=new se;p!=null&&Object.keys(p).forEach(C=>{y.set(C,p[C])});let b=new ie({body:m.body,status:m.statusCode,statusText:"OK",headers:y});r.next(b),r.complete()}).catch(m=>{r.error(new ae({error:m??"Unknown error",status:0,statusText:m??"Unknown error"}))})})}var He=(t,e)=>{let o={relayconfigState:s(S),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(x)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let a=new $;return o.relayconfigState.configLoaded.subscribe(p=>{p&&Le(o,t,e).subscribe(a)}),a}return Le(o,t,e)};var De={providers:[ee(),he(Ne,ge(),fe(ue)),pe(le(),ce([He,xe])),h,{provide:f,useValue:Ae},{provide:te,useValue:Ie()},{provide:ye,useValue:{alertVariant:"simple"}},Re,k,we,ne,ve,oe,Te,Ee]};re(A,De);
|
|
1
|
+
import{b as Me,c as Ie}from"./chunk-VEWX3KXN.js";import{a as Re}from"./chunk-TAFKX5F2.js";import{a as Ee}from"./chunk-KRXQDBGB.js";import{a as k}from"./chunk-LWJ6FCGJ.js";import{a as Te}from"./chunk-FOQJA6X2.js";import{b as we}from"./chunk-VHOAXFIJ.js";import"./chunk-FVZOIWTT.js";import{a as D}from"./chunk-6Q6SSTBK.js";import{a as ve}from"./chunk-FK7JFD5B.js";import"./chunk-5DJAX2HH.js";import"./chunk-QZRRXR3V.js";import"./chunk-6K3PRIYO.js";import{a as H}from"./chunk-TELPJYLN.js";import{a as h,b as S,c as Se,d as I}from"./chunk-5QZIKR6A.js";import{v as ye,x as be}from"./chunk-HPNLQHW6.js";import{a as T,d as Ce}from"./chunk-BGTK25UG.js";import{c as me,d as de,g as ue,h as he,i as fe,j as ge}from"./chunk-A4LPGPDU.js";import{a as re}from"./chunk-PKPBSTZA.js";import{a as se,b as ie,c as ae,e as pe,f as ce,g as le}from"./chunk-QPTSKQZ2.js";import{fa as oe,ka as ne}from"./chunk-OTPG7USH.js";import"./chunk-TT3S63BX.js";import{Bb as Z,E as M,I as K,Ic as ee,Jc as te,K as w,M as q,R as v,U as z,W as s,cb as Y,da as _,ea as X,f as F,g as $,l as B,la as d,m as G,na as Q,p as R,y as L,z as J}from"./chunk-T2WO6CVD.js";import"./chunk-7CGTOI24.js";function Ue(){try{let t=document.querySelector('meta[name="duplicati-proxy-config"]');if(t){let e=(t.getAttribute("content")||"").trim();if(e&&e.startsWith("/"))return e}}catch(t){console.warn("Failed to read proxy configuration from meta tag:",t)}return null}function ke(){let t=Ue();if(t&&t.length>0){let e=t;e.startsWith("/")||(e=`/${e}`),e.endsWith("/")&&(e=e.slice(0,-1)),T.BASE=e}else T.BASE=""}var A=class t{#e=s(h);#a=s(S);ngOnInit(){ke(),this.#a.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||t)};static \u0275cmp=Y({type:t,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&Z(0,"router-outlet")},dependencies:[me],encapsulation:2})};var Ae={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new z("ENVIRONMENT");var O=class t{#e=s(Ce);isLoaded=d(!1);webmodules=d(null);preload(e=!1){let o=this.#e.getApiV1Webmodules().pipe(q(n=>this.webmodules.set(n)),M(()=>this.isLoaded.set(!0)));if(e)return o;o.subscribe()}static \u0275fac=function(o){return new(o||t)};static \u0275prov=v({token:t,factory:t.\u0275fac,providedIn:"root"})};var We=()=>{let t=s(I);return t.token()?!0:t.checkProxyAuthed().pipe(w(e=>e?B(!0):t.refreshToken().pipe(R(()=>!0))))},je=()=>{let t=s(S),e=s(k),o=s(_),n=t.relayIsEnabled()?"longpoll":"websocket",a=[o.get(H).preload(!0),o.get(H).preloadFilterGroups(!0),o.get(O).preload(!0)];return t.configLoaded===null?L(a).pipe(R(()=>n)):t.configLoaded?.pipe(w(()=>L(a)))},Fe=()=>!0,Oe={path:"connect/:typeParam",loadComponent:()=>import("./chunk-CRIAZIHV.js")},$e=()=>{let t=s(h);return!t.getItem("locale")&&navigator.language&&t.setItem("locale",navigator.language),!0},Ne=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-XZ35H3QB.js")},{path:"logout",loadComponent:()=>import("./chunk-NJ2XZSM6.js")},{path:"",canActivate:[We],children:[{path:"",canActivate:[je,Fe,$e],children:[{path:"welcome",loadComponent:()=>import("./chunk-ZXVCNNR6.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-WHT6WK7V.js")},Oe]},{path:"",loadComponent:()=>import("./chunk-FNIOBDFO.js"),children:[{path:"",loadComponent:()=>import("./chunk-Z6QCNSVI.js")},Oe,{path:"add-backup",loadComponent:()=>import("./chunk-D3VVL4NK.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-AEVJZNUY.js")},{path:"backup/import",loadComponent:()=>import("./chunk-DH6M7Y7C.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-BNQSW4G5.js"),loadChildren:()=>import("./chunk-FRN7G2XC.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-BNQSW4G5.js"),loadChildren:()=>import("./chunk-FRN7G2XC.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-AESH2EML.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-WUK4ABE5.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-FPKRDCQ6.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-QGD6TGTI.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-YFWXKCXL.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-GXYICCA6.js")},{path:"from-config",loadComponent:()=>import("./chunk-FQZFKTPW.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-ZTXNJMNP.js"),loadChildren:()=>import("./chunk-UGATCU55.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-ZTXNJMNP.js"),loadChildren:()=>import("./chunk-UGATCU55.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-ZTXNJMNP.js"),loadChildren:()=>import("./chunk-UGATCU55.js")},{path:"settings",loadComponent:()=>import("./chunk-DNHCL3D4.js")},{path:"about",loadComponent:()=>import("./chunk-GG3FXQPK.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-G4BVOKDI.js")},{path:"changelog",loadComponent:()=>import("./chunk-T7WSF7RL.js")},{path:"libraries",loadComponent:()=>import("./chunk-B2Y54P3R.js")},{path:"system-info",loadComponent:()=>import("./chunk-SFR3XMV4.js")},{path:"server-settings",loadComponent:()=>import("./chunk-G4PJG5YL.js")},{path:"logs",loadChildren:()=>import("./chunk-MRAKGZE6.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-7XS6T6TX.js")}]}]}]}]}]}];var U=null,xe=(t,e)=>{let o=s(I),n=s(de),a=s(h),p=s(f),i=a.getItem("locale"),u=s(be),c=Me(i),r=T.BASE||"",m=t.url===`${r}/api/v1/auth/login`,y=t.url===`${r}/api/v1/auth/refresh`,b=t.url===`${r}/api/v1/progressstate`,C=t.url===`${r}/api/v1/remoteoperation/test`,E=t.url===`${r}/api/v1/filesystem/validate`,Ve=t.url.startsWith(`${r}/api/v2/`),P=o.token(),W=t,j=t.headers.has("custom-proxy-check")||P===Se;if(P&&t.url.startsWith(r+p.baseUrl)&&!j){let l=t.headers.set("Authorization",`Bearer ${P}`);i&&i!=="en-US"&&(l=l.set("X-Ui-Language",c)),W=t.clone({headers:l})}return e(W).pipe(R(l=>{if(l.type===4&&l.status===200&&Ve){let g=l.body;if(g?.Success===!1)throw{status:200,message:g?.Error??"Unknown error",error:{Error:g?.Error??"Unknown error"},requestBody:g}}return l}),J(l=>{let g=l.error?.Error||`Error Code: ${l.status}, Message: ${l.message}`;return!j&&(b&&l.status===404||C||E||u.error(g),y&&l.status===401&&(o.logout(),n.navigate(["/logout"])),!m&&!y&&l.status===401)?(U??=o.refreshToken().pipe(K()),U.pipe(w(()=>e(t.clone({headers:t.headers.set("Authorization",`Bearer ${o.token()}`)}))),M(()=>U=null))):G(()=>({error:l,message:g}))}))};var N=class t{#e=s(X);showError(e){let o=this.#e.querySelector("body > .loading");if(!o)return;o.classList.add("has-error"),o.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let a=this.#e.createElement("div");a.classList.add("loading-error"),a.textContent=e||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),o.append(n,a,p)}static \u0275fac=function(o){return new(o||t)};static \u0275prov=v({token:t,factory:t.\u0275fac,providedIn:"root"})};var Be="1.0.0",Pe=`portal-proxy-client-${D()}`,Ge=1,x=class t{#e=1e3;#a=s(f);#d=s(N);#o=d("disconnected");#u=d(this.#e);#p=d(!1);#n=d(!1);#c=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#l=[];#r={};#t=null;#h=new TextDecoder("utf-8");#m=null;#g=Q(()=>{let e=this.#p(),o=this.#u(),n=this.#c();if(!n||!e||!o||o<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n)},o)});#i(e){this.#s||(this.#s=!0,this.#d.showError(e||"Unable to connect to the server."))}#f(){this.#s||(this.#s=!0)}utf8Atob(e){let o=Uint8Array.from(atob(e),a=>a.charCodeAt(0)),n=this.#h.decode(o);return n?JSON.parse(n):null}connectToMachineServer(e,o){let n=o?.reconnect??!1,a=this.wsState();(a==="disconnected"||a==="error"||n)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(this.#a.machineServerUrl),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#p.set(!1),this.#c.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#c.set(e),this.#p.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=p=>{let i=JSON.parse(p.data);if(this.wsState()==="connect"){if(i.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${i.type}'`);return}let c={token:e,publicKey:"",clientVersion:Be,protocolVersion:Ge},r=this.createResponse(i,"authportal",c);this.#o.set("welcome"),this.#t?.send(r)}else if(this.wsState()==="welcome"){if(i.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${i.type}'`);return}var u=JSON.parse(i.payload??"");if(u.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#l.length>0;){let c=this.#l.pop();c&&this.#r[c.messageId]&&this.activateCommand(c)}}else if(this.wsState()==="authenticated"){if(i.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${i.type}'`);return}let c=this.#r[i.messageId];if(c){if(i.errorMessage)this.#i(i.errorMessage),c.reject(i.errorMessage);else{let r=JSON.parse(i.payload??"");r.statusCode>=400?this.#i(r.body||`Initial request failed with status code ${r.statusCode}`):this.#f(),r.body=r?.body==null?null:this.utf8Atob(r.body),c.resolve(r)}delete this.#r[i.messageId],window.clearTimeout(c.timer)}}})}disconnectFromMachineServer(e=null){e&&console.error(e),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(e,o,n){let a={from:Pe,to:e.from,type:o,messageId:e.messageId,payload:JSON.stringify(n)};return JSON.stringify(a)}sendCommand(e,o,n,a,p,i,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(e),new Promise((c,r)=>{let m=D(),b={from:Pe,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:a,body:p,headers:i})},C={resolve:c,reject:r,timer:window.setTimeout(()=>{let E=this.#r[m];E&&(delete this.#r[m],this.#i("The request timed out before receiving a response."),E.reject("Timeout"))},u)};this.#r[m]=C,this.#n()?this.activateCommand(b):this.#l.push(b)})}activateCommand(e){this.#t?.send(JSON.stringify(e))}static \u0275fac=function(o){return new(o||t)};static \u0275prov=v({token:t,factory:t.\u0275fac,providedIn:"root"})};function Je(t){if(typeof t!="string")return null;let o=new TextEncoder().encode(t);return window.btoa(String.fromCharCode(...o))}function Le(t,e,o){let n=t.relayconfigState.config();if(n===null)return o(e);let a=Je(e.body),p={};e.headers.keys().forEach(r=>{p[r]=e.headers.get(r)??""});let i=e.headers.get("timeout"),u=i!==null?parseInt(i):t.defaultTimeout;e.url.startsWith("/api/v1/serverstate")&&e.url.includes("longpoll=true")&&(u=1e3*99);let c=t.relayWebsocket.sendCommand(n.accessToken,n.clientId,e.method,e.url,a,p,u);return new F(r=>{c.then(m=>{let y=new se;p!=null&&Object.keys(p).forEach(C=>{y.set(C,p[C])});let b=new ie({body:m.body,status:m.statusCode,statusText:"OK",headers:y});r.next(b),r.complete()}).catch(m=>{r.error(new ae({error:m??"Unknown error",status:0,statusText:m??"Unknown error"}))})})}var He=(t,e)=>{let o={relayconfigState:s(S),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(x)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let a=new $;return o.relayconfigState.configLoaded.subscribe(p=>{p&&Le(o,t,e).subscribe(a)}),a}return Le(o,t,e)};var De={providers:[ee(),he(Ne,ge(),fe(ue)),pe(le(),ce([He,xe])),h,{provide:f,useValue:Ae},{provide:te,useValue:Ie()},{provide:ye,useValue:{alertVariant:"simple"}},Re,k,we,ne,ve,oe,Te,Ee]};re(A,De);
|
package/package.json
CHANGED
package/chunk-4QGMMHYT.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-3BGJPVDV.js")},{path:"destination",loadComponent:()=>import("./chunk-3U36LG4E.js")},{path:"source-data",loadComponent:()=>import("./chunk-2JD6CIZ4.js")},{path:"schedule",loadComponent:()=>import("./chunk-PCFTQ4BE.js")},{path:"options",loadComponent:()=>import("./chunk-5QAV2WXY.js")}];export{o as default};
|
package/chunk-AABUGLWU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as v}from"./chunk-TELPJYLN.js";import{b as $,d as j}from"./chunk-5QZIKR6A.js";import{z as f}from"./chunk-HPNLQHW6.js";import{c as b}from"./chunk-BGTK25UG.js";import{ka as L}from"./chunk-OTPG7USH.js";import{Cb as N,Cc as G,Db as y,Eb as I,Ec as W,L as E,Mc as p,Pa as R,Pb as _,Qb as A,R as h,Rb as w,Sb as P,Tb as F,W as c,cb as M,f as m,g as k,la as n,na as O}from"./chunk-T2WO6CVD.js";var S=class r{reconnectTimer=n(15e3);countdown=n(0);connectTimerEffect=O(()=>{let e=this.reconnectTimer();this.countdown.set(e/1e3)});interval=setInterval(()=>{if(this.countdown()<=1){this.countdown.set(this.reconnectTimer()/1e3);return}this.countdown.set(this.countdown()-1)},1e3);ngOnDestroy(){clearInterval(this.interval)}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=M({type:r,selectors:[["app-disconnected-dialog"]],decls:8,vars:4,consts:()=>{let e;e=$localize`Reconnecting...`;let t;return t=$localize` The connection to the server is lost, attempting again in ${"\uFFFD#6\uFFFD"}:START_TAG_STRONG:0:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_STRONG:`,[e,t,["header",""],["content",""]]},template:function(t,s){t&1&&(N(0,"header",2)(1,"h3"),w(2,0),y()(),N(3,"div",3)(4,"p"),_(5,1),I(6,"strong"),G(7,"number"),A(),y()()),t&2&&(R(7),P(W(7,1,s.countdown(),"2.0-0")),F(5))},dependencies:[L],styles:["[_nghost-%COMP%]{display:block;padding:1rem}"],changeDetection:0})};var D=class r{dialog=c(f);#t=c(b);#i=n("disconnected");#s=n(null);#e=n(-1);#r=n(0);#l=n(!1);#u=new k;connectionStatus=this.#i.asReadonly();serverState=this.#s.asReadonly();#o=void 0;duration=c($).relayIsEnabled()?"94s":"299s";start(){this.#l.set(!0),this.#u=new k,this.#c()}stop(){this.#u.next(),this.#u.complete(),this.#l.set(!1)}reconnect(){this.stop(),this.start()}reconnectIfNeeded(){this.#l()||this.reconnect()}#c(){this.#i.set("connecting"),this.#t.getApiV1Serverstate({lastEventId:this.#e(),longpoll:this.#e()>=0,duration:this.duration}).pipe(E(this.#u)).subscribe({next:e=>{e&&this.#a(e),this.#n()},error:e=>{let s=this.#r()+1,a=Math.min(5e3*s,3e4);this.#r.set(s),s>3&&this.#i.set("disconnected"),this.#o||(this.#o=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1})),this.#o.component.reconnectTimer.set(a),setTimeout(()=>{this.#c()},a)}})}#a(e){this.#i.set("connected"),this.#s.set(e),this.#e.set(e.LastEventID??-1),this.#r.set(0)}#n(){this.#l()&&this.#c()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};var u=!1,T=class r{#t=c(j);#i=c(v);dialog=c(f);#s=null;#e=n("disconnected");#r=n(null);#l=n(null);#u=n(null);#o=n(null);#c=n(null);#a=void 0;#n=n({legacystatus:!0});shouldConnect=n(!0);connectionStatus=this.#e.asReadonly();serverState=this.#r.asReadonly();serverProgress=this.#l.asReadonly();serverSettings=this.#u.asReadonly();subscriptions=this.#n.asReadonly();serverTaskQueue=this.#o.asReadonly();backupListState=this.#c.asReadonly();#h=null;taskCompleted=new m(e=>{this.#h=e});#d=0;start(){this.#p(),this.shouldConnect.set(!0)}#p(){let e=this.#t.token();if(!e){console.error("No access token available");return}let t=window.location.protocol==="https:"?"wss:":"ws:",s=window.location.port?`:${window.location.port}`:"";window.location.port==="4200"&&(s=":8200");let a=window.location.hostname,g=this.#i.hasWebSocketAuth()?`${t}//${a}${s}/notifications`:`${t}//${a}${s}/notifications?token=${e}`;this.#e.set("connecting"),this.#s=new WebSocket(g),this.#s.onopen=()=>{u&&console.log("WebSocket connection established"),this.#i.hasWebSocketAuth()?(this.#e.set("authenticating"),this.#s?.send(JSON.stringify({Version:1,Token:e}))):this.#S()},this.#s.onmessage=d=>{if(this.#e()==="authenticating")try{let i=JSON.parse(d.data);i.Success?(u&&console.log("WebSocket authentication successful"),this.#S()):(console.error("WebSocket authentication failed:",i.Message),this.#e.set("disconnected"));return}catch(i){console.error("Error parsing WebSocket authentication reply",i),this.#e.set("disconnected");return}try{let i=JSON.parse(d.data),l=i?.Type;if(l==="legacystatus"||l==null)u&&console.log("Received legacy status update:",i),this.#r.set(i);else if(l==="reply"){let o=i;o.Success||console.error("WebSocket reply error:",o.Message)}else if(l==="progress"){let o=i;u&&console.log("Received progress update:",o.Data),this.#l.set(o.Data)}else if(l==="serversettings"){let o=i;u&&console.log("Received server settings update:",o.Data),this.#u.set(o.Data)}else if(l==="taskqueue"){let o=i;u&&console.log("Received task update:",o.Data),this.#o.set(o.Data)}else if(l==="taskcompleted"){let o=i;u&&console.log("Received task completed:",o.Data),this.#h?.next(o.Data)}else if(l==="backuplist"){let o=i;u&&console.log("Received backup list update:",o.Data),this.#c.set(o.Data)}else console.warn("Unknown WebSocket message type:",l)}catch(i){console.error("Error parsing WebSocket message",i)}},this.#s.onclose=d=>{u&&console.log("WebSocket connection closed",d),this.#e.set("disconnected"),this.shouldConnect()&&(this.#a||(this.#a=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1}),this.#a.component.reconnectTimer.set(15e3)),setTimeout(()=>this.#p(),5e3))},this.#s.onerror=d=>{console.error("WebSocket error",d),this.#e.set("disconnected")}}#S(){this.#e.set("connected");let e=this.#n();Object.keys(e).length>0&&Object.entries(e).forEach(([t,s])=>{s!=null&&this.sendSubscribeRequest(t,s)}),this.#a&&this.#a.close()}stop(){this.shouldConnect.set(!1),this.#s?.close()}reconnect(){this.#s?.close(),this.start()}reconnectIfNeeded(){this.#s?.readyState!==WebSocket.OPEN&&this.reconnect()}sendSubscribeRequest(e,t){this.#s?.send(JSON.stringify({Version:1,Id:`req-${++this.#d}`,Action:"sub",Service:e,Data:t||null}))}subscribe(e,t=void 0){let s=this.#n(),a=s[e];(!a||JSON.stringify(a)!==JSON.stringify(t||!0))&&(s[e]=t||!0,this.#n.set(s),this.#e()=="connected"&&this.sendSubscribeRequest(e,t))}unsubscribe(e){let t=this.#n();t[e]&&(delete t[e],this.#n.set(t),this.#e()=="connected"&&this.#s?.send(JSON.stringify({Version:1,Id:`req-${++this.#d}`,Action:"unsub",Service:e})))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};var x=10,q=class r{#t=c(T);#i=c(D);#s=c(b);#e=c(v);#r=n("longpoll");#l=n(!1);#u=p(()=>this.#e.hasTaskCompletedOption()&&this.#r()==="websocket");#o={};#c=null;#a=!1;#n=[];constructor(){this.#t.subscribe("taskcompleted"),this.#t.taskCompleted.subscribe(e=>{if(this.#n.unshift(e),this.#n.length>x&&this.#n.pop(),!e.ID)return;let t=this.#o[e.ID];t&&(t.forEach(s=>{s.next(e),s.complete()}),delete this.#o[e.ID])})}connectionStatus=p(()=>this.#r()==="websocket"?this.#t.connectionStatus():this.#i.connectionStatus());isConnectionMethodSet=this.#l.asReadonly();serverState=p(()=>this.#r()==="websocket"?this.#t.serverState():this.#i.serverState());progressState=this.#t.serverProgress;taskQueueState=this.#t.serverTaskQueue;activeTaskQueueState=p(()=>this.#r()==="websocket"?this.#t.serverTaskQueue()?.map(t=>t.ID).filter(t=>t)??[]:(this.#i.serverState()?.SchedulerQueueIds??[]).map(t=>t.Item1).filter(t=>t));backupListState=p(()=>this.#t.backupListState());setConnectionMethod(e){e==="websocket"?(this.#t.reconnectIfNeeded(),this.#i.stop()):(this.#i.reconnectIfNeeded(),this.#t.stop()),this.#r.set(e),this.#l.set(!0)}getConnectionMethod(){return this.#r()}subscribe(e,t=null){this.#t.subscribe(e,t)}unsubscribe(e){this.#t.unsubscribe(e)}waitForTaskToComplete(e){return new m(t=>{let s=this.#n.find(a=>a.ID===e);if(s){t.next(s),t.complete();return}this.#o[e]=this.#o[e]||[],this.#o[e].push(t),this.#h()})}#h(){this.#a||this.#u()||(this.#a=!0,this.#d())}#d(){let e=Object.keys(this.#o).map(s=>parseInt(s,10));if(e.length===0){this.#p();return}let t=Math.min(...e);this.#s.getApiV1TaskByTaskid({taskid:t}).subscribe({next:s=>{s.TaskFinished!=null&&(this.#n.unshift(s),this.#n.length>x&&this.#n.pop(),this.#o[t].forEach(g=>{g.next(s),g.complete()}),delete this.#o[t])},complete:()=>{this.#c=window.setTimeout(()=>{this.#d()},1e3)},error:s=>{this.#c=window.setTimeout(()=>{this.#d()},3e3)}})}#p(){this.#c!==null&&(clearTimeout(this.#c),this.#c=null),this.#a=!1}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};export{T as a,q as b};
|
package/chunk-VW35MTSI.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-TEGY2W63.js")},{path:"encryption",loadComponent:()=>import("./chunk-QG566HCB.js")},{path:"select-files",loadComponent:()=>import("./chunk-SBWCJMHH.js")},{path:"options",loadComponent:()=>import("./chunk-ZHTPSBYJ.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-MXH4QJKB.js")}],t=o;export{t as default};
|