diff --git a/src/MDriveSync.Client.API/wwwroot/assets/index-KxJlzSCy.js b/src/MDriveSync.Client.API/wwwroot/assets/index-oiiYFCE1.js similarity index 99% rename from src/MDriveSync.Client.API/wwwroot/assets/index-KxJlzSCy.js rename to src/MDriveSync.Client.API/wwwroot/assets/index-oiiYFCE1.js index 42161f1..b80ed4c 100644 --- a/src/MDriveSync.Client.API/wwwroot/assets/index-KxJlzSCy.js +++ b/src/MDriveSync.Client.API/wwwroot/assets/index-oiiYFCE1.js @@ -998,4 +998,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&W2n[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},vce=Symbol("internals");function z$(e){return e&&String(e).trim().toLowerCase()}function A4(e){return e===!1||e==null?e:vt.isArray(e)?e.map(A4):String(e)}function q2n(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const K2n=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function N9(e,t,n,r,o){if(vt.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!vt.isString(t)){if(vt.isString(r))return t.indexOf(r)!==-1;if(vt.isRegExp(r))return r.test(t)}}function U2n(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function G2n(e,t){const n=vt.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,a,i){return this[r].call(this,t,o,a,i)},configurable:!0})})}class pN{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function a(l,s,u){const m=z$(s);if(!m)throw new Error("header name must be a non-empty string");const v=vt.findKey(o,m);(!v||o[v]===void 0||u===!0||u===void 0&&o[v]!==!1)&&(o[v||s]=A4(l))}const i=(l,s)=>vt.forEach(l,(u,m)=>a(u,m,s));return vt.isPlainObject(t)||t instanceof this.constructor?i(t,n):vt.isString(t)&&(t=t.trim())&&!K2n(t)?i(V2n(t),n):t!=null&&a(n,t,r),this}get(t,n){if(t=z$(t),t){const r=vt.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return q2n(o);if(vt.isFunction(n))return n.call(this,o,r);if(vt.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=z$(t),t){const r=vt.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||N9(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function a(i){if(i=z$(i),i){const l=vt.findKey(r,i);l&&(!n||N9(r,r[l],l,n))&&(delete r[l],o=!0)}}return vt.isArray(t)?t.forEach(a):a(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const a=n[r];(!t||N9(this,this[a],a,t,!0))&&(delete this[a],o=!0)}return o}normalize(t){const n=this,r={};return vt.forEach(this,(o,a)=>{const i=vt.findKey(r,a);if(i){n[i]=A4(o),delete n[a];return}const l=t?U2n(a):String(a).trim();l!==a&&delete n[a],n[l]=A4(o),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return vt.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&vt.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[vce]=this[vce]={accessors:{}}).accessors,o=this.prototype;function a(i){const l=z$(i);r[l]||(G2n(o,i),r[l]=!0)}return vt.isArray(t)?t.forEach(a):a(t),this}}pN.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);vt.reduceDescriptors(pN.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});vt.freezeMethods(pN);const Bd=pN;function j9(e,t){const n=this||yG,r=t||n,o=Bd.from(r.headers);let a=r.data;return vt.forEach(e,function(l){a=l.call(n,a,o.normalize(),t?t.status:void 0)}),o.normalize(),a}function E4e(e){return!!(e&&e.__CANCEL__)}function QO(e,t,n){Un.call(this,e??"canceled",Un.ERR_CANCELED,t,n),this.name="CanceledError"}vt.inherits(QO,Un,{__CANCEL__:!0});function X2n(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Un("Request failed with status code "+n.status,[Un.ERR_BAD_REQUEST,Un.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Y2n=iu.hasStandardBrowserEnv?{write(e,t,n,r,o,a){const i=[e+"="+encodeURIComponent(t)];vt.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),vt.isString(r)&&i.push("path="+r),vt.isString(o)&&i.push("domain="+o),a===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Q2n(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Z2n(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function I4e(e,t){return e&&!Q2n(t)?Z2n(e,t):t}const J2n=iu.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(a){let i=a;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(i){const l=vt.isString(i)?o(i):i;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}();function ewn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function twn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,a=0,i;return t=t!==void 0?t:1e3,function(s){const u=Date.now(),m=r[a];i||(i=u),n[o]=s,r[o]=u;let v=a,h=0;for(;v!==o;)h+=n[v++],v=v%e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),u-i{const a=o.loaded,i=o.lengthComputable?o.total:void 0,l=a-n,s=r(l),u=a<=i;n=a;const m={loaded:a,total:i,progress:i?a/i:void 0,bytes:l,rate:s||void 0,estimated:s&&i&&u?(i-a)/s:void 0,event:o};m[t?"download":"upload"]=!0,e(m)}}const nwn=typeof XMLHttpRequest<"u",rwn=nwn&&function(e){return new Promise(function(n,r){let o=e.data;const a=Bd.from(e.headers).normalize();let{responseType:i,withXSRFToken:l}=e,s;function u(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}let m;if(vt.isFormData(o)){if(iu.hasStandardBrowserEnv||iu.hasStandardBrowserWebWorkerEnv)a.setContentType(!1);else if((m=a.getContentType())!==!1){const[f,...g]=m?m.split(";").map(b=>b.trim()).filter(Boolean):[];a.setContentType([f||"multipart/form-data",...g].join("; "))}}let v=new XMLHttpRequest;if(e.auth){const f=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(f+":"+g))}const h=I4e(e.baseURL,e.url);v.open(e.method.toUpperCase(),w4e(h,e.params,e.paramsSerializer),!0),v.timeout=e.timeout;function c(){if(!v)return;const f=Bd.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),b={data:!i||i==="text"||i==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:f,config:e,request:v};X2n(function(C){n(C),u()},function(C){r(C),u()},b),v=null}if("onloadend"in v?v.onloadend=c:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(c)},v.onabort=function(){v&&(r(new Un("Request aborted",Un.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new Un("Network Error",Un.ERR_NETWORK,e,v)),v=null},v.ontimeout=function(){let g=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const b=e.transitional||O4e;e.timeoutErrorMessage&&(g=e.timeoutErrorMessage),r(new Un(g,b.clarifyTimeoutError?Un.ETIMEDOUT:Un.ECONNABORTED,e,v)),v=null},iu.hasStandardBrowserEnv&&(l&&vt.isFunction(l)&&(l=l(e)),l||l!==!1&&J2n(h))){const f=e.xsrfHeaderName&&e.xsrfCookieName&&Y2n.read(e.xsrfCookieName);f&&a.set(e.xsrfHeaderName,f)}o===void 0&&a.setContentType(null),"setRequestHeader"in v&&vt.forEach(a.toJSON(),function(g,b){v.setRequestHeader(b,g)}),vt.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),i&&i!=="json"&&(v.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&v.addEventListener("progress",gce(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&v.upload&&v.upload.addEventListener("progress",gce(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=f=>{v&&(r(!f||f.type?new QO(null,e,v):f),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const d=ewn(h);if(d&&iu.protocols.indexOf(d)===-1){r(new Un("Unsupported protocol "+d+":",Un.ERR_BAD_REQUEST,e));return}v.send(o||null)})},eA={http:P2n,xhr:rwn};vt.forEach(eA,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const hce=e=>`- ${e}`,own=e=>vt.isFunction(e)||e===null||e===!1,M4e={getAdapter:e=>{e=vt.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let a=0;a`adapter ${l} `+(s===!1?"is not supported by the environment":"is not available in the build"));let i=t?a.length>1?`since : `+a.map(hce).join(` -`):" "+hce(a[0]):"as no adapter specified";throw new Un("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:eA};function D9(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new QO(null,e)}function bce(e){return D9(e),e.headers=Bd.from(e.headers),e.data=j9.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),M4e.getAdapter(e.adapter||yG.adapter)(e).then(function(r){return D9(e),r.data=j9.call(e,e.transformResponse,r),r.headers=Bd.from(r.headers),r},function(r){return E4e(r)||(D9(e),r&&r.response&&(r.response.data=j9.call(e,e.transformResponse,r.response),r.response.headers=Bd.from(r.response.headers))),Promise.reject(r)})}const yce=e=>e instanceof Bd?e.toJSON():e;function r1(e,t){t=t||{};const n={};function r(u,m,v){return vt.isPlainObject(u)&&vt.isPlainObject(m)?vt.merge.call({caseless:v},u,m):vt.isPlainObject(m)?vt.merge({},m):vt.isArray(m)?m.slice():m}function o(u,m,v){if(vt.isUndefined(m)){if(!vt.isUndefined(u))return r(void 0,u,v)}else return r(u,m,v)}function a(u,m){if(!vt.isUndefined(m))return r(void 0,m)}function i(u,m){if(vt.isUndefined(m)){if(!vt.isUndefined(u))return r(void 0,u)}else return r(void 0,m)}function l(u,m,v){if(v in t)return r(u,m);if(v in e)return r(void 0,u)}const s={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(u,m)=>o(yce(u),yce(m),!0)};return vt.forEach(Object.keys(Object.assign({},e,t)),function(m){const v=s[m]||o,h=v(e[m],t[m],m);vt.isUndefined(h)&&v!==l||(n[m]=h)}),n}const R4e="1.6.3",CG={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{CG[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Cce={};CG.transitional=function(t,n,r){function o(a,i){return"[Axios v"+R4e+"] Transitional option '"+a+"'"+i+(r?". "+r:"")}return(a,i,l)=>{if(t===!1)throw new Un(o(i," has been removed"+(n?" in "+n:"")),Un.ERR_DEPRECATED);return n&&!Cce[i]&&(Cce[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,i,l):!0}};function awn(e,t,n){if(typeof e!="object")throw new Un("options must be an object",Un.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const a=r[o],i=t[a];if(i){const l=e[a],s=l===void 0||i(l,a,e);if(s!==!0)throw new Un("option "+a+" must be "+s,Un.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Un("Unknown option "+a,Un.ERR_BAD_OPTION)}}const tA={assertOptions:awn,validators:CG},Af=tA.validators;class I3{constructor(t){this.defaults=t,this.interceptors={request:new mce,response:new mce}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=r1(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:a}=n;r!==void 0&&tA.assertOptions(r,{silentJSONParsing:Af.transitional(Af.boolean),forcedJSONParsing:Af.transitional(Af.boolean),clarifyTimeoutError:Af.transitional(Af.boolean)},!1),o!=null&&(vt.isFunction(o)?n.paramsSerializer={serialize:o}:tA.assertOptions(o,{encode:Af.function,serialize:Af.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=a&&vt.merge(a.common,a[n.method]);a&&vt.forEach(["delete","get","head","post","put","patch","common"],d=>{delete a[d]}),n.headers=Bd.concat(i,a);const l=[];let s=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(n)===!1||(s=s&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const u=[];this.interceptors.response.forEach(function(f){u.push(f.fulfilled,f.rejected)});let m,v=0,h;if(!s){const d=[bce.bind(this),void 0];for(d.unshift.apply(d,l),d.push.apply(d,u),h=d.length,m=Promise.resolve(n);v{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](o);r._listeners=null}),this.promise.then=o=>{let a;const i=new Promise(l=>{r.subscribe(l),a=l}).then(o);return i.cancel=function(){r.unsubscribe(a)},i},t(function(a,i,l){r.reason||(r.reason=new QO(a,i,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new $G(function(o){t=o}),cancel:t}}}const iwn=$G;function lwn(e){return function(n){return e.apply(null,n)}}function swn(e){return vt.isObject(e)&&e.isAxiosError===!0}const nA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(nA).forEach(([e,t])=>{nA[t]=e});const cwn=nA;function T4e(e){const t=new H4(e),n=f4e(H4.prototype.request,t);return vt.extend(n,H4.prototype,t,{allOwnKeys:!0}),vt.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return T4e(r1(e,o))},n}const xo=T4e(yG);xo.Axios=H4;xo.CanceledError=QO;xo.CancelToken=iwn;xo.isCancel=E4e;xo.VERSION=R4e;xo.toFormData=fN;xo.AxiosError=Un;xo.Cancel=xo.CanceledError;xo.all=function(t){return Promise.all(t)};xo.spread=lwn;xo.isAxiosError=swn;xo.mergeConfig=r1;xo.AxiosHeaders=Bd;xo.formToJSON=e=>P4e(vt.isHTMLForm(e)?new FormData(e):e);xo.getAdapter=M4e.getAdapter;xo.HttpStatusCode=cwn;xo.default=xo;const uwn=xo,ra=uwn.create({}),dwn=async()=>(await ra.get("/api/drive/drives")).data,fwn=async()=>(await ra.get("/api/drive/jobs")).data,pwn=async e=>(await ra.post(`/api/drive/job/mount/${e}`)).data,mwn=async e=>(await ra.post(`/api/drive/job/unmount/${e}`)).data,vwn=async e=>(await ra.post(`/api/drive/mount/${e}`)).data,gwn=async e=>(await ra.post(`/api/drive/unmount/${e}`)).data,N4e=async()=>(await ra.get("/api/drive/points")).data,hwn=async()=>(await ra.get("/api/drive/crons")).data,bwn=async(e,t)=>(await ra.get(`/api/drive/files/${e}?parentId=${t||""}`)).data,ywn=async(e,t)=>(await ra.get(`/api/drive/download/${e}/${t}`)).data,$ce=async e=>(await ra.put("/api/drive/job",e)).data,Sce=async(e,t)=>(await ra.post(`/api/drive/job/${e}`,t)).data,Cwn=async(e,t)=>(await ra.put(`/api/drive/job/${e}/${t}`)).data,F9=async(e,t)=>(await ra.get(`/api/drive/file/${e}/${t}`)).data,xce=async(e,t)=>(await ra.put(`/api/drive/${e}`,t)).data,$wn=async e=>(await ra.post("/api/drive",e)).data,Swn=async e=>(await ra.delete(`/api/drive/${e}`)).data,wce=async(e="")=>(await ra.post("/api/drive/paths",{path:e})).data;var jt=(e=>(e[e.None=0]="None",e[e.Initializing=1]="Initializing",e[e.Idle=5]="Idle",e[e.Starting=6]="Starting",e[e.Scanning=7]="Scanning",e[e.BackingUp=8]="BackingUp",e[e.Restoring=9]="Restoring",e[e.Verifying=10]="Verifying",e[e.Queued=11]="Queued",e[e.Completed=15]="Completed",e[e.Paused=16]="Paused",e[e.Error=17]="Error",e[e.Cancelling=18]="Cancelling",e[e.Cancelled=19]="Cancelled",e[e.Disabled=100]="Disabled",e[e.Deleted=101]="Deleted",e[e.Continue=102]="Continue",e))(jt||{});const xwn=e=>{let t="default",n="";switch(e){case jt.None:t="grey",n="默认";break;case jt.Initializing:t="blue",n="初始化中";break;case jt.Idle:t="green",n="空闲";break;case jt.Starting:t="orange",n="启动中";break;case jt.Scanning:t="cyan",n="扫描中";break;case jt.BackingUp:t="purple",n="备份中";break;case jt.Restoring:t="magenta",n="还原中";break;case jt.Verifying:t="gold",n="校验中";break;case jt.Queued:t="lime",n="队列中";break;case jt.Completed:t="success",n="完成";break;case jt.Paused:t="warning",n="暂停";break;case jt.Error:t="error",n="错误";break;case jt.Cancelling:t="volcano",n="取消中";break;case jt.Cancelled:t="default",n="已取消";break;case jt.Disabled:t="black",n="禁用";break;default:n="未知"}return B.jsx(yz,{color:t,children:n})};function k$(e,t=2){if(e===0)return"0 Bytes";const n=1024,r=t<0?0:t,o=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],a=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,a)).toFixed(r))+" "+o[a]}var rA={exports:{}};(function(e,t){(function(n,r){r(t,e)})(yo,function(n,r){var o={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function a(){return"jsonp_"+Date.now()+"_"+Math.ceil(Math.random()*1e5)}function i(u){try{delete window[u]}catch{window[u]=void 0}}function l(u){var m=document.getElementById(u);m&&document.getElementsByTagName("head")[0].removeChild(m)}function s(u){var m=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],v=u,h=m.timeout||o.timeout,c=m.jsonpCallback||o.jsonpCallback,d=void 0;return new Promise(function(f,g){var b=m.jsonpCallbackFunction||a(),y=c+"_"+b;window[b]=function($){f({ok:!0,json:function(){return Promise.resolve($)}}),d&&clearTimeout(d),l(y),i(b)},v+=v.indexOf("?")===-1?"?":"&";var C=document.createElement("script");C.setAttribute("src",""+v+c+"="+b),m.charset&&C.setAttribute("charset",m.charset),m.nonce&&C.setAttribute("nonce",m.nonce),m.referrerPolicy&&C.setAttribute("referrerPolicy",m.referrerPolicy),m.crossorigin&&C.setAttribute("crossorigin","true"),C.id=y,document.getElementsByTagName("head")[0].appendChild(C),d=setTimeout(function(){g(new Error("JSONP request to "+u+" timed out")),i(b),l(y),window[b]=function(){i(b)}},h),C.onerror=function(){g(new Error("JSONP request to "+u+" failed")),i(b),l(y),d&&clearTimeout(d)}})}r.exports=s})})(rA,rA.exports);var wwn=rA.exports;const Own=Fr(wwn),{Step:Oce}=Jb,_ce=({clientId:e="12561ebaf6504bea8a611932684c86f6",redirectUri:t="https://api.duplicati.net/api/open/aliyundrive",onClose:n,isAdd:r,drive:o,onOk:a,onJobAdd:i})=>{const[l,s]=p.useState(!1),[u,m]=p.useState(!1),[v,h]=p.useState(""),[c,d]=p.useState(()=>(o==null?void 0:o.refreshToken)||""),[f]=Vt.useForm(),[g,b]=p.useState(0),[y,C]=p.useState(),[$,S]=p.useState([]),[w,x]=p.useState(o==null?void 0:o.mountPoint),[_,O]=p.useState(!1),[P,R]=p.useState(o);p.useEffect(()=>{var z,H,W,K,V,q,U;l&&(h(Math.random().toString(36).substr(2)+Math.random().toString(36).substr(2)),N4e().then(G=>{var J;G.success&&S(((J=G.data)==null?void 0:J.map(Y=>({value:Y})))||[])}),o&&(o.isRecycleBin=(z=o.mountConfig)==null?void 0:z.isRecycleBin,o.mountDrive=(H=o.mountConfig)==null?void 0:H.mountDrive,o.mountPath=(W=o.mountConfig)==null?void 0:W.mountPath,o.mountPoint=(K=o.mountConfig)==null?void 0:K.mountPoint,o.mountReadOnly=(V=o.mountConfig)==null?void 0:V.mountReadOnly,o.mountOnStartup=(q=o.mountConfig)==null?void 0:q.mountOnStartup,o.rapidUpload=(U=o.mountConfig)==null?void 0:U.rapidUpload),R(o),x(o==null?void 0:o.mountPoint),f&&o&&f.setFieldsValue(o))},[o,f,l]);const T=p.useCallback(()=>{m(!0);const z=`https://openapi.alipan.com/oauth/authorize?client_id=${e}&redirect_uri=${t}&scope=user:base,file:all:read,file:all:write&relogin=true&state=${v}`,H=680,W=760,K=window.screen.width/2-H/2,V=window.screen.height/2-W/2,q=window.open(z,"_blank",`height=${W},width=${H},left=${K},top=${V},toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no`);let U=300;const G=()=>{U--,U>0&&v?Own(`https://api.duplicati.net/api/open/aliyundrive/token?state=${v}`).then(J=>J.json()).then(J=>{J?(d(J),m(!1),q==null||q.close()):setTimeout(G,1e3)}).catch(()=>{setTimeout(G,1e3)}):(m(!1),q==null||q.close())};setTimeout(G,6e3)},[v,e,t]),E=p.useCallback(()=>{s(!0)},[]),I=p.useCallback(()=>{s(!1),n&&n()},[n]),j=()=>{f.validateFields().then(z=>{C({...y,...z}),b(g+1)}).catch(z=>{gn.error(z==null?void 0:z.errorFields[0].errors[0])})},L=()=>{f.validateFields().then(z=>{C({...y,...z}),b(g-1)}).catch(z=>{gn.error(z==null?void 0:z.errorFields[0].errors[0])})},N=async()=>{if(!o||!o.id){gn.error("保存云盘后才能执行挂载磁盘");return}if(!w){gn.error("请选择或输入挂载点");return}O(!0),f.validateFields().then(async z=>{if(z.refreshToken=c,z.mountPoint=w,z.mountConfig={isRecycleBin:z.isRecycleBin,mountDrive:z.mountDrive,mountPath:z.mountPath,mountPoint:z.mountPoint,mountReadOnly:z.mountReadOnly,mountOnStartup:z.mountOnStartup,rapidUpload:z.rapidUpload},o){const H=await xce(o.id,z);if(H!=null&&H.success){const W=await vwn(o.id);W.success?(gn.success("挂载成功,首次初始化列表需要1~5分钟,请耐心等待"),a&&a(),I()):gn.error(W.message||"操作失败"),O(!1)}else gn.error((H==null?void 0:H.message)||"操作失败")}}).catch(z=>{gn.error(z==null?void 0:z.errorFields[0].errors[0])}).finally(()=>{O(!1)})},D=()=>{if(!o||!o.id){gn.error("保存云盘后才能执行挂载磁盘");return}O(!0),gwn(o.id).then(z=>{z.success?(gn.success("操作成功"),a&&a(),I()):gn.error(z.message||"操作失败")}).finally(()=>O(!1))},k=async()=>{if(!c){gn.error("请授权");return}O(!0),f.validateFields().then(async z=>{if(z.refreshToken=c,z.mountPoint=w,z.mountConfig={isRecycleBin:z.isRecycleBin,mountDrive:z.mountDrive,mountPath:z.mountPath,mountPoint:z.mountPoint,mountReadOnly:z.mountReadOnly,mountOnStartup:z.mountOnStartup,rapidUpload:z.rapidUpload},o){const H=await xce(o.id,z);H!=null&&H.success?(gn.success("保存成功"),a&&a(),O(!1),I()):gn.error((H==null?void 0:H.message)||"操作失败")}else{const H=await $wn(z);H!=null&&H.success?(gn.success("保存成功"),a&&a(),O(!1),I()):gn.error((H==null?void 0:H.message)||"操作失败")}}).catch(z=>{gn.error(z==null?void 0:z.errorFields[0].errors[0])}).finally(()=>{O(!1)})},F=async()=>{if(o){const z=await Swn(o.id);z!=null&&z.success?(gn.success("操作成功"),I(),a&&a()):gn.error((z==null?void 0:z.message)||"操作失败")}};return B.jsxs(B.Fragment,{children:[B.jsx(P1.Button,{menu:{items:r?[{key:"import",label:"导入配置"},{key:"export",label:"导出配置"}]:[{key:"add",label:"添加作业"}],onClick:z=>{z.key=="add"&&i&&i()}},size:"small",className:"mr-2",onClick:()=>{E()},children:r?B.jsx(wW,{}):B.jsx(cV,{})}),B.jsx(vx,{title:"阿里云盘授权",open:l,onCancel:I,width:760,footer:B.jsxs("div",{children:[B.jsx(Fn,{disabled:o==null?void 0:o.isMount,loading:_,onClick:k,type:"primary",children:"保存"}),B.jsx(Fn,{onClick:I,type:"default",children:"取消"})]}),children:B.jsxs(cs,{spinning:u,tip:"授权中",children:[B.jsxs(Jb,{className:"py-3",onChange:z=>{b(z)},current:g,progressDot:!0,children:[B.jsx(Oce,{title:"授权管理"}),B.jsx(Oce,{title:"云盘挂载"})]}),B.jsxs(Vt,{disabled:o==null?void 0:o.isMount,form:f,labelCol:{span:4},wrapperCol:{span:18},children:[g==0&&B.jsx(B.Fragment,{children:B.jsxs(Vt.Item,{tooltip:"点击扫码获取阿里云盘授权令牌",label:"授权令牌",children:[B.jsx(bo.TextArea,{placeholder:"授权令牌",value:c,onChange:z=>d(z.target.value),rows:5}),B.jsx("span",{className:"text-blue-500 cursor-pointer hover:text-blue-700",onClick:T,children:"点击扫码授权"}),!r&&B.jsx(h0e,{title:"解除授权令牌?",description:"解除授权将会同时删除当前云盘下的所有作业",onConfirm:F,okText:"确认",cancelText:"取消",placement:"topLeft",children:B.jsx("span",{className:"text-red-500 cursor-pointer hover:text-red-700 w-auto flex",children:"解除授权"})})]})}),g==1&&B.jsxs(B.Fragment,{children:[B.jsxs(Vt.Item,{tooltip:"云盘挂载到本地磁盘的位置",label:"挂载点",help:B.jsxs("span",{children:["如果你想将云盘或云盘的某个目录挂载到本地磁盘,像访问本地磁盘一样访问云盘,请设置挂载到磁盘的位置。",B.jsx("br",{}),"确保挂载的磁盘盘符没有被占用,Linux 确保是空的文件夹。",B.jsx("br",{}),"windows 示例:C:\\,linux 示例:/tmp。",B.jsx("br",{}),B.jsxs("span",{children:["请确保已安装磁盘驱动,下载驱动:",B.jsx("a",{href:"/driver/Dokan_x64.msi",target:"_blank",children:"Windows_x64.msi"}),B.jsx(Av,{type:"vertical"}),B.jsx("a",{href:"/driver/Dokan_x86.msi",target:"_blank",children:"Windows_x86.msi"})]})]}),children:[B.jsx(Zme,{options:$,placeholder:"请输入或选择挂载点",value:w,onChange:z=>{x(z),C(H=>(H&&(H.mountPoint=z),H))}}),P&&P.id&&B.jsx("div",{className:"flex flex-row items-center py-2",children:P.isMount?B.jsxs("div",{className:"flex flex-row items-center",children:[B.jsx("span",{className:"text-green-400",children:"当前已挂载磁盘"}),B.jsx("span",{className:"text-gray-400",children:"(挂载中不可修改配置)"}),B.jsx(Av,{type:"vertical",className:"ml-4"}),B.jsx(Fn,{loading:_,size:"small",type:"link",onClick:D,disabled:!1,children:"卸载挂载"})]}):B.jsxs("div",{className:"flex flex-row items-center",children:[B.jsx("span",{className:"text-gray-400",children:"当前未挂载到本地磁盘"}),B.jsx(Av,{type:"vertical",className:"ml-4"}),B.jsx(Fn,{loading:_,size:"small",type:"link",onClick:N,children:"立即挂载"})]})})]}),B.jsx(Vt.Item,{name:"mountOnStartup",label:"自动挂载",tooltip:"程序启动后,立即将云盘挂载到本地磁盘",valuePropName:"checked",children:B.jsx(Ga,{})}),B.jsx(Vt.Item,{name:"isRecycleBin",label:"启用回收站",tooltip:"是否启用回收站,如果启用则删除文件时,保留到回收站",valuePropName:"checked",children:B.jsx(Ga,{})}),B.jsx(Vt.Item,{name:"mountReadOnly",label:"只读模式",tooltip:"以只读模式挂载阿里云盘时,无法对文件修改删除等",valuePropName:"checked",children:B.jsx(Ga,{})}),B.jsx(Vt.Item,{name:"mountDrive",label:"云盘类型",tooltip:"选择挂载的阿里云盘是备份盘还是资源库",children:B.jsxs(Pr,{children:[B.jsx(Pr.Option,{value:"backup",children:"备份盘"}),B.jsx(Pr.Option,{value:"resource",children:"资源库"})]})}),B.jsx(Vt.Item,{name:"mountPath",label:"云盘目录",tooltip:"指定挂载云盘的某个目录",help:"如果你希望只挂载某个目录到本地磁盘,则输入云盘路径,格式:文件夹/文件夹/文件夹,示例:backup/mdrive",children:B.jsx(bo,{})})]})]}),B.jsxs("div",{className:"pt-3 items-center justify-center w-full flex",children:[g>0&&B.jsx(Fn,{style:{margin:"0 8px"},onClick:()=>L(),children:"上一步"}),g<1&&B.jsx(Fn,{ghost:!0,type:"primary",onClick:()=>j(),children:"下一步"})]})]})})]})},{Step:FP}=Jb,{SHOW_PARENT:_wn}=lV,Pwn=({visible:e,onOk:t,onCancel:n,jobConfig:r,currentDriveId:o})=>{const[a]=Vt.useForm(),[i,l]=p.useState(0),[s,u]=p.useState(),[m,v]=p.useState(!1),[h,c]=p.useState([]),[d,f]=p.useState([]),[g,b]=p.useState();p.useEffect(()=>{hwn().then(N=>{c(N)}),wce().then(N=>{if(N.success){const D=N.data.filter(z=>z.id.includes("%")).map(z=>({title:z.text,label:z.text,value:z.resolvedpath||z.id,key:z.resolvedpath||z.id,icon:B.jsx(bj,{}),children:[]})),k=N.data.filter(z=>!z.id.includes("%")).map(z=>({title:z.text,label:z.text,value:z.id,key:z.id,icon:B.jsx(bj,{}),children:[]})),F=[];D.length>0&&F.push({title:"用户数据",label:"用户数据",value:":user",key:":user",icon:B.jsx(xlt,{className:"text-[#1677FF]"}),children:D,checkable:!1}),k.length>0&&F.push({title:"计算机",label:"计算机",value:":jsj",key:":jsj",icon:B.jsx(Xit,{}),children:k,checkable:!1}),R(F)}}),N4e().then(N=>{var D;N.success&&f(((D=N.data)==null?void 0:D.map(k=>({value:k})))||[])})},[]),p.useEffect(()=>{var N,D,k;a&&e&&(l(0),x(!0),r&&(r.mountOnStartup=(N=r.mountConfig)==null?void 0:N.mountOnStartup,r.mountPoint=(D=r.mountConfig)==null?void 0:D.mountPoint,r.mountReadOnly=(k=r.mountConfig)==null?void 0:k.mountReadOnly),u(r),a.setFieldsValue(r),O(r.sources||[]),b(r.mountPoint))},[e,r,a]);const y=()=>{a.validateFields().then(N=>{u({...s,...N})})},C=()=>{a.validateFields().then(N=>{u({...s,...N}),l(i+1)}).catch(N=>{gn.error(N==null?void 0:N.errorFields[0].errors[0])})},$=()=>{a.validateFields().then(N=>{u({...s,...N}),l(i-1)}).catch(N=>{gn.error(N==null?void 0:N.errorFields[0].errors[0])})},S=()=>{v(!0),a.validateFields().then(N=>{const D={...s,...N};D.mountConfig={mountPoint:D.mountPoint,mountReadOnly:D.mountReadOnly,mountOnStartup:D.mountOnStartup},u(D),D.id?$ce(D).then(k=>{k!=null&&k.success?(gn.success("操作成功"),t&&t()):gn.error((k==null?void 0:k.message)||"操作失败")}):Sce(o,D).then(k=>{k!=null&&k.success?(gn.success("操作成功"),t&&t()):gn.error((k==null?void 0:k.message)||"操作失败")})}).catch(N=>{gn.error(N==null?void 0:N.errorFields[0].errors[0])}).finally(()=>{v(!1)})},[w,x]=p.useState(!0),[_,O]=p.useState(()=>(r==null?void 0:r.sources)||[]),[P,R]=p.useState([]),T=N=>{O(N),u(D=>(D&&(D.sources=N),D))},E=(N,D,k)=>N.map(F=>F.key===D?{...F,children:k}:F.children&&F.children.length>0?{...F,children:E(F.children,D,k)}:F),I=async N=>{var D;if(!(!N.key||N.key.toString().startsWith(":")))try{const k=await wce(N.key);if(k.success){const F=(D=k.data)==null?void 0:D.map(z=>({title:z.text,label:z.text,value:z.id,key:z.id,children:[],icon:B.jsx(bj,{})}));R(z=>E(z,N.key,F||[]))}}catch{gn.error("加载子文件夹时出错")}},j=()=>{if(!r.id){gn.error("保存作业后才能执行挂载磁盘");return}if(!g){gn.error("请选择或输入挂载点");return}v(!0),a.validateFields().then(N=>{const D={...s,...N};D.mountConfig={mountPoint:D.mountPoint,mountReadOnly:D.mountReadOnly,mountOnStartup:D.mountOnStartup},u(D),D.id?$ce(D).then(k=>{k!=null&&k.success?pwn(r.id).then(F=>{F.success?(gn.success("挂载成功,首次初始化列表需要1~5分钟,请耐心等待"),t&&t()):gn.error(F.message||"操作失败")}).finally(()=>v(!1)):(gn.error((k==null?void 0:k.message)||"操作失败"),v(!1))}):Sce(o,D).then(k=>{k!=null&&k.success?(gn.warning("添加作业成功,请重新设置挂载"),t&&t()):gn.error((k==null?void 0:k.message)||"操作失败")}).finally(()=>v(!1))}).catch(N=>{gn.error(N==null?void 0:N.errorFields[0].errors[0]),v(!1)})},L=()=>{if(!r.id){gn.error("保存作业后才能执行挂载磁盘");return}if(!g){gn.error("请选择或输入挂载点");return}v(!0),mwn(r.id).then(N=>{N.success?(gn.success("操作成功"),t&&t()):gn.error(N.message||"操作失败")}).finally(()=>v(!1))};return B.jsxs(vx,{title:"作业配置",open:e,onOk:S,onCancel:n,width:760,footer:[B.jsx(Fn,{loading:m,type:"primary",onClick:S,children:"保存"},"submit"),B.jsx(Fn,{onClick:n,children:"取消"},"cancel")],className:"w-full",children:[B.jsxs(Jb,{className:"py-3",onChange:N=>{y(),l(N)},current:i,children:[B.jsx(FP,{title:"基本信息"}),B.jsx(FP,{title:"作业配置"}),B.jsx(FP,{title:"高级设置"}),B.jsx(FP,{title:"挂载配置"})]}),B.jsxs(Vt,{disabled:r==null?void 0:r.isMount,form:a,labelCol:{span:6},wrapperCol:{span:18},children:[i==0&&B.jsxs(B.Fragment,{children:[B.jsx(Vt.Item,{required:!0,name:"id",label:"作业标识",children:B.jsx(bo,{disabled:!0})}),B.jsx(Vt.Item,{name:"name",label:"作业名称",rules:[{required:!0,message:"请输入任务/作业名称"}],children:B.jsx(bo,{})}),B.jsx(Vt.Item,{name:"description",label:"作业描述",children:B.jsx(bo,{})}),B.jsx(Vt.Item,{name:"schedules",label:"作业计划",help:B.jsxs("span",{children:["更多示例:",B.jsx("a",{href:"https://www.bejson.com/othertools/cron/",target:"_blank",children:"Cron 表达式"}),",支持自定义作业时间,示例:0 15 10 * * ?。"]}),children:B.jsx(Pr,{options:h==null?void 0:h.map(N=>({value:N})),mode:"tags",tokenSeparators:[","]})}),B.jsx(Vt.Item,{name:"mode",label:"同步模式",help:"镜像:以本地为主,如果远程和本地不一致则删除远程文件;备份:以本地为主,将本地备份到远程,不删除远程文件;双向:双向同步,同时保留,冲突的文件重新命名。",children:B.jsxs(Pr,{children:[B.jsx(Pr.Option,{value:0,children:"镜像"}),B.jsx(Pr.Option,{value:1,children:"备份"}),B.jsx(Pr.Option,{value:2,children:"双向"})]})})]}),i==1&&B.jsxs(B.Fragment,{children:[B.jsxs(Vt.Item,{required:!0,label:"本地目录",tooltip:"源路劲、本地路径,请选择本地文件夹",help:"请选择或输入本地文件夹,支持多选,例如:E:\\test, E:\\kopia",children:[w?B.jsx(lV,{treeData:P,onChange:T,treeCheckable:!0,treeIcon:!0,style:{width:"100%"},allowClear:!0,treeDefaultExpandedKeys:[":user",":jsj",":sources"],placeholder:"请选择文件夹",showCheckedStrategy:_wn,value:_,loadData:I,treeNodeLabelProp:"key"}):B.jsx(Pr,{onChange:T,value:_,mode:"tags",allowClear:!0,tokenSeparators:[",",","],placeholder:"请输入粘贴文件夹路径"}),B.jsx("span",{className:"cursor-pointer text-blue-500 block py-1",onClick:()=>{x(!w)},children:w?"切换为输入文件夹":"切换为选择文件夹,多个以逗号分割"})]}),B.jsx(Vt.Item,{required:!0,name:"defaultDrive",label:"目标位置",tooltip:"阿里云盘的存储位置,个人私有文件建议存储到备份盘",children:B.jsxs(Pr,{children:[B.jsx(Pr.Option,{value:"backup",children:"备份盘"}),B.jsx(Pr.Option,{value:"resource",children:"资源库"})]})}),B.jsx(Vt.Item,{required:!0,name:"target",label:"目标目录",tooltip:"云盘存储路径,远程备份/同步存储的路径",help:"路径格式:/文件夹/文件夹/文件夹,示例:backup/mdrive",children:B.jsx(bo,{})}),B.jsx(Vt.Item,{name:"filters",label:"过滤文件",tooltip:"排除本地不需要过滤的文件/文件夹",help:B.jsxs(B.Fragment,{children:[B.jsx("div",{children:"支持正则表达式,多个文件/文件夹用逗号分隔,过滤的文件/文件夹不会同步"}),B.jsx("div",{children:"示例:/Recovery/*, *.log, *.tmp, **/@Recycle/*, **/logs/*,更多示例请参考官网。"})]}),children:B.jsx(Pr,{mode:"tags",tokenSeparators:[",",","]})}),B.jsx(Vt.Item,{name:"restore",label:"还原目录",tooltip:"还原文件时的本地文件夹",children:B.jsx(bo,{})}),B.jsx(Vt.Item,{name:"rapidUpload",label:"启用秒传",valuePropName:"checked",tooltip:"是否启用阿里云盘秒传功能",children:B.jsx(Ga,{})}),B.jsx(Vt.Item,{name:"isRecycleBin",label:"启用回收站",tooltip:"是否启用回收站,如果启用则删除文件时,保留到回收站",valuePropName:"checked",children:B.jsx(Ga,{})}),B.jsx(Vt.Item,{name:"isTemporary",label:"立即执行",tooltip:"表示是否启动后立即执行作业,如果是一次性作业,请选择立即执行",valuePropName:"checked",children:B.jsx(Ga,{})})]}),i==2&&B.jsxs(B.Fragment,{children:[B.jsx(Vt.Item,{name:"checkAlgorithm",tooltip:"文件是否变更检查算法",label:"文件对比检查算法",children:B.jsxs(Pr,{children:[B.jsx(Pr.Option,{value:"md5",children:"MD5"}),B.jsx(Pr.Option,{value:"sha1",children:"SHA1"}),B.jsx(Pr.Option,{value:"sha256",children:"SHA256"})]})}),B.jsx(Vt.Item,{name:"checkLevel",label:"文件对比检查级别",tooltip:"文件变更时,文件是否变动检查算法级别,默认:1",help:B.jsxs("span",{children:["0:比较文件大小和时间,1:采样计算文件 hash(推荐),2:比较整个文件的 hash",B.jsx("br",{}),"3:比较文件头部 hash,4:比较文件尾部 hash"]}),children:B.jsx(Ys,{min:0,max:4})}),B.jsx(Vt.Item,{name:"fileWatcher",label:"启用文件系统监听",valuePropName:"checked",tooltip:"启用监听可以更加快捷的计算需要同步的文件",children:B.jsx(Ga,{})}),B.jsx(Vt.Item,{name:"order",label:"显示顺序",tooltip:"作业显示顺序",children:B.jsx(Ys,{min:0})}),B.jsx(Vt.Item,{name:"uploadThread",label:"上传并行任务数",tooltip:"上传并行任务数(0:自动,最大:10)",children:B.jsx(Ys,{min:0,max:10})}),B.jsx(Vt.Item,{name:"downloadThread",label:"下载并行任务数",tooltip:"下载并行任务数(0:自动,最大:10)",children:B.jsx(Ys,{min:0,max:10})})]}),i==3&&B.jsxs(B.Fragment,{children:[B.jsxs(Vt.Item,{tooltip:"云盘挂载到本地磁盘的位置",label:"挂载点",help:B.jsxs("span",{children:["如果你想将云盘的备份目录挂载到本地磁盘,像访问本地磁盘一样访问云盘,请设置挂载到磁盘的位置。",B.jsx("br",{}),"确保挂载的磁盘盘符没有被占用,Linux 确保是空的文件夹。",B.jsx("br",{}),"windows 示例:C:\\,linux 示例:/tmp。",B.jsx("br",{}),B.jsxs("span",{children:["请确保已安装磁盘驱动,下载驱动:",B.jsx("a",{href:"/driver/Dokan_x64.msi",target:"_blank",children:"Windows_x64.msi"}),B.jsx(Av,{type:"vertical"}),B.jsx("a",{href:"/driver/Dokan_x86.msi",target:"_blank",children:"Windows_x86.msi"})]})]}),children:[B.jsx(Zme,{options:d,placeholder:"请输入或选择挂载点",value:g,onChange:N=>{b(N),u(D=>(D&&(D.mountPoint=N),D))}}),r.id&&B.jsx("div",{className:"flex flex-row items-center py-2",children:r.isMount?B.jsxs("div",{className:"flex flex-row items-center",children:[B.jsx("span",{className:"text-green-400",children:"当前已挂载磁盘"}),B.jsx("span",{className:"text-gray-400",children:"(挂载中不可修改配置)"}),B.jsx(Av,{type:"vertical",className:"ml-4"}),B.jsx(Fn,{loading:m,size:"small",type:"link",onClick:L,disabled:!1,children:"卸载挂载"})]}):B.jsxs("div",{className:"flex flex-row items-center",children:[B.jsx("span",{className:"text-gray-400",children:"当前未挂载到本地磁盘"}),B.jsx(Av,{type:"vertical",className:"ml-4"}),B.jsx(Fn,{loading:m,size:"small",type:"link",onClick:j,children:"立即挂载"})]})})]}),B.jsx(Vt.Item,{name:"mountOnStartup",label:"自动挂载",tooltip:"作业启动后,立即挂载磁盘",valuePropName:"checked",children:B.jsx(Ga,{})}),B.jsx(Vt.Item,{name:"mountReadOnly",label:"只读模式",tooltip:"以只读模式挂载阿里云盘时,无法对文件修改删除等",valuePropName:"checked",children:B.jsx(Ga,{})})]})]}),B.jsxs("div",{className:"pt-3 items-center justify-center w-full flex",children:[i>0&&B.jsx(Fn,{style:{margin:"0 8px"},onClick:()=>$(),children:"上一步"}),i<3&&B.jsx(Fn,{ghost:!0,type:"primary",onClick:()=>C(),children:"下一步"})]})]})},Ewn={route:{path:"/",routes:[{path:"/welcome",name:"欢迎",icon:B.jsx(ylt,{})},{path:"/setting",name:"设置",icon:B.jsx(dlt,{})},{path:"/about",name:"关于",icon:B.jsx(EH,{})},{path:"https://github.com/trueai-org/MDriveSync",name:"官网",icon:B.jsx(Ait,{})}]},location:{pathname:"/"}};function Iwn(){const[e,t]=p.useState("/"),[n,r]=p.useState(!1),[o,a]=p.useState(!1),[i,l]=p.useState(!1),[s,u]=p.useState(!1),[m,v]=p.useState(),[h,c]=p.useState(),[d,f]=p.useState(),[g,b]=p.useState(),[y,C]=p.useState(),$=[{title:"名称",dataIndex:"name",fixed:"left",render:(re,Z)=>Z.category=="image"?B.jsxs("div",{className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:[B.jsx(bit,{}),B.jsx("span",{children:Z.name})]}):Z.category=="video"?B.jsxs("div",{className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:[B.jsx(Dlt,{}),B.jsx("span",{children:Z.name})]}):Z.category=="doc"?B.jsxs("div",{className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:[B.jsx(Aqe,{}),B.jsx("span",{children:Z.name})]}):Z.category=="audio"?B.jsxs("div",{className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:[B.jsx(iit,{}),B.jsx("span",{children:Z.name})]}):Z.category=="zip"?B.jsxs("div",{className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:[B.jsx(Sit,{}),B.jsx("span",{children:Z.name})]}):Z.category=="app"?B.jsxs("div",{className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:[B.jsx(tV,{}),B.jsx("span",{children:Z.name})]}):Z.isFolder?B.jsxs("div",{onClick:()=>{j(Z)},className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:[B.jsx(pbe,{}),B.jsx("span",{children:Z.name})]}):B.jsx("div",{className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:B.jsx("span",{children:Z.name})})},{title:"大小",dataIndex:"size",width:120,fixed:"left",align:"right",render:re=>B.jsx("span",{children:re?k$(re):"-"})},{title:"修改时间",dataIndex:"updated_at",width:160,align:"right",render:re=>re?XIt(re,"yyyy-MM-dd hh:mm:ss"):"-"},{title:"操作",key:"action",width:80,align:"center",render:(re,Z)=>Z.isFile?B.jsx(Fn,{type:"primary",ghost:!0,size:"small",icon:B.jsx(Yrt,{}),onClick:()=>{ywn(h.id,Z.file_id).then(le=>{const de=encodeURIComponent(le.url),pe=encodeURIComponent(Z.name);window.open(`/api/drive/download?url=${de}&name=${pe}`)})}}):"-"}],S=oe.useRef(null),w=oe.useMemo(()=>d,[d]),x=(re,Z)=>{l(!0),Cwn(Z,re.key).then(le=>{le!=null&&le.success?(gn.success("操作成功"),T()):gn.error((le==null?void 0:le.message)||"操作失败")}).finally(()=>{l(!1)})},_=[{key:jt.Continue,label:"继续"},{key:jt.Initializing,label:"初始化"},{key:jt.BackingUp,label:"执行"},{key:jt.Paused,label:"暂停"},{key:jt.Disabled,label:"禁用"},{key:jt.None,label:"启用"},{key:jt.Cancelled,label:"取消"},{key:jt.Deleted,label:"删除"}],O=re=>{switch(re){case jt.None:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Initializing);case jt.Initializing:return[];case jt.Idle:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.BackingUp||(Z==null?void 0:Z.key)==jt.Disabled||(Z==null?void 0:Z.key)==jt.Deleted);case jt.Starting:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Paused);case jt.Scanning:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Paused);case jt.BackingUp:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Paused||(Z==null?void 0:Z.key)==jt.Cancelled);case jt.Restoring:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Paused);case jt.Verifying:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Paused);case jt.Queued:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Cancelled);case jt.Completed:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.BackingUp||(Z==null?void 0:Z.key)==jt.Disabled||(Z==null?void 0:Z.key)==jt.Deleted);case jt.Paused:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Continue||(Z==null?void 0:Z.key)==jt.Cancelled);case jt.Error:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.BackingUp||(Z==null?void 0:Z.key)==jt.Disabled||(Z==null?void 0:Z.key)==jt.Deleted||(Z==null?void 0:Z.key)==jt.Initializing);case jt.Cancelling:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Paused);case jt.Cancelled:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.BackingUp||(Z==null?void 0:Z.key)==jt.Disabled||(Z==null?void 0:Z.key)==jt.Deleted||(Z==null?void 0:Z.key)==jt.Initializing);case jt.Disabled:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.None||(Z==null?void 0:Z.key)==jt.Deleted||(Z==null?void 0:Z.key)==jt.Initializing);default:return[]}},P=oe.useMemo(()=>`包含 ${(d==null?void 0:d.filter(re=>re.isFile).length)||0} 个文件,${(d==null?void 0:d.filter(re=>re.isFolder).length)||0} 个文件夹,总大小 ${k$((d==null?void 0:d.filter(re=>re.isFile).reduce((re,Z)=>re+Z.size,0))||0)}`,[d]),R=oe.useMemo(()=>h?g?g.key:(h==null?void 0:h.target)+"/":"/",[h,g]);p.useEffect(()=>{T()},[]);const T=()=>{l(!0),dwn().then(re=>{v(re||[]),l(!1)})},E=(re,Z)=>{u(!0),bwn(re,Z).then(le=>{f(le),!Z&&le&&le.length>0&&F9(re,le[0].parent_file_id).then(de=>{b(de),C(de.file_id)})}).finally(()=>u(!1))},I=re=>{re.state!=jt.Disabled&&re.state!=jt.Initializing&&(c(re),E(re.id))},j=re=>{u(!0),F9(h.id,re.file_id).then(Z=>{b(Z),E(h.id,Z.file_id)}).finally(()=>u(!1))},L=()=>{g&&(u(!0),F9(h.id,g.parent_file_id).then(re=>{b(re),E(h.id,re.file_id)}))},N=()=>{h&&I(h)},[D,k]=p.useState(!1),[F,z]=p.useState(null),[H,W]=p.useState(),K=re=>{z(re),k(!0)},V=re=>{W(re),z({id:"",name:"",description:"",state:jt.None,mode:0,rapidUpload:!0,checkLevel:1,checkAlgorithm:"sha256",order:0,isTemporary:!1,isRecycleBin:!0,uploadThread:0,downloadThread:0,schedules:[],filters:[],fileWatcher:!0,defaultDrive:"backup",target:"",sources:[]}),k(!0)},q=()=>{k(!1),T()},U=()=>{k(!1)},G=[{label:"天蓝",value:"#1677FF"},{label:"拂晓",value:"#1890ff"},{label:"薄暮",value:"#F5222D"},{label:"火山",value:"#FA541C"},{label:"日暮",value:"#FAAD14"},{label:"明青",value:"#13C2C2"},{label:"草绿",value:"#52C41A"},{label:"深蓝",value:"#2F54EB"},{label:"酱紫",value:"#722ED1"}],[J,Y]=p.useState(()=>localStorage.getItem("theme")?JSON.parse(localStorage.getItem("theme")):{fixSiderbar:!0,layout:"mix",splitMenus:!0}),ae=p.useRef(null),ne=p.useRef(null),[ee,X]=p.useState(!1),te=[{title:"欢迎使用 MDrive 阿里云盘数据同步工具",description:"在这里添加授权、管理授权,添加作业,管理作业等操作。",target:()=>ae.current},{title:"在这里可以查看或管理云盘文件",description:"点击文件夹可以进入文件夹,点击文件可以下载。",target:()=>ne.current}],{data:Q,refetch:ie}=eIe({queryKey:["jobs"],queryFn:async()=>(await fwn()).data,staleTime:60*1e3,refetchInterval:1*1e3});return p.useEffect(()=>{ie()},[ie]),p.useEffect(()=>{if(Q&&m){const re=m.map(Z=>({...Z,jobs:Z.jobs.map(le=>{const de=Q.find(pe=>pe.id===le.id);return de?{...le,state:de.state,metadata:de.metadata,isMount:de.isMount}:le})}));v(re)}},[Q]),B.jsxs(v3t,{title:"MDrive",logo:B.jsx("img",{src:"/logo.png",style:{width:24,height:24}}),...Ewn,...J,location:{pathname:e},footerRender:()=>B.jsxs("div",{className:"text-center text-gray-400",children:["Power by"," ",B.jsx("a",{target:"_blank",href:"https://github.com/trueai-org/MDriveSync",children:"MDrive"})," ","v1.4.0 |"," ",B.jsx("a",{target:"_blank",href:"https://github.com/trueai-org/MDriveSyncWebUI",children:"WebUI"})," ","|"," ",B.jsx("a",{target:"_blank",href:"https://github.com/trueai-org/MDriveSync",children:"官网"})," ","|"," ",B.jsx("a",{target:"_blank",href:"https://duplicati.net",children:"Duplicati"})]}),menuItemRender:(re,Z)=>B.jsx("a",{onClick:()=>{var le;t(re.path||"/"),re.path=="/welcome"&&X(!0),re.path=="/setting"&&a(!0),re.path=="/about"&&r(!0),(le=re.path)!=null&&le.startsWith("http")&&window.open(re.path)},children:Z}),layout:"top",loading:i,children:[B.jsxs(v4,{split:"vertical",style:{minHeight:520},children:[B.jsx(v4,{bodyStyle:{margin:0,padding:0},headerBordered:!0,title:B.jsx("div",{className:"font-bold",children:"存储和作业"}),colSpan:"432px",ref:ae,extra:B.jsx(_ce,{isAdd:!0,onOk:T}),children:m&&(m==null?void 0:m.map((re,Z)=>{var le,de;return B.jsx(K6t,{rowKey:re.id+Z,style:{borderBlockEnd:"1px solid rgba(211, 167, 255, 0.17)"},headerTitle:B.jsxs("div",{className:"text-base whitespace-nowrap flex items-center",children:[B.jsxs("span",{className:"mr-2",children:[" ",re.name||"未命名云盘"," "]}),re.metadata&&((le=re.metadata)==null?void 0:le.identity)&&B.jsx(yz,{className:"uppercase",color:"pink",children:re.metadata.identity}),re.metadata&&((de=re.metadata)==null?void 0:de.level)&&B.jsx(yz,{className:"uppercase",children:re.metadata.level}),re.metadata&&re.metadata.usedSize&&re.metadata.totalSize&&B.jsxs("span",{className:"text-xs text-gray-500",children:[k$(re.metadata.usedSize)," /"," ",k$(re.metadata.totalSize)]})]}),toolBarRender:()=>[B.jsx(_ce,{drive:re,onOk:T,onJobAdd:()=>V(re.id)})],dataSource:re.jobs.map(pe=>({title:pe.name,job:pe})),onRow:pe=>({onClick:()=>{I(pe.job)}}),metas:{title:{},subTitle:{render:(pe,ue)=>xwn(ue.job.state)},description:{render:(pe,ue)=>{var me,he,be,Me,je,De,xe,ye;return B.jsxs(B.Fragment,{children:[B.jsxs("div",{className:"text-xs",children:["包含 ",((he=(me=ue.job)==null?void 0:me.metadata)==null?void 0:he.fileCount)||0," 个文件,",((Me=(be=ue.job)==null?void 0:be.metadata)==null?void 0:Me.folderCount)||0," ","个文件夹,总大小"," ",k$(((De=(je=ue.job)==null?void 0:je.metadata)==null?void 0:De.totalSize)||0)]}),((ye=(xe=ue.job)==null?void 0:xe.metadata)==null?void 0:ye.message)&&B.jsx("div",{className:"text-xs",children:ue.job.metadata.message})]})}},actions:{render:(pe,ue)=>B.jsx(P1.Button,{size:"small",menu:{items:O(ue.job.state),onClick:me=>{x(me,ue.job.id)}},onClick:()=>K(ue.job),children:B.jsx(cV,{})})}}},Z)}))}),B.jsx(v4,{bodyStyle:{margin:0,padding:0},headerBordered:!0,title:B.jsx("div",{className:"font-bold",children:"文件管理"}),ref:ne,children:B.jsxs("div",{className:"flex px-6 py-4 flex-col w-full space-y-3 overflow-y-auto",children:[B.jsxs("div",{className:"flex flex-row space-x-2 items-center w-full",children:[B.jsx(Fn,{onClick:()=>N(),disabled:!h||y==(g==null?void 0:g.file_id),icon:B.jsx(qit,{})}),B.jsx(Fn,{icon:B.jsx(llt,{}),onClick:()=>L(),disabled:!h||y==(g==null?void 0:g.file_id)}),B.jsx(bo,{style:{width:"100%"},value:R,placeholder:"文件夹"}),B.jsx(Fn,{onClick:()=>j(g),disabled:!h,icon:B.jsx(S0e,{})})]}),B.jsx(Ed,{virtual:!0,columns:$,scroll:{x:400,y:400},rowKey:"file_id",dataSource:w||[],pagination:!1,ref:S,size:"small",loading:s}),h&&B.jsx("div",{className:"text-xs text-gray-600",children:P})]})})]}),B.jsx(Pwn,{visible:D,onOk:q,onCancel:U,jobConfig:F,currentDriveId:H}),B.jsx(vx,{title:"关于",open:n,width:760,footer:null,onCancel:()=>r(!1),children:B.jsx("div",{className:"my-3",children:B.jsxs("div",{className:"flex flex-col space-y-2",children:[B.jsx("div",{children:"多平台、模块化、安全的云盘同步工具备份,支持百度网盘、阿里云盘等,集成 Duplicati、Kopia 等多种模块,支持加密还原等,支持单向、镜像、双向等同步备份,完全免费开源。"}),B.jsx("div",{children:"提供 Docker 版、Duplicati 版、Kopia 版、Windows 服务版、Windows 版、手机版、网页版、Linux版、Mac 版等多平台版本。"}),B.jsx("div",{children:"支持多种算法同步与备份,保证数据的安全性,任何第三方、任何云盘服务商都无法查看或分析你的数据,只有通过你本人设置的安全密钥才能解密数据,保证您的数据安全和隐私。"}),B.jsxs("div",{children:["更多文档:",B.jsx("a",{target:"_blank",href:"https://github.com/trueai-org/MDriveSync",children:"MDriveSync 官网"})]})]})})}),B.jsx(vx,{title:"设置",open:o,width:760,footer:null,onCancel:()=>a(!1),children:B.jsxs("div",{className:"my-3 flex flex-col space-y-3",children:[B.jsxs("div",{className:"flex flex-row items-center",children:[B.jsx("span",{className:"flex flex-col flex-none w-20",children:B.jsx("span",{children:"网站主题:"})}),B.jsxs("div",{className:"flex flex-row items-center space-x-2",children:[B.jsx(xCe.Select,{className:"w-24",options:G,value:J==null?void 0:J.colorPrimary,placeholder:"主题色",onChange:re=>{const Z={...J,colorPrimary:re};Y(Z),localStorage.setItem("theme",JSON.stringify(Z))}}),B.jsx("span",{style:{backgroundColor:J==null?void 0:J.colorPrimary},className:"w-6 h-6 block rounded"})]})]}),B.jsxs("div",{className:"flex flex-row items-center",children:[B.jsx("span",{className:"flex flex-col flex-none w-20",children:B.jsx("span",{children:"暗色模式:"})}),B.jsx("div",{className:"flex flex-col",children:B.jsx(A0e,{checked:(J==null?void 0:J.navTheme)==="realDark",onChange:re=>{const le={...J,navTheme:re?"realDark":"light"};Y(le),localStorage.setItem("theme",JSON.stringify(le))}})})]}),B.jsxs("div",{className:"flex flex-row",children:[B.jsx("span",{className:"flex flex-col flex-none w-20",children:B.jsx("span",{children:"登录密码:"})}),B.jsx("div",{className:"flex flex-col flex-1 text-gray-400",children:"请修改配置 appsettings.json,如果通过 docker 启动也可以通过环境变量修改,示例:-e BASIC_AUTH_USER=admin -e BASIC_AUTH_PASSWORD=123456"})]})]})}),B.jsx(snt,{open:ee,onClose:()=>X(!1),steps:te})]})}const Mwn=new F6e;L9.createRoot(document.getElementById("root")).render(B.jsx(oe.StrictMode,{children:B.jsx(A6e,{client:Mwn,children:B.jsx(Iwn,{})})})); +`):" "+hce(a[0]):"as no adapter specified";throw new Un("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:eA};function D9(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new QO(null,e)}function bce(e){return D9(e),e.headers=Bd.from(e.headers),e.data=j9.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),M4e.getAdapter(e.adapter||yG.adapter)(e).then(function(r){return D9(e),r.data=j9.call(e,e.transformResponse,r),r.headers=Bd.from(r.headers),r},function(r){return E4e(r)||(D9(e),r&&r.response&&(r.response.data=j9.call(e,e.transformResponse,r.response),r.response.headers=Bd.from(r.response.headers))),Promise.reject(r)})}const yce=e=>e instanceof Bd?e.toJSON():e;function r1(e,t){t=t||{};const n={};function r(u,m,v){return vt.isPlainObject(u)&&vt.isPlainObject(m)?vt.merge.call({caseless:v},u,m):vt.isPlainObject(m)?vt.merge({},m):vt.isArray(m)?m.slice():m}function o(u,m,v){if(vt.isUndefined(m)){if(!vt.isUndefined(u))return r(void 0,u,v)}else return r(u,m,v)}function a(u,m){if(!vt.isUndefined(m))return r(void 0,m)}function i(u,m){if(vt.isUndefined(m)){if(!vt.isUndefined(u))return r(void 0,u)}else return r(void 0,m)}function l(u,m,v){if(v in t)return r(u,m);if(v in e)return r(void 0,u)}const s={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(u,m)=>o(yce(u),yce(m),!0)};return vt.forEach(Object.keys(Object.assign({},e,t)),function(m){const v=s[m]||o,h=v(e[m],t[m],m);vt.isUndefined(h)&&v!==l||(n[m]=h)}),n}const R4e="1.6.3",CG={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{CG[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Cce={};CG.transitional=function(t,n,r){function o(a,i){return"[Axios v"+R4e+"] Transitional option '"+a+"'"+i+(r?". "+r:"")}return(a,i,l)=>{if(t===!1)throw new Un(o(i," has been removed"+(n?" in "+n:"")),Un.ERR_DEPRECATED);return n&&!Cce[i]&&(Cce[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,i,l):!0}};function awn(e,t,n){if(typeof e!="object")throw new Un("options must be an object",Un.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const a=r[o],i=t[a];if(i){const l=e[a],s=l===void 0||i(l,a,e);if(s!==!0)throw new Un("option "+a+" must be "+s,Un.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Un("Unknown option "+a,Un.ERR_BAD_OPTION)}}const tA={assertOptions:awn,validators:CG},Af=tA.validators;class I3{constructor(t){this.defaults=t,this.interceptors={request:new mce,response:new mce}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=r1(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:a}=n;r!==void 0&&tA.assertOptions(r,{silentJSONParsing:Af.transitional(Af.boolean),forcedJSONParsing:Af.transitional(Af.boolean),clarifyTimeoutError:Af.transitional(Af.boolean)},!1),o!=null&&(vt.isFunction(o)?n.paramsSerializer={serialize:o}:tA.assertOptions(o,{encode:Af.function,serialize:Af.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=a&&vt.merge(a.common,a[n.method]);a&&vt.forEach(["delete","get","head","post","put","patch","common"],d=>{delete a[d]}),n.headers=Bd.concat(i,a);const l=[];let s=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(n)===!1||(s=s&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const u=[];this.interceptors.response.forEach(function(f){u.push(f.fulfilled,f.rejected)});let m,v=0,h;if(!s){const d=[bce.bind(this),void 0];for(d.unshift.apply(d,l),d.push.apply(d,u),h=d.length,m=Promise.resolve(n);v{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](o);r._listeners=null}),this.promise.then=o=>{let a;const i=new Promise(l=>{r.subscribe(l),a=l}).then(o);return i.cancel=function(){r.unsubscribe(a)},i},t(function(a,i,l){r.reason||(r.reason=new QO(a,i,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new $G(function(o){t=o}),cancel:t}}}const iwn=$G;function lwn(e){return function(n){return e.apply(null,n)}}function swn(e){return vt.isObject(e)&&e.isAxiosError===!0}const nA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(nA).forEach(([e,t])=>{nA[t]=e});const cwn=nA;function T4e(e){const t=new H4(e),n=f4e(H4.prototype.request,t);return vt.extend(n,H4.prototype,t,{allOwnKeys:!0}),vt.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return T4e(r1(e,o))},n}const xo=T4e(yG);xo.Axios=H4;xo.CanceledError=QO;xo.CancelToken=iwn;xo.isCancel=E4e;xo.VERSION=R4e;xo.toFormData=fN;xo.AxiosError=Un;xo.Cancel=xo.CanceledError;xo.all=function(t){return Promise.all(t)};xo.spread=lwn;xo.isAxiosError=swn;xo.mergeConfig=r1;xo.AxiosHeaders=Bd;xo.formToJSON=e=>P4e(vt.isHTMLForm(e)?new FormData(e):e);xo.getAdapter=M4e.getAdapter;xo.HttpStatusCode=cwn;xo.default=xo;const uwn=xo,ra=uwn.create({}),dwn=async()=>(await ra.get("/api/drive/drives")).data,fwn=async()=>(await ra.get("/api/drive/jobs")).data,pwn=async e=>(await ra.post(`/api/drive/job/mount/${e}`)).data,mwn=async e=>(await ra.post(`/api/drive/job/unmount/${e}`)).data,vwn=async e=>(await ra.post(`/api/drive/mount/${e}`)).data,gwn=async e=>(await ra.post(`/api/drive/unmount/${e}`)).data,N4e=async()=>(await ra.get("/api/drive/points")).data,hwn=async()=>(await ra.get("/api/drive/crons")).data,bwn=async(e,t)=>(await ra.get(`/api/drive/files/${e}?parentId=${t||""}`)).data,ywn=async(e,t)=>(await ra.get(`/api/drive/download/${e}/${t}`)).data,$ce=async e=>(await ra.put("/api/drive/job",e)).data,Sce=async(e,t)=>(await ra.post(`/api/drive/job/${e}`,t)).data,Cwn=async(e,t)=>(await ra.put(`/api/drive/job/${e}/${t}`)).data,F9=async(e,t)=>(await ra.get(`/api/drive/file/${e}/${t}`)).data,xce=async(e,t)=>(await ra.put(`/api/drive/${e}`,t)).data,$wn=async e=>(await ra.post("/api/drive",e)).data,Swn=async e=>(await ra.delete(`/api/drive/${e}`)).data,wce=async(e="")=>(await ra.post("/api/drive/paths",{path:e})).data;var jt=(e=>(e[e.None=0]="None",e[e.Initializing=1]="Initializing",e[e.Idle=5]="Idle",e[e.Starting=6]="Starting",e[e.Scanning=7]="Scanning",e[e.BackingUp=8]="BackingUp",e[e.Restoring=9]="Restoring",e[e.Verifying=10]="Verifying",e[e.Queued=11]="Queued",e[e.Completed=15]="Completed",e[e.Paused=16]="Paused",e[e.Error=17]="Error",e[e.Cancelling=18]="Cancelling",e[e.Cancelled=19]="Cancelled",e[e.Disabled=100]="Disabled",e[e.Deleted=101]="Deleted",e[e.Continue=102]="Continue",e))(jt||{});const xwn=e=>{let t="default",n="";switch(e){case jt.None:t="grey",n="默认";break;case jt.Initializing:t="blue",n="初始化中";break;case jt.Idle:t="green",n="空闲";break;case jt.Starting:t="orange",n="启动中";break;case jt.Scanning:t="cyan",n="扫描中";break;case jt.BackingUp:t="purple",n="备份中";break;case jt.Restoring:t="magenta",n="还原中";break;case jt.Verifying:t="gold",n="校验中";break;case jt.Queued:t="lime",n="队列中";break;case jt.Completed:t="success",n="完成";break;case jt.Paused:t="warning",n="暂停";break;case jt.Error:t="error",n="错误";break;case jt.Cancelling:t="volcano",n="取消中";break;case jt.Cancelled:t="default",n="已取消";break;case jt.Disabled:t="black",n="禁用";break;default:n="未知"}return B.jsx(yz,{color:t,children:n})};function k$(e,t=2){if(e===0)return"0 Bytes";const n=1024,r=t<0?0:t,o=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],a=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,a)).toFixed(r))+" "+o[a]}var rA={exports:{}};(function(e,t){(function(n,r){r(t,e)})(yo,function(n,r){var o={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function a(){return"jsonp_"+Date.now()+"_"+Math.ceil(Math.random()*1e5)}function i(u){try{delete window[u]}catch{window[u]=void 0}}function l(u){var m=document.getElementById(u);m&&document.getElementsByTagName("head")[0].removeChild(m)}function s(u){var m=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],v=u,h=m.timeout||o.timeout,c=m.jsonpCallback||o.jsonpCallback,d=void 0;return new Promise(function(f,g){var b=m.jsonpCallbackFunction||a(),y=c+"_"+b;window[b]=function($){f({ok:!0,json:function(){return Promise.resolve($)}}),d&&clearTimeout(d),l(y),i(b)},v+=v.indexOf("?")===-1?"?":"&";var C=document.createElement("script");C.setAttribute("src",""+v+c+"="+b),m.charset&&C.setAttribute("charset",m.charset),m.nonce&&C.setAttribute("nonce",m.nonce),m.referrerPolicy&&C.setAttribute("referrerPolicy",m.referrerPolicy),m.crossorigin&&C.setAttribute("crossorigin","true"),C.id=y,document.getElementsByTagName("head")[0].appendChild(C),d=setTimeout(function(){g(new Error("JSONP request to "+u+" timed out")),i(b),l(y),window[b]=function(){i(b)}},h),C.onerror=function(){g(new Error("JSONP request to "+u+" failed")),i(b),l(y),d&&clearTimeout(d)}})}r.exports=s})})(rA,rA.exports);var wwn=rA.exports;const Own=Fr(wwn),{Step:Oce}=Jb,_ce=({clientId:e="8dfd3cd56aa14e7d89bedcf975d388ce",redirectUri:t="https://api.duplicati.net/api/open/aliyundrive",onClose:n,isAdd:r,drive:o,onOk:a,onJobAdd:i})=>{const[l,s]=p.useState(!1),[u,m]=p.useState(!1),[v,h]=p.useState(""),[c,d]=p.useState(()=>(o==null?void 0:o.refreshToken)||""),[f]=Vt.useForm(),[g,b]=p.useState(0),[y,C]=p.useState(),[$,S]=p.useState([]),[w,x]=p.useState(o==null?void 0:o.mountPoint),[_,O]=p.useState(!1),[P,R]=p.useState(o);p.useEffect(()=>{var z,H,W,K,V,q,U;l&&(h(Math.random().toString(36).substr(2)+Math.random().toString(36).substr(2)),N4e().then(G=>{var J;G.success&&S(((J=G.data)==null?void 0:J.map(Y=>({value:Y})))||[])}),o&&(o.isRecycleBin=(z=o.mountConfig)==null?void 0:z.isRecycleBin,o.mountDrive=(H=o.mountConfig)==null?void 0:H.mountDrive,o.mountPath=(W=o.mountConfig)==null?void 0:W.mountPath,o.mountPoint=(K=o.mountConfig)==null?void 0:K.mountPoint,o.mountReadOnly=(V=o.mountConfig)==null?void 0:V.mountReadOnly,o.mountOnStartup=(q=o.mountConfig)==null?void 0:q.mountOnStartup,o.rapidUpload=(U=o.mountConfig)==null?void 0:U.rapidUpload),R(o),x(o==null?void 0:o.mountPoint),f&&o&&f.setFieldsValue(o))},[o,f,l]);const T=p.useCallback(()=>{m(!0);const z=`https://openapi.alipan.com/oauth/authorize?client_id=${e}&redirect_uri=${t}&scope=user:base,file:all:read,file:all:write&relogin=true&state=${v}`,H=680,W=760,K=window.screen.width/2-H/2,V=window.screen.height/2-W/2,q=window.open(z,"_blank",`height=${W},width=${H},left=${K},top=${V},toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no`);let U=300;const G=()=>{U--,U>0&&v?Own(`https://api.duplicati.net/api/open/aliyundrive/token?state=${v}`).then(J=>J.json()).then(J=>{J?(d(J),m(!1),q==null||q.close()):setTimeout(G,1e3)}).catch(()=>{setTimeout(G,1e3)}):(m(!1),q==null||q.close())};setTimeout(G,6e3)},[v,e,t]),E=p.useCallback(()=>{s(!0)},[]),I=p.useCallback(()=>{s(!1),n&&n()},[n]),j=()=>{f.validateFields().then(z=>{C({...y,...z}),b(g+1)}).catch(z=>{gn.error(z==null?void 0:z.errorFields[0].errors[0])})},L=()=>{f.validateFields().then(z=>{C({...y,...z}),b(g-1)}).catch(z=>{gn.error(z==null?void 0:z.errorFields[0].errors[0])})},N=async()=>{if(!o||!o.id){gn.error("保存云盘后才能执行挂载磁盘");return}if(!w){gn.error("请选择或输入挂载点");return}O(!0),f.validateFields().then(async z=>{if(z.refreshToken=c,z.mountPoint=w,z.mountConfig={isRecycleBin:z.isRecycleBin,mountDrive:z.mountDrive,mountPath:z.mountPath,mountPoint:z.mountPoint,mountReadOnly:z.mountReadOnly,mountOnStartup:z.mountOnStartup,rapidUpload:z.rapidUpload},o){const H=await xce(o.id,z);if(H!=null&&H.success){const W=await vwn(o.id);W.success?(gn.success("挂载成功,首次初始化列表需要1~5分钟,请耐心等待"),a&&a(),I()):gn.error(W.message||"操作失败"),O(!1)}else gn.error((H==null?void 0:H.message)||"操作失败")}}).catch(z=>{gn.error(z==null?void 0:z.errorFields[0].errors[0])}).finally(()=>{O(!1)})},D=()=>{if(!o||!o.id){gn.error("保存云盘后才能执行挂载磁盘");return}O(!0),gwn(o.id).then(z=>{z.success?(gn.success("操作成功"),a&&a(),I()):gn.error(z.message||"操作失败")}).finally(()=>O(!1))},k=async()=>{if(!c){gn.error("请授权");return}O(!0),f.validateFields().then(async z=>{if(z.refreshToken=c,z.mountPoint=w,z.mountConfig={isRecycleBin:z.isRecycleBin,mountDrive:z.mountDrive,mountPath:z.mountPath,mountPoint:z.mountPoint,mountReadOnly:z.mountReadOnly,mountOnStartup:z.mountOnStartup,rapidUpload:z.rapidUpload},o){const H=await xce(o.id,z);H!=null&&H.success?(gn.success("保存成功"),a&&a(),O(!1),I()):gn.error((H==null?void 0:H.message)||"操作失败")}else{const H=await $wn(z);H!=null&&H.success?(gn.success("保存成功"),a&&a(),O(!1),I()):gn.error((H==null?void 0:H.message)||"操作失败")}}).catch(z=>{gn.error(z==null?void 0:z.errorFields[0].errors[0])}).finally(()=>{O(!1)})},F=async()=>{if(o){const z=await Swn(o.id);z!=null&&z.success?(gn.success("操作成功"),I(),a&&a()):gn.error((z==null?void 0:z.message)||"操作失败")}};return B.jsxs(B.Fragment,{children:[B.jsx(P1.Button,{menu:{items:r?[{key:"import",label:"导入配置"},{key:"export",label:"导出配置"}]:[{key:"add",label:"添加作业"}],onClick:z=>{z.key=="add"&&i&&i()}},size:"small",className:"mr-2",onClick:()=>{E()},children:r?B.jsx(wW,{}):B.jsx(cV,{})}),B.jsx(vx,{title:"阿里云盘授权",open:l,onCancel:I,width:760,footer:B.jsxs("div",{children:[B.jsx(Fn,{disabled:o==null?void 0:o.isMount,loading:_,onClick:k,type:"primary",children:"保存"}),B.jsx(Fn,{onClick:I,type:"default",children:"取消"})]}),children:B.jsxs(cs,{spinning:u,tip:"授权中",children:[B.jsxs(Jb,{className:"py-3",onChange:z=>{b(z)},current:g,progressDot:!0,children:[B.jsx(Oce,{title:"授权管理"}),B.jsx(Oce,{title:"云盘挂载"})]}),B.jsxs(Vt,{disabled:o==null?void 0:o.isMount,form:f,labelCol:{span:4},wrapperCol:{span:18},children:[g==0&&B.jsx(B.Fragment,{children:B.jsxs(Vt.Item,{tooltip:"点击扫码获取阿里云盘授权令牌",label:"授权令牌",children:[B.jsx(bo.TextArea,{placeholder:"授权令牌",value:c,onChange:z=>d(z.target.value),rows:5}),B.jsx("span",{className:"text-blue-500 cursor-pointer hover:text-blue-700",onClick:T,children:"点击扫码授权"}),!r&&B.jsx(h0e,{title:"解除授权令牌?",description:"解除授权将会同时删除当前云盘下的所有作业",onConfirm:F,okText:"确认",cancelText:"取消",placement:"topLeft",children:B.jsx("span",{className:"text-red-500 cursor-pointer hover:text-red-700 w-auto flex",children:"解除授权"})})]})}),g==1&&B.jsxs(B.Fragment,{children:[B.jsxs(Vt.Item,{tooltip:"云盘挂载到本地磁盘的位置",label:"挂载点",help:B.jsxs("span",{children:["如果你想将云盘或云盘的某个目录挂载到本地磁盘,像访问本地磁盘一样访问云盘,请设置挂载到磁盘的位置。",B.jsx("br",{}),"确保挂载的磁盘盘符没有被占用,Linux 确保是空的文件夹。",B.jsx("br",{}),"windows 示例:C:\\,linux 示例:/tmp。",B.jsx("br",{}),B.jsxs("span",{children:["请确保已安装磁盘驱动,下载驱动:",B.jsx("a",{href:"/driver/Dokan_x64.msi",target:"_blank",children:"Windows_x64.msi"}),B.jsx(Av,{type:"vertical"}),B.jsx("a",{href:"/driver/Dokan_x86.msi",target:"_blank",children:"Windows_x86.msi"})]})]}),children:[B.jsx(Zme,{options:$,placeholder:"请输入或选择挂载点",value:w,onChange:z=>{x(z),C(H=>(H&&(H.mountPoint=z),H))}}),P&&P.id&&B.jsx("div",{className:"flex flex-row items-center py-2",children:P.isMount?B.jsxs("div",{className:"flex flex-row items-center",children:[B.jsx("span",{className:"text-green-400",children:"当前已挂载磁盘"}),B.jsx("span",{className:"text-gray-400",children:"(挂载中不可修改配置)"}),B.jsx(Av,{type:"vertical",className:"ml-4"}),B.jsx(Fn,{loading:_,size:"small",type:"link",onClick:D,disabled:!1,children:"卸载挂载"})]}):B.jsxs("div",{className:"flex flex-row items-center",children:[B.jsx("span",{className:"text-gray-400",children:"当前未挂载到本地磁盘"}),B.jsx(Av,{type:"vertical",className:"ml-4"}),B.jsx(Fn,{loading:_,size:"small",type:"link",onClick:N,children:"立即挂载"})]})})]}),B.jsx(Vt.Item,{name:"mountOnStartup",label:"自动挂载",tooltip:"程序启动后,立即将云盘挂载到本地磁盘",valuePropName:"checked",children:B.jsx(Ga,{})}),B.jsx(Vt.Item,{name:"isRecycleBin",label:"启用回收站",tooltip:"是否启用回收站,如果启用则删除文件时,保留到回收站",valuePropName:"checked",children:B.jsx(Ga,{})}),B.jsx(Vt.Item,{name:"mountReadOnly",label:"只读模式",tooltip:"以只读模式挂载阿里云盘时,无法对文件修改删除等",valuePropName:"checked",children:B.jsx(Ga,{})}),B.jsx(Vt.Item,{name:"mountDrive",label:"云盘类型",tooltip:"选择挂载的阿里云盘是备份盘还是资源库",children:B.jsxs(Pr,{children:[B.jsx(Pr.Option,{value:"backup",children:"备份盘"}),B.jsx(Pr.Option,{value:"resource",children:"资源库"})]})}),B.jsx(Vt.Item,{name:"mountPath",label:"云盘目录",tooltip:"指定挂载云盘的某个目录",help:"如果你希望只挂载某个目录到本地磁盘,则输入云盘路径,格式:文件夹/文件夹/文件夹,示例:backup/mdrive",children:B.jsx(bo,{})})]})]}),B.jsxs("div",{className:"pt-3 items-center justify-center w-full flex",children:[g>0&&B.jsx(Fn,{style:{margin:"0 8px"},onClick:()=>L(),children:"上一步"}),g<1&&B.jsx(Fn,{ghost:!0,type:"primary",onClick:()=>j(),children:"下一步"})]})]})})]})},{Step:FP}=Jb,{SHOW_PARENT:_wn}=lV,Pwn=({visible:e,onOk:t,onCancel:n,jobConfig:r,currentDriveId:o})=>{const[a]=Vt.useForm(),[i,l]=p.useState(0),[s,u]=p.useState(),[m,v]=p.useState(!1),[h,c]=p.useState([]),[d,f]=p.useState([]),[g,b]=p.useState();p.useEffect(()=>{hwn().then(N=>{c(N)}),wce().then(N=>{if(N.success){const D=N.data.filter(z=>z.id.includes("%")).map(z=>({title:z.text,label:z.text,value:z.resolvedpath||z.id,key:z.resolvedpath||z.id,icon:B.jsx(bj,{}),children:[]})),k=N.data.filter(z=>!z.id.includes("%")).map(z=>({title:z.text,label:z.text,value:z.id,key:z.id,icon:B.jsx(bj,{}),children:[]})),F=[];D.length>0&&F.push({title:"用户数据",label:"用户数据",value:":user",key:":user",icon:B.jsx(xlt,{className:"text-[#1677FF]"}),children:D,checkable:!1}),k.length>0&&F.push({title:"计算机",label:"计算机",value:":jsj",key:":jsj",icon:B.jsx(Xit,{}),children:k,checkable:!1}),R(F)}}),N4e().then(N=>{var D;N.success&&f(((D=N.data)==null?void 0:D.map(k=>({value:k})))||[])})},[]),p.useEffect(()=>{var N,D,k;a&&e&&(l(0),x(!0),r&&(r.mountOnStartup=(N=r.mountConfig)==null?void 0:N.mountOnStartup,r.mountPoint=(D=r.mountConfig)==null?void 0:D.mountPoint,r.mountReadOnly=(k=r.mountConfig)==null?void 0:k.mountReadOnly),u(r),a.setFieldsValue(r),O(r.sources||[]),b(r.mountPoint))},[e,r,a]);const y=()=>{a.validateFields().then(N=>{u({...s,...N})})},C=()=>{a.validateFields().then(N=>{u({...s,...N}),l(i+1)}).catch(N=>{gn.error(N==null?void 0:N.errorFields[0].errors[0])})},$=()=>{a.validateFields().then(N=>{u({...s,...N}),l(i-1)}).catch(N=>{gn.error(N==null?void 0:N.errorFields[0].errors[0])})},S=()=>{v(!0),a.validateFields().then(N=>{const D={...s,...N};D.mountConfig={mountPoint:D.mountPoint,mountReadOnly:D.mountReadOnly,mountOnStartup:D.mountOnStartup},u(D),D.id?$ce(D).then(k=>{k!=null&&k.success?(gn.success("操作成功"),t&&t()):gn.error((k==null?void 0:k.message)||"操作失败")}):Sce(o,D).then(k=>{k!=null&&k.success?(gn.success("操作成功"),t&&t()):gn.error((k==null?void 0:k.message)||"操作失败")})}).catch(N=>{gn.error(N==null?void 0:N.errorFields[0].errors[0])}).finally(()=>{v(!1)})},[w,x]=p.useState(!0),[_,O]=p.useState(()=>(r==null?void 0:r.sources)||[]),[P,R]=p.useState([]),T=N=>{O(N),u(D=>(D&&(D.sources=N),D))},E=(N,D,k)=>N.map(F=>F.key===D?{...F,children:k}:F.children&&F.children.length>0?{...F,children:E(F.children,D,k)}:F),I=async N=>{var D;if(!(!N.key||N.key.toString().startsWith(":")))try{const k=await wce(N.key);if(k.success){const F=(D=k.data)==null?void 0:D.map(z=>({title:z.text,label:z.text,value:z.id,key:z.id,children:[],icon:B.jsx(bj,{})}));R(z=>E(z,N.key,F||[]))}}catch{gn.error("加载子文件夹时出错")}},j=()=>{if(!r.id){gn.error("保存作业后才能执行挂载磁盘");return}if(!g){gn.error("请选择或输入挂载点");return}v(!0),a.validateFields().then(N=>{const D={...s,...N};D.mountConfig={mountPoint:D.mountPoint,mountReadOnly:D.mountReadOnly,mountOnStartup:D.mountOnStartup},u(D),D.id?$ce(D).then(k=>{k!=null&&k.success?pwn(r.id).then(F=>{F.success?(gn.success("挂载成功,首次初始化列表需要1~5分钟,请耐心等待"),t&&t()):gn.error(F.message||"操作失败")}).finally(()=>v(!1)):(gn.error((k==null?void 0:k.message)||"操作失败"),v(!1))}):Sce(o,D).then(k=>{k!=null&&k.success?(gn.warning("添加作业成功,请重新设置挂载"),t&&t()):gn.error((k==null?void 0:k.message)||"操作失败")}).finally(()=>v(!1))}).catch(N=>{gn.error(N==null?void 0:N.errorFields[0].errors[0]),v(!1)})},L=()=>{if(!r.id){gn.error("保存作业后才能执行挂载磁盘");return}if(!g){gn.error("请选择或输入挂载点");return}v(!0),mwn(r.id).then(N=>{N.success?(gn.success("操作成功"),t&&t()):gn.error(N.message||"操作失败")}).finally(()=>v(!1))};return B.jsxs(vx,{title:"作业配置",open:e,onOk:S,onCancel:n,width:760,footer:[B.jsx(Fn,{loading:m,type:"primary",onClick:S,children:"保存"},"submit"),B.jsx(Fn,{onClick:n,children:"取消"},"cancel")],className:"w-full",children:[B.jsxs(Jb,{className:"py-3",onChange:N=>{y(),l(N)},current:i,children:[B.jsx(FP,{title:"基本信息"}),B.jsx(FP,{title:"作业配置"}),B.jsx(FP,{title:"高级设置"}),B.jsx(FP,{title:"挂载配置"})]}),B.jsxs(Vt,{disabled:r==null?void 0:r.isMount,form:a,labelCol:{span:6},wrapperCol:{span:18},children:[i==0&&B.jsxs(B.Fragment,{children:[B.jsx(Vt.Item,{required:!0,name:"id",label:"作业标识",children:B.jsx(bo,{disabled:!0})}),B.jsx(Vt.Item,{name:"name",label:"作业名称",rules:[{required:!0,message:"请输入任务/作业名称"}],children:B.jsx(bo,{})}),B.jsx(Vt.Item,{name:"description",label:"作业描述",children:B.jsx(bo,{})}),B.jsx(Vt.Item,{name:"schedules",label:"作业计划",help:B.jsxs("span",{children:["更多示例:",B.jsx("a",{href:"https://www.bejson.com/othertools/cron/",target:"_blank",children:"Cron 表达式"}),",支持自定义作业时间,示例:0 15 10 * * ?。"]}),children:B.jsx(Pr,{options:h==null?void 0:h.map(N=>({value:N})),mode:"tags",tokenSeparators:[","]})}),B.jsx(Vt.Item,{name:"mode",label:"同步模式",help:"镜像:以本地为主,如果远程和本地不一致则删除远程文件;备份:以本地为主,将本地备份到远程,不删除远程文件;双向:双向同步,同时保留,冲突的文件重新命名。",children:B.jsxs(Pr,{children:[B.jsx(Pr.Option,{value:0,children:"镜像"}),B.jsx(Pr.Option,{value:1,children:"备份"}),B.jsx(Pr.Option,{value:2,children:"双向"})]})})]}),i==1&&B.jsxs(B.Fragment,{children:[B.jsxs(Vt.Item,{required:!0,label:"本地目录",tooltip:"源路劲、本地路径,请选择本地文件夹",help:"请选择或输入本地文件夹,支持多选,例如:E:\\test, E:\\kopia",children:[w?B.jsx(lV,{treeData:P,onChange:T,treeCheckable:!0,treeIcon:!0,style:{width:"100%"},allowClear:!0,treeDefaultExpandedKeys:[":user",":jsj",":sources"],placeholder:"请选择文件夹",showCheckedStrategy:_wn,value:_,loadData:I,treeNodeLabelProp:"key"}):B.jsx(Pr,{onChange:T,value:_,mode:"tags",allowClear:!0,tokenSeparators:[",",","],placeholder:"请输入粘贴文件夹路径"}),B.jsx("span",{className:"cursor-pointer text-blue-500 block py-1",onClick:()=>{x(!w)},children:w?"切换为输入文件夹":"切换为选择文件夹,多个以逗号分割"})]}),B.jsx(Vt.Item,{required:!0,name:"defaultDrive",label:"目标位置",tooltip:"阿里云盘的存储位置,个人私有文件建议存储到备份盘",children:B.jsxs(Pr,{children:[B.jsx(Pr.Option,{value:"backup",children:"备份盘"}),B.jsx(Pr.Option,{value:"resource",children:"资源库"})]})}),B.jsx(Vt.Item,{required:!0,name:"target",label:"目标目录",tooltip:"云盘存储路径,远程备份/同步存储的路径",help:"路径格式:/文件夹/文件夹/文件夹,示例:backup/mdrive",children:B.jsx(bo,{})}),B.jsx(Vt.Item,{name:"filters",label:"过滤文件",tooltip:"排除本地不需要过滤的文件/文件夹",help:B.jsxs(B.Fragment,{children:[B.jsx("div",{children:"支持正则表达式,多个文件/文件夹用逗号分隔,过滤的文件/文件夹不会同步"}),B.jsx("div",{children:"示例:/Recovery/*, *.log, *.tmp, **/@Recycle/*, **/logs/*,更多示例请参考官网。"})]}),children:B.jsx(Pr,{mode:"tags",tokenSeparators:[",",","]})}),B.jsx(Vt.Item,{name:"restore",label:"还原目录",tooltip:"还原文件时的本地文件夹",children:B.jsx(bo,{})}),B.jsx(Vt.Item,{name:"rapidUpload",label:"启用秒传",valuePropName:"checked",tooltip:"是否启用阿里云盘秒传功能",children:B.jsx(Ga,{})}),B.jsx(Vt.Item,{name:"isRecycleBin",label:"启用回收站",tooltip:"是否启用回收站,如果启用则删除文件时,保留到回收站",valuePropName:"checked",children:B.jsx(Ga,{})}),B.jsx(Vt.Item,{name:"isTemporary",label:"立即执行",tooltip:"表示是否启动后立即执行作业,如果是一次性作业,请选择立即执行",valuePropName:"checked",children:B.jsx(Ga,{})})]}),i==2&&B.jsxs(B.Fragment,{children:[B.jsx(Vt.Item,{name:"checkAlgorithm",tooltip:"文件是否变更检查算法",label:"文件对比检查算法",children:B.jsxs(Pr,{children:[B.jsx(Pr.Option,{value:"md5",children:"MD5"}),B.jsx(Pr.Option,{value:"sha1",children:"SHA1"}),B.jsx(Pr.Option,{value:"sha256",children:"SHA256"})]})}),B.jsx(Vt.Item,{name:"checkLevel",label:"文件对比检查级别",tooltip:"文件变更时,文件是否变动检查算法级别,默认:1",help:B.jsxs("span",{children:["0:比较文件大小和时间,1:采样计算文件 hash(推荐),2:比较整个文件的 hash",B.jsx("br",{}),"3:比较文件头部 hash,4:比较文件尾部 hash"]}),children:B.jsx(Ys,{min:0,max:4})}),B.jsx(Vt.Item,{name:"fileWatcher",label:"启用文件系统监听",valuePropName:"checked",tooltip:"启用监听可以更加快捷的计算需要同步的文件",children:B.jsx(Ga,{})}),B.jsx(Vt.Item,{name:"order",label:"显示顺序",tooltip:"作业显示顺序",children:B.jsx(Ys,{min:0})}),B.jsx(Vt.Item,{name:"uploadThread",label:"上传并行任务数",tooltip:"上传并行任务数(0:自动,最大:10)",children:B.jsx(Ys,{min:0,max:10})}),B.jsx(Vt.Item,{name:"downloadThread",label:"下载并行任务数",tooltip:"下载并行任务数(0:自动,最大:10)",children:B.jsx(Ys,{min:0,max:10})})]}),i==3&&B.jsxs(B.Fragment,{children:[B.jsxs(Vt.Item,{tooltip:"云盘挂载到本地磁盘的位置",label:"挂载点",help:B.jsxs("span",{children:["如果你想将云盘的备份目录挂载到本地磁盘,像访问本地磁盘一样访问云盘,请设置挂载到磁盘的位置。",B.jsx("br",{}),"确保挂载的磁盘盘符没有被占用,Linux 确保是空的文件夹。",B.jsx("br",{}),"windows 示例:C:\\,linux 示例:/tmp。",B.jsx("br",{}),B.jsxs("span",{children:["请确保已安装磁盘驱动,下载驱动:",B.jsx("a",{href:"/driver/Dokan_x64.msi",target:"_blank",children:"Windows_x64.msi"}),B.jsx(Av,{type:"vertical"}),B.jsx("a",{href:"/driver/Dokan_x86.msi",target:"_blank",children:"Windows_x86.msi"})]})]}),children:[B.jsx(Zme,{options:d,placeholder:"请输入或选择挂载点",value:g,onChange:N=>{b(N),u(D=>(D&&(D.mountPoint=N),D))}}),r.id&&B.jsx("div",{className:"flex flex-row items-center py-2",children:r.isMount?B.jsxs("div",{className:"flex flex-row items-center",children:[B.jsx("span",{className:"text-green-400",children:"当前已挂载磁盘"}),B.jsx("span",{className:"text-gray-400",children:"(挂载中不可修改配置)"}),B.jsx(Av,{type:"vertical",className:"ml-4"}),B.jsx(Fn,{loading:m,size:"small",type:"link",onClick:L,disabled:!1,children:"卸载挂载"})]}):B.jsxs("div",{className:"flex flex-row items-center",children:[B.jsx("span",{className:"text-gray-400",children:"当前未挂载到本地磁盘"}),B.jsx(Av,{type:"vertical",className:"ml-4"}),B.jsx(Fn,{loading:m,size:"small",type:"link",onClick:j,children:"立即挂载"})]})})]}),B.jsx(Vt.Item,{name:"mountOnStartup",label:"自动挂载",tooltip:"作业启动后,立即挂载磁盘",valuePropName:"checked",children:B.jsx(Ga,{})}),B.jsx(Vt.Item,{name:"mountReadOnly",label:"只读模式",tooltip:"以只读模式挂载阿里云盘时,无法对文件修改删除等",valuePropName:"checked",children:B.jsx(Ga,{})})]})]}),B.jsxs("div",{className:"pt-3 items-center justify-center w-full flex",children:[i>0&&B.jsx(Fn,{style:{margin:"0 8px"},onClick:()=>$(),children:"上一步"}),i<3&&B.jsx(Fn,{ghost:!0,type:"primary",onClick:()=>C(),children:"下一步"})]})]})},Ewn={route:{path:"/",routes:[{path:"/welcome",name:"欢迎",icon:B.jsx(ylt,{})},{path:"/setting",name:"设置",icon:B.jsx(dlt,{})},{path:"/about",name:"关于",icon:B.jsx(EH,{})},{path:"https://github.com/trueai-org/MDriveSync",name:"官网",icon:B.jsx(Ait,{})}]},location:{pathname:"/"}};function Iwn(){const[e,t]=p.useState("/"),[n,r]=p.useState(!1),[o,a]=p.useState(!1),[i,l]=p.useState(!1),[s,u]=p.useState(!1),[m,v]=p.useState(),[h,c]=p.useState(),[d,f]=p.useState(),[g,b]=p.useState(),[y,C]=p.useState(),$=[{title:"名称",dataIndex:"name",fixed:"left",render:(re,Z)=>Z.category=="image"?B.jsxs("div",{className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:[B.jsx(bit,{}),B.jsx("span",{children:Z.name})]}):Z.category=="video"?B.jsxs("div",{className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:[B.jsx(Dlt,{}),B.jsx("span",{children:Z.name})]}):Z.category=="doc"?B.jsxs("div",{className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:[B.jsx(Aqe,{}),B.jsx("span",{children:Z.name})]}):Z.category=="audio"?B.jsxs("div",{className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:[B.jsx(iit,{}),B.jsx("span",{children:Z.name})]}):Z.category=="zip"?B.jsxs("div",{className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:[B.jsx(Sit,{}),B.jsx("span",{children:Z.name})]}):Z.category=="app"?B.jsxs("div",{className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:[B.jsx(tV,{}),B.jsx("span",{children:Z.name})]}):Z.isFolder?B.jsxs("div",{onClick:()=>{j(Z)},className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:[B.jsx(pbe,{}),B.jsx("span",{children:Z.name})]}):B.jsx("div",{className:"space-x-1 text-base flex items-center cursor-pointer hover:text-blue-500",children:B.jsx("span",{children:Z.name})})},{title:"大小",dataIndex:"size",width:120,fixed:"left",align:"right",render:re=>B.jsx("span",{children:re?k$(re):"-"})},{title:"修改时间",dataIndex:"updated_at",width:160,align:"right",render:re=>re?XIt(re,"yyyy-MM-dd hh:mm:ss"):"-"},{title:"操作",key:"action",width:80,align:"center",render:(re,Z)=>Z.isFile?B.jsx(Fn,{type:"primary",ghost:!0,size:"small",icon:B.jsx(Yrt,{}),onClick:()=>{ywn(h.id,Z.file_id).then(le=>{const de=encodeURIComponent(le.url),pe=encodeURIComponent(Z.name);window.open(`/api/drive/download?url=${de}&name=${pe}`)})}}):"-"}],S=oe.useRef(null),w=oe.useMemo(()=>d,[d]),x=(re,Z)=>{l(!0),Cwn(Z,re.key).then(le=>{le!=null&&le.success?(gn.success("操作成功"),T()):gn.error((le==null?void 0:le.message)||"操作失败")}).finally(()=>{l(!1)})},_=[{key:jt.Continue,label:"继续"},{key:jt.Initializing,label:"初始化"},{key:jt.BackingUp,label:"执行"},{key:jt.Paused,label:"暂停"},{key:jt.Disabled,label:"禁用"},{key:jt.None,label:"启用"},{key:jt.Cancelled,label:"取消"},{key:jt.Deleted,label:"删除"}],O=re=>{switch(re){case jt.None:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Initializing);case jt.Initializing:return[];case jt.Idle:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.BackingUp||(Z==null?void 0:Z.key)==jt.Disabled||(Z==null?void 0:Z.key)==jt.Deleted);case jt.Starting:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Paused);case jt.Scanning:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Paused);case jt.BackingUp:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Paused||(Z==null?void 0:Z.key)==jt.Cancelled);case jt.Restoring:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Paused);case jt.Verifying:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Paused);case jt.Queued:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Cancelled);case jt.Completed:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.BackingUp||(Z==null?void 0:Z.key)==jt.Disabled||(Z==null?void 0:Z.key)==jt.Deleted);case jt.Paused:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Continue||(Z==null?void 0:Z.key)==jt.Cancelled);case jt.Error:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.BackingUp||(Z==null?void 0:Z.key)==jt.Disabled||(Z==null?void 0:Z.key)==jt.Deleted||(Z==null?void 0:Z.key)==jt.Initializing);case jt.Cancelling:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.Paused);case jt.Cancelled:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.BackingUp||(Z==null?void 0:Z.key)==jt.Disabled||(Z==null?void 0:Z.key)==jt.Deleted||(Z==null?void 0:Z.key)==jt.Initializing);case jt.Disabled:return _.filter(Z=>(Z==null?void 0:Z.key)==jt.None||(Z==null?void 0:Z.key)==jt.Deleted||(Z==null?void 0:Z.key)==jt.Initializing);default:return[]}},P=oe.useMemo(()=>`包含 ${(d==null?void 0:d.filter(re=>re.isFile).length)||0} 个文件,${(d==null?void 0:d.filter(re=>re.isFolder).length)||0} 个文件夹,总大小 ${k$((d==null?void 0:d.filter(re=>re.isFile).reduce((re,Z)=>re+Z.size,0))||0)}`,[d]),R=oe.useMemo(()=>h?g?g.key:(h==null?void 0:h.target)+"/":"/",[h,g]);p.useEffect(()=>{T()},[]);const T=()=>{l(!0),dwn().then(re=>{v(re||[]),l(!1)})},E=(re,Z)=>{u(!0),bwn(re,Z).then(le=>{f(le),!Z&&le&&le.length>0&&F9(re,le[0].parent_file_id).then(de=>{b(de),C(de.file_id)})}).finally(()=>u(!1))},I=re=>{re.state!=jt.Disabled&&re.state!=jt.Initializing&&(c(re),E(re.id))},j=re=>{u(!0),F9(h.id,re.file_id).then(Z=>{b(Z),E(h.id,Z.file_id)}).finally(()=>u(!1))},L=()=>{g&&(u(!0),F9(h.id,g.parent_file_id).then(re=>{b(re),E(h.id,re.file_id)}))},N=()=>{h&&I(h)},[D,k]=p.useState(!1),[F,z]=p.useState(null),[H,W]=p.useState(),K=re=>{z(re),k(!0)},V=re=>{W(re),z({id:"",name:"",description:"",state:jt.None,mode:0,rapidUpload:!0,checkLevel:1,checkAlgorithm:"sha256",order:0,isTemporary:!1,isRecycleBin:!0,uploadThread:0,downloadThread:0,schedules:[],filters:[],fileWatcher:!0,defaultDrive:"backup",target:"",sources:[]}),k(!0)},q=()=>{k(!1),T()},U=()=>{k(!1)},G=[{label:"天蓝",value:"#1677FF"},{label:"拂晓",value:"#1890ff"},{label:"薄暮",value:"#F5222D"},{label:"火山",value:"#FA541C"},{label:"日暮",value:"#FAAD14"},{label:"明青",value:"#13C2C2"},{label:"草绿",value:"#52C41A"},{label:"深蓝",value:"#2F54EB"},{label:"酱紫",value:"#722ED1"}],[J,Y]=p.useState(()=>localStorage.getItem("theme")?JSON.parse(localStorage.getItem("theme")):{fixSiderbar:!0,layout:"mix",splitMenus:!0}),ae=p.useRef(null),ne=p.useRef(null),[ee,X]=p.useState(!1),te=[{title:"欢迎使用 MDrive 阿里云盘数据同步工具",description:"在这里添加授权、管理授权,添加作业,管理作业等操作。",target:()=>ae.current},{title:"在这里可以查看或管理云盘文件",description:"点击文件夹可以进入文件夹,点击文件可以下载。",target:()=>ne.current}],{data:Q,refetch:ie}=eIe({queryKey:["jobs"],queryFn:async()=>(await fwn()).data,staleTime:60*1e3,refetchInterval:1*1e3});return p.useEffect(()=>{ie()},[ie]),p.useEffect(()=>{if(Q&&m){const re=m.map(Z=>({...Z,jobs:Z.jobs.map(le=>{const de=Q.find(pe=>pe.id===le.id);return de?{...le,state:de.state,metadata:de.metadata,isMount:de.isMount}:le})}));v(re)}},[Q]),B.jsxs(v3t,{title:"MDrive",logo:B.jsx("img",{src:"/logo.png",style:{width:24,height:24}}),...Ewn,...J,location:{pathname:e},footerRender:()=>B.jsxs("div",{className:"text-center text-gray-400",children:["Power by"," ",B.jsx("a",{target:"_blank",href:"https://github.com/trueai-org/MDriveSync",children:"MDrive"})," ","v1.5.0 |"," ",B.jsx("a",{target:"_blank",href:"https://github.com/trueai-org/MDriveSyncWebUI",children:"WebUI"})," ","|"," ",B.jsx("a",{target:"_blank",href:"https://github.com/trueai-org/MDriveSync",children:"官网"})," ","|"," ",B.jsx("a",{target:"_blank",href:"https://duplicati.net",children:"Duplicati"})]}),menuItemRender:(re,Z)=>B.jsx("a",{onClick:()=>{var le;t(re.path||"/"),re.path=="/welcome"&&X(!0),re.path=="/setting"&&a(!0),re.path=="/about"&&r(!0),(le=re.path)!=null&&le.startsWith("http")&&window.open(re.path)},children:Z}),layout:"top",loading:i,children:[B.jsxs(v4,{split:"vertical",style:{minHeight:520},children:[B.jsx(v4,{bodyStyle:{margin:0,padding:0},headerBordered:!0,title:B.jsx("div",{className:"font-bold",children:"存储和作业"}),colSpan:"432px",ref:ae,extra:B.jsx(_ce,{isAdd:!0,onOk:T}),children:m&&(m==null?void 0:m.map((re,Z)=>{var le,de;return B.jsx(K6t,{rowKey:re.id+Z,style:{borderBlockEnd:"1px solid rgba(211, 167, 255, 0.17)"},headerTitle:B.jsxs("div",{className:"text-base whitespace-nowrap flex items-center",children:[B.jsxs("span",{className:"mr-2",children:[" ",re.name||"未命名云盘"," "]}),re.metadata&&((le=re.metadata)==null?void 0:le.identity)&&B.jsx(yz,{className:"uppercase",color:"pink",children:re.metadata.identity}),re.metadata&&((de=re.metadata)==null?void 0:de.level)&&B.jsx(yz,{className:"uppercase",children:re.metadata.level}),re.metadata&&re.metadata.usedSize&&re.metadata.totalSize&&B.jsxs("span",{className:"text-xs text-gray-500",children:[k$(re.metadata.usedSize)," /"," ",k$(re.metadata.totalSize)]})]}),toolBarRender:()=>[B.jsx(_ce,{drive:re,onOk:T,onJobAdd:()=>V(re.id)})],dataSource:re.jobs.map(pe=>({title:pe.name,job:pe})),onRow:pe=>({onClick:()=>{I(pe.job)}}),metas:{title:{},subTitle:{render:(pe,ue)=>xwn(ue.job.state)},description:{render:(pe,ue)=>{var me,he,be,Me,je,De,xe,ye;return B.jsxs(B.Fragment,{children:[B.jsxs("div",{className:"text-xs",children:["包含 ",((he=(me=ue.job)==null?void 0:me.metadata)==null?void 0:he.fileCount)||0," 个文件,",((Me=(be=ue.job)==null?void 0:be.metadata)==null?void 0:Me.folderCount)||0," ","个文件夹,总大小"," ",k$(((De=(je=ue.job)==null?void 0:je.metadata)==null?void 0:De.totalSize)||0)]}),((ye=(xe=ue.job)==null?void 0:xe.metadata)==null?void 0:ye.message)&&B.jsx("div",{className:"text-xs",children:ue.job.metadata.message})]})}},actions:{render:(pe,ue)=>B.jsx(P1.Button,{size:"small",menu:{items:O(ue.job.state),onClick:me=>{x(me,ue.job.id)}},onClick:()=>K(ue.job),children:B.jsx(cV,{})})}}},Z)}))}),B.jsx(v4,{bodyStyle:{margin:0,padding:0},headerBordered:!0,title:B.jsx("div",{className:"font-bold",children:"文件管理"}),ref:ne,children:B.jsxs("div",{className:"flex px-6 py-4 flex-col w-full space-y-3 overflow-y-auto",children:[B.jsxs("div",{className:"flex flex-row space-x-2 items-center w-full",children:[B.jsx(Fn,{onClick:()=>N(),disabled:!h||y==(g==null?void 0:g.file_id),icon:B.jsx(qit,{})}),B.jsx(Fn,{icon:B.jsx(llt,{}),onClick:()=>L(),disabled:!h||y==(g==null?void 0:g.file_id)}),B.jsx(bo,{style:{width:"100%"},value:R,placeholder:"文件夹"}),B.jsx(Fn,{onClick:()=>j(g),disabled:!h,icon:B.jsx(S0e,{})})]}),B.jsx(Ed,{virtual:!0,columns:$,scroll:{x:400,y:400},rowKey:"file_id",dataSource:w||[],pagination:!1,ref:S,size:"small",loading:s}),h&&B.jsx("div",{className:"text-xs text-gray-600",children:P})]})})]}),B.jsx(Pwn,{visible:D,onOk:q,onCancel:U,jobConfig:F,currentDriveId:H}),B.jsx(vx,{title:"关于",open:n,width:760,footer:null,onCancel:()=>r(!1),children:B.jsx("div",{className:"my-3",children:B.jsxs("div",{className:"flex flex-col space-y-2",children:[B.jsx("div",{children:"多平台、模块化、安全的云盘同步工具备份,支持百度网盘、阿里云盘等,集成 Duplicati、Kopia 等多种模块,支持加密还原等,支持单向、镜像、双向等同步备份,完全免费开源。"}),B.jsx("div",{children:"提供 Docker 版、Duplicati 版、Kopia 版、Windows 服务版、Windows 版、手机版、网页版、Linux版、Mac 版等多平台版本。"}),B.jsx("div",{children:"支持多种算法同步与备份,保证数据的安全性,任何第三方、任何云盘服务商都无法查看或分析你的数据,只有通过你本人设置的安全密钥才能解密数据,保证您的数据安全和隐私。"}),B.jsxs("div",{children:["更多文档:",B.jsx("a",{target:"_blank",href:"https://github.com/trueai-org/MDriveSync",children:"MDriveSync 官网"})]})]})})}),B.jsx(vx,{title:"设置",open:o,width:760,footer:null,onCancel:()=>a(!1),children:B.jsxs("div",{className:"my-3 flex flex-col space-y-3",children:[B.jsxs("div",{className:"flex flex-row items-center",children:[B.jsx("span",{className:"flex flex-col flex-none w-20",children:B.jsx("span",{children:"网站主题:"})}),B.jsxs("div",{className:"flex flex-row items-center space-x-2",children:[B.jsx(xCe.Select,{className:"w-24",options:G,value:J==null?void 0:J.colorPrimary,placeholder:"主题色",onChange:re=>{const Z={...J,colorPrimary:re};Y(Z),localStorage.setItem("theme",JSON.stringify(Z))}}),B.jsx("span",{style:{backgroundColor:J==null?void 0:J.colorPrimary},className:"w-6 h-6 block rounded"})]})]}),B.jsxs("div",{className:"flex flex-row items-center",children:[B.jsx("span",{className:"flex flex-col flex-none w-20",children:B.jsx("span",{children:"暗色模式:"})}),B.jsx("div",{className:"flex flex-col",children:B.jsx(A0e,{checked:(J==null?void 0:J.navTheme)==="realDark",onChange:re=>{const le={...J,navTheme:re?"realDark":"light"};Y(le),localStorage.setItem("theme",JSON.stringify(le))}})})]}),B.jsxs("div",{className:"flex flex-row",children:[B.jsx("span",{className:"flex flex-col flex-none w-20",children:B.jsx("span",{children:"登录密码:"})}),B.jsx("div",{className:"flex flex-col flex-1 text-gray-400",children:"请修改配置 appsettings.json,如果通过 docker 启动也可以通过环境变量修改,示例:-e BASIC_AUTH_USER=admin -e BASIC_AUTH_PASSWORD=123456"})]})]})}),B.jsx(snt,{open:ee,onClose:()=>X(!1),steps:te})]})}const Mwn=new F6e;L9.createRoot(document.getElementById("root")).render(B.jsx(oe.StrictMode,{children:B.jsx(A6e,{client:Mwn,children:B.jsx(Iwn,{})})})); diff --git a/src/MDriveSync.Client.API/wwwroot/index.html b/src/MDriveSync.Client.API/wwwroot/index.html index 9ae91cd..5830ecc 100644 --- a/src/MDriveSync.Client.API/wwwroot/index.html +++ b/src/MDriveSync.Client.API/wwwroot/index.html @@ -4,7 +4,7 @@ MDrive - +