You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
12 KiB

  1. (()=>{var e,t,n,r={15340:()=>{},47790:()=>{},51069:()=>{},61876:(e,t,n)=>{"use strict";var r,s=n(35810),i=n(81222),a=n(53334),o=n(19051),l=n(85168),c=n(12555),u=n(63814),d=n(98469),f=n(85471);function p(e){return!(!e.status||e.status===r.SUCCESS)&&(e.userProvided||"password::global::user"===e.authMechanism)}function A(e){if(e.type===s.pt.File)return!1;const t=e.attributes;return!(!t.scope||!t.backend||"personal"!==t.scope&&"system"!==t.scope)}!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={})),(0,c.IF)(o.Ay);const g=new s.hY({id:"credentials-external-storage",displayName:()=>(0,a.t)("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=>{if(1!==e.length)return!1;const t=e[0];return!!A(t)&&!!p(t.attributes?.config||{})},async exec(e){const{login:t,password:s}=await new Promise(e=>(0,d.S)((0,f.$V)(()=>Promise.all([n.e(4208),n.e(4139)]).then(n.bind(n,84139))),{},t=>{e(t)}));if(t&&s)try{await async function(e,t,n){const s=(await o.Ay.request({method:"PUT",url:(0,u.Jv)("apps/files_external/userglobalstorages/{id}",{id:e.attributes.id}),confirmPassword:c.mH.Strict,data:{backendOptions:{user:t,password:n}}})).data;return s.status!==r.SUCCESS?((0,l.Qg)((0,a.t)("files_external","Unable to update this external storage config. {statusMessage}",{statusMessage:s?.statusMessage||""})),null):((0,l.Te)((0,a.t)("files_external","New configuration successfully saved")),f.Ay.set(e.attributes,"config",s),!0)}(e,t,s),(0,l.Te)((0,a.t)("files_external","Credentials successfully set"))}catch(e){(0,l.Qg)((0,a.t)("files_external","Error while setting credentials: {error}",{error:e.message}))}return null},order:-1e3,default:s.m9.DEFAULT,inline:()=>!0});var m=n(21777);const h=`/files/${(0,m.HW)()?.uid}`;function w(e){const t=(e.path+"/"+e.name).replace(/^\//gm,"");return new s.vd({id:e.id,source:(0,u.dC)("dav"+h+"/"+t),root:h,owner:(0,m.HW)()?.uid||null,permissions:e.config.status!==r.SUCCESS?s.aX.NONE:e?.permissions||s.aX.READ,attributes:{displayName:t,...e}})}var C=n(85072),b=n.n(C),v=n(97825),x=n.n(v),y=n(77659),E=n.n(y),T=n(55056),_=n.n(T),S=n(10540),H=n.n(S),O=n(41113),N=n.n(O),k=n(64755),P={};P.styleTagTransform=N(),P.setAttributes=_(),P.insert=E().bind(null,"head"),P.domAPI=x(),P.insertStyleElement=H(),b()(k.A,P),k.A&&k.A.locals&&k.A.locals;const I=new s.hY({id:"check-external-storage",displayName:()=>"",iconSvgInline:()=>"",enabled:e=>e.every(e=>!0===A(e)),exec:async()=>null,async renderInline(e){const t=document.createElement("span");t.className="files-list__row-status",t.innerHTML=(0,a.Tl)("files_external","Checking storage …");let n=null;return function(e,t=!0){const n=t?"userglobalstorages":"userstorages";return o.Ay.get((0,u.Jv)(`apps/files_external/${n}/${e}?testOnly=false`))}(e.attributes.id,"system"===e.attributes.scope).then(s=>{if(n=s.data,f.Ay.set(e.attributes,"config",n),n.status!==r.SUCCESS)throw new Error(n?.statusMessage||(0,a.Tl)("files_external","There was an error with this external storage."));t.remove()}).catch(r=>{r.response&&!n&&(0,l.I9)((0,a.Tl)("files_external","We were unable to check the external storage {basename}",{basename:e.basename})),t.innerHTML="";const s=!!n&&p(n),i=document.createElement("span");i.classList.add("files-list__row-status--"+(s?"warning":"error")),s||(t.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>',t.title=r.message),t.prepend(i)}),t},order:10}),M=new s.hY({id:"open-in-files-external-storage",displayName:e=>(e?.[0]?.attributes?.config||{status:r.INDETERMINATE}).status!==r.SUCCESS?(0,a.Tl)("files_ext
  2. //# sourceMappingURL=files_external-init.js.map?v=6867c55fb613d43037f0