mirror of
https://github.com/nextcloud/server.git
synced 2026-02-19 02:38:40 -05:00
2 lines
5.1 KiB
JavaScript
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-nUg13ekW.chunk.mjs";import{c as w,i as U}from"./index-ClUK5nWL.chunk.mjs";import{a as S,c as B,b as K}from"./index-C1xmmKTZ-B_lLl9Ld.chunk.mjs";import{l as R}from"./index-Ma7sfat2.chunk.mjs";import{t}from"./translation-DoG5ZELJ-2ffMJaM4.chunk.mjs";import{g as E}from"./createElementId-DhjFt1I9-CRJVCjcq.chunk.mjs";import{N as V}from"./NcNoteCard-Cok_4Fld-BLQT242e.chunk.mjs";import{N as C}from"./ContentCopy-Cff3hXjy.chunk.mjs";import"./PencilOutline-Da_gxdzI.chunk.mjs";import"./index-BfDa8hG_.chunk.mjs";import"./NcBreadcrumbs-5gl8Syfa-fSFDzBYX.chunk.mjs";import"./NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-DyY3Wrls.chunk.mjs";import{w as T}from"./index-DeDXQtUD.chunk.mjs";import"./NcAvatar-C9d7Wrc8-DSaQpb7G.chunk.mjs";import"./NcRichText-DJlaHs_Q-BIFzgFw2.chunk.mjs";import{N as q}from"./logger-D3RVzcfQ-B4GxPQ5t.chunk.mjs";import"./mdi-DK5BPbEO.chunk.mjs";import"./index-6_gsQFyp.chunk.mjs";import{N as H}from"./NcCheckboxRadioSwitch-BMsPx74L-DIBi32kw.chunk.mjs";import"./NcChip-B71t2Ny2-DqpmLeAg.chunk.mjs";import"./NcColorPicker-DDHxR-iN-BfqdUpwQ.chunk.mjs";import"./TrayArrowDown-C2uV7B4C.chunk.mjs";import"./NcSelect-DLheQ2yp-CBfrlGlO.chunk.mjs";import"./NcEmojiPicker-Djc9a0gw-BzZP_l-N.chunk.mjs";import"./Plus-BaNqZv8i.chunk.mjs";import{N as M,I as _,l as O}from"./types-CYpDn74U.chunk.mjs";/* empty css */import"./NcInputField-o5OFv3z6-DGXgkff4.chunk.mjs";import{N as h}from"./NcPasswordField-uaMO2pdt-Bb_nZP1o.chunk.mjs";import"./TrashCanOutline-YYyMK6ia.chunk.mjs";import"./index-m906szCF.chunk.mjs";import"./NcUserBubble-vOAXLHB5-hYokuz_z.chunk.mjs";import"./NcUserStatusIcon-XiwrgeCm-BGKwPmPa.chunk.mjs";import"./colors-BHGKZFDI-_xZPp21x.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
|