mirror of
https://github.com/nextcloud/server.git
synced 2026-02-24 10:26:07 -05:00
2 lines
7.3 KiB
JavaScript
2 lines
7.3 KiB
JavaScript
import{f as k,s as x,v as H,r as i,g as f,o as m,u as e,w as c,j as g,t as w,x as A,c as P,h as p,e as h,z as K,H as N,p as T,F as j,b as z,k as D}from"./runtime-dom.esm-bundler-w0tDt7Gi.chunk.mjs";import{a as F,l as I}from"./index-Ma7sfat2.chunk.mjs";import{t as o}from"./translation-DoG5ZELJ-Bni_xMHF.chunk.mjs";import"./PencilOutline-DDvj_Sz4.chunk.mjs";import{g as S}from"./createElementId-DhjFt1I9-B1fq6aa1.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 M}from"./NcModal-DHryP_87-BkYzWFXJ.chunk.mjs";import"./NcAvatar-C9d7Wrc8-q6rj2o8q.chunk.mjs";import"./NcContent-O-bMKi-3-BTSEBJ49.chunk.mjs";import{N as U}from"./autolink-U5pBzLgI-2h5mm9kB.chunk.mjs";import"./Web-DzGiDslj.chunk.mjs";import"./index-Bndk0DrU.chunk.mjs";import{N as B}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";/* empty css */import"./NcInputField-o5OFv3z6-BKcArNCr.chunk.mjs";import{N as E}from"./mdi-YPhQfxXZ.chunk.mjs";import{N as V}from"./NcPasswordField-uaMO2pdt-PEl2ADM3.chunk.mjs";import{c as R}from"./index-2HC-5o-4.chunk.mjs";import"./TrashCanOutline-Big6DF74.chunk.mjs";import"./index-Xc5-Sgfz.chunk.mjs";import{N as $}from"./ContentCopy-CgZpiJBj.chunk.mjs";import"./NcUserBubble-vOAXLHB5-D4rSztCT.chunk.mjs";import"./NcUserStatusIcon-XiwrgeCm-BwqP5szn.chunk.mjs";import"./colors-BHGKZFDI-DxHUsrfC.chunk.mjs";import{d as O}from"./index-C1xmmKTZ-zpf0CQaW.chunk.mjs";import{N as q,l as C,I as G}from"./types-CIWUFW_f.chunk.mjs";import"./index-sH3U_332.chunk.mjs";const J=k({__name:"SettingsAdminHomeStorage",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(b){const a=x(b,"modelValue"),s=i(!1);return H(a,()=>{s.value=!0}),M(a,async(t,n)=>{if(t===n){s.value=!1;return}try{await R.post(S("/apps/encryption/ajax/setEncryptHomeStorage"),{encryptHomeStorage:t})}finally{s.value=!1}},{debounce:800}),(t,n)=>(m(),f(e(B),{modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=r=>a.value=r),loading:s.value,description:e(o)("encryption","Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted"),type:"switch"},{default:c(()=>[g(w(e(o)("encryption","Encrypt the home storage")),1)]),_:1},8,["modelValue","loading","description"]))}}),L=k({__name:"SettingsAdminRecoveryKey",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(b){const a=x(b,"modelValue"),s=A("form"),t=i(!1),n=i(!1),r=i(""),l=i(""),v=K(()=>r.value===l.value);async function _(){if(!t.value&&v.value){n.value=!1,t.value=!0;try{const{data:d}=await R.post(S("/apps/encryption/ajax/adminRecovery"),{adminEnableRecovery:!a.value,recoveryPassword:r.value,confirmPassword:l.value});a.value=!a.value,r.value=l.value="",s.value?.reset(),d.data.message&&O(d.data.message)}catch(d){n.value=!0,C.error("Failed to update recovery key settings",{error:d})}finally{t.value=!1}}}return(d,u)=>(m(),P("form",{ref:"form",onSubmit:N(_,["prevent"])},[p(e(q),{label:a.value?e(o)("encryption","Disable recovery key"):e(o)("encryption","Enable recovery key"),description:e(o)("encryption","The recovery key is an additional encryption key used to encrypt files. It is used to recover files from an account if the password is forgotten.")},{default:c(()=>[p(e(V),{modelValue:r.value,"onUpdate:modelValue":u[0]||(u[0]=y=>r.value=y),required:"",name:"password",label:e(o)("encryption","Recovery key password")},null,8,["modelValue","label"]),p(e(V),{modelValue:l.value,"onUpdate:modelValue":u[1]||(u[1]=y=>l.value=y),required:"",name:"confirmPassword",error:!!l.value&&!v.value,helperText:v.value||!l.value?"":e(o)("encryption","Passwords fields do not match"),label:e(o)("encryption","Repeat recovery key password")},null,8,["modelValue","error","helperText","label"]),p(e(U),{type:"submit",variant:a.value?"error":"primary"},{default:c(()=>[g(w(a.value?e(o)("encryption","Disable recovery key"):e(o)("encryption","Enable recovery key")),1)]),_:1},8,["variant"]),n.value?(m(),f(e(E),{key:0,type:"error"},{default:c(()=>[g(w(e(o)("encryption","An error occurred while updating the recovery key settings. Please try again.")),1)]),_:1})):h("",!0)]),_:1},8,["label","description"])],544))}}),Q=k({__name:"SettingsAdminRecoveryKeyChange",setup(b){const a=A("form"),s=i(!1),t=i(!1),n=i(""),r=i(""),l=i(""),v=K(()=>r.value===l.value);async function _(){if(!s.value&&v.value){t.value=!1,s.value=!0;try{await R.post(S("/apps/encryption/ajax/changeRecoveryPassword"),{oldPassword:n.value,newPassword:r.value,confirmPassword:l.value}),n.value=r.value=l.value="",a.value?.reset()}catch(d){t.value=!0,C.error("Failed to update recovery key settings",{error:d})}finally{s.value=!1}}}return(d,u)=>(m(),P("form",{ref:"form",class:T(d.$style.settingsAdminRecoveryKeyChange),onSubmit:N(_,["prevent"])},[p(e(q),{label:e(o)("encryption","Change recovery key password")},{default:c(()=>[p(e(V),{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=y=>n.value=y),required:"",name:"oldPassword",label:e(o)("encryption","Old recovery key password")},null,8,["modelValue","label"]),p(e(V),{modelValue:r.value,"onUpdate:modelValue":u[1]||(u[1]=y=>r.value=y),required:"",name:"password",label:e(o)("encryption","New recovery key password")},null,8,["modelValue","label"]),p(e(V),{modelValue:l.value,"onUpdate:modelValue":u[2]||(u[2]=y=>l.value=y),required:"",name:"confirmPassword",error:!v.value&&!!l.value,helperText:v.value||!l.value?"":e(o)("encryption","Passwords fields do not match"),label:e(o)("encryption","Repeat new recovery key password")},null,8,["modelValue","error","helperText","label"]),p(e(U),{type:"submit",variant:"primary"},{default:c(()=>[g(w(e(o)("encryption","Change recovery key password")),1)]),_:1}),t.value?(m(),f(e(E),{key:0,type:"error"},{default:c(()=>[g(w(e(o)("encryption","An error occurred while changing the recovery key password. Please try again.")),1)]),_:1})):h("",!0)]),_:1},8,["label"])],34))}}),W="_settingsAdminRecoveryKeyChange_12rwr_2",X={settingsAdminRecoveryKeyChange:W},Y={$style:X},Z=F(Q,[["__cssModules",Y]]),ee=k({__name:"SettingsAdmin",setup(b){const a=I("encryption","adminSettings"),s=i(a.encryptHomeStorage),t=i(a.recoveryEnabled);return(n,r)=>(m(),f(e($),{name:e(o)("encryption","Default encryption module")},{default:c(()=>[e(a).initStatus===e(G).NotInitialized&&!e(a).masterKeyEnabled?(m(),f(e(E),{key:0,type:"warning"},{default:c(()=>[g(w(e(o)("encryption","Encryption app is enabled but your keys are not initialized, please log-out and log-in again")),1)]),_:1})):(m(),P(j,{key:1},[p(J,{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=l=>s.value=l)},null,8,["modelValue"]),r[2]||(r[2]=z("br",null,null,-1)),e(a).masterKeyEnabled?(m(),f(L,{key:0,modelValue:t.value,"onUpdate:modelValue":r[1]||(r[1]=l=>t.value=l)},null,8,["modelValue"])):h("",!0),e(a).masterKeyEnabled&&t.value?(m(),f(Z,{key:1})):h("",!0)],64))]),_:1},8,["name"]))}}),ae=D(ee);ae.mount("#encryption-settings-section");
|
|
//# sourceMappingURL=encryption-settings_admin.mjs.map
|