@duplicati/ngclient 0.0.171 → 0.0.172
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Pt}from"./chunk-MZMEFIHU.js";import{a as Ot}from"./chunk-XDECUOQ5.js";import{a as ht}from"./chunk-NOHHRZSK.js";import"./chunk-DU5QSRYH.js";import"./chunk-D2DI6ZER.js";import"./chunk-M77IE672.js";import"./chunk-I5AKUAZF.js";import"./chunk-PJAWWLYW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-RECKKS2S.js";import{a as ie}from"./chunk-W4QCGFNO.js";import"./chunk-L4GZJLYK.js";import{a as X}from"./chunk-LJQN4G2O.js";import"./chunk-I2RHQQ3J.js";import{a as Mt}from"./chunk-F2QQDU4N.js";import{a as ft}from"./chunk-XE5OMGTJ.js";import"./chunk-T6C2OUI5.js";import{a as rt,b as Tt}from"./chunk-TJ3WIU6Q.js";import{b as ne}from"./chunk-KBGIIJMM.js";import{B as J,E as ct,G as gt,H as te,L as Ct,M as pt,N as Et,P as ut,W as Nt,Y as mt,c as j,e as K,i as Q,m as dt,s as Y,t as Z,u as k,w as ee,z as St}from"./chunk-LFRGO2IP.js";import"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{$b as d,B as b,Bc as V,Cb as m,Db as o,Eb as i,Fb as h,H as R,Mb as f,Oa as tt,Ra as _,Rc as w,Sc as x,Tb as G,Ub as y,Vb as l,Wb as B,Xb as H,Yb as W,Yc as _t,Zb as c,_ as P,a as Ye,b as Ze,bb as D,c as et,da as p,ea as E,gb as le,gc as st,hb as nt,hc as at,kc as M,n as F,nc as $,oa as S,oc as q,pc as _e,rb as it,sb as ot,sc as A,tc as v,uc as L,wb as g,xb as C,yc as lt}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var $t=["formRef"],At=()=>[import("./chunk-7KUVROHU.js").then(s=>s.OptionsListComponent)];function vt(s,t){s&1&&(o(0,"sh-alert",3),l(1,1),i())}function Lt(s,t){if(s&1){let e=f();o(0,"app-options-list",5),L("optionsChange",function(a){p(e);let T=d();return v(T.settings,a)||(T.settings=a),E(a)}),i()}if(s&2){let e=d();A("options",e.settings),m("hasFreeTextSettings",!0)}}var z=class s{#e=P(X);#n=P(ne);formRef=_t.required("formRef");settings=S([]);isSubmitting=S(!1);isLoadingOptions=S(!0);saved=S(!1);lastRecievedServerSettings=S({});serverSettingsEffect=x(()=>{let t=this.#e.serverSettings();if(t===void 0)return;this.lastRecievedServerSettings.set(t),this.isLoadingOptions.set(!0);let e=Object.entries(t);e.forEach(([n,a],T)=>{if(n.startsWith("--")){let N=n.substring(2);this.settings.update(u=>(u.some(O=>O.Name===N)||u.push({Name:N,Value:a}),u))}T===e.length-1&&this.isLoadingOptions.set(!1)})});submit(){this.isSubmitting.set(!0);let t=this.settings(),e=this.lastRecievedServerSettings(),n=t.map(u=>u.Name),T=Object.keys(e).filter(u=>u.startsWith("--")).filter(u=>!n.includes(u.replace("--",""))),N=t.reduce((u,O)=>{let I=O.Name?.startsWith("--")?O.Name:`--${O.Name}`;return u[I]=O.Value,u},{});T.forEach(u=>{N[u]=null}),this.#n.patchApiV1Serversettings({requestBody:N}).pipe(R(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.#e.refreshServerSettings(),this.saved.set(!0),setTimeout(()=>{this.saved.set(!1)},3e3)}})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=D({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(e,n){e&1&&st(n.formRef,$t,5),e&2&&at()},decls:8,vars:4,consts:()=>{let t;t=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:floppy-disk${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: Save settings `;let e;return e=$localize`Settings saved`,[t,e,[1,"actions"],[1,"success"],["shButton","","type","button",1,"raised","primary",3,"click"],[3,"optionsChange","options","hasFreeTextSettings"]]},template:function(e,n){e&1&&(o(0,"div",2),g(1,vt,2,0,"sh-alert",3),o(2,"button",4),c("click",function(){return n.submit()}),G(3,0),h(4,"sh-icon"),y(),i()(),nt(5,Lt,1,2),it(6,5,At)),e&2&&(_(),C(n.saved()?1:-1),_(),M("loader",n.isSubmitting()),_(4),ot(!n.isLoadingOptions()))},dependencies:[Z,J,k,ee],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40.625rem;justify-self:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end;margin-bottom:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}"],changeDetection:0})};function bt(s,t){if(s&1){let e=f();o(0,"sh-form-field",12)(1,"input",13),L("ngModelChange",function(a){p(e);let T=d(2);return v(T.registerUrl,a)||(T.registerUrl=a),E(a)}),i()(),o(2,"button",14),c("click",function(){p(e);let a=d(2);return E(a.register())}),l(3,0),i()}if(s&2){let e=d(2);_(),A("ngModel",e.registerUrl)}}function wt(s,t){if(s&1&&(o(0,"div",9)(1,"label"),l(2,1),i(),o(3,"a",15),$(4),i()()),s&2){let e=d(2);_(3),m("href",lt(e.claimUrl()),tt),_(),q(e.claimUrl())}}function Dt(s,t){s&1&&(o(0,"div",9)(1,"label"),l(2,2),i()())}function xt(s,t){if(s&1){let e=f();o(0,"button",14),c("click",function(){p(e);let a=d(2);return E(a.cancel())}),l(1,3),i()}}function kt(s,t){if(s&1){let e=f();o(0,"button",14),c("click",function(){p(e);let a=d(2);return E(a.disable())}),l(1,4),i()}}function Jt(s,t){if(s&1){let e=f();o(0,"button",14),c("click",function(){p(e);let a=d(2);return E(a.enable())}),l(1,5),i(),o(2,"button",16),c("click",function(){p(e);let a=d(2);return E(a.delete())}),l(3,6),i()}}function Xt(s,t){s&1&&(G(0,7,1),h(1,"sh-icon"),y())}function Vt(s,t){s&1&&(G(0,7,2),h(1,"sh-icon"),y())}function zt(s,t){if(s&1){let e=f();o(0,"sh-chip",17),c("click",function(){p(e);let a=d(2);return E(a.copyReportingUrl())}),G(1,7),g(2,Xt,2,0,"sh-icon")(3,Vt,2,0,"sh-icon"),y(),i()}if(s&2){let e=d(2);_(2),C(e.copiedReportingUrl()===!0?2:3)}}function Ut(s,t){if(s&1&&(o(0,"div",8),g(1,bt,4,1),g(2,wt,5,3,"div",9),g(3,Dt,3,0,"div",9),g(4,xt,2,0,"button",10),g(5,kt,2,0,"button",10),g(6,Jt,4,0),g(7,zt,4,1,"sh-chip",11),i()),s&2){let e=d();_(),C(e.state()==="inactive"?1:-1),_(),C(e.state()==="registered"?2:-1),_(),C(e.state()==="registering"?3:-1),_(),C(e.state()==="registering"||e.state()==="registeringfaulted"||e.state()==="registered"?4:-1),_(),C(e.state()==="connected"||e.state()==="connecting"?5:-1),_(),C(e.state()==="disabled"?6:-1),_(),C(e.additionalReportingUrl()!==""?7:-1)}}var oe=class s{#e=P(ie);#n=P(X);state=this.#e.state;claimUrl=this.#e.claimUrl;registerUrl=this.#e.registerUrl;additionalReportingUrl=w(()=>{let t=this.#n.serverSettings();return this.#e.state()==="inactive"?"":t&&t["additional-report-url"]||""});copiedReportingUrl=S(!1);ngOnInit(){this.#e.refreshRemoteControlStatus()}cancel(){this.#e.cancelRemoteRegistration()}register(){this.#e.beginRemoteRegistration()}disable(){this.#e.disableRemoteControl()}enable(){this.#e.enableRemoteControl()}delete(){this.#e.deleteRemoteControl()}copyReportingUrl(){let t=this.additionalReportingUrl();t&&(this.copiedReportingUrl.set(!0),setTimeout(()=>this.copiedReportingUrl.set(!1),2e3),navigator.clipboard.writeText(t))}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=D({type:s,selectors:[["app-remote-control"]],decls:1,vars:1,consts:()=>{let t;t=$localize`Register on console`;let e;e=$localize`Machine is now registered, open this link to add it to your account:`;let n;n=$localize`Registering, please wait...`;let a;a=$localize`Cancel registration`;let T;T=$localize`Disable console connection`;let N;N=$localize`Enable console connection`;let u;u=$localize` Delete console connection setup `;let O;return O=$localize` Reporting configured by server ${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,O=W(O),[t,e,n,a,T,N,u,O,[1,"field-row"],[1,"field-col"],["type","button","shButton","",1,"raised"],[1,"reporting-url","primary","simple"],["label","Registration URL","for","remoteControlRegisterUrl"],["type","text","sh-input","","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl",3,"ngModelChange","ngModel"],["type","button","shButton","",1,"raised",3,"click"],["target","_blank",3,"href"],["type","button","shButton","",1,"raised","error",3,"click"],[1,"reporting-url","primary","simple",3,"click"]]},template:function(e,n){e&1&&g(0,Ut,8,7,"div",8),e&2&&C(n.state()!=="unknown"?0:-1)},dependencies:[Y,j,K,Q,te,J,ct,k],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.reporting-url[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none;margin-top:.25rem}"],changeDetection:0})};function Gt(...s){let t=S(...s);return Object.defineProperty(t,"value",{get:t.asReadonly(),set:t.set.bind(t)})}var se=()=>({standalone:!0});function Bt(s,t){s&1&&(o(0,"label"),l(1,34),i())}function Ht(s,t){s&1&&(o(0,"label"),l(1,35),i())}function Wt(s,t){if(s&1){let e=f();o(0,"section")(1,"div",52)(2,"h3"),l(3,32),i(),o(4,"p"),l(5,33),i()(),o(6,"div",53)(7,"sh-toggle",63),c("click",function(){p(e);let a=d(2);return E(a.toggleConsoleControl())}),g(8,Bt,2,0,"label")(9,Ht,2,0,"label"),i()()()}if(s&2){let e=d(2);_(7),M("active",!e.consoleControlDisabled()),_(),C(e.consoleControlDisabled()?8:9)}}function qt(s,t){if(s&1&&(o(0,"section")(1,"div",52)(2,"h3"),l(3,31),i(),o(4,"p"),$(5),i()(),o(6,"div",53),h(7,"app-remote-control"),i()(),g(8,Wt,10,3,"section")),s&2){let e=d();_(5),q(e.remoteControlStatus()),_(3),C(e.remoteControlState()!="inactive"?8:-1)}}function jt(s,t){s&1&&(o(0,"sh-icon",78),$(1,"check"),i())}function Kt(s,t){s&1&&(o(0,"sh-icon",79),$(1,"prohibit"),i())}function Qt(s,t){if(s&1){let e=f();o(0,"button",83),c("click",function(){p(e);let a=d(2);return E(a.updatePassphrase())}),l(1,39),i()}if(s&2){let e=d(2);M("loader",e.isUpdating())}}function Yt(s,t){if(s&1){let e=f();o(0,"button",84),c("click",function(){p(e);let a=d(2);return E(a.updatePassphrase())}),l(1,40),i()}if(s&2){let e=d(2);M("loader",e.isUpdating()),m("disabled",!0)}}function Zt(s,t){if(s&1){let e=f();o(0,"sh-form-field")(1,"label",74),l(2,36),i(),o(3,"input",75),L("ngModelChange",function(a){p(e);let T=d();return v(T.passphrase,a)||(T.passphrase=a),E(a)}),i()(),o(4,"sh-form-field")(5,"label",76),l(6,37),i(),o(7,"input",77),L("ngModelChange",function(a){p(e);let T=d();return v(T.repeatPassphrase,a)||(T.repeatPassphrase=a),E(a)}),i(),g(8,jt,2,0,"sh-icon",78)(9,Kt,2,0,"sh-icon",79),i(),o(10,"div",58)(11,"button",80),c("click",function(){p(e);let a=d();return E(a.cancelPasswordChange())}),l(12,38),i(),g(13,Qt,2,2,"button",81)(14,Yt,2,3,"button",82),i()}if(s&2){let e=d();_(3),A("ngModel",e.passphrase),_(4),m("disabled",e.passphrase().length===0),A("ngModel",e.repeatPassphrase),_(),C(e.passphrase().length!==0&&e.passphrase()===e.repeatPassphrase()?8:9),_(3),M("loader",e.isUpdating()),_(2),C(e.passphrase().length!==0&&e.passphrase()===e.repeatPassphrase()?13:14)}}function en(s,t){s&1&&(o(0,"sh-icon",85),$(1,"check"),i())}function tn(s,t){if(s&1){let e=f();o(0,"div",58)(1,"button",80),c("click",function(){p(e);let a=d();return E(a.openPassphraseForm())}),l(2,41),i(),g(3,en,2,0,"sh-icon",85),i()}if(s&2){let e=d();_(3),C(e.passwordUpdated()?3:-1)}}function nn(s,t){if(s&1){let e=f();o(0,"sh-form-field")(1,"label",86),l(2,42),i(),o(3,"textarea",87),L("ngModelChange",function(a){p(e);let T=d();return v(T.allowedHostnames,a)||(T.allowedHostnames=a),E(a)}),i()(),o(4,"sh-alert",88),l(5,43),i(),o(6,"button",83),c("click",function(){p(e);let a=d();return E(a.updateAllowedHostnames())}),l(7,44),i()}if(s&2){let e=d();_(3),A("ngModel",e.allowedHostnames),_(3),M("loader",e.updatingAllowedHosts())}}function on(s,t){if(s&1){let e=f();o(0,"section")(1,"div",52)(2,"h3"),l(3,45),i(),o(4,"p"),l(5,46),i()(),o(6,"div",53)(7,"sh-select",89)(8,"input",60),c("ngModelChange",function(a){p(e);let T=d();return E(T.updatePowerMode(a))}),i()()()()}if(s&2){let e=d();_(7),m("options",e.powerModeOptions())("isClearable",!1),_(),m("ngModel",e.powerModeCtrl())("ngModelOptions",V(4,se))}}function sn(s,t){if(s&1&&(o(0,"p"),l(1,47),i()),s&2){let e,n=d();_(),B((e=n.sysinfo())==null?null:e.ServerVersionName),H(1)}}function an(s,t){s&1&&h(0,"sh-progress-bar",64)}function ln(s,t){if(s&1&&$(0),s&2){let e=t.$implicit;_e(" ",e.label," ")}}function _n(s,t){if(s&1&&$(0),s&2){let e=t.$implicit;_e(" ",e.label," ")}}function rn(s,t){if(s&1){let e=f();o(0,"section")(1,"div",52)(2,"h3"),l(3,48),i(),o(4,"p"),G(5,49),h(6,"a",90)(7,"br")(8,"br"),y(),i()(),o(9,"div",53)(10,"sh-select",91)(11,"input",60),c("ngModelChange",function(a){p(e);let T=d();return E(T.updateUsageStatistics(a))}),i(),le(12,_n,1,1,"ng-template"),i()()()}if(s&2){let e=d();_(10),m("options",e.usageStatisticsOptions())("isLoading",e.updatingUsageStatistics()),_(),m("ngModel",e.usageStatistics())("ngModelOptions",V(4,se))}}function Tn(s,t,e){let n=Gt(s),a=n[Ye];e?.equal&&(a.equal=e.equal);let T;return n.set=N=>{clearTimeout(T),T=setTimeout(()=>Ze(a,N),t)},n.update=N=>{clearTimeout(T),T=setTimeout(()=>et(a,N),t)},n}var dn=[{value:"none",label:$localize`None`},{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],yt=[{value:"none",label:$localize`System default ($value)`},{value:"information",label:$localize`Usage statistics, warnings, errors, and crashes`},{value:"warning",label:$localize`Warnings, errors and crashes`},{value:"error",label:$localize`Errors and crashes`},{value:"crash",label:$localize`Crashes only`},{value:"disabled",label:$localize`None / disabled`}],re=class s{#e=P(St);#n=P(Pt);#i=P(ft);#t=P(ne);#o=P(X);#s=P(ie);#_=P(Tt);#a=P(rt);#l=this.#a.getItem("locale")??"en-US";sysinfo=this.#i.systemInfo;isDarkMode=this.#n.isDarkMode;editAs=S("list");previousLang=this.#l;langCtrl=S(this.#l);powerModeCtrl=S("");usageStatistics=S("");updatingUsageStatistics=S(!1);remoteControlStatus=this.#s.status;remoteControlState=this.#s.state;updatingChannel=S(!1);updateChannel=S("");isUsingRelay=this.#_.relayIsEnabled;usageStatisticsDisabled=w(()=>(this.#i.systemInfo()?.DefaultUsageReportLevel??"").toLowerCase()==="disabled");#T=x(()=>{let t=this.#i.systemInfo()?.DefaultUsageReportLevel??"",e=yt;e[0].label=$localize`System default (${t})`,this.usageStatisticsOptions.set(e)});setNewChannel(t){let e=this.updateChannel();this.updateChannel.set(t),this.#t.patchApiV1Serversettings({requestBody:{"update-channel":t}}).pipe(R(()=>this.updatingChannel.set(!1)),b(()=>(this.updateChannel.set(e),F(null)))).subscribe()}allowRemoteAccess=S(!1);allowedHostnames=S("");loadedAllowedHostnames=S("");updatingRemoteAccess=S(!1);updatingAllowedHosts=S(!1);updatingConsoleControl=S(!1);consoleControlDisabled=S(!1);updateRemoteAccess(){let t=this.allowRemoteAccess(),e=!t;this.allowRemoteAccess.set(e),this.#t.patchApiV1Serversettings({requestBody:{"server-listen-interface":e?"any":"loopback"}}).pipe(R(()=>this.updatingRemoteAccess.set(!1)),b(()=>(this.allowRemoteAccess.set(t),F(null)))).subscribe()}updateAllowedHostnames(){let t=this.loadedAllowedHostnames(),e=this.allowedHostnames();this.updatingAllowedHosts.set(!0),this.#t.patchApiV1Serversettings({requestBody:{"server-listen-interface":"any","allowed-hostnames":e}}).pipe(R(()=>this.updatingAllowedHosts.set(!1)),b(()=>(this.allowedHostnames.set(t),F(null)))).subscribe()}toggleConsoleControl(){let t=this.consoleControlDisabled(),e=!t;this.updatingConsoleControl.set(!0),this.consoleControlDisabled.set(e),this.#t.patchApiV1Serversettings({requestBody:{"disable-console-control":e?"True":"False"}}).pipe(R(()=>this.updatingConsoleControl.set(!1)),b(()=>(this.consoleControlDisabled.set(t),F(null)))).subscribe()}updatingDisableTrayIconLogin=S(!1);disableTrayIconLogin=S(!1);saveDisableTrayIconLogin(){let t=this.disableTrayIconLogin(),e=!t;this.updatingDisableTrayIconLogin.set(!0),this.disableTrayIconLogin.set(e),this.#t.patchApiV1Serversettings({requestBody:{"disable-tray-icon-login":e?"True":"False"}}).pipe(R(()=>this.updatingDisableTrayIconLogin.set(!1)),b(()=>(this.disableTrayIconLogin.set(t),F(null)))).subscribe()}showPassphraseForm=S(!1);isUpdating=S(!1);passphrase=S("");repeatPassphrase=S("");passwordUpdated=S(!1);updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#t.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(R(()=>this.isUpdating.set(!1))).subscribe({next:()=>{this.showPassphraseForm.set(!1),this.passwordUpdated.set(!0),setTimeout(()=>{this.passwordUpdated.set(!1)},3e3)}}))}openPassphraseForm(){this.showPassphraseForm.set(!0)}cancelPasswordChange(){this.showPassphraseForm.set(!1)}languageOptions=S(ht);powerModeOptions=w(()=>{let t=this.#i.systemInfo();return!t?.PowerModeProviders||t.PowerModeProviders.filter(e=>e!==""&&e!=="None").length==0?[]:t.PowerModeProviders.map(e=>({value:e==""?"default":e,label:e===""?$localize`Default`:e}))});usageStatisticsOptions=S(yt);timeTypeOptions=S(dn);timeType=S("none");timeValue=Tn(0,300);timeRange=w(()=>this.timeType()==="h"?[0,24]:[0,60]);timeValueEffect=x(()=>{let t=this.timeValue(),e=this.#o.serverSettings();!e||e["startup-delay"]===""&&this.timeType()==="none"||this.updateStartupDelay()});updateLocale(t){!t||t===""||t===this.previousLang||(this.#a.setItem("locale",t),window.location.reload())}updateStartupDelay(){let t=this.timeValue(),e=this.timeType(),n="";e!=="none"&&t!==0&&(n=`${t}${e}`),this.#t.patchApiV1Serversettings({requestBody:{"startup-delay":n}}).subscribe()}updateTimeType(t){this.timeType()==="none"&&this.timeValue.set(0),this.timeType.set(t)}updateUsageStatistics(t){let e=this.usageStatistics();!t||t===""||t===e||(this.usageStatistics.set(t),this.updatingUsageStatistics.set(!0),this.#t.patchApiV1Serversettings({requestBody:{"usage-reporter-level":this.usageStatistics()==="none"?"":this.usageStatistics()}}).pipe(R(()=>this.updatingUsageStatistics.set(!1)),b(()=>(this.usageStatistics.set(e),F(null)))).subscribe())}updatePowerMode(t){let e=this.powerModeCtrl();e!==t&&(t==="default"&&(t=""),this.#t.patchApiV1Serversettings({requestBody:{"power-mode-provider":t||""}}).pipe(b(()=>(this.powerModeCtrl.set(e),F(null)))).subscribe())}serverSettingsEffect=x(()=>{let t=this.#o.serverSettings();if(t===void 0)return;let e=t["startup-delay"],n=e.slice(-1),a=e.slice(0,-1),T=["s","m","h"];this.disableTrayIconLogin.set(t["disable-tray-icon-login"]!=="False"),this.updateChannel.set(t["update-channel"]),this.allowRemoteAccess.set(t["server-listen-interface"]==="any"),this.allowedHostnames.set(t["allowed-hostnames"]),this.loadedAllowedHostnames.set(t["allowed-hostnames"]),this.consoleControlDisabled.set(t["disable-console-control"]==="True"),this.usageStatistics.set(t["usage-reporter-level"]===""?"none":t["usage-reporter-level"]),this.timeType.set(e==""?"none":T.includes(n)?n:"none"),this.timeValue.set(e==""?0:parseInt(a));let N=t["power-mode-provider"]===""||t["power-mode-provider"]==null?"default":t["power-mode-provider"];this.powerModeCtrl.set(N)});setDarkMode(){this.#n.setDarkMode()}setLightMode(){this.#n.setLightMode()}changeDefaultClientTo(t){this.#e.open(Mt,{data:{title:$localize`Use legacy UI`,message:$localize`Are you sure you want to use the legacy user interface, not recommended unless you have a specific reason?`,confirmText:$localize`Use legacy`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#r(t),window.location.replace(`/${t}`))}})}#r(t){var e=new Date;e.setTime(e.getTime()+2160*60*60*1e3),document.cookie="default-client="+t+"; expires="+e.toUTCString()+"; path=/"}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=D({type:s,selectors:[["app-settings"]],decls:123,vars:43,consts:()=>{let t;t=$localize`Settings`;let e;e=$localize`Configure your backup settings.`;let n;n=$localize`Color theme`;let a;a=$localize`Customize your application theme`;let T;T=$localize`Passwords`;let N;N=$localize`Change server passphrase`;let u;u=$localize`Language`;let O;O=$localize`Select a language for the platform`;let I;I=$localize`Use legacy interface`;let Te;Te=$localize`Use the old user interface, not recommended unless you have a specific reason.`;let de;de=$localize`${"\uFFFD#46\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#46\uFFFD"}:CLOSE_TAG_SH_ICON: Use legacy UI `;let Se;Se=$localize`Allow remote access (requires restart)`;let ce;ce=$localize` By allowing remote access, the server listens to requests from any machine on your network. If you enable this option, make sure you are always using the computer on a secure firewall protected network. `;let ge;ge=$localize`Allow remote access`;let Ce;Ce=$localize`Prevent tray icon automatic log-in`;let pe;pe=$localize` By default, the tray icon will open the user interface with a token that unlocks the user interface. This ensures that you can access the user interface from the tray icon, while requiring others to enter a password. If you prefer having to type in the password, even when accessing the user interface from the tray icon, enable this option. `;let Ee;Ee=$localize`Prevent tray icon automatic log-in`;let ue;ue=$localize`Update channel`;let Ne;Ne=$localize` Default (${"\uFFFD0\uFFFD"}:INTERPOLATION:) `;let me;me=$localize`Same as the base install version: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let fe;fe=$localize`Stable`;let Me;Me=$localize`Official stable release.`;let Pe;Pe=$localize`Beta`;let Oe;Oe=$localize` Try out the new features that we are working on. Test a backup and restore before using this in production environments. `;let he;he=$localize` Experimental `;let Ie;Ie=$localize`Early previews of new features. Not for use with important data.`;let Re;Re=$localize`Canary`;let Ge;Ge=$localize`Builds for developers and testers only. Not for use with important data.`;let ye;ye=$localize`Pause after startup or hibernation`;let $e;$e=$localize` Duplicati will run when started, but will remain in paused state for the duration. Duplicati will occupy minimal system resources and no backups will be run. `;let Ae;Ae=$localize`Advanced options`;let ve;ve=$localize`Connect to console`;let Le;Le=$localize`Disable console control`;let Fe;Fe=$localize` Disabling console control will disable remote access to this machine from the console, but will keep the registration intact and allow pushing settings from the console. `;let be;be=$localize`Remote control disabled`;let we;we=$localize`Remote control enabled`;let De;De=$localize`Enter new password`;let xe;xe=$localize`Repeat password`;let ae;ae=$localize`Password have to be filled and have to match`;let ke;ke=$localize`Passphrase`;let Je;Je=$localize`Repeat passphrase`;let Xe;Xe=$localize`Cancel`;let Ve;Ve=$localize` Update passphrase `;let ze;ze=$localize` Update passphrase `;let Ue;Ue=$localize`Change password`;let Be;Be=$localize`Allowed hostnames`;let He;He=$localize` To prevent various DNS based attacks, Duplicati limits the allowed hostnames to the ones listed here. Direct IP access and localhost is always allowed. Multiple hostnames can be supplied with a semicolon separator. If any of the allowed hostnames is an asterisk (*), all hostnames are allowed and this feature is disabled. If the field is empty, only IP address and localhost access is allowed. `;let We;We=$localize` Update allowed hostnames `;let qe;qe=$localize`Power mode provider`;let je;je=$localize` The power mode provider monitors the system for when it enters a low power state and pauses Duplicati. When the system resumes, Duplicati will resume as well. Choosing the None option disables detection of low power states and Duplicati will run all the time. `;let Ke;Ke=$localize`Installed version: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let Qe;Qe=$localize`Usage statistics`;let U;return U=$localize` Usage reports help us improve the user experience and evaluate impact of new features. We use them to generate ${"\uFFFD#6\uFFFD"}:START_LINK:public usage statistics.${"\uFFFD/#6\uFFFD"}:CLOSE_LINK:${"[\uFFFD#7\uFFFD\uFFFD/#7\uFFFD|\uFFFD#8\uFFFD\uFFFD/#8\uFFFD]"}:LINE_BREAK:${"[\uFFFD#7\uFFFD\uFFFD/#7\uFFFD|\uFFFD#8\uFFFD\uFFFD/#8\uFFFD]"}:LINE_BREAK: All usage reports are sent anonymously and do not contain any personal information. They contain information about hardware and operating system, the type of backend, backup duration, overall size of source data and similar data. They do not contain paths, filenames, usernames, passwords or similar sensitive information. `,U=W(U),[t,e,n,a,T,N,u,O,I,Te,de,Se,ce,ge,Ce,pe,Ee,ue,Ne,me,fe,Me,Pe,Oe,he,Ie,Re,Ge,ye,$e,Ae,ve,Le,Fe,be,we,ke,Je,Xe,Ve,ze,Ue,Be,He,We,qe,je,Ke,Qe,U,[1,"content"],[1,"title"],[1,"left"],[1,"right"],[1,"themes"],["src","assets/images/light-theme.png","alt","light theme",3,"click"],["src","assets/images/dark-theme.png","alt","dark theme",3,"click"],[1,"right","passphrase-form"],[1,"actions"],["value","value","label","label",3,"options","isClearable","inlineSearch"],["type","text",3,"ngModelChange","ngModel","ngModelOptions"],["shButton","",1,"primary",3,"click"],[1,"right","remote-access-form"],[1,"primary","raised",3,"click"],[1,"indeterminate","primary"],[1,"right","radios"],[1,"radio-option",3,"click"],[1,"primary","raised"],[1,"field-row"],[1,"raised","primary",3,"unit"],["type","range",3,"ngModelChange","min","max","disabled","ngModel","ngModelOptions"],["label","label","value","value",3,"options","isClearable"],["type","text",3,"ngModelChange","ngModel"],[1,"advanced-settings"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",De,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",xe,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"sh-success"],["suffix",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"loader"],["shButton","","shTooltip",ae,1,"raised","primary",3,"loader","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",ae,1,"raised","primary",3,"click","disabled"],[1,"sh-success"],["for","allowedHostnames"],["type","text","id","allowedHostnames",3,"ngModelChange","ngModel"],["type","primary"],["value","value","label","label",3,"options","isClearable"],["href","#"],["label","label","value","value",3,"options","isLoading"]]},template:function(e,n){if(e&1&&(h(0,"app-status-bar"),o(1,"div",50)(2,"header")(3,"div",51)(4,"h2"),l(5,0),i(),o(6,"p"),l(7,1),i()()(),g(8,qt,9,2),o(9,"section")(10,"div",52)(11,"h3"),l(12,2),i(),o(13,"p"),l(14,3),i()(),o(15,"div",53)(16,"div",54)(17,"img",55),c("click",function(){return n.setLightMode()}),i(),o(18,"img",56),c("click",function(){return n.setDarkMode()}),i()()()(),o(19,"section")(20,"div",52)(21,"h3"),l(22,4),i(),o(23,"p"),l(24,5),i()(),o(25,"div",57),g(26,Zt,15,7)(27,tn,4,1,"div",58),i()(),o(28,"section")(29,"div",52)(30,"h3"),l(31,6),i(),o(32,"p"),l(33,7),i()(),o(34,"div",53)(35,"sh-select",59)(36,"input",60),c("ngModelChange",function(T){return n.updateLocale(T)}),i()()()(),o(37,"section")(38,"div",52)(39,"h3"),l(40,8),i(),o(41,"p"),l(42,9),i()(),o(43,"div",53)(44,"button",61),c("click",function(){return n.changeDefaultClientTo("ngclient")}),G(45,10),h(46,"sh-icon"),y(),i()()(),o(47,"section")(48,"div",52)(49,"h3"),l(50,11),i(),o(51,"p"),l(52,12),i()(),o(53,"div",62)(54,"sh-toggle",63),c("click",function(){return n.updateRemoteAccess()}),o(55,"label"),l(56,13),i()(),g(57,nn,8,3),i()(),o(58,"section")(59,"div",52)(60,"h3"),l(61,14),i(),o(62,"p"),l(63,15),i()(),o(64,"div",53)(65,"sh-toggle",63),c("click",function(){return n.saveDisableTrayIconLogin()}),o(66,"label"),l(67,16),i()()()(),g(68,on,9,5,"section"),o(69,"section")(70,"div",52)(71,"h3"),l(72,17),i(),g(73,sn,2,1,"p"),g(74,an,1,0,"sh-progress-bar",64),i(),o(75,"div",65)(76,"div",66),c("click",function(){return n.setNewChannel("")}),o(77,"sh-radio",67),l(78,18),i(),o(79,"p"),l(80,19),i()(),o(81,"div",66),c("click",function(){return n.setNewChannel("stable")}),o(82,"sh-radio",67),l(83,20),i(),o(84,"p"),l(85,21),i()(),o(86,"div",66),c("click",function(){return n.setNewChannel("beta")}),o(87,"sh-radio",67),l(88,22),i(),o(89,"p"),l(90,23),i()(),o(91,"div",66),c("click",function(){return n.setNewChannel("experimental")}),o(92,"sh-radio",67),l(93,24),i(),o(94,"p"),l(95,25),i()(),o(96,"div",66),c("click",function(){return n.setNewChannel("canary")}),o(97,"sh-radio",67),l(98,26),i(),o(99,"p"),l(100,27),i()()()()(),h(101,"sh-divider"),o(102,"div",50)(103,"section")(104,"div",52)(105,"h3"),l(106,28),i(),o(107,"p"),l(108,29),i()(),o(109,"div",53)(110,"div",68)(111,"sh-range-slider",69)(112,"input",70),L("ngModelChange",function(T){return v(n.timeValue,T)||(n.timeValue=T),T}),i()(),o(113,"sh-select",71)(114,"input",72),c("ngModelChange",function(T){return n.updateTimeType(T)}),i(),le(115,ln,1,1,"ng-template"),i()()()(),g(116,rn,13,5,"section"),i(),o(117,"div",50)(118,"section")(119,"div",73)(120,"h3"),l(121,30),i(),h(122,"app-advanced-options-settings"),i()()()),e&2){let a,T,N;_(8),C(n.isUsingRelay()?-1:8),_(9),M("active",!n.isDarkMode()),_(),M("active",n.isDarkMode()),_(8),C(n.showPassphraseForm()?26:27),_(9),m("options",n.languageOptions())("isClearable",!1)("inlineSearch",!0),_(),m("ngModel",n.langCtrl())("ngModelOptions",V(41,se)),_(18),M("active",n.allowRemoteAccess()),_(3),C(n.allowRemoteAccess()?57:-1),_(8),M("active",n.disableTrayIconLogin()),_(3),C(n.powerModeOptions().length>0?68:-1),_(5),C((a=n.sysinfo())!=null&&a.ServerVersion?73:-1),_(),C(n.updatingChannel()?74:-1),_(3),M("active",n.updateChannel()===""),_(),B((T=n.sysinfo())==null?null:T.DefaultUpdateChannel),H(78),_(2),B((N=n.sysinfo())==null?null:N.ServerVersionType),H(80),_(2),M("active",n.updateChannel()==="stable"),_(5),M("active",n.updateChannel()==="beta"),_(5),M("active",n.updateChannel()==="experimental"),_(5),M("active",n.updateChannel()==="canary"),_(14),m("unit",n.timeType()==="none"?"s":n.timeType()),_(),m("min",n.timeRange()[0])("max",n.timeRange()[1])("disabled",n.timeType()==="none"),A("ngModel",n.timeValue),m("ngModelOptions",V(42,se)),_(),m("options",n.timeTypeOptions())("isClearable",!1),_(),m("ngModel",n.timeType()),_(2),C(n.usageStatisticsDisabled()?-1:116)}},dependencies:[Y,j,dt,K,Q,Z,Ot,oe,z,J,pt,Et,Ct,Nt,mt,te,k,gt,ee,ut],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem 2rem}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem 0;background:var(--base-1);border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:2rem 0;border-top:1px solid var(--base-4)}section[_ngcontent-%COMP%]:first-of-type{border-top:0}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;align-items:flex-start}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] sh-button-group[_ngcontent-%COMP%]{margin-top:.25rem}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;width:50%}.passphrase-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:1rem}.passphrase-form[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.remote-access-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.themes[_ngcontent-%COMP%]{display:flex;gap:.5rem}.themes[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:15rem;border-radius:var(--shape-3);cursor:pointer}.themes[_ngcontent-%COMP%] img.active[_ngcontent-%COMP%]{border:2px solid var(--primary-8)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.radio-option[_ngcontent-%COMP%]{cursor:pointer}.radio-option[_ngcontent-%COMP%] sh-radio[_ngcontent-%COMP%]{color:var(--base-8);margin-bottom:.25rem}.radio-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;color:var(--base-9)}.field-col[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.advanced-settings[_ngcontent-%COMP%]{grid-column:1/-1;display:grid;grid-template-columns:auto 1fr;gap:1rem}"],changeDetection:0})};export{Tn as debounceSignal,re as default};
|
|
1
|
+
import{a as Pt}from"./chunk-MZMEFIHU.js";import{a as Ot}from"./chunk-XDECUOQ5.js";import{a as ht}from"./chunk-NOHHRZSK.js";import"./chunk-DU5QSRYH.js";import"./chunk-D2DI6ZER.js";import"./chunk-M77IE672.js";import"./chunk-I5AKUAZF.js";import"./chunk-PJAWWLYW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-RECKKS2S.js";import{a as ie}from"./chunk-W4QCGFNO.js";import"./chunk-L4GZJLYK.js";import{a as X}from"./chunk-LJQN4G2O.js";import"./chunk-I2RHQQ3J.js";import{a as Mt}from"./chunk-F2QQDU4N.js";import{a as ft}from"./chunk-XE5OMGTJ.js";import"./chunk-T6C2OUI5.js";import{a as rt,b as Tt}from"./chunk-TJ3WIU6Q.js";import{b as ne}from"./chunk-KBGIIJMM.js";import{B as J,E as ct,G as gt,H as te,L as Ct,M as pt,N as Et,P as ut,W as Nt,Y as mt,c as j,e as K,i as Q,m as dt,s as Y,t as Z,u as k,w as ee,z as St}from"./chunk-LFRGO2IP.js";import"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{$b as d,B as b,Bc as V,Cb as m,Db as o,Eb as i,Fb as h,H as R,Mb as f,Oa as tt,Ra as _,Rc as w,Sc as x,Tb as G,Ub as y,Vb as l,Wb as B,Xb as H,Yb as W,Yc as _t,Zb as c,_ as P,a as Ye,b as Ze,bb as D,c as et,da as p,ea as E,gb as le,gc as st,hb as nt,hc as at,kc as M,n as F,nc as $,oa as S,oc as q,pc as _e,rb as it,sb as ot,sc as A,tc as v,uc as L,wb as g,xb as C,yc as lt}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var $t=["formRef"],At=()=>[import("./chunk-7KUVROHU.js").then(s=>s.OptionsListComponent)];function vt(s,t){s&1&&(o(0,"sh-alert",3),l(1,1),i())}function Lt(s,t){if(s&1){let e=f();o(0,"app-options-list",5),L("optionsChange",function(a){p(e);let T=d();return v(T.settings,a)||(T.settings=a),E(a)}),i()}if(s&2){let e=d();A("options",e.settings),m("hasFreeTextSettings",!0)}}var z=class s{#e=P(X);#n=P(ne);formRef=_t.required("formRef");settings=S([]);isSubmitting=S(!1);isLoadingOptions=S(!0);saved=S(!1);lastRecievedServerSettings=S({});serverSettingsEffect=x(()=>{let t=this.#e.serverSettings();if(t===void 0)return;this.lastRecievedServerSettings.set(t),this.isLoadingOptions.set(!0);let e=Object.entries(t);e.forEach(([n,a],T)=>{if(n.startsWith("--")){let N=n.substring(2);this.settings.update(u=>(u.some(O=>O.Name===N)||u.push({Name:N,Value:a}),u))}T===e.length-1&&this.isLoadingOptions.set(!1)})});submit(){this.isSubmitting.set(!0);let t=this.settings(),e=this.lastRecievedServerSettings(),n=t.map(u=>u.Name),T=Object.keys(e).filter(u=>u.startsWith("--")).filter(u=>!n.includes(u.replace("--",""))),N=t.reduce((u,O)=>{let I=O.Name?.startsWith("--")?O.Name:`--${O.Name}`;return u[I]=O.Value,u},{});T.forEach(u=>{N[u]=null}),this.#n.patchApiV1Serversettings({requestBody:N}).pipe(R(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.#e.refreshServerSettings(),this.saved.set(!0),setTimeout(()=>{this.saved.set(!1)},3e3)}})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=D({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(e,n){e&1&&st(n.formRef,$t,5),e&2&&at()},decls:8,vars:4,consts:()=>{let t;t=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:floppy-disk${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: Save settings `;let e;return e=$localize`Settings saved`,[t,e,[1,"actions"],[1,"success"],["shButton","","type","button",1,"raised","primary",3,"click"],[3,"optionsChange","options","hasFreeTextSettings"]]},template:function(e,n){e&1&&(o(0,"div",2),g(1,vt,2,0,"sh-alert",3),o(2,"button",4),c("click",function(){return n.submit()}),G(3,0),h(4,"sh-icon"),y(),i()(),nt(5,Lt,1,2),it(6,5,At)),e&2&&(_(),C(n.saved()?1:-1),_(),M("loader",n.isSubmitting()),_(4),ot(!n.isLoadingOptions()))},dependencies:[Z,J,k,ee],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40.625rem;justify-self:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end;margin-bottom:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}"],changeDetection:0})};function bt(s,t){if(s&1){let e=f();o(0,"sh-form-field",12)(1,"input",13),L("ngModelChange",function(a){p(e);let T=d(2);return v(T.registerUrl,a)||(T.registerUrl=a),E(a)}),i()(),o(2,"button",14),c("click",function(){p(e);let a=d(2);return E(a.register())}),l(3,0),i()}if(s&2){let e=d(2);_(),A("ngModel",e.registerUrl)}}function wt(s,t){if(s&1&&(o(0,"div",9)(1,"label"),l(2,1),i(),o(3,"a",15),$(4),i()()),s&2){let e=d(2);_(3),m("href",lt(e.claimUrl()),tt),_(),q(e.claimUrl())}}function Dt(s,t){s&1&&(o(0,"div",9)(1,"label"),l(2,2),i()())}function xt(s,t){if(s&1){let e=f();o(0,"button",14),c("click",function(){p(e);let a=d(2);return E(a.cancel())}),l(1,3),i()}}function kt(s,t){if(s&1){let e=f();o(0,"button",14),c("click",function(){p(e);let a=d(2);return E(a.disable())}),l(1,4),i()}}function Jt(s,t){if(s&1){let e=f();o(0,"button",14),c("click",function(){p(e);let a=d(2);return E(a.enable())}),l(1,5),i(),o(2,"button",16),c("click",function(){p(e);let a=d(2);return E(a.delete())}),l(3,6),i()}}function Xt(s,t){s&1&&(G(0,7,1),h(1,"sh-icon"),y())}function Vt(s,t){s&1&&(G(0,7,2),h(1,"sh-icon"),y())}function zt(s,t){if(s&1){let e=f();o(0,"sh-chip",17),c("click",function(){p(e);let a=d(2);return E(a.copyReportingUrl())}),G(1,7),g(2,Xt,2,0,"sh-icon")(3,Vt,2,0,"sh-icon"),y(),i()}if(s&2){let e=d(2);_(2),C(e.copiedReportingUrl()===!0?2:3)}}function Ut(s,t){if(s&1&&(o(0,"div",8),g(1,bt,4,1),g(2,wt,5,3,"div",9),g(3,Dt,3,0,"div",9),g(4,xt,2,0,"button",10),g(5,kt,2,0,"button",10),g(6,Jt,4,0),g(7,zt,4,1,"sh-chip",11),i()),s&2){let e=d();_(),C(e.state()==="inactive"?1:-1),_(),C(e.state()==="registered"?2:-1),_(),C(e.state()==="registering"?3:-1),_(),C(e.state()==="registering"||e.state()==="registeringfaulted"||e.state()==="registered"?4:-1),_(),C(e.state()==="connected"||e.state()==="connecting"?5:-1),_(),C(e.state()==="disabled"?6:-1),_(),C(e.additionalReportingUrl()!==""?7:-1)}}var oe=class s{#e=P(ie);#n=P(X);state=this.#e.state;claimUrl=this.#e.claimUrl;registerUrl=this.#e.registerUrl;additionalReportingUrl=w(()=>{let t=this.#n.serverSettings();return this.#e.state()==="inactive"?"":t&&t["additional-report-url"]||""});copiedReportingUrl=S(!1);ngOnInit(){this.#e.refreshRemoteControlStatus()}cancel(){this.#e.cancelRemoteRegistration()}register(){this.#e.beginRemoteRegistration()}disable(){this.#e.disableRemoteControl()}enable(){this.#e.enableRemoteControl()}delete(){this.#e.deleteRemoteControl()}copyReportingUrl(){let t=this.additionalReportingUrl();t&&(this.copiedReportingUrl.set(!0),setTimeout(()=>this.copiedReportingUrl.set(!1),2e3),navigator.clipboard.writeText(t))}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=D({type:s,selectors:[["app-remote-control"]],decls:1,vars:1,consts:()=>{let t;t=$localize`Register on console`;let e;e=$localize`Machine is now registered, open this link to add it to your account:`;let n;n=$localize`Registering, please wait...`;let a;a=$localize`Cancel registration`;let T;T=$localize`Disable console connection`;let N;N=$localize`Enable console connection`;let u;u=$localize` Delete console connection setup `;let O;return O=$localize` Reporting configured by server ${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,O=W(O),[t,e,n,a,T,N,u,O,[1,"field-row"],[1,"field-col"],["type","button","shButton","",1,"raised"],[1,"reporting-url","primary","simple"],["label","Registration URL","for","remoteControlRegisterUrl"],["type","text","sh-input","","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl",3,"ngModelChange","ngModel"],["type","button","shButton","",1,"raised",3,"click"],["target","_blank",3,"href"],["type","button","shButton","",1,"raised","error",3,"click"],[1,"reporting-url","primary","simple",3,"click"]]},template:function(e,n){e&1&&g(0,Ut,8,7,"div",8),e&2&&C(n.state()!=="unknown"?0:-1)},dependencies:[Y,j,K,Q,te,J,ct,k],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.reporting-url[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none;margin-top:.25rem}"],changeDetection:0})};function Gt(...s){let t=S(...s);return Object.defineProperty(t,"value",{get:t.asReadonly(),set:t.set.bind(t)})}var se=()=>({standalone:!0});function Bt(s,t){s&1&&(o(0,"label"),l(1,34),i())}function Ht(s,t){s&1&&(o(0,"label"),l(1,35),i())}function Wt(s,t){if(s&1){let e=f();o(0,"section")(1,"div",52)(2,"h3"),l(3,32),i(),o(4,"p"),l(5,33),i()(),o(6,"div",53)(7,"sh-toggle",63),c("click",function(){p(e);let a=d(2);return E(a.toggleConsoleControl())}),g(8,Bt,2,0,"label")(9,Ht,2,0,"label"),i()()()}if(s&2){let e=d(2);_(7),M("active",!e.consoleControlDisabled()),_(),C(e.consoleControlDisabled()?8:9)}}function qt(s,t){if(s&1&&(o(0,"section")(1,"div",52)(2,"h3"),l(3,31),i(),o(4,"p"),$(5),i()(),o(6,"div",53),h(7,"app-remote-control"),i()(),g(8,Wt,10,3,"section")),s&2){let e=d();_(5),q(e.remoteControlStatus()),_(3),C(e.remoteControlState()!="inactive"?8:-1)}}function jt(s,t){s&1&&(o(0,"sh-icon",78),$(1,"check"),i())}function Kt(s,t){s&1&&(o(0,"sh-icon",79),$(1,"prohibit"),i())}function Qt(s,t){if(s&1){let e=f();o(0,"button",83),c("click",function(){p(e);let a=d(2);return E(a.updatePassphrase())}),l(1,39),i()}if(s&2){let e=d(2);M("loader",e.isUpdating())}}function Yt(s,t){if(s&1){let e=f();o(0,"button",84),c("click",function(){p(e);let a=d(2);return E(a.updatePassphrase())}),l(1,40),i()}if(s&2){let e=d(2);M("loader",e.isUpdating()),m("disabled",!0)}}function Zt(s,t){if(s&1){let e=f();o(0,"sh-form-field")(1,"label",74),l(2,36),i(),o(3,"input",75),L("ngModelChange",function(a){p(e);let T=d();return v(T.passphrase,a)||(T.passphrase=a),E(a)}),i()(),o(4,"sh-form-field")(5,"label",76),l(6,37),i(),o(7,"input",77),L("ngModelChange",function(a){p(e);let T=d();return v(T.repeatPassphrase,a)||(T.repeatPassphrase=a),E(a)}),i(),g(8,jt,2,0,"sh-icon",78)(9,Kt,2,0,"sh-icon",79),i(),o(10,"div",58)(11,"button",80),c("click",function(){p(e);let a=d();return E(a.cancelPasswordChange())}),l(12,38),i(),g(13,Qt,2,2,"button",81)(14,Yt,2,3,"button",82),i()}if(s&2){let e=d();_(3),A("ngModel",e.passphrase),_(4),m("disabled",e.passphrase().length===0),A("ngModel",e.repeatPassphrase),_(),C(e.passphrase().length!==0&&e.passphrase()===e.repeatPassphrase()?8:9),_(3),M("loader",e.isUpdating()),_(2),C(e.passphrase().length!==0&&e.passphrase()===e.repeatPassphrase()?13:14)}}function en(s,t){s&1&&(o(0,"sh-icon",85),$(1,"check"),i())}function tn(s,t){if(s&1){let e=f();o(0,"div",58)(1,"button",80),c("click",function(){p(e);let a=d();return E(a.openPassphraseForm())}),l(2,41),i(),g(3,en,2,0,"sh-icon",85),i()}if(s&2){let e=d();_(3),C(e.passwordUpdated()?3:-1)}}function nn(s,t){if(s&1){let e=f();o(0,"sh-form-field")(1,"label",86),l(2,42),i(),o(3,"textarea",87),L("ngModelChange",function(a){p(e);let T=d();return v(T.allowedHostnames,a)||(T.allowedHostnames=a),E(a)}),i()(),o(4,"sh-alert",88),l(5,43),i(),o(6,"button",83),c("click",function(){p(e);let a=d();return E(a.updateAllowedHostnames())}),l(7,44),i()}if(s&2){let e=d();_(3),A("ngModel",e.allowedHostnames),_(3),M("loader",e.updatingAllowedHosts())}}function on(s,t){if(s&1){let e=f();o(0,"section")(1,"div",52)(2,"h3"),l(3,45),i(),o(4,"p"),l(5,46),i()(),o(6,"div",53)(7,"sh-select",89)(8,"input",60),c("ngModelChange",function(a){p(e);let T=d();return E(T.updatePowerMode(a))}),i()()()()}if(s&2){let e=d();_(7),m("options",e.powerModeOptions())("isClearable",!1),_(),m("ngModel",e.powerModeCtrl())("ngModelOptions",V(4,se))}}function sn(s,t){if(s&1&&(o(0,"p"),l(1,47),i()),s&2){let e,n=d();_(),B((e=n.sysinfo())==null?null:e.ServerVersionName),H(1)}}function an(s,t){s&1&&h(0,"sh-progress-bar",64)}function ln(s,t){if(s&1&&$(0),s&2){let e=t.$implicit;_e(" ",e.label," ")}}function _n(s,t){if(s&1&&$(0),s&2){let e=t.$implicit;_e(" ",e.label," ")}}function rn(s,t){if(s&1){let e=f();o(0,"section")(1,"div",52)(2,"h3"),l(3,48),i(),o(4,"p"),G(5,49),h(6,"a",90)(7,"br")(8,"br"),y(),i()(),o(9,"div",53)(10,"sh-select",91)(11,"input",60),c("ngModelChange",function(a){p(e);let T=d();return E(T.updateUsageStatistics(a))}),i(),le(12,_n,1,1,"ng-template"),i()()()}if(s&2){let e=d();_(10),m("options",e.usageStatisticsOptions())("isLoading",e.updatingUsageStatistics()),_(),m("ngModel",e.usageStatistics())("ngModelOptions",V(4,se))}}function Tn(s,t,e){let n=Gt(s),a=n[Ye];e?.equal&&(a.equal=e.equal);let T;return n.set=N=>{clearTimeout(T),T=setTimeout(()=>Ze(a,N),t)},n.update=N=>{clearTimeout(T),T=setTimeout(()=>et(a,N),t)},n}var dn=[{value:"none",label:$localize`None`},{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],yt=[{value:"none",label:$localize`System default ($value)`},{value:"information",label:$localize`Usage statistics, warnings, errors, and crashes`},{value:"warning",label:$localize`Warnings, errors and crashes`},{value:"error",label:$localize`Errors and crashes`},{value:"crash",label:$localize`Crashes only`},{value:"disabled",label:$localize`None / disabled`}],re=class s{#e=P(St);#n=P(Pt);#i=P(ft);#t=P(ne);#o=P(X);#s=P(ie);#_=P(Tt);#a=P(rt);#l=this.#a.getItem("locale")??"en-US";sysinfo=this.#i.systemInfo;isDarkMode=this.#n.isDarkMode;editAs=S("list");previousLang=this.#l;langCtrl=S(this.#l);powerModeCtrl=S("");usageStatistics=S("");updatingUsageStatistics=S(!1);remoteControlStatus=this.#s.status;remoteControlState=this.#s.state;updatingChannel=S(!1);updateChannel=S("");isUsingRelay=this.#_.relayIsEnabled;usageStatisticsDisabled=w(()=>(this.#i.systemInfo()?.DefaultUsageReportLevel??"").toLowerCase()==="disabled");#T=x(()=>{let t=this.#i.systemInfo()?.DefaultUsageReportLevel??"",e=yt;e[0].label=$localize`System default (${t})`,this.usageStatisticsOptions.set(e)});setNewChannel(t){let e=this.updateChannel();this.updateChannel.set(t),this.#t.patchApiV1Serversettings({requestBody:{"update-channel":t}}).pipe(R(()=>this.updatingChannel.set(!1)),b(()=>(this.updateChannel.set(e),F(null)))).subscribe()}allowRemoteAccess=S(!1);allowedHostnames=S("");loadedAllowedHostnames=S("");updatingRemoteAccess=S(!1);updatingAllowedHosts=S(!1);updatingConsoleControl=S(!1);consoleControlDisabled=S(!1);updateRemoteAccess(){let t=this.allowRemoteAccess(),e=!t;this.allowRemoteAccess.set(e),this.#t.patchApiV1Serversettings({requestBody:{"server-listen-interface":e?"any":"loopback"}}).pipe(R(()=>this.updatingRemoteAccess.set(!1)),b(()=>(this.allowRemoteAccess.set(t),F(null)))).subscribe()}updateAllowedHostnames(){let t=this.loadedAllowedHostnames(),e=this.allowedHostnames();this.updatingAllowedHosts.set(!0),this.#t.patchApiV1Serversettings({requestBody:{"server-listen-interface":"any","allowed-hostnames":e}}).pipe(R(()=>this.updatingAllowedHosts.set(!1)),b(()=>(this.allowedHostnames.set(t),F(null)))).subscribe()}toggleConsoleControl(){let t=this.consoleControlDisabled(),e=!t;this.updatingConsoleControl.set(!0),this.consoleControlDisabled.set(e),this.#t.patchApiV1Serversettings({requestBody:{"disable-console-control":e?"True":"False"}}).pipe(R(()=>this.updatingConsoleControl.set(!1)),b(()=>(this.consoleControlDisabled.set(t),F(null)))).subscribe()}updatingDisableTrayIconLogin=S(!1);disableTrayIconLogin=S(!1);saveDisableTrayIconLogin(){let t=this.disableTrayIconLogin(),e=!t;this.updatingDisableTrayIconLogin.set(!0),this.disableTrayIconLogin.set(e),this.#t.patchApiV1Serversettings({requestBody:{"disable-tray-icon-login":e?"True":"False"}}).pipe(R(()=>this.updatingDisableTrayIconLogin.set(!1)),b(()=>(this.disableTrayIconLogin.set(t),F(null)))).subscribe()}showPassphraseForm=S(!1);isUpdating=S(!1);passphrase=S("");repeatPassphrase=S("");passwordUpdated=S(!1);updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#t.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(R(()=>this.isUpdating.set(!1))).subscribe({next:()=>{this.showPassphraseForm.set(!1),this.passwordUpdated.set(!0),setTimeout(()=>{this.passwordUpdated.set(!1)},3e3)}}))}openPassphraseForm(){this.showPassphraseForm.set(!0)}cancelPasswordChange(){this.showPassphraseForm.set(!1)}languageOptions=S(ht);powerModeOptions=w(()=>{let t=this.#i.systemInfo();return!t?.PowerModeProviders||t.PowerModeProviders.filter(e=>e!==""&&e!=="None").length==0?[]:t.PowerModeProviders.map(e=>({value:e==""?"default":e,label:e===""?$localize`Default`:e}))});usageStatisticsOptions=S(yt);timeTypeOptions=S(dn);timeType=S("none");timeValue=Tn(0,300);timeRange=w(()=>this.timeType()==="h"?[0,24]:[0,60]);timeValueEffect=x(()=>{let t=this.timeValue(),e=this.#o.serverSettings();!e||e["startup-delay"]===""&&this.timeType()==="none"||this.updateStartupDelay()});updateLocale(t){!t||t===""||t===this.previousLang||(this.#a.setItem("locale",t),window.location.reload())}updateStartupDelay(){let t=this.timeValue(),e=this.timeType(),n="";e!=="none"&&t!==0&&(n=`${t}${e}`),this.#t.patchApiV1Serversettings({requestBody:{"startup-delay":n}}).subscribe()}updateTimeType(t){this.timeType()==="none"&&this.timeValue.set(0),this.timeType.set(t)}updateUsageStatistics(t){let e=this.usageStatistics();!t||t===""||t===e||(this.usageStatistics.set(t),this.updatingUsageStatistics.set(!0),this.#t.patchApiV1Serversettings({requestBody:{"usage-reporter-level":this.usageStatistics()==="none"?"":this.usageStatistics()}}).pipe(R(()=>this.updatingUsageStatistics.set(!1)),b(()=>(this.usageStatistics.set(e),F(null)))).subscribe())}updatePowerMode(t){let e=this.powerModeCtrl();e!==t&&(t==="default"&&(t=""),this.#t.patchApiV1Serversettings({requestBody:{"power-mode-provider":t||""}}).pipe(b(()=>(this.powerModeCtrl.set(e),F(null)))).subscribe())}serverSettingsEffect=x(()=>{let t=this.#o.serverSettings();if(t===void 0)return;let e=t["startup-delay"],n=e.slice(-1),a=e.slice(0,-1),T=["s","m","h"];this.disableTrayIconLogin.set(t["disable-tray-icon-login"]!=="False"),this.updateChannel.set(t["update-channel"]),this.allowRemoteAccess.set(t["server-listen-interface"]==="any"),this.allowedHostnames.set(t["allowed-hostnames"]),this.loadedAllowedHostnames.set(t["allowed-hostnames"]),this.consoleControlDisabled.set(t["disable-console-control"]==="True"),this.usageStatistics.set(t["usage-reporter-level"]===""?"none":t["usage-reporter-level"]),this.timeType.set(e==""?"none":T.includes(n)?n:"none"),this.timeValue.set(e==""?0:parseInt(a));let N=t["power-mode-provider"]===""||t["power-mode-provider"]==null?"default":t["power-mode-provider"];this.powerModeCtrl.set(N)});setDarkMode(){this.#n.setDarkMode()}setLightMode(){this.#n.setLightMode()}changeDefaultClientTo(t){this.#e.open(Mt,{data:{title:$localize`Use legacy UI`,message:$localize`Are you sure you want to use the legacy user interface, not recommended unless you have a specific reason?`,confirmText:$localize`Use legacy`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#r(t),window.location.replace(`/${t}`))}})}#r(t){var e=new Date;e.setTime(e.getTime()+2160*60*60*1e3),document.cookie="default-client="+t+"; expires="+e.toUTCString()+"; path=/"}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=D({type:s,selectors:[["app-settings"]],decls:123,vars:43,consts:()=>{let t;t=$localize`Settings`;let e;e=$localize`Configure your backup settings.`;let n;n=$localize`Color theme`;let a;a=$localize`Customize your application theme`;let T;T=$localize`Passwords`;let N;N=$localize`Change server passphrase`;let u;u=$localize`Language`;let O;O=$localize`Select a language for the platform`;let I;I=$localize`Use legacy interface`;let Te;Te=$localize`Use the old user interface, not recommended unless you have a specific reason.`;let de;de=$localize`${"\uFFFD#46\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#46\uFFFD"}:CLOSE_TAG_SH_ICON: Use legacy UI `;let Se;Se=$localize`Allow remote access (requires restart)`;let ce;ce=$localize` By allowing remote access, the server listens to requests from any machine on your network. If you enable this option, make sure you are always using the computer on a secure firewall protected network. `;let ge;ge=$localize`Allow remote access`;let Ce;Ce=$localize`Prevent tray icon automatic log-in`;let pe;pe=$localize` By default, the tray icon will open the user interface with a token that unlocks the user interface. This ensures that you can access the user interface from the tray icon, while requiring others to enter a password. If you prefer having to type in the password, even when accessing the user interface from the tray icon, enable this option. `;let Ee;Ee=$localize`Prevent tray icon automatic log-in`;let ue;ue=$localize`Update channel`;let Ne;Ne=$localize` Default (${"\uFFFD0\uFFFD"}:INTERPOLATION:) `;let me;me=$localize`Same as the base install version: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let fe;fe=$localize`Stable`;let Me;Me=$localize`Official stable release.`;let Pe;Pe=$localize`Beta`;let Oe;Oe=$localize` Try out the new features that we are working on. Test a backup and restore before using this in production environments. `;let he;he=$localize` Experimental `;let Ie;Ie=$localize`Early previews of new features. Not for use with important data.`;let Re;Re=$localize`Canary`;let Ge;Ge=$localize`Builds for developers and testers only. Not for use with important data.`;let ye;ye=$localize`Pause after startup or hibernation`;let $e;$e=$localize` Duplicati will run when started, but will remain in paused state for the duration. Duplicati will occupy minimal system resources and no backups will be run. `;let Ae;Ae=$localize`Advanced options`;let ve;ve=$localize`Connect to console`;let Le;Le=$localize`Disable console control`;let Fe;Fe=$localize` Disabling console control will disable remote access to this machine from the console, but will keep the registration intact and allow pushing settings from the console. `;let be;be=$localize`Remote control disabled`;let we;we=$localize`Remote control enabled`;let De;De=$localize`Enter new password`;let xe;xe=$localize`Repeat password`;let ae;ae=$localize`Password have to be filled and have to match`;let ke;ke=$localize`Passphrase`;let Je;Je=$localize`Repeat passphrase`;let Xe;Xe=$localize`Cancel`;let Ve;Ve=$localize` Update passphrase `;let ze;ze=$localize` Update passphrase `;let Ue;Ue=$localize`Change password`;let Be;Be=$localize`Allowed hostnames`;let He;He=$localize` To prevent various DNS based attacks, Duplicati limits the allowed hostnames to the ones listed here. Direct IP access and localhost is always allowed. Multiple hostnames can be supplied with a semicolon separator. If any of the allowed hostnames is an asterisk (*), all hostnames are allowed and this feature is disabled. If the field is empty, only IP address and localhost access is allowed. `;let We;We=$localize` Update allowed hostnames `;let qe;qe=$localize`Power mode provider`;let je;je=$localize` The power mode provider monitors the system for when it enters a low power state and pauses Duplicati. When the system resumes, Duplicati will resume as well. Choosing the None option disables detection of low power states and Duplicati will run all the time. `;let Ke;Ke=$localize`Installed version: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let Qe;Qe=$localize`Usage statistics`;let U;return U=$localize` Usage reports help us improve the user experience and evaluate impact of new features. We use them to generate ${"\uFFFD#6\uFFFD"}:START_LINK:public usage statistics.${"\uFFFD/#6\uFFFD"}:CLOSE_LINK:${"[\uFFFD#7\uFFFD\uFFFD/#7\uFFFD|\uFFFD#8\uFFFD\uFFFD/#8\uFFFD]"}:LINE_BREAK:${"[\uFFFD#7\uFFFD\uFFFD/#7\uFFFD|\uFFFD#8\uFFFD\uFFFD/#8\uFFFD]"}:LINE_BREAK: All usage reports are sent anonymously and do not contain any personal information. They contain information about hardware and operating system, the type of backend, backup duration, overall size of source data and similar data. They do not contain paths, filenames, usernames, passwords or similar sensitive information. `,U=W(U),[t,e,n,a,T,N,u,O,I,Te,de,Se,ce,ge,Ce,pe,Ee,ue,Ne,me,fe,Me,Pe,Oe,he,Ie,Re,Ge,ye,$e,Ae,ve,Le,Fe,be,we,ke,Je,Xe,Ve,ze,Ue,Be,He,We,qe,je,Ke,Qe,U,[1,"content"],[1,"title"],[1,"left"],[1,"right"],[1,"themes"],["src","assets/images/light-theme.png","alt","light theme",3,"click"],["src","assets/images/dark-theme.png","alt","dark theme",3,"click"],[1,"right","passphrase-form"],[1,"actions"],["value","value","label","label",3,"options","isClearable","inlineSearch"],["type","text",3,"ngModelChange","ngModel","ngModelOptions"],["shButton","",1,"primary",3,"click"],[1,"right","remote-access-form"],[1,"primary","raised",3,"click"],[1,"indeterminate","primary"],[1,"right","radios"],[1,"radio-option",3,"click"],[1,"primary","raised"],[1,"field-row"],[1,"raised","primary",3,"unit"],["type","range",3,"ngModelChange","min","max","disabled","ngModel","ngModelOptions"],["label","label","value","value",3,"options","isClearable"],["type","text",3,"ngModelChange","ngModel"],[1,"advanced-settings"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",De,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",xe,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"sh-success"],["suffix",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"loader"],["shButton","","shTooltip",ae,1,"raised","primary",3,"loader","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",ae,1,"raised","primary",3,"click","disabled"],[1,"sh-success"],["for","allowedHostnames"],["type","text","id","allowedHostnames",3,"ngModelChange","ngModel"],["type","primary"],["value","value","label","label",3,"options","isClearable"],["href","#"],["label","label","value","value",3,"options","isLoading"]]},template:function(e,n){if(e&1&&(h(0,"app-status-bar"),o(1,"div",50)(2,"header")(3,"div",51)(4,"h2"),l(5,0),i(),o(6,"p"),l(7,1),i()()(),g(8,qt,9,2),o(9,"section")(10,"div",52)(11,"h3"),l(12,2),i(),o(13,"p"),l(14,3),i()(),o(15,"div",53)(16,"div",54)(17,"img",55),c("click",function(){return n.setLightMode()}),i(),o(18,"img",56),c("click",function(){return n.setDarkMode()}),i()()()(),o(19,"section")(20,"div",52)(21,"h3"),l(22,4),i(),o(23,"p"),l(24,5),i()(),o(25,"div",57),g(26,Zt,15,7)(27,tn,4,1,"div",58),i()(),o(28,"section")(29,"div",52)(30,"h3"),l(31,6),i(),o(32,"p"),l(33,7),i()(),o(34,"div",53)(35,"sh-select",59)(36,"input",60),c("ngModelChange",function(T){return n.updateLocale(T)}),i()()()(),o(37,"section")(38,"div",52)(39,"h3"),l(40,8),i(),o(41,"p"),l(42,9),i()(),o(43,"div",53)(44,"button",61),c("click",function(){return n.changeDefaultClientTo("ngclient")}),G(45,10),h(46,"sh-icon"),y(),i()()(),o(47,"section")(48,"div",52)(49,"h3"),l(50,11),i(),o(51,"p"),l(52,12),i()(),o(53,"div",62)(54,"sh-toggle",63),c("click",function(){return n.updateRemoteAccess()}),o(55,"label"),l(56,13),i()(),g(57,nn,8,3),i()(),o(58,"section")(59,"div",52)(60,"h3"),l(61,14),i(),o(62,"p"),l(63,15),i()(),o(64,"div",53)(65,"sh-toggle",63),c("click",function(){return n.saveDisableTrayIconLogin()}),o(66,"label"),l(67,16),i()()()(),g(68,on,9,5,"section"),o(69,"section")(70,"div",52)(71,"h3"),l(72,17),i(),g(73,sn,2,1,"p"),g(74,an,1,0,"sh-progress-bar",64),i(),o(75,"div",65)(76,"div",66),c("click",function(){return n.setNewChannel("")}),o(77,"sh-radio",67),l(78,18),i(),o(79,"p"),l(80,19),i()(),o(81,"div",66),c("click",function(){return n.setNewChannel("stable")}),o(82,"sh-radio",67),l(83,20),i(),o(84,"p"),l(85,21),i()(),o(86,"div",66),c("click",function(){return n.setNewChannel("beta")}),o(87,"sh-radio",67),l(88,22),i(),o(89,"p"),l(90,23),i()(),o(91,"div",66),c("click",function(){return n.setNewChannel("experimental")}),o(92,"sh-radio",67),l(93,24),i(),o(94,"p"),l(95,25),i()(),o(96,"div",66),c("click",function(){return n.setNewChannel("canary")}),o(97,"sh-radio",67),l(98,26),i(),o(99,"p"),l(100,27),i()()()(),o(101,"section")(102,"div",52)(103,"h3"),l(104,28),i(),o(105,"p"),l(106,29),i()(),o(107,"div",53)(108,"div",68)(109,"sh-range-slider",69)(110,"input",70),L("ngModelChange",function(T){return v(n.timeValue,T)||(n.timeValue=T),T}),i()(),o(111,"sh-select",71)(112,"input",72),c("ngModelChange",function(T){return n.updateTimeType(T)}),i(),le(113,ln,1,1,"ng-template"),i()()()(),g(114,rn,13,5,"section"),i(),h(115,"sh-divider"),o(116,"div",50)(117,"section")(118,"div",73)(119,"h3"),l(120,30),i(),h(121,"app-advanced-options-settings"),i()()(),h(122,"sh-divider")),e&2){let a,T,N;_(8),C(n.isUsingRelay()?-1:8),_(9),M("active",!n.isDarkMode()),_(),M("active",n.isDarkMode()),_(8),C(n.showPassphraseForm()?26:27),_(9),m("options",n.languageOptions())("isClearable",!1)("inlineSearch",!0),_(),m("ngModel",n.langCtrl())("ngModelOptions",V(41,se)),_(18),M("active",n.allowRemoteAccess()),_(3),C(n.allowRemoteAccess()?57:-1),_(8),M("active",n.disableTrayIconLogin()),_(3),C(n.powerModeOptions().length>0?68:-1),_(5),C((a=n.sysinfo())!=null&&a.ServerVersion?73:-1),_(),C(n.updatingChannel()?74:-1),_(3),M("active",n.updateChannel()===""),_(),B((T=n.sysinfo())==null?null:T.DefaultUpdateChannel),H(78),_(2),B((N=n.sysinfo())==null?null:N.ServerVersionType),H(80),_(2),M("active",n.updateChannel()==="stable"),_(5),M("active",n.updateChannel()==="beta"),_(5),M("active",n.updateChannel()==="experimental"),_(5),M("active",n.updateChannel()==="canary"),_(12),m("unit",n.timeType()==="none"?"s":n.timeType()),_(),m("min",n.timeRange()[0])("max",n.timeRange()[1])("disabled",n.timeType()==="none"),A("ngModel",n.timeValue),m("ngModelOptions",V(42,se)),_(),m("options",n.timeTypeOptions())("isClearable",!1),_(),m("ngModel",n.timeType()),_(2),C(n.usageStatisticsDisabled()?-1:114)}},dependencies:[Y,j,dt,K,Q,Z,Ot,oe,z,J,pt,Et,Ct,Nt,mt,te,k,gt,ee,ut],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem 2rem}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem 0;background:var(--base-1);border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:2rem 0;border-top:1px solid var(--base-4)}section[_ngcontent-%COMP%]:first-of-type{border-top:0}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;align-items:flex-start}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] sh-button-group[_ngcontent-%COMP%]{margin-top:.25rem}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;width:50%}.passphrase-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:1rem}.passphrase-form[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.remote-access-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.themes[_ngcontent-%COMP%]{display:flex;gap:.5rem}.themes[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:15rem;border-radius:var(--shape-3);cursor:pointer}.themes[_ngcontent-%COMP%] img.active[_ngcontent-%COMP%]{border:2px solid var(--primary-8)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.radio-option[_ngcontent-%COMP%]{cursor:pointer}.radio-option[_ngcontent-%COMP%] sh-radio[_ngcontent-%COMP%]{color:var(--base-8);margin-bottom:.25rem}.radio-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;color:var(--base-9)}.field-col[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.advanced-settings[_ngcontent-%COMP%]{grid-column:1/-1;display:grid;grid-template-columns:auto 1fr;gap:1rem}"],changeDetection:0})};export{Tn as debounceSignal,re as default};
|
package/index.html
CHANGED
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
<body>
|
|
84
84
|
<app-root></app-root>
|
|
85
85
|
<div class="loading">Connecting ...</div>
|
|
86
|
-
<link rel="modulepreload" href="chunk-NOHHRZSK.js"><link rel="modulepreload" href="chunk-66KMXCBD.js"><link rel="modulepreload" href="chunk-PDBKO5D5.js"><link rel="modulepreload" href="chunk-DU5QSRYH.js"><link rel="modulepreload" href="chunk-D2DI6ZER.js"><link rel="modulepreload" href="chunk-M77IE672.js"><link rel="modulepreload" href="chunk-I5AKUAZF.js"><link rel="modulepreload" href="chunk-PJAWWLYW.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-RECKKS2S.js"><script src="polyfills-S663R3NQ.js" type="module"></script><script src="main-
|
|
86
|
+
<link rel="modulepreload" href="chunk-NOHHRZSK.js"><link rel="modulepreload" href="chunk-66KMXCBD.js"><link rel="modulepreload" href="chunk-PDBKO5D5.js"><link rel="modulepreload" href="chunk-DU5QSRYH.js"><link rel="modulepreload" href="chunk-D2DI6ZER.js"><link rel="modulepreload" href="chunk-M77IE672.js"><link rel="modulepreload" href="chunk-I5AKUAZF.js"><link rel="modulepreload" href="chunk-PJAWWLYW.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-RECKKS2S.js"><script src="polyfills-S663R3NQ.js" type="module"></script><script src="main-X4XGDJTL.js" type="module"></script></body>
|
|
87
87
|
</html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Re,c as Te}from"./chunk-NOHHRZSK.js";import{a as be}from"./chunk-66KMXCBD.js";import{a as Se}from"./chunk-PDBKO5D5.js";import{a as k}from"./chunk-DU5QSRYH.js";import{a as Ce}from"./chunk-D2DI6ZER.js";import{b as ve}from"./chunk-M77IE672.js";import"./chunk-I5AKUAZF.js";import"./chunk-PJAWWLYW.js";import{a as P}from"./chunk-6Q6SSTBK.js";import{a as ge}from"./chunk-RECKKS2S.js";import"./chunk-F2QQDU4N.js";import{a as L}from"./chunk-XE5OMGTJ.js";import"./chunk-T6C2OUI5.js";import{a as h,b as v,c as ye,d as I}from"./chunk-TJ3WIU6Q.js";import{c as fe}from"./chunk-KBGIIJMM.js";import{v as ue,x as he}from"./chunk-LFRGO2IP.js";import{c as ae,d as pe,g as ce,h as le,i as me,j as de}from"./chunk-LEZL7BSL.js";import{a as ee}from"./chunk-4MEL5WTX.js";import{a as te,b as oe,c as ne,e as re,f as se,g as ie}from"./chunk-5K64UNNB.js";import{la as Y,qa as Z}from"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{A as x,B as G,Fb as z,H as w,Mc as q,N as B,Nc as X,P as R,R as J,Sc as Q,V as M,Y as _,_ as r,bb as K,f as W,i as j,ia as $,n as U,o as F,oa as d,r as S}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var E=class e{#o=r(h);#s=r(v);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=K({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ae],encapsulation:2})};var Me={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new _("ENVIRONMENT");var A=class e{#o=r(fe);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(J(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};var Le=()=>{let e=r(I);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?U(!0):e.refreshToken().pipe(S(()=>!0))))},Pe=()=>{let e=r(v),t=r(k),o=r($),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Ve=()=>!0,Ie={path:"connect/:typeParam",loadComponent:()=>import("./chunk-HJ5IWG4Y.js")},De=()=>{let e=r(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},ke=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-NHRDYV7W.js")},{path:"logout",loadComponent:()=>import("./chunk-XTYBRFP6.js")},{path:"",canActivate:[Le],children:[{path:"",canActivate:[Pe,Ve,De],children:[{path:"welcome",loadComponent:()=>import("./chunk-XY6KVQXK.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-ABJWT6DQ.js")},Ie]},{path:"",loadComponent:()=>import("./chunk-5SNEZYDF.js"),children:[{path:"",loadComponent:()=>import("./chunk-ZTCP7QD2.js")},Ie,{path:"add-backup",loadComponent:()=>import("./chunk-47AUYCMN.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-RNNVKT2R.js")},{path:"backup/import",loadComponent:()=>import("./chunk-X5FW56GT.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-AFUSUOJX.js"),loadChildren:()=>import("./chunk-AGFUNVOJ.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-AFUSUOJX.js"),loadChildren:()=>import("./chunk-AGFUNVOJ.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-4FD362Y4.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-4L4YRYBK.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-ES5NR2JV.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-PG2PHQWA.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-IZQG3EV6.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-FVVMRBPU.js")},{path:"from-config",loadComponent:()=>import("./chunk-CSY4BFC4.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-RKMVTPJD.js"),loadChildren:()=>import("./chunk-LEYS7OLH.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-RKMVTPJD.js"),loadChildren:()=>import("./chunk-LEYS7OLH.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-RKMVTPJD.js"),loadChildren:()=>import("./chunk-LEYS7OLH.js")},{path:"settings",loadComponent:()=>import("./chunk-K2PFS33O.js")},{path:"about",loadComponent:()=>import("./chunk-646U6U3M.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-MP7JKTLP.js")},{path:"changelog",loadComponent:()=>import("./chunk-FCZXIW2B.js")},{path:"libraries",loadComponent:()=>import("./chunk-S5O366BO.js")},{path:"system-info",loadComponent:()=>import("./chunk-WEFZF25L.js")},{path:"server-settings",loadComponent:()=>import("./chunk-4PMLRVX5.js")},{path:"logs",loadChildren:()=>import("./chunk-TZP7VKPA.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-CCM2D4BF.js")}]}]}]}]}]}];var V=null,Ee=(e,t)=>{let o=r(I),n=r(pe),i=r(h),l=r(f),s=i.getItem("locale"),u=r(he),p=Re(s),a=e.url==="/api/v1/auth/login",m=e.url==="/api/v1/auth/refresh",C=e.url==="/api/v1/progressstate",y=e.url==="/api/v1/remoteoperation/test",b=e.url==="/api/v1/filesystem/validate",T=e.url.startsWith("/api/v2/"),O=o.token(),D=e,H=e.headers.has("custom-proxy-check")||O===ye;if(O&&e.url.startsWith(l.baseUrl)&&!H){let c=e.headers.set("Authorization",`Bearer ${O}`);s&&s!=="en-US"&&(c=c.set("X-Ui-Language",p)),D=e.clone({headers:c})}return t(D).pipe(S(c=>{if(c.type===4&&c.status===200&&T){let g=c.body;if(g?.Success===!1)throw{status:200,message:g?.Error??"Unknown error",error:{Error:g?.Error??"Unknown error"},requestBody:g}}return c}),G(c=>{let g=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!H&&(C&&c.status===404||y||b||u.error(g),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!a&&!m&&c.status===401)?(V??=o.refreshToken().pipe(B()),V.pipe(R(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),w(()=>V=null))):F(()=>({error:c,message:g}))}))};var He="1.0.0",Ae=`portal-proxy-client-${P()}`,We=1,N=class e{#o=1e3;#s=r(f);#t=d("disconnected");#l=d(this.#o);#i=d(!1);#n=d(!1);#a=d(null);isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#t.asReadonly();#p=[];#r={};#e=null;#m=new TextDecoder("utf-8");#c=null;#d=Q(()=>{let t=this.#i(),o=this.#l(),n=this.#a();if(!n||!t||!o||o<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},o)});utf8Atob(t){let o=Uint8Array.from(atob(t),i=>i.charCodeAt(0)),n=this.#m.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,i=this.wsState();(i==="disconnected"||i==="error"||n)&&(this.#e?.close(),this.#e=null),!this.#e&&(this.#e=new WebSocket(this.#s.machineServerUrl),this.#t.set("connecting"),this.#e.onopen=()=>{this.#t.set("connect"),this.#n.set(!0),this.#i.set(!1),this.#a.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#n.set(!1),this.#a.set(t),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=l=>{let s=JSON.parse(l.data);if(this.wsState()==="connect"){if(s.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${s.type}'`);return}let p={token:t,publicKey:"",clientVersion:He,protocolVersion:We},a=this.createResponse(s,"authportal",p);this.#t.set("welcome"),this.#e?.send(a)}else if(this.wsState()==="welcome"){if(s.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${s.type}'`);return}var u=JSON.parse(s.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let p=this.#p.pop();p&&this.#r[p.messageId]&&this.activateCommand(p)}}else if(this.wsState()==="authenticated"){if(s.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${s.type}'`);return}let p=this.#r[s.messageId];if(p){if(s.errorMessage){p.reject(s.errorMessage);return}else{let a=JSON.parse(s.payload??"");a.body=a?.body==null?null:this.utf8Atob(a.body),p.resolve(a)}delete this.#r[s.messageId],window.clearTimeout(p.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let i={from:Ae,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(t,o,n,i,l,s,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((p,a)=>{let m=P(),y={from:Ae,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,body:l,headers:s})},b={resolve:p,reject:a,timer:window.setTimeout(()=>{let T=this.#r[m];T&&(delete this.#r[m],T.reject("Timeout"))},u)};this.#r[m]=b,this.#n()?this.activateCommand(y):this.#p.push(y)})}activateCommand(t){this.#e?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};function je(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function Ne(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let i=je(t.body),l={};t.headers.keys().forEach(a=>{l[a]=t.headers.get(a)??""});let s=t.headers.get("timeout"),u=s!==null?parseInt(s):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let p=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,i,l,u);return new W(a=>{p.then(m=>{let C=new te;l!=null&&Object.keys(l).forEach(b=>{C.set(b,l[b])});let y=new oe({body:m.body,status:m.code,statusText:"OK",headers:C});a.next(y),a.complete()}).catch(m=>{a.error(new ne({error:m??"Unknown error",status:0,statusText:m??"Unknown error"}))})})}var Oe=(e,t)=>{let o={relayconfigState:r(v),defaultTimeout:r(f).defaultTimeout,relayWebsocket:r(N)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let i=new j;return o.relayconfigState.configLoaded.subscribe(l=>{l&&Ne(o,e,t).subscribe(i)}),i}return Ne(o,e,t)};var xe={providers:[q(),le(ke,de(),me(ce)),re(ie(),se([Oe,Ee])),h,{provide:f,useValue:Me},{provide:X,useValue:Te()},{provide:ue,useValue:{alertVariant:"simple"}},be,k,ve,Z,ge,Y,Ce,Se]};ee(E,xe);
|
|
1
|
+
import{b as Re,c as Te}from"./chunk-NOHHRZSK.js";import{a as be}from"./chunk-66KMXCBD.js";import{a as Se}from"./chunk-PDBKO5D5.js";import{a as k}from"./chunk-DU5QSRYH.js";import{a as Ce}from"./chunk-D2DI6ZER.js";import{b as ve}from"./chunk-M77IE672.js";import"./chunk-I5AKUAZF.js";import"./chunk-PJAWWLYW.js";import{a as P}from"./chunk-6Q6SSTBK.js";import{a as ge}from"./chunk-RECKKS2S.js";import"./chunk-F2QQDU4N.js";import{a as L}from"./chunk-XE5OMGTJ.js";import"./chunk-T6C2OUI5.js";import{a as h,b as v,c as ye,d as I}from"./chunk-TJ3WIU6Q.js";import{c as fe}from"./chunk-KBGIIJMM.js";import{v as ue,x as he}from"./chunk-LFRGO2IP.js";import{c as ae,d as pe,g as ce,h as le,i as me,j as de}from"./chunk-LEZL7BSL.js";import{a as ee}from"./chunk-4MEL5WTX.js";import{a as te,b as oe,c as ne,e as re,f as se,g as ie}from"./chunk-5K64UNNB.js";import{la as Y,qa as Z}from"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{A as x,B as G,Fb as z,H as w,Mc as q,N as B,Nc as X,P as R,R as J,Sc as Q,V as M,Y as _,_ as r,bb as K,f as W,i as j,ia as $,n as U,o as F,oa as d,r as S}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var E=class e{#o=r(h);#s=r(v);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=K({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ae],encapsulation:2})};var Me={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new _("ENVIRONMENT");var A=class e{#o=r(fe);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(J(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};var Le=()=>{let e=r(I);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?U(!0):e.refreshToken().pipe(S(()=>!0))))},Pe=()=>{let e=r(v),t=r(k),o=r($),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Ve=()=>!0,Ie={path:"connect/:typeParam",loadComponent:()=>import("./chunk-HJ5IWG4Y.js")},De=()=>{let e=r(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},ke=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-NHRDYV7W.js")},{path:"logout",loadComponent:()=>import("./chunk-XTYBRFP6.js")},{path:"",canActivate:[Le],children:[{path:"",canActivate:[Pe,Ve,De],children:[{path:"welcome",loadComponent:()=>import("./chunk-XY6KVQXK.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-ABJWT6DQ.js")},Ie]},{path:"",loadComponent:()=>import("./chunk-5SNEZYDF.js"),children:[{path:"",loadComponent:()=>import("./chunk-ZTCP7QD2.js")},Ie,{path:"add-backup",loadComponent:()=>import("./chunk-47AUYCMN.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-RNNVKT2R.js")},{path:"backup/import",loadComponent:()=>import("./chunk-X5FW56GT.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-AFUSUOJX.js"),loadChildren:()=>import("./chunk-AGFUNVOJ.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-AFUSUOJX.js"),loadChildren:()=>import("./chunk-AGFUNVOJ.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-4FD362Y4.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-4L4YRYBK.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-ES5NR2JV.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-PG2PHQWA.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-IZQG3EV6.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-FVVMRBPU.js")},{path:"from-config",loadComponent:()=>import("./chunk-CSY4BFC4.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-RKMVTPJD.js"),loadChildren:()=>import("./chunk-LEYS7OLH.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-RKMVTPJD.js"),loadChildren:()=>import("./chunk-LEYS7OLH.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-RKMVTPJD.js"),loadChildren:()=>import("./chunk-LEYS7OLH.js")},{path:"settings",loadComponent:()=>import("./chunk-CBL5TPIR.js")},{path:"about",loadComponent:()=>import("./chunk-646U6U3M.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-MP7JKTLP.js")},{path:"changelog",loadComponent:()=>import("./chunk-FCZXIW2B.js")},{path:"libraries",loadComponent:()=>import("./chunk-S5O366BO.js")},{path:"system-info",loadComponent:()=>import("./chunk-WEFZF25L.js")},{path:"server-settings",loadComponent:()=>import("./chunk-4PMLRVX5.js")},{path:"logs",loadChildren:()=>import("./chunk-TZP7VKPA.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-CCM2D4BF.js")}]}]}]}]}]}];var V=null,Ee=(e,t)=>{let o=r(I),n=r(pe),i=r(h),l=r(f),s=i.getItem("locale"),u=r(he),p=Re(s),a=e.url==="/api/v1/auth/login",m=e.url==="/api/v1/auth/refresh",C=e.url==="/api/v1/progressstate",y=e.url==="/api/v1/remoteoperation/test",b=e.url==="/api/v1/filesystem/validate",T=e.url.startsWith("/api/v2/"),O=o.token(),D=e,H=e.headers.has("custom-proxy-check")||O===ye;if(O&&e.url.startsWith(l.baseUrl)&&!H){let c=e.headers.set("Authorization",`Bearer ${O}`);s&&s!=="en-US"&&(c=c.set("X-Ui-Language",p)),D=e.clone({headers:c})}return t(D).pipe(S(c=>{if(c.type===4&&c.status===200&&T){let g=c.body;if(g?.Success===!1)throw{status:200,message:g?.Error??"Unknown error",error:{Error:g?.Error??"Unknown error"},requestBody:g}}return c}),G(c=>{let g=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!H&&(C&&c.status===404||y||b||u.error(g),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!a&&!m&&c.status===401)?(V??=o.refreshToken().pipe(B()),V.pipe(R(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),w(()=>V=null))):F(()=>({error:c,message:g}))}))};var He="1.0.0",Ae=`portal-proxy-client-${P()}`,We=1,N=class e{#o=1e3;#s=r(f);#t=d("disconnected");#l=d(this.#o);#i=d(!1);#n=d(!1);#a=d(null);isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#t.asReadonly();#p=[];#r={};#e=null;#m=new TextDecoder("utf-8");#c=null;#d=Q(()=>{let t=this.#i(),o=this.#l(),n=this.#a();if(!n||!t||!o||o<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},o)});utf8Atob(t){let o=Uint8Array.from(atob(t),i=>i.charCodeAt(0)),n=this.#m.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,i=this.wsState();(i==="disconnected"||i==="error"||n)&&(this.#e?.close(),this.#e=null),!this.#e&&(this.#e=new WebSocket(this.#s.machineServerUrl),this.#t.set("connecting"),this.#e.onopen=()=>{this.#t.set("connect"),this.#n.set(!0),this.#i.set(!1),this.#a.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#n.set(!1),this.#a.set(t),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=l=>{let s=JSON.parse(l.data);if(this.wsState()==="connect"){if(s.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${s.type}'`);return}let p={token:t,publicKey:"",clientVersion:He,protocolVersion:We},a=this.createResponse(s,"authportal",p);this.#t.set("welcome"),this.#e?.send(a)}else if(this.wsState()==="welcome"){if(s.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${s.type}'`);return}var u=JSON.parse(s.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let p=this.#p.pop();p&&this.#r[p.messageId]&&this.activateCommand(p)}}else if(this.wsState()==="authenticated"){if(s.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${s.type}'`);return}let p=this.#r[s.messageId];if(p){if(s.errorMessage){p.reject(s.errorMessage);return}else{let a=JSON.parse(s.payload??"");a.body=a?.body==null?null:this.utf8Atob(a.body),p.resolve(a)}delete this.#r[s.messageId],window.clearTimeout(p.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let i={from:Ae,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(t,o,n,i,l,s,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((p,a)=>{let m=P(),y={from:Ae,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,body:l,headers:s})},b={resolve:p,reject:a,timer:window.setTimeout(()=>{let T=this.#r[m];T&&(delete this.#r[m],T.reject("Timeout"))},u)};this.#r[m]=b,this.#n()?this.activateCommand(y):this.#p.push(y)})}activateCommand(t){this.#e?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};function je(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function Ne(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let i=je(t.body),l={};t.headers.keys().forEach(a=>{l[a]=t.headers.get(a)??""});let s=t.headers.get("timeout"),u=s!==null?parseInt(s):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let p=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,i,l,u);return new W(a=>{p.then(m=>{let C=new te;l!=null&&Object.keys(l).forEach(b=>{C.set(b,l[b])});let y=new oe({body:m.body,status:m.code,statusText:"OK",headers:C});a.next(y),a.complete()}).catch(m=>{a.error(new ne({error:m??"Unknown error",status:0,statusText:m??"Unknown error"}))})})}var Oe=(e,t)=>{let o={relayconfigState:r(v),defaultTimeout:r(f).defaultTimeout,relayWebsocket:r(N)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let i=new j;return o.relayconfigState.configLoaded.subscribe(l=>{l&&Ne(o,e,t).subscribe(i)}),i}return Ne(o,e,t)};var xe={providers:[q(),le(ke,de(),me(ce)),re(ie(),se([Oe,Ee])),h,{provide:f,useValue:Me},{provide:X,useValue:Te()},{provide:ue,useValue:{alertVariant:"simple"}},be,k,ve,Z,ge,Y,Ce,Se]};ee(E,xe);
|
package/package.json
CHANGED