nextcloud-server/dist/federatedfilesharing-settin...

3 lines
6.5 KiB
JavaScript

import{h as V,l as s,A as U,g as G,d as T,e,c as g,o as c,w as i,a as f,m as v,k as h,u as a,b as u,t as l,N as x,_ as C,f as D}from"./TrayArrowDown-sRwZP_WA.chunk.mjs";import{s as m,c as b}from"./Plus-DDsJI2iW.chunk.mjs";import{c as I}from"./index-Dqjjhtll.chunk.mjs";import{N as p}from"./ContentCopy-BEfKgtZW.chunk.mjs";import{l as S}from"./logger-Cu5Dvow_.chunk.mjs";import"./modulepreload-polyfill-BxzAKjcf.chunk.mjs";import"./TrashCanOutline-avc1vI9P.chunk.mjs";const j={class:"settings-subsection"},q={class:"settings-subsection__name"},F=V({__name:"AdminSettings",setup(R){const E=s("federatedfilesharing","sharingFederatedDocUrl"),y=new Proxy({outgoingServer2serverShareEnabled:[s("federatedfilesharing","outgoingServer2serverShareEnabled"),"outgoing_server2server_share_enabled"],incomingServer2serverShareEnabled:[s("federatedfilesharing","incomingServer2serverShareEnabled"),"incoming_server2server_share_enabled"],outgoingServer2serverGroupShareEnabled:[s("federatedfilesharing","outgoingServer2serverGroupShareEnabled"),"outgoing_server2server_group_share_enabled"],incomingServer2serverGroupShareEnabled:[s("federatedfilesharing","incomingServer2serverGroupShareEnabled"),"incoming_server2server_group_share_enabled"],federatedGroupSharingSupported:[s("federatedfilesharing","federatedGroupSharingSupported"),"federated_group_sharing_supported"],federatedTrustedShareAutoAccept:[s("federatedfilesharing","federatedTrustedShareAutoAccept"),"federatedTrustedShareAutoAccept"],lookupServerEnabled:[s("federatedfilesharing","lookupServerEnabled"),"lookupServerEnabled"],lookupServerUploadEnabled:[s("federatedfilesharing","lookupServerUploadEnabled"),"lookupServerUploadEnabled"]},{get(t,d){return t[d]?.[0]},set(t,d,o){return d in t?(t[d][0]=o,k(t[d][1],o),!0):!1}}),r=U(y);async function _(t){if(t===!1)return r.lookupServerUploadEnabled=!1;await b({name:e("federatedfilesharing","Confirm data upload to lookup server"),text:e("federatedfilesharing",'When enabled, all account properties (e.g. email address) with scope visibility set to "published", will be automatically synced and transmitted to an external system and made available in a public, global address book.'),labelConfirm:e("federatedfilesharing","Enable data upload"),labelReject:e("federatedfilesharing","Disable upload"),severity:"warning"}).then(()=>{r.lookupServerUploadEnabled=!0}).catch(()=>{r.lookupServerUploadEnabled=!1})}async function w(t){if(t===!1)return r.lookupServerEnabled=!1;await b({name:e("federatedfilesharing","Confirm querying lookup server"),text:e("federatedfilesharing","When enabled, the search input when creating shares will be sent to an external system that provides a public and global address book.")+e("federatedfilesharing","This is used to retrieve the federated cloud ID to make federated sharing easier.")+e("federatedfilesharing","Moreover, email addresses of users might be sent to that system in order to verify them."),labelConfirm:e("federatedfilesharing","Enable querying"),labelReject:e("federatedfilesharing","Disable querying"),severity:"warning"}).then(()=>{r.lookupServerEnabled=!0}).catch(()=>{r.lookupServerEnabled=!1})}async function k(t,d){await I();const o=G("/apps/provisioning_api/api/v1/config/apps/{appId}/{key}",{appId:"files_sharing",key:t}),A=d?"yes":"no";try{const{data:n}=await T.post(o,{value:A});if(n.ocs.meta.status!=="ok")if(n.ocs.meta.message)m(n.ocs.meta.message),S.error("Error updating federated files sharing config",{error:n.ocs});else throw new Error(`Failed to update federatedfilesharing config, ${n.ocs.meta.statuscode}`)}catch(n){S.error("Error updating federated files sharing config",{error:n}),m(e("federatedfilesharing","Unable to update federated files sharing config"))}}return(t,d)=>(c(),g(a(x),{name:a(e)("federatedfilesharing","Federated Cloud Sharing"),description:a(e)("federatedfilesharing","Adjust how people can share between servers. This includes shares between people on this server as well if they are using federated sharing."),"doc-url":a(E)},{default:i(()=>[f(a(p),{modelValue:r.outgoingServer2serverShareEnabled,"onUpdate:modelValue":d[0]||(d[0]=o=>r.outgoingServer2serverShareEnabled=o),type:"switch"},{default:i(()=>[u(l(a(e)("federatedfilesharing","Allow people on this server to send shares to other servers (this option also allows WebDAV access to public shares)")),1)]),_:1},8,["modelValue"]),f(a(p),{modelValue:r.incomingServer2serverShareEnabled,"onUpdate:modelValue":d[1]||(d[1]=o=>r.incomingServer2serverShareEnabled=o),type:"switch"},{default:i(()=>[u(l(a(e)("federatedfilesharing","Allow people on this server to receive shares from other servers")),1)]),_:1},8,["modelValue"]),r.federatedGroupSharingSupported?(c(),g(a(p),{key:0,modelValue:r.outgoingServer2serverGroupShareEnabled,"onUpdate:modelValue":d[2]||(d[2]=o=>r.outgoingServer2serverGroupShareEnabled=o),type:"switch"},{default:i(()=>[u(l(a(e)("federatedfilesharing","Allow people on this server to send shares to groups on other servers")),1)]),_:1},8,["modelValue"])):v("",!0),r.federatedGroupSharingSupported?(c(),g(a(p),{key:1,modelValue:r.incomingServer2serverGroupShareEnabled,"onUpdate:modelValue":d[3]||(d[3]=o=>r.incomingServer2serverGroupShareEnabled=o),type:"switch"},{default:i(()=>[u(l(a(e)("federatedfilesharing","Allow people on this server to receive group shares from other servers")),1)]),_:1},8,["modelValue"])):v("",!0),h("fieldset",null,[h("legend",null,l(a(e)("federatedfilesharing","The lookup server is only available for global scale.")),1),f(a(p),{type:"switch","model-value":r.lookupServerEnabled,disabled:"","onUpdate:modelValue":w},{default:i(()=>[u(l(a(e)("federatedfilesharing","Search global and public address book for people")),1)]),_:1},8,["model-value"]),f(a(p),{type:"switch","model-value":r.lookupServerUploadEnabled,disabled:"","onUpdate:modelValue":_},{default:i(()=>[u(l(a(e)("federatedfilesharing","Allow people to publish their data to a global and public address book")),1)]),_:1},8,["model-value"])]),h("div",j,[h("h3",q,l(a(e)("federatedfilesharing","Trusted federation")),1),f(a(p),{modelValue:r.federatedTrustedShareAutoAccept,"onUpdate:modelValue":d[4]||(d[4]=o=>r.federatedTrustedShareAutoAccept=o),type:"switch"},{default:i(()=>[u(l(a(e)("federatedfilesharing","Automatically accept shares from trusted federated accounts and groups by default")),1)]),_:1},8,["modelValue"])])]),_:1},8,["name","description","doc-url"]))}}),W=C(F,[["__scopeId","data-v-5ef41235"]]),N=s("federatedfilesharing","internalOnly",!1);N||D(W).mount("#vue-admin-federated");
//# sourceMappingURL=federatedfilesharing-settings-admin.mjs.map