nextcloud-server/dist/sharebymail-admin-settings.mjs

3 lines
2.0 KiB
JavaScript

import{_ as u,N as b,r as l,c as w,o as f,w as i,a as d,b as p,t as m,g,d as S,e as c,l as h,f as I}from"./TrayArrowDown-sRwZP_WA.chunk.mjs";import{s as M}from"./Plus-DDsJI2iW.chunk.mjs";import{c as k}from"./index-Dqjjhtll.chunk.mjs";import{N}from"./ContentCopy-BEfKgtZW.chunk.mjs";import{g as R}from"./TrashCanOutline-avc1vI9P.chunk.mjs";const T=R().detectLogLevel().setApp("sharebymail").build(),V={name:"AdminSettings",components:{NcCheckboxRadioSwitch:N,NcSettingsSection:b},setup(){return{t:c}},data(){return{sendPasswordMail:h("sharebymail","sendPasswordMail"),replyToInitiator:h("sharebymail","replyToInitiator")}},watch:{sendPasswordMail(e){this.update("sendpasswordmail",e)},replyToInitiator(e){this.update("replyToInitiator",e)}},methods:{async update(e,a){await k();const o=g("/apps/provisioning_api/api/v1/config/apps/{appId}/{key}",{appId:"sharebymail",key:e}),t=a?"yes":"no";try{const{data:s}=await S.post(o,{value:t});this.handleResponse({status:s.ocs?.meta?.status})}catch(s){this.handleResponse({errorMessage:c("sharebymail","Unable to update share by mail config"),error:s})}},async handleResponse({status:e,errorMessage:a,error:o}){e!=="ok"&&(M(a),T.error(a,{error:o}))}}};function v(e,a,o,t,s,x){const n=l("NcCheckboxRadioSwitch"),y=l("NcSettingsSection");return f(),w(y,{name:t.t("sharebymail","Share by mail"),description:t.t("sharebymail","Allows people to share a personalized link to a file or folder by putting in an email address.")},{default:i(()=>[d(n,{modelValue:s.sendPasswordMail,"onUpdate:modelValue":a[0]||(a[0]=r=>s.sendPasswordMail=r),type:"switch"},{default:i(()=>[p(m(t.t("sharebymail","Send password by mail")),1)]),_:1},8,["modelValue"]),d(n,{modelValue:s.replyToInitiator,"onUpdate:modelValue":a[1]||(a[1]=r=>s.replyToInitiator=r),type:"switch"},{default:i(()=>[p(m(t.t("sharebymail","Reply to initiator")),1)]),_:1},8,["modelValue"])]),_:1},8,["name","description"])}const P=u(V,[["render",v]]),_=I(P);_.mount("#vue-admin-sharebymail");
//# sourceMappingURL=sharebymail-admin-settings.mjs.map