nextcloud/dist/encryption-settings_personal.mjs
Ferdinand Thiessen a623bffb00
chore: compile assets
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-01-14 10:27:02 +01:00

2 lines
4.9 KiB
JavaScript

import{b,v as x,r as l,j as N,o as p,e as v,w as d,c as u,l as E,u as e,g as f,t as g,H as j,q as F,s as I,h as z}from"./runtime-dom.esm-bundler-BrYCUcZF.chunk.mjs";import{c as w,i as S}from"./index-BfylblLb.chunk.mjs";import{a as U,w as B,d as K,c as R}from"./index-JpgrUA2Z-BFiKKJ1W.chunk.mjs";import{l as q}from"./index-xFugdZPW.chunk.mjs";import{t as r}from"./translation-DoG5ZELJ-gw0g4US-.chunk.mjs";import{g as _}from"./createElementId-DhjFt1I9--Zqj3wLs.chunk.mjs";import{N as V,c as C}from"./NcNoteCard-CVhtNL04-hwuc093N.chunk.mjs";import{N as T}from"./ContentCopy-DVkZwwZt.chunk.mjs";import"./NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-CAvY10OW.chunk.mjs";import"./index-DZnagzmP.chunk.mjs";import"./NcBreadcrumbs-DYfGaSjT-DHeGymVL.chunk.mjs";import"./NcAvatar-DmUGApWA-DBHt6M62.chunk.mjs";import"./NcRichText-CBMtJzE_-bvZFA37H.chunk.mjs";import"./mdi-D55n0uzy.chunk.mjs";import"./index-6_gsQFyp.chunk.mjs";import{N as H}from"./NcCheckboxRadioSwitch-BCSKF7Tk-yPckcGKs.chunk.mjs";import"./NcColorPicker-Kc0JqRtp-VtydDeG1.chunk.mjs";import"./TrayArrowDown-DV7s2Yis.chunk.mjs";import"./NcSelect-Czzsi3P_-DLFUGW7z.chunk.mjs";import"./NcEmojiPicker-pM4Pg2yq-C_Dpe77I.chunk.mjs";import"./index-BZk0T9Q-.chunk.mjs";import{N as M,I as h,l as O}from"./types-C3HF-oQj.chunk.mjs";/* empty css */import"./NcInputField-Bwsh2aHY-CHbAfY0u.chunk.mjs";import{N as k}from"./NcPasswordField-djttkA5Q-2g87vOpY.chunk.mjs";import"./TrashCanOutline-CvWRJ8GE.chunk.mjs";import"./NcUserBubble-DPAmU2_J-BCvWAzcB.chunk.mjs";import"./PencilOutline-DCq8EKwg.chunk.mjs";import"./colors-Go3zmZRD-DU6ImAGi.chunk.mjs";import"./string_decoder-BO00msnV.chunk.mjs";const Y=b({__name:"SettingsPersonalChangePrivateKey",props:{recoveryEnabledForUser:{type:Boolean}},emits:["updated"],setup(c,{emit:a}){const s=a,i=x("form"),t=l(!1),o=l(!1),n=l(""),y=l("");async function P(){if(!t.value){t.value=!0,o.value=!1;try{await w.post(_("/apps/encryption/ajax/updatePrivateKeyPassword"),{oldPassword:n.value,newPassword:y.value}),n.value=y.value="",i.value?.reset(),s("updated")}catch(m){S(m)&&m.response&&m.response.data?.data?.message&&U(m.response.data.data.message),o.value=!0}finally{t.value=!1}}}return(m,J)=>(p(),N("form",{ref:"form",onSubmit:j(P,["prevent"])},[v(e(M),{label:e(r)("encryption","Update private key password"),description:e(r)("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:d(()=>[c.recoveryEnabledForUser?(p(),u(e(V),{key:0},{default:d(()=>[f(g(e(r)("encryption","If you do not remember your old password you can ask your administrator to recover your files.")),1)]),_:1})):E("",!0),v(e(k),{label:e(r)("encryption","Old log-in password")},null,8,["label"]),v(e(k),{label:e(r)("encryption","Current log-in password")},null,8,["label"]),v(e(C),{type:"submit",variant:"primary"},{default:d(()=>[f(g(e(r)("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=F(c,"modelValue"),s=l(!1);return I(a,()=>{s.value=!0}),B([a],async([i],[t])=>{if(i===t){s.value=!1;return}const o=K(r("encryption","Updating recovery keys. This can take some time…"));try{await w.post(_("/apps/encryption/ajax/userSetRecovery"),{userEnableRecovery:a.value})}catch(n){a.value=t,S(n)&&n.response&&n.response.data?.data?.message&&U(n.response.data.data.message)}finally{o.hideToast(),s.value=!1}},{debounce:800}),(i,t)=>(p(),u(e(H),{modelValue:a.value,"onUpdate:modelValue":t[0]||(t[0]=o=>a.value=o),type:"switch",loading:s.value,description:e(r)("encryption","Enabling this option will allow you to reobtain access to your encrypted files in case of password loss")},{default:d(()=>[f(g(e(r)("encryption","Enable password recovery")),1)]),_:1},8,["modelValue","loading","description"]))}}),D=b({__name:"SettingsPersonal",setup(c){const a=q("encryption","personalSettings"),s=l(a.initialized),i=l(a.recoveryEnabledForUser);async function t(){try{const{data:o}=await w.get(_("/apps/encryption/ajax/getStatus"));s.value=o.initStatus,o.data.message&&R(o.data.message)}catch(o){O.error("Failed to fetch current encryption status",{error:o})}}return(o,n)=>(p(),u(e(T),{name:e(r)("encryption","Basic encryption module")},{default:d(()=>[s.value===e(h).NotInitialized?(p(),u(e(V),{key:0,type:"warning"},{default:d(()=>[f(g(e(r)("encryption","Encryption app is enabled but your keys are not initialized, please log-out and log-in again")),1)]),_:1})):s.value===e(h).InitExecuted?(p(),u(Y,{key:1,"recovery-enabled-for-user":i.value,onUpdated:t},null,8,["recovery-enabled-for-user"])):e(a).recoveryEnabled&&e(a).privateKeySet?(p(),u(A,{key:2,modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=y=>i.value=y)},null,8,["modelValue"])):E("",!0)]),_:1},8,["name"]))}}),G=z(D);G.mount("#encryption-settings-section");
//# sourceMappingURL=encryption-settings_personal.mjs.map