Files
nextcloud-server/dist/federatedfilesharing-init-files.mjs
nextcloud-command 78098c8325 chore(assets): Recompile assets
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2026-04-01 13:41:02 +00:00

3 lines
3.8 KiB
JavaScript

import{c as d,i as _}from"./index-ClciYKp3.chunk.mjs";import{b as y,a as u}from"./index-C1xmmKTZ-CmvjJKkk.chunk.mjs";import{s as b,b as m}from"./index-Bp9-GhMo.chunk.mjs";import{_ as R,l as D}from"./public-CvthP4YJ.chunk.mjs";import{t}from"./translation-DoG5ZELJ-DJHEP2RB.chunk.mjs";import{N as v,s as S}from"./NcDialog-nDc1gW50-CpnK8gUQ.chunk.mjs";import{N as F}from"./NcPasswordField-BOLzDHBJ-DvzsiWPp.chunk.mjs";import{b as O,o as f,c as h,w as k,g as C,t as P,u as i,F as q,h as x,l as N,D as E}from"./preload-helper-DoJVKVMq.chunk.mjs";import{l as M}from"./logger-BKNNYSvV.chunk.mjs";import"./util-Caafb9Jl.chunk.mjs";import"./NcIconSvgWrapper-De-2-ukl-CcvQeIAt.chunk.mjs";import"./TrashCanOutline-D66Xz3gd.chunk.mjs";import"./mdi-BUoBIgaz.chunk.mjs";import"./NcModal-kyWZ3UFC-BxKwwKAq.chunk.mjs";import"./Web-rJva_rmF.chunk.mjs";import"./NcInputField-CPL-a_MM-DHVwy56P.chunk.mjs";const T=O({__name:"RemoteShareDialog",props:{name:{},owner:{},remote:{},passwordRequired:{type:Boolean}},emits:["close"],setup(e,{emit:r}){const s=e,a=r,o=N(""),n=E(()=>[{label:t("federatedfilesharing","Cancel"),callback:()=>a("close",!1)},{label:t("federatedfilesharing","Add remote share"),type:s.passwordRequired?"submit":void 0,variant:"primary",callback:()=>a("close",!0,o.value)}]);return(p,l)=>(f(),h(i(v),{buttons:n.value,isForm:e.passwordRequired,name:i(t)("federatedfilesharing","Remote share"),onSubmit:l[1]||(l[1]=w=>a("close",!0,o.value))},{default:k(()=>[C("p",null,P(i(t)("federatedfilesharing","Do you want to add the remote share {name} from {owner}@{remote}?",{name:e.name,owner:e.owner,remote:e.remote})),1),e.passwordRequired?(f(),h(i(F),{key:0,modelValue:o.value,"onUpdate:modelValue":l[0]||(l[0]=w=>o.value=w),class:q(p.$style.remoteShareDialog__password),label:i(t)("federatedfilesharing","Remote share password")},null,8,["modelValue","class","label"])):x("",!0)]),_:1},8,["buttons","isForm","name"]))}}),U="_remoteShareDialog__password_1ccpy_2",V={remoteShareDialog__password:U},$={$style:V},j=R(T,[["__cssModules",$]]);async function I(e,r,s,a=!1){const[o,n]=await S(j,{name:e,owner:r,remote:s,passwordRequired:a});if(a&&o)return n;if(!o)throw new Error("Dialog was cancelled")}window.addEventListener("DOMContentLoaded",()=>{L(),D("federatedfilesharing","notificationsEnabled",!0)!==!0&&A(),b("notifications:action:executed",({action:e,notification:r})=>{r.app==="files_sharing"&&r.object_type==="remote_share"&&e.type==="POST"&&c()})});function c(){if(!window?.OCP?.Files?.Router?.goToRoute){window.location.reload();return}window.OCP.Files.Router.goToRoute(null,{...window.OCP.Files.Router.params,fileid:void 0},{...window.OCP.Files.Router.query,dir:"/",openfile:void 0})}function L(){const e=window.OC.Util.History.parseUrlQuery();if(e.remote&&e.token&&e.name){const r=(s,a)=>{s!==!1&&d.post(m("apps/federatedfilesharing/askForFederatedShare"),{remote:a.remote,token:a.token,owner:a.owner,ownerDisplayName:a.ownerDisplayName||a.owner,name:a.name,password:a.password||""}).then(({data:o})=>{Object.hasOwn(o,"legacyMount")?c():y(o.message)}).catch(o=>{M.error("Error while processing incoming share",{error:o}),_(o)&&o.response.data.message?u(o.response.data.message):u(t("federatedfilesharing","Incoming share could not be processed"))})};location.hash="",e.passwordProtected=parseInt(e.protected,10)===1,g(e,e.passwordProtected,r)}}async function A(){const{data:e}=await d.get(m("/apps/files_sharing/api/externalShares"));for(let r=0;r<e.length;++r)g(e[r],!1,function(s,a){s===!1?d.delete(m("/apps/files_sharing/api/externalShares/"+a.id)):d.post(m("/apps/files_sharing/api/externalShares"),{id:a.id}).then(()=>c())})}function g(e,r,s){const a=e.ownerDisplayName||e.owner,o=e.name,n=e.remote.replace(/^https?:\/\//,"").replace(/\/$/,"");I(o,a,n,r).then(p=>s(!0,{...e,password:p})).catch(()=>s(!1,e))}
//# sourceMappingURL=federatedfilesharing-init-files.mjs.map