2025-01-29 10:22:22 +00:00
|
|
|
(()=>{"use strict";var e,t,n,r={26436:(e,t,n)=>{var r,s=n(32981),a=n(53334),o=n(34297),i=n(63814),l=n(85168),u=n(65043),c=n(85471);!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.INDETERMINATE=2]="INDETERMINATE",e[e.INCOMPLETE_CONF=3]="INCOMPLETE_CONF",e[e.UNAUTHORIZED=4]="UNAUTHORIZED",e[e.TIMEOUT=5]="TIMEOUT",e[e.NETWORK_ERROR=6]="NETWORK_ERROR"}(r||(r={}));const d=function(e){return!(!e.status||e.status===r.SUCCESS)&&(e.userProvided||"password::global::user"===e.authMechanism)},p=function(e){if(e.type===o.pt.File)return!1;const t=e.attributes;return!(!t.scope||!t.backend||"personal"!==t.scope&&"system"!==t.scope)},g=new o.hY({id:"credentials-external-storage",displayName:()=>(0,a.Tl)("files","Enter missing credentials"),iconSvgInline:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-login" viewBox="0 0 24 24"><path d="M11 7L9.6 8.4L12.2 11H2V13H12.2L9.6 15.6L11 17L16 12L11 7M20 19H12V21H20C21.1 21 22 20.1 22 19V5C22 3.9 21.1 3 20 3H12V5H20V19Z" /></svg>',enabled:e=>{var t;if(1!==e.length)return!1;const n=e[0];if(!p(n))return!1;const r=(null===(t=n.attributes)||void 0===t?void 0:t.config)||{};return!!d(r)},async exec(e){const{login:t,password:s}=await new Promise((e=>(0,l.Ss)((0,c.$V)((()=>Promise.all([n.e(4208),n.e(5203)]).then(n.bind(n,95203)))),{},(t=>{e(t)}))));return t&&s?await async function(e,t,n){const s=(await u.Ay.put((0,i.Jv)("apps/files_external/userglobalstorages/{id}",e.attributes),{backendOptions:{user:t,password:n}})).data;return s.status!==r.SUCCESS?((0,l.Qg)((0,a.Tl)("files_external","Unable to update this external storage config. {statusMessage}",{statusMessage:(null==s?void 0:s.statusMessage)||""})),null):((0,l.Te)((0,a.Tl)("files_external","New configuration successfully saved")),c.Ay.set(e.attributes,"config",s),!0)}(e,t,s):null},order:-1e3,default:o.m9.DEFAULT,inline:()=>!0});var f=n(85072),A=n.n(f),v=n(97825),h=n.n(v),m=n(77659),w=n.n(m),C=n(55056),b=n.n(C),x=n(10540),y=n.n(x),E=n(41113),T=n.n(E),_=n(64755),S={};S.styleTagTransform=T(),S.setAttributes=b(),S.insert=w().bind(null,"head"),S.domAPI=h(),S.insertStyleElement=y(),A()(_.A,S),_.A&&_.A.locals&&_.A.locals;var O,N=n(21777);const H="/files/".concat(null===(O=(0,N.HW)())||void 0===O?void 0:O.uid),k=e=>{var t;const n=(e.path+"/"+e.name).replace(/^\//gm,"");return new o.vd({id:e.id,source:(0,i.dC)("dav"+H+"/"+n),root:H,owner:(null===(t=(0,N.HW)())||void 0===t?void 0:t.uid)||null,permissions:e.config.status!==r.SUCCESS?o.aX.NONE:(null==e?void 0:e.permissions)||o.aX.READ,attributes:{displayName:n,...e}})},R=new o.hY({id:"check-external-storage",displayName:()=>"",iconSvgInline:()=>"",enabled:e=>e.every((e=>!0===p(e))),exec:async()=>null,async renderInline(e){let t=null;try{const s=await function(e){const t=arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?"userstorages":"userglobalstorages";return u.Ay.get((0,i.Jv)("apps/files_external/".concat(t,"/").concat(e,"?testOnly=false")))}(e.attributes.id,"system"===e.attributes.scope);var n;if(t=s.data,c.Ay.set(e.attributes,"config",t),t.status!==r.SUCCESS)throw new Error((null===(n=t)||void 0===n?void 0:n.statusMessage)||(0,a.Tl)("files_external","There was an error with this external storage."));return null}catch(n){if(n.response&&!t)return(0,l.I9)((0,a.Tl)("files_external","We were unable to check the external storage {basename}",{basename:e.basename})),null;const r=d(t),s=document.createElement("span");s.classList.add("files-list__row-status--".concat(r?"warning":"error"));const o=document.createElement("span");return o.className="files-list__row-status",r||(o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-alert-circle" viewBox="0 0 24 24"><path d="M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z" /></svg>',o.title=n.message),o.prepend(s),o}},order:10}),M=new o.hY({id:"open-in-files-external-storage",displayName:e=>{var t;return((null==e||null===(t=e[0])||void 0===t||null===(t=t.attributes)||void 0===t?void 0:t.config)||{status:r.INDETERMINATE}).status!==r.SUCCESS?(0,a.Tl)("files_external","Examine this fa
|