nextcloud/dist/encryption-settings_personal.mjs
Julien Veyssier 9464eabad7
chore(assets): compile assets
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2026-02-23 15:30:43 +01:00

2 lines
5.2 KiB
JavaScript

import{f as b,x,c as F,o as l,h as v,w as m,g as u,e as h,u as e,j as f,t as g,H as N,r as p,s as j,v as I,k as z}from"./runtime-dom.esm-bundler-w0tDt7Gi.chunk.mjs";import{c as w,i as U}from"./index-2HC-5o-4.chunk.mjs";import{a as S,c as B,b as K}from"./index-C1xmmKTZ-zpf0CQaW.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-B1fq6aa1.chunk.mjs";import{N as V}from"./mdi-YPhQfxXZ.chunk.mjs";import{N as C}from"./ContentCopy-CgZpiJBj.chunk.mjs";import"./PencilOutline-DDvj_Sz4.chunk.mjs";import"./index-YJDZtAE3.chunk.mjs";import"./NcBreadcrumbs-5gl8Syfa-DFvZelfE.chunk.mjs";import"./NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-DGMMvskr.chunk.mjs";import{w as T}from"./NcModal-DHryP_87-BkYzWFXJ.chunk.mjs";import"./NcAvatar-C9d7Wrc8-q6rj2o8q.chunk.mjs";import"./NcContent-O-bMKi-3-BTSEBJ49.chunk.mjs";import{N as q}from"./autolink-U5pBzLgI-2h5mm9kB.chunk.mjs";import"./Web-DzGiDslj.chunk.mjs";import"./index-Bndk0DrU.chunk.mjs";import{N as H}from"./NcCheckboxRadioSwitch-BMsPx74L-_RgKMJqI.chunk.mjs";import"./Plus-B5IcgSUH.chunk.mjs";import"./NcColorPicker-DDHxR-iN-D6pVzho_.chunk.mjs";import"./TrayArrowDown-Dr6EId-V.chunk.mjs";import"./index-1X7ElQaR.chunk.mjs";import"./NcSelect-DLheQ2yp-dx4VDMCp.chunk.mjs";import"./NcEmojiPicker-Djc9a0gw-C7_0jdtl.chunk.mjs";import"./NcEmptyContent-B8-90BSI-BCYMHGEW.chunk.mjs";import"./NcRichText-DJlaHs_Q-DtEEZneY.chunk.mjs";import{N as M,I as E,l as O}from"./types-CIWUFW_f.chunk.mjs";/* empty css */import"./NcInputField-o5OFv3z6-BKcArNCr.chunk.mjs";import{N as _}from"./NcPasswordField-uaMO2pdt-PEl2ADM3.chunk.mjs";import"./TrashCanOutline-Big6DF74.chunk.mjs";import"./index-Xc5-Sgfz.chunk.mjs";import"./NcUserBubble-vOAXLHB5-D4rSztCT.chunk.mjs";import"./NcUserStatusIcon-XiwrgeCm-BwqP5szn.chunk.mjs";import"./colors-BHGKZFDI-DxHUsrfC.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=x("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(),F("form",{ref:"form",onSubmit:N(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(q),{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}),T([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(C),{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