mirror of
https://github.com/nextcloud/server.git
synced 2026-02-19 02:38:40 -05:00
3 lines
8.1 KiB
JavaScript
3 lines
8.1 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('', '', 'dist/CredentialsDialog-CTscFo5v.chunk.mjs'),window.OC.filePath('', '', 'dist/translation-DoG5ZELJ-2ffMJaM4.chunk.mjs'),window.OC.filePath('', '', 'dist/index-6_gsQFyp.chunk.mjs'),window.OC.filePath('', '', 'dist/index-DeDXQtUD.chunk.mjs'),window.OC.filePath('', '', 'dist/runtime-dom.esm-bundler-nUg13ekW.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9-CRJVCjcq.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9-C_oBIsvc.chunk.css'),window.OC.filePath('', '', 'dist/logger-D3RVzcfQ-B4GxPQ5t.chunk.mjs'),window.OC.filePath('', '', 'dist/logger-D3RVzcfQ-R3us1MM8.chunk.css'),window.OC.filePath('', '', 'dist/mdi-DK5BPbEO.chunk.mjs'),window.OC.filePath('', '', 'dist/mdi-BYHcrfvW.chunk.css'),window.OC.filePath('', '', 'dist/index-CySLkPBX.chunk.css'),window.OC.filePath('', '', 'dist/NcNoteCard-Cok_4Fld-BLQT242e.chunk.mjs'),window.OC.filePath('', '', 'dist/NcNoteCard-Cok_4Fld-Jq77EThs.chunk.css'),window.OC.filePath('', '', 'dist/NcPasswordField-uaMO2pdt-Bb_nZP1o.chunk.mjs'),window.OC.filePath('', '', 'dist/index-ClUK5nWL.chunk.mjs'),window.OC.filePath('', '', 'dist/index-sH3U_332.chunk.mjs'),window.OC.filePath('', '', 'dist/index-Ma7sfat2.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-o5OFv3z6-DGXgkff4.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-o5OFv3z6-BYlw6Xsd.chunk.css'),window.OC.filePath('', '', 'dist/NcPasswordField-uaMO2pdt-DxPSRxK-.chunk.css'),window.OC.filePath('', '', 'dist/TrashCanOutline-YYyMK6ia.chunk.mjs')])))=>i.map(i=>d[i]);
|
||
import{D as x,g as C,V as E,C as p,b as u}from"./index-CZqtY2I6.chunk.mjs";import{_ as V,l as M}from"./index-Ma7sfat2.chunk.mjs";import{t as s}from"./translation-DoG5ZELJ-2ffMJaM4.chunk.mjs";import{c as l}from"./index-ClUK5nWL.chunk.mjs";import{d as w,a as h,s as L,e as S}from"./index-C1xmmKTZ-B_lLl9Ld.chunk.mjs";import{e as _,a as c}from"./index-6_gsQFyp.chunk.mjs";import{a as T,P as A}from"./index-b3AfNmc1.chunk.mjs";import{g as m,b as N,i as y}from"./createElementId-DhjFt1I9-CRJVCjcq.chunk.mjs";import{s as P}from"./index-DeDXQtUD.chunk.mjs";import{S as a}from"./types-CVC8uzLj.chunk.mjs";import{F as k,b,P as d}from"./public-BJJBqhxW.chunk.mjs";import{a as D}from"./runtime-dom.esm-bundler-nUg13ekW.chunk.mjs";import"./index-sH3U_332.chunk.mjs";import"./NcNoteCard-Cok_4Fld-BLQT242e.chunk.mjs";import"./logger-D3RVzcfQ-B4GxPQ5t.chunk.mjs";import"./NcPasswordField-uaMO2pdt-Bb_nZP1o.chunk.mjs";import"./NcInputField-o5OFv3z6-DGXgkff4.chunk.mjs";import"./mdi-DK5BPbEO.chunk.mjs";const I='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-folder-network-outline" viewBox="0 0 24 24"><path d="M15 20C15 19.45 14.55 19 14 19H13V17H19C20.11 17 21 16.11 21 15V7C21 5.9 20.11 5 19 5H13L11 3H5C3.9 3 3 3.9 3 5V15C3 16.11 3.9 17 5 17H11V19H10C9.45 19 9 19.45 9 20H2V22H9C9 22.55 9.45 23 10 23H14C14.55 23 15 22.55 15 22H22V20H15M5 15V7H19V15H5Z" /></svg>',O='<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>';function v(e){return e.status===void 0||e.status===a.Success?!1:e.userProvided||e.authMechanism==="password::global::user"}function H(e){if(e.type===k.File)return!1;const t=e.attributes;return!t.scope||!t.backend?!1:t.scope==="personal"||t.scope==="system"}T(l);async function R(e,t,n){const r=(await l.request({method:"PUT",url:m("apps/files_external/userglobalstorages/{id}",{id:e.id}),confirmPassword:A.Strict,data:{backendOptions:{user:t,password:n}}})).data;return r.status!==a.Success?(h(s("files_external","Unable to update this external storage config. {statusMessage}",{statusMessage:r?.statusMessage||""})),null):(w(s("files_external","New configuration successfully saved")),e.attributes.config=r,_("files:node:updated",e),!0)}const F="credentials-external-storage",U={id:F,displayName:()=>s("files","Enter missing credentials"),iconSvgInline:()=>O,enabled:({nodes:e})=>{if(e.length!==1||!e[0])return!1;const t=e[0];if(!H(t))return!1;const n=t.attributes?.config||{};return!!v(n)},async exec({nodes:e}){const{login:t,password:n}=await P(D(()=>V(()=>import("./CredentialsDialog-CTscFo5v.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]),import.meta.url)))??{};if(t&&n)try{await R(e[0],t,n),w(s("files_external","Credentials successfully set"))}catch(r){h(s("files_external","Error while setting credentials: {error}",{error:r.message}))}return null},order:-1e3,default:x.DEFAULT,inline:()=>!0},$='<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=`/files/${c()?.uid}`;function B(e){const t=(e.path+"/"+e.name).replace(/^\//gm,"");return new b({id:e.id,source:y("dav"+o+"/"+t),root:o,owner:c()?.uid||null,permissions:e.config.status!==a.Success?d.NONE:e?.permissions||d.READ,attributes:{displayName:t,...e}})}async function Z(){const e=(await l.get(N("apps/files_external/api/v1/mounts"))).data.ocs.data.map(B);return{folder:new b({id:0,source:y("dav"+o),root:o,owner:c()?.uid||null,permissions:d.READ}),contents:e}}function j(e,t=!0){const n=t?"userglobalstorages":"userstorages";return l.get(m(`apps/files_external/${n}/${e}?testOnly=false`))}const q={id:"check-external-storage",displayName:()=>"",iconSvgInline:()=>"",enabled:({nodes:e})=>e.every(t=>H(t)===!0),exec:async()=>null,async renderInline({nodes:e}){if(e.length!==1||!e[0])return null;const t=e[0],n=document.createElement("span");n.className="files-list__row-status",n.innerHTML=s("files_external","Checking storage …");let r;try{const{data:i}=await j(t.id,t.attributes.scope==="system");if(r=i,t.attributes.config=r,_("files:node:updated",t),r.status!==a.Success)throw new Error(r?.statusMessage||s("files_external","There was an error with this external storage."));n.remove()}catch(i){i.response&&!r&&L(s("files_external","We were unable to check the external storage {basename}",{basename:t.basename})),n.innerHTML="";const f=r?v(r):!1,g=document.createElement("span");g.classList.add(`files-list__row-status--${f?"warning":"error"}`),f||(n.innerHTML=$,n.title=i.message),n.prepend(g)}return n},order:10},W={id:"open-in-files-external-storage",displayName:({nodes:e})=>(e?.[0]?.attributes?.config||{status:a.Indeterminate}).status!==a.Success?s("files_external","Examine this faulty external storage configuration"):s("files","Open in Files"),iconSvgInline:()=>"",enabled:({view:e})=>e.id==="extstoragemounts",async exec({nodes:e}){if(e[0]?.attributes?.config?.status!==a.Success){if(await S({name:s("files_external","External mount error"),text:s("files_external","There was an error with this external storage. Do you want to review this mount point config in the settings page?"),labelConfirm:s("files_external","Open settings"),labelReject:s("files_external","Ignore")})===!0){const t=c()?.isAdmin?"admin":"user";window.location.href=m(`/settings/${t}/externalstorages`)}return null}return window.OCP.Files.Router.goToRoute(null,{view:"files"},{dir:e[0].path}),null},order:-1e3,default:x.HIDDEN},Y=M("files_external","allowUserMounting",!1),z=C();z.register(new E({id:"extstoragemounts",name:s("files_external","External storage"),caption:s("files_external","List of external storage."),emptyCaption:Y?s("files_external","There is no external storage configured. You can configure them in your Personal settings."):s("files_external","There is no external storage configured and you don't have the permission to configure them."),emptyTitle:s("files_external","No external storage"),icon:I,order:30,columns:[new p({id:"storage-type",title:s("files_external","Storage type"),render(e){const t=e.attributes?.backend||s("files_external","Unknown"),n=document.createElement("span");return n.textContent=t,n}}),new p({id:"scope",title:s("files_external","Scope"),render(e){const t=document.createElement("span");let n=s("files_external","Personal");return e.attributes?.scope==="system"&&(n=s("files_external","System")),t.textContent=n,t}})],getContents:Z})),u(U),u(q),u(W);
|
||
//# sourceMappingURL=files_external-init.mjs.map
|