nextcloud/dist/encryption-settings_personal.mjs
nextcloud-command 16592b9f73 chore(assets): Recompile assets
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2026-02-28 19:57:23 +00:00

2 lines
5.2 KiB
JavaScript

import{f as b,v as F,o as l,c as N,h as v,w as m,g as u,u as e,j as f,t as g,e as h,H as x,r as p,q as j,s as I,k as z}from"./runtime-dom.esm-bundler-DIF-dmiV.chunk.mjs";import{c as w,i as U}from"./index-D0gj0nne.chunk.mjs";import{a as S,c as B,b as K}from"./index-C1xmmKTZ-D5oZDAAj.chunk.mjs";import{l as R}from"./index-Ma7sfat2.chunk.mjs";import{t}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import{g as k}from"./createElementId-DhjFt1I9-DmxdOxki.chunk.mjs";import{N as V}from"./mdi-LZKofHvu.chunk.mjs";import{N as q}from"./ContentCopy-FlPcmQnb.chunk.mjs";import"./PencilOutline-CaufIfvV.chunk.mjs";import"./index-BJZCBgSE.chunk.mjs";import"./NcBreadcrumbs-5gl8Syfa-_CkkmbDD.chunk.mjs";import"./NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-DCYCyTiK.chunk.mjs";import{w as C}from"./NcModal-DHryP_87-DTKTujA6.chunk.mjs";import"./NcAvatar-C9d7Wrc8-DQEQ3PqU.chunk.mjs";import"./NcContent-O-bMKi-3-DtmBDm0W.chunk.mjs";import{N as T}from"./autolink-U5pBzLgI-DPNCkNxB.chunk.mjs";import"./Web-D7kU0XCu.chunk.mjs";import"./index-Bndk0DrU.chunk.mjs";import{N as H}from"./NcCheckboxRadioSwitch-BMsPx74L-CnVoVoz9.chunk.mjs";import"./Plus-fUY_fiSE.chunk.mjs";import"./NcColorPicker-DDHxR-iN-BOhWUwld.chunk.mjs";import"./TrayArrowDown-CSxQ3T_x.chunk.mjs";import"./index-BIuNq36J.chunk.mjs";import"./NcSelect-DLheQ2yp-C6fHgfXd.chunk.mjs";import"./NcEmojiPicker-Djc9a0gw-Cs_klLi0.chunk.mjs";import"./NcEmptyContent-B8-90BSI-1y2HcWGh.chunk.mjs";import"./NcRichText-DJlaHs_Q-5ZQTmfxg.chunk.mjs";import{N as M,I as E,l as O}from"./types-D2N8JdWQ.chunk.mjs";/* empty css */import"./NcInputField-o5OFv3z6-vgXJNqqQ.chunk.mjs";import{N as _}from"./NcPasswordField-uaMO2pdt-3LVTs_hE.chunk.mjs";import"./TrashCanOutline-B5JNH7nQ.chunk.mjs";import"./index-DmA6R0rP.chunk.mjs";import"./NcUserBubble-vOAXLHB5-BLt6cX5g.chunk.mjs";import"./NcUserStatusIcon-XiwrgeCm-CnAxKXWQ.chunk.mjs";import"./colors-BHGKZFDI-mDrpd0b8.chunk.mjs";import"./index-sH3U_332.chunk.mjs";const Y=b({__name:"SettingsPersonalChangePrivateKey",props:{recoveryEnabledForUser:{type:Boolean}},emits:["updated"],setup(c,{emit:a}){const s=a,i=F("form"),r=p(!1),o=p(!1),n=p(""),y=p("");async function P(){if(!r.value){r.value=!0,o.value=!1;try{await w.post(k("/apps/encryption/ajax/updatePrivateKeyPassword"),{oldPassword:n.value,newPassword:y.value}),n.value=y.value="",i.value?.reset(),s("updated")}catch(d){U(d)&&d.response&&d.response.data?.data?.message&&S(d.response.data.data.message),o.value=!0}finally{r.value=!1}}}return(d,J)=>(l(),N("form",{ref:"form",onSubmit:x(P,["prevent"])},[v(e(M),{label:e(t)("encryption","Update private key password"),description:e(t)("encryption","Your private key password no longer matches your log-in password. Set your old private key password to your current log-in password.")},{default:m(()=>[c.recoveryEnabledForUser?(l(),u(e(V),{key:0},{default:m(()=>[f(g(e(t)("encryption","If you do not remember your old password you can ask your administrator to recover your files.")),1)]),_:1})):h("",!0),v(e(_),{label:e(t)("encryption","Old log-in password")},null,8,["label"]),v(e(_),{label:e(t)("encryption","Current log-in password")},null,8,["label"]),v(e(T),{type:"submit",variant:"primary"},{default:m(()=>[f(g(e(t)("encryption","Update")),1)]),_:1})]),_:1},8,["label","description"])],544))}}),A=b({__name:"SettingsPersonalEnableRecovery",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(c){const a=j(c,"modelValue"),s=p(!1);return I(a,()=>{s.value=!0}),C([a],async([i],[r])=>{if(i===r){s.value=!1;return}const o=B(t("encryption","Updating recovery keys. This can take some time…"));try{await w.post(k("/apps/encryption/ajax/userSetRecovery"),{userEnableRecovery:a.value})}catch(n){a.value=r,U(n)&&n.response&&n.response.data?.data?.message&&S(n.response.data.data.message)}finally{o.hideToast(),s.value=!1}},{debounce:800}),(i,r)=>(l(),u(e(H),{modelValue:a.value,"onUpdate:modelValue":r[0]||(r[0]=o=>a.value=o),type:"switch",loading:s.value,description:e(t)("encryption","Enabling this option will allow you to reobtain access to your encrypted files in case of password loss")},{default:m(()=>[f(g(e(t)("encryption","Enable password recovery")),1)]),_:1},8,["modelValue","loading","description"]))}}),D=b({__name:"SettingsPersonal",setup(c){const a=R("encryption","personalSettings"),s=p(a.initialized),i=p(a.recoveryEnabledForUser);async function r(){try{const{data:o}=await w.get(k("/apps/encryption/ajax/getStatus"));s.value=o.initStatus,o.data.message&&K(o.data.message)}catch(o){O.error("Failed to fetch current encryption status",{error:o})}}return(o,n)=>(l(),u(e(q),{name:e(t)("encryption","Basic encryption module")},{default:m(()=>[s.value===e(E).NotInitialized?(l(),u(e(V),{key:0,type:"warning"},{default:m(()=>[f(g(e(t)("encryption","Encryption app is enabled but your keys are not initialized, please log-out and log-in again")),1)]),_:1})):s.value===e(E).InitExecuted?(l(),u(Y,{key:1,recoveryEnabledForUser:i.value,onUpdated:r},null,8,["recoveryEnabledForUser"])):e(a).recoveryEnabled&&e(a).privateKeySet?(l(),u(A,{key:2,modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=y=>i.value=y)},null,8,["modelValue"])):h("",!0)]),_:1},8,["name"]))}}),G=z(D);G.mount("#encryption-settings-section");
//# sourceMappingURL=encryption-settings_personal.mjs.map