nextcloud/dist/encryption-settings_personal.mjs
nextcloud-command 0254414a98 chore(assets): Recompile assets
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2026-03-14 22:50:03 +00:00

2 lines
5.1 KiB
JavaScript

import{b,x,j as F,o as l,e as v,w as d,c as u,l as k,u as e,g as f,t as g,H as N,r as p,s as j,v as I,h as z}from"./runtime-dom.esm-bundler-CgYXkLV7.chunk.mjs";import{c as w,i as U}from"./index-IPON9qO1.chunk.mjs";import{a as S,c as B,b as K}from"./index-C1xmmKTZ-DHV8JZOG.chunk.mjs";import{l as R}from"./index-BgmsSgl5.chunk.mjs";import{t}from"./translation-DoG5ZELJ-XUrtIRvk.chunk.mjs";import{g as E}from"./createElementId-DhjFt1I9-D6sOOWeT.chunk.mjs";import{N as V}from"./NcNoteCard-CWiO3Dse-DJ5wV2Sw.chunk.mjs";import{N as C}from"./ContentCopy-BDBVtVf4.chunk.mjs";import"./PencilOutline-JA7iF0oB.chunk.mjs";import"./index-gcVmkJui.chunk.mjs";import"./NcBreadcrumbs-5gl8Syfa-OGAo_Wb9.chunk.mjs";import"./NcDateTime.vue_vue_type_script_setup_true_lang-B4upiZjL-DnxW8VJB.chunk.mjs";import{w as T}from"./index-C493a1t-.chunk.mjs";import"./NcAvatar-ruClKRzS-BgeUBh5W.chunk.mjs";import"./NcRichText-D_ssz6sB-DW_PHdHl.chunk.mjs";import{N as q}from"./logger-D3RVzcfQ-88xHyoDn.chunk.mjs";import"./mdi-36VzJ0Uy.chunk.mjs";import"./index-Bndk0DrU.chunk.mjs";import{N as H}from"./NcCheckboxRadioSwitch-D0gFwEVl-DCiJhL6I.chunk.mjs";import"./NcChip-CrVOU2RM-XlAogc61.chunk.mjs";import"./NcColorPicker-D07Se8Xb-CCnR45nI.chunk.mjs";import"./TrayArrowDown-B2rpXp5-.chunk.mjs";import"./NcSelect-B1uITk_3-CsHvKsDu.chunk.mjs";import"./NcEmojiPicker-DGgqTnHp-D4bZ1CbY.chunk.mjs";import"./Plus-xxJZmotj.chunk.mjs";import{N as M,I as _,l as O}from"./types-BA4pxuUT.chunk.mjs";/* empty css */import"./NcInputField-CPL-a_MM-6ClrUH-f.chunk.mjs";import{N as h}from"./NcPasswordField-BOLzDHBJ-Cgi99HhR.chunk.mjs";import"./TrashCanOutline-rMwsRZQn.chunk.mjs";import"./index-BLmWdBZx.chunk.mjs";import"./NcUserBubble-BE6yD-R0-C8R7EmPu.chunk.mjs";import"./NcUserStatusIcon-JWiuiAXe-CiPikwn2.chunk.mjs";import"./colors-BfjxNgsx-dKEg53sb.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(E("/apps/encryption/ajax/updatePrivateKeyPassword"),{oldPassword:n.value,newPassword:y.value}),n.value=y.value="",i.value?.reset(),s("updated")}catch(m){U(m)&&m.response&&m.response.data?.data?.message&&S(m.response.data.data.message),o.value=!0}finally{r.value=!1}}}return(m,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:d(()=>[c.recoveryEnabledForUser?(l(),u(e(V),{key:0},{default:d(()=>[f(g(e(t)("encryption","If you do not remember your old password you can ask your administrator to recover your files.")),1)]),_:1})):k("",!0),v(e(h),{label:e(t)("encryption","Old log-in password")},null,8,["label"]),v(e(h),{label:e(t)("encryption","Current log-in password")},null,8,["label"]),v(e(q),{type:"submit",variant:"primary"},{default:d(()=>[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(E("/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:d(()=>[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(E("/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:d(()=>[s.value===e(_).NotInitialized?(l(),u(e(V),{key:0,type:"warning"},{default:d(()=>[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(_).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"])):k("",!0)]),_:1},8,["name"]))}}),G=z(D);G.mount("#encryption-settings-section");
//# sourceMappingURL=encryption-settings_personal.mjs.map