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

3 lines
1.9 KiB
JavaScript

import{_ as u,N as b,a as w,r as l,c as f,o as g,w as r,b as d,d as p,t as m,v as S,e as I,f as c,l as h,g as M}from"./NcSettingsSection-DFav6ob5-DwBgvX10.chunk.mjs";import{g as k,s as v}from"./check-JUc8IOXP.chunk.mjs";import{c as R}from"./index-OdkWN6SR.chunk.mjs";const T=k().detectLogLevel().setApp("sharebymail").build(),V={name:"AdminSettings",components:{NcCheckboxRadioSwitch:w,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 R();const o=S("/apps/provisioning_api/api/v1/config/apps/{appId}/{key}",{appId:"sharebymail",key:e}),t=a?"yes":"no";try{const{data:s}=await I.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"&&(v(a),T.error(a,{error:o}))}}};function N(e,a,o,t,s,x){const n=l("NcCheckboxRadioSwitch"),y=l("NcSettingsSection");return g(),f(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:r(()=>[d(n,{modelValue:s.sendPasswordMail,"onUpdate:modelValue":a[0]||(a[0]=i=>s.sendPasswordMail=i),type:"switch"},{default:r(()=>[p(m(t.t("sharebymail","Send password by mail")),1)]),_:1},8,["modelValue"]),d(n,{modelValue:s.replyToInitiator,"onUpdate:modelValue":a[1]||(a[1]=i=>s.replyToInitiator=i),type:"switch"},{default:r(()=>[p(m(t.t("sharebymail","Reply to initiator")),1)]),_:1},8,["modelValue"])]),_:1},8,["name","description"])}const P=u(V,[["render",N]]),_=M(P);_.mount("#vue-admin-sharebymail");
//# sourceMappingURL=sharebymail-admin-settings.mjs.map