mirror of
https://github.com/nextcloud/server.git
synced 2026-03-28 21:33:40 -04:00
2 lines
5.3 KiB
JavaScript
2 lines
5.3 KiB
JavaScript
import{f as b,C as x,o as l,c as F,h as v,w as u,g as m,u as e,v as f,t as g,e as k,M as N,r as p,B,i as I,x as j}from"./runtime-dom.esm-bundler-CKxgtjB6.chunk.mjs";import{c as w,i as U}from"./index-2a6kOrDy.chunk.mjs";import{a as S,c as z,b as C}from"./index-C1xmmKTZ-DF4bDPEh.chunk.mjs";import{l as K}from"./index-BgmsSgl5.chunk.mjs";import{t}from"./translation-DoG5ZELJ-XUrtIRvk.chunk.mjs";import{g as E}from"./createElementId-DhjFt1I9-DdwCqgaq.chunk.mjs";import{N as V}from"./mdi--cNatcgF.chunk.mjs";import{N as R}from"./ContentCopy-ljx8CODs.chunk.mjs";import"./PencilOutline-Qk8GS-l0.chunk.mjs";import"./index-DblWoJ6I.chunk.mjs";import"./NcBreadcrumbs-5gl8Syfa-DJcXDkmn.chunk.mjs";import"./NcDateTime.vue_vue_type_script_setup_true_lang-B4upiZjL-CDFdx-HI.chunk.mjs";import"./NcModal-kyWZ3UFC-CC38MZrD.chunk.mjs";import"./NcAvatar-ruClKRzS-gxaDTlsM.chunk.mjs";import"./NcContent-D69ktIEB-CM64XV1n.chunk.mjs";import{N as M}from"./autolink-U5pBzLgI-D1NMH9bI.chunk.mjs";import"./Web-DS-WBH9c.chunk.mjs";import"./index-Bndk0DrU.chunk.mjs";import{N as T}from"./NcCheckboxRadioSwitch-D0gFwEVl-BbcIGLyw.chunk.mjs";import"./Plus-BtJ3xjfW.chunk.mjs";import"./NcColorPicker-D07Se8Xb-D3qyscwi.chunk.mjs";import"./TrayArrowDown-D7fMRVjO.chunk.mjs";import"./index-CrY7NZWO.chunk.mjs";import"./NcSelect-B1uITk_3-0e2p8qEi.chunk.mjs";import"./NcEmojiPicker-DGgqTnHp-BmMIlAzR.chunk.mjs";import"./NcEmptyContent-CDgWCt_m-Dz_uR0NU.chunk.mjs";import"./NcRichText-D_ssz6sB-ByGnwwpX.chunk.mjs";import{N as q,I as _,l as O}from"./types-QRkNTXge.chunk.mjs";/* empty css */import"./NcInputField-CPL-a_MM-R1bsVnGI.chunk.mjs";import{N as h}from"./NcPasswordField-BOLzDHBJ-CKSnPt2n.chunk.mjs";import"./TrashCanOutline-DmYYOQ4b.chunk.mjs";import"./index-CqVYsIAH.chunk.mjs";import"./NcUserBubble-BE6yD-R0-BAJg1c4w.chunk.mjs";import"./NcUserStatusIcon-JWiuiAXe-DUOABbOJ.chunk.mjs";import"./colors-BfjxNgsx-YlZbKUzS.chunk.mjs";import{w as Y}from"./index-BShhF1iS.chunk.mjs";import"./index-sH3U_332.chunk.mjs";const A=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(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(q),{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:u(()=>[c.recoveryEnabledForUser?(l(),m(e(V),{key:0},{default:u(()=>[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(M),{type:"submit",variant:"primary"},{default:u(()=>[f(g(e(t)("encryption","Update")),1)]),_:1})]),_:1},8,["label","description"])],544))}}),D=b({__name:"SettingsPersonalEnableRecovery",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(c){const a=B(c,"modelValue"),s=p(!1);return I(a,()=>{s.value=!0}),Y([a],async([i],[r])=>{if(i===r){s.value=!1;return}const o=z(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(),m(e(T),{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:u(()=>[f(g(e(t)("encryption","Enable password recovery")),1)]),_:1},8,["modelValue","loading","description"]))}}),G=b({__name:"SettingsPersonal",setup(c){const a=K("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&&C(o.data.message)}catch(o){O.error("Failed to fetch current encryption status",{error:o})}}return(o,n)=>(l(),m(e(R),{name:e(t)("encryption","Basic encryption module")},{default:u(()=>[s.value===e(_).NotInitialized?(l(),m(e(V),{key:0,type:"warning"},{default:u(()=>[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(),m(A,{key:1,recoveryEnabledForUser:i.value,onUpdated:r},null,8,["recoveryEnabledForUser"])):e(a).recoveryEnabled&&e(a).privateKeySet?(l(),m(D,{key:2,modelValue:i.value,"onUpdate:modelValue":n[0]||(n[0]=y=>i.value=y)},null,8,["modelValue"])):k("",!0)]),_:1},8,["name"]))}}),H=j(G);H.mount("#encryption-settings-section");
|
|
//# sourceMappingURL=encryption-settings_personal.mjs.map
|