mirror of
https://github.com/nextcloud/server.git
synced 2026-03-09 01:40:53 -04:00
3 lines
8.2 KiB
JavaScript
3 lines
8.2 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('', '', 'dist/CredentialsDialog-CbO2pMBh.chunk.mjs'),window.OC.filePath('', '', 'dist/translation-DoG5ZELJ-Bni_xMHF.chunk.mjs'),window.OC.filePath('', '', 'dist/index-Bndk0DrU.chunk.mjs'),window.OC.filePath('', '', 'dist/index-CezD717V.chunk.mjs'),window.OC.filePath('', '', 'dist/runtime-dom.esm-bundler-Bpt0bWgp.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9-COdYgGCC.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9-C_oBIsvc.chunk.css'),window.OC.filePath('', '', 'dist/logger-D3RVzcfQ-DhmPs7Vh.chunk.mjs'),window.OC.filePath('', '', 'dist/logger-D3RVzcfQ-C6IbiOqD.chunk.css'),window.OC.filePath('', '', 'dist/mdi-0dI0vmBh.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-Df11KHe2.chunk.mjs'),window.OC.filePath('', '', 'dist/NcNoteCard-Cok_4Fld-Jq77EThs.chunk.css'),window.OC.filePath('', '', 'dist/NcPasswordField-DYF18Cdo-BbpNSGg_.chunk.mjs'),window.OC.filePath('', '', 'dist/index-DNyFZ0q1.chunk.mjs'),window.OC.filePath('', '', 'dist/string_decoder-BO00msnV.chunk.mjs'),window.OC.filePath('', '', 'dist/index-xFugdZPW.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-tt_Gi9ja-81wMHLk1.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-tt_Gi9ja-CVgD0Z-G.chunk.css'),window.OC.filePath('', '', 'dist/NcPasswordField-DYF18Cdo-DxPSRxK-.chunk.css'),window.OC.filePath('', '', 'dist/TrashCanOutline-BwjpsJlQ.chunk.mjs')])))=>i.map(i=>d[i]);
|
||
import{F as m,D as x,g as E,V,C as w,c}from"./index-CW_b-FTi.chunk.mjs";import{_ as M,l as L}from"./index-xFugdZPW.chunk.mjs";import{t as s}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{c as l}from"./index-DNyFZ0q1.chunk.mjs";import{d as h,a as _,s as S,e as T}from"./index-JpgrUA2Z-Btt9G24P.chunk.mjs";import{e as b,a as u}from"./index-Bndk0DrU.chunk.mjs";import{a as A,P as N}from"./index-BtP4usxU.chunk.mjs";import{g as f,b as P,f as y}from"./createElementId-DhjFt1I9-COdYgGCC.chunk.mjs";import{s as k}from"./index-CezD717V.chunk.mjs";import{S as a}from"./types-C3MFFrct.chunk.mjs";import{F as D,b as v,P as d}from"./folder-CeyZUHai-D6Yi8ym-.chunk.mjs";import{a as I}from"./runtime-dom.esm-bundler-Bpt0bWgp.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";import"./NcNoteCard-Cok_4Fld-Df11KHe2.chunk.mjs";import"./logger-D3RVzcfQ-DhmPs7Vh.chunk.mjs";import"./NcPasswordField-DYF18Cdo-BbpNSGg_.chunk.mjs";import"./NcInputField-tt_Gi9ja-81wMHLk1.chunk.mjs";import"./mdi-0dI0vmBh.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>',F='<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===D.File)return!1;const t=e.attributes;return!t.scope||!t.backend?!1:t.scope==="personal"||t.scope==="system"}A(l);async function R(e,t,n){const r=(await l.request({method:"PUT",url:f("apps/files_external/userglobalstorages/{id}",{id:e.attributes.id}),confirmPassword:N.Strict,data:{backendOptions:{user:t,password:n}}})).data;return r.status!==a.Success?(_(s("files_external","Unable to update this external storage config. {statusMessage}",{statusMessage:r?.statusMessage||""})),null):(h(s("files_external","New configuration successfully saved")),e.attributes.config=r,b("files:node:updated",e),!0)}const U="credentials-external-storage",$=new m({id:U,displayName:()=>s("files","Enter missing credentials"),iconSvgInline:()=>F,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 k(I(()=>M(()=>import("./CredentialsDialog-CbO2pMBh.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),h(s("files_external","Credentials successfully set"))}catch(r){_(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 v({id:e.id,source:y("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(P("apps/files_external/api/v1/mounts"))).data.ocs.data.map(Z);return{folder:new v({id:0,source:y("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(f(`apps/files_external/${n}/${e}?testOnly=false`))}const W=new m({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,b("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&&S(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 m({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 T({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=f(`/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=L("files_external","allowUserMounting",!1),G=E();G.register(new V({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
|