mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
3 lines
7.8 KiB
JavaScript
3 lines
7.8 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('', '', 'dist/CredentialsDialog-DRqXEuS4.chunk.mjs'),window.OC.filePath('', '', 'dist/translation-DoG5ZELJ-gw0g4US-.chunk.mjs'),window.OC.filePath('', '', 'dist/index-6_gsQFyp.chunk.mjs'),window.OC.filePath('', '', 'dist/index-JpgrUA2Z-BFiKKJ1W.chunk.mjs'),window.OC.filePath('', '', 'dist/index-xFugdZPW.chunk.mjs'),window.OC.filePath('', '', 'dist/runtime-dom.esm-bundler-BrYCUcZF.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9--Zqj3wLs.chunk.mjs'),window.OC.filePath('', '', 'dist/NcNoteCard-CVhtNL04-hwuc093N.chunk.mjs'),window.OC.filePath('', '', 'dist/NcNoteCard-CVhtNL04-DopLwvn9.chunk.css'),window.OC.filePath('', '', 'dist/mdi-D55n0uzy.chunk.mjs'),window.OC.filePath('', '', 'dist/mdi-BYHcrfvW.chunk.css'),window.OC.filePath('', '', 'dist/index-JpgrUA2Z-PxDoi4mB.chunk.css'),window.OC.filePath('', '', 'dist/NcPasswordField-djttkA5Q-2g87vOpY.chunk.mjs'),window.OC.filePath('', '', 'dist/index-BfylblLb.chunk.mjs'),window.OC.filePath('', '', 'dist/string_decoder-BO00msnV.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-Bwsh2aHY-CHbAfY0u.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-Bwsh2aHY-_gyGHRGx.chunk.css'),window.OC.filePath('', '', 'dist/NcPasswordField-djttkA5Q-2EzJaBaw.chunk.css'),window.OC.filePath('', '', 'dist/TrashCanOutline-CvWRJ8GE.chunk.mjs')])))=>i.map(i=>d[i]);
|
||
import{F as E,c as f,D as x,b as h,P as d,g as V,V as M,C as w,f as c}from"./index-C12Y86mH.chunk.mjs";import{_ as L,l as S}from"./index-xFugdZPW.chunk.mjs";import{t as s}from"./translation-DoG5ZELJ-gw0g4US-.chunk.mjs";import{c as l}from"./index-BfylblLb.chunk.mjs";import{b as T,e as _,a as b,s as A,h as N}from"./index-JpgrUA2Z-BFiKKJ1W.chunk.mjs";import{e as y,a as u}from"./index-6_gsQFyp.chunk.mjs";import{a as P,P as k}from"./index-cDQt1Drw.chunk.mjs";import{g as m,a as D,b as v}from"./createElementId-DhjFt1I9--Zqj3wLs.chunk.mjs";import{S as a}from"./types-BoPN4zt3.chunk.mjs";import{a as I}from"./runtime-dom.esm-bundler-BrYCUcZF.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";import"./NcNoteCard-CVhtNL04-hwuc093N.chunk.mjs";import"./mdi-D55n0uzy.chunk.mjs";import"./NcPasswordField-djttkA5Q-2g87vOpY.chunk.mjs";import"./NcInputField-Bwsh2aHY-CHbAfY0u.chunk.mjs";const O='<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>',R='<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 H(e){return e.status===void 0||e.status===a.Success?!1:e.userProvided||e.authMechanism==="password::global::user"}function C(e){if(e.type===E.File)return!1;const t=e.attributes;return!t.scope||!t.backend?!1:t.scope==="personal"||t.scope==="system"}P(l);async function F(e,t,n){const r=(await l.request({method:"PUT",url:m("apps/files_external/userglobalstorages/{id}",{id:e.attributes.id}),confirmPassword:k.Strict,data:{backendOptions:{user:t,password:n}}})).data;return r.status!==a.Success?(b(s("files_external","Unable to update this external storage config. {statusMessage}",{statusMessage:r?.statusMessage||""})),null):(_(s("files_external","New configuration successfully saved")),e.attributes.config=r,y("files:node:updated",e),!0)}const U="credentials-external-storage",$=new f({id:U,displayName:()=>s("files","Enter missing credentials"),iconSvgInline:()=>R,enabled:({nodes:e})=>{if(e.length!==1||!e[0])return!1;const t=e[0];if(!C(t))return!1;const n=t.attributes?.config||{};return!!H(n)},async exec({nodes:e}){const{login:t,password:n}=await T(I(()=>L(()=>import("./CredentialsDialog-DRqXEuS4.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url)))??{};if(t&&n)try{await F(e[0],t,n),_(s("files_external","Credentials successfully set"))}catch(r){b(s("files_external","Error while setting credentials: {error}",{error:r.message}))}return null},order:-1e3,default:x.DEFAULT,inline:()=>!0}),B='<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/${u()?.uid}`;function Z(e){const t=(e.path+"/"+e.name).replace(/^\//gm,"");return new h({id:e.id,source:v("dav"+o+"/"+t),root:o,owner:u()?.uid||null,permissions:e.config.status!==a.Success?d.NONE:e?.permissions||d.READ,attributes:{displayName:t,...e}})}async function j(){const e=(await l.get(D("apps/files_external/api/v1/mounts"))).data.ocs.data.map(Z);return{folder:new h({id:0,source:v("dav"+o),root:o,owner:u()?.uid||null,permissions:d.READ}),contents:e}}function q(e,t=!0){const n=t?"userglobalstorages":"userstorages";return l.get(m(`apps/files_external/${n}/${e}?testOnly=false`))}const W=new f({id:"check-external-storage",displayName:()=>"",iconSvgInline:()=>"",enabled:({nodes:e})=>e.every(t=>C(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 q(t.attributes.id,t.attributes.scope==="system");if(r=i,t.attributes.config=r,y("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&&A(s("files_external","We were unable to check the external storage {basename}",{basename:t.basename})),n.innerHTML="";const g=r?H(r):!1,p=document.createElement("span");p.classList.add(`files-list__row-status--${g?"warning":"error"}`),g||(n.innerHTML=B,n.title=i.message),n.prepend(p)}return n},order:10}),Y=new f({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 N({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=u()?.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}),z=S("files_external","allowUserMounting",!1),G=V();G.register(new M({id:"extstoragemounts",name:s("files_external","External storage"),caption:s("files_external","List of external storage."),emptyCaption:z?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:O,order:30,columns:[new w({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 w({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:j})),c($),c(W),c(Y);
|
||
//# sourceMappingURL=files_external-init.mjs.map
|