You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nextcloud-server/dist/encryption-settings_admin.mjs

2 lines
7.8 KiB

import{b as k,q as x,B as T,o as m,c as f,u as e,w as c,z as g,t as w,p as s,s as A,g as P,l as u,i as h,O as q,y as K,k as H,F as j,h as z,f as D}from"./Web-YxOIih-q.chunk.mjs";import{_ as F,l as I}from"./public-C1mLBHT3.chunk.mjs";import{t as o}from"./translation-DoG5ZELJ-Cnt4vXgN.chunk.mjs";import"./PencilOutline-DUsa_r-m.chunk.mjs";import"./createElementId-DhjFt1I9-CeyNLNUQ.chunk.mjs";import"./NcTextArea-Dxzj4zdb-DaKN2AdL.chunk.mjs";/* empty css */import"./NcActionInput-Dr8Yrafu-DPVaatG7.chunk.mjs";import"./NcActionLink-BFiaYt9A-B1MbKmUJ.chunk.mjs";import"./NcDateTime.vue_vue_type_script_setup_true_lang-BJuPH7S7-B_Nx_tHj.chunk.mjs";import"./NcModal-DiDvgcU8-D2f8VN_9.chunk.mjs";import"./NcActionSeparator-B9pNQaji-B5GIovH-.chunk.mjs";import"./NcActionText-CQ9qwJ0p-DjPadvh3.chunk.mjs";import"./NcContent-BYh5hWDN-QORxkz4T.chunk.mjs";import{N}from"./logger-D3RVzcfQ-DRPkuAPJ.chunk.mjs";import"./Check-DJVOsq9N.chunk.mjs";import"./NcAvatar-1KxMUN7V-DtAdmWOQ.chunk.mjs";import"./NcBreadcrumbs-B4eyDS9i-tnJr-W9y.chunk.mjs";import{b as S}from"./index-kP1pdrFW.chunk.mjs";import{N as M}from"./NcCheckboxRadioSwitch-DVdt5Hkq-CCqT2NmK.chunk.mjs";import"./Plus-DjXMgI8x.chunk.mjs";import"./index-yjPU-tjT.chunk.mjs";import"./TrayArrowDown-1TeDwNYk.chunk.mjs";import"./NcDashboardWidget-zmbDEGL--BBT25w8h.chunk.mjs";import"./index-_fCJFuDj.chunk.mjs";import"./mdi-DaKqoE8u.chunk.mjs";import"./index-DL00COnj.chunk.mjs";import"./NcEmojiPicker-UTxgju3f-DQrxIlWK.chunk.mjs";import"./MapMarkerOutline-CqtaOiDu.chunk.mjs";import"./index-CXvUXmGP.chunk.mjs";/* empty css */import"./NcInputField-5Sg6EUP6-BDCxBkzD.chunk.mjs";import{N as E}from"./TrashCanOutline-zBEOFG6G.chunk.mjs";import{N as V}from"./NcPasswordField-BFyzHTOO-bxe6S7B3.chunk.mjs";import"./index-iRIxi2Vt.chunk.mjs";import{c as R}from"./index-C5ZxdJOD.chunk.mjs";import"./NcTextField.vue_vue_type_script_setup_true_lang-Bx2esFU2-BdzWEUCz.chunk.mjs";import"./NcSelectTags-I2hJaNax-B1aaHlJ1.chunk.mjs";import{N as B}from"./ContentCopy-2Uvfrjpi.chunk.mjs";import"./NcUserBubble-BXR7vT0V-CeirtlO9.chunk.mjs";import"./NcUserStatusIcon-BF5OEQFU-BbBQ45O1.chunk.mjs";import"./emoji-C8k9NUlo-BNYdWfNi.chunk.mjs";import"./colors-Cv9F-jWS-BbMd5FbR.chunk.mjs";import{w as O}from"./index-ZOyhCJFr.chunk.mjs";import{d as $}from"./index-B_OxHYNM.chunk.mjs";import{N as U,l as C,I as G}from"./types-8ULM1lVX.chunk.mjs";import"./ArrowRight-Ds1zL9Fh.chunk.mjs";import"./util-C9Hc1fff.chunk.mjs";const J=k({__name:"SettingsAdminHomeStorage",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(b){const a=x(b,"modelValue"),i=s(!1);return T(a,()=>{i.value=!0}),O(a,async(l,n)=>{if(l===n){i.value=!1;return}try{await R.post(S("/apps/encryption/ajax/setEncryptHomeStorage"),{encryptHomeStorage:l})}finally{i.value=!1}},{debounce:800}),(l,n)=>(m(),f(e(M),{modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=r=>a.value=r),loading:i.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"),i=A("form"),l=s(!1),n=s(!1),r=s(""),t=s(""),v=K(()=>r.value===t.value);async function _(){if(!l.value&&v.value){n.value=!1,l.value=!0;try{const{data:d}=await R.post(S("/apps/encryption/ajax/adminRecovery"),{adminEnableRecovery:!a.value,recoveryPassword:r.value,confirmPassword:t.value});a.value=!a.value,r.value=t.value="",i.value?.reset(),d.data.message&&$(d.data.message)}catch(d){n.value=!0,C.error("Failed to update recovery key settings",{error:d})}finally{l.value=!1}}}return(d,p)=>(m(),P("form",{ref:"form",onSubmit:q(_,["prevent"])},[u(e(U),{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(()=>[u(e(V),{modelValue:r.value,"onUpdate:modelValue":p[0]||(p[0]=y=>r.value=y),required:"",name:"password",label:e(o)("encryption","Recovery key password")},null,8,["modelValue","label"]),u(e(V),{modelValue:t.value,"onUpdate:modelValue":p[1]||(p[1]=y=>t.value=y),required:"",name:"confirmPassword",error:!!t.value&&!v.value,helperText:v.value||!t.value?"":e(o)("encryption","Passwords fields do not match"),label:e(o)("encryption","Repeat recovery key password")},null,8,["modelValue","error","helperText","label"]),u(e(N),{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"),i=s(!1),l=s(!1),n=s(""),r=s(""),t=s(""),v=K(()=>r.value===t.value);async function _(){if(!i.value&&v.value){l.value=!1,i.value=!0;try{await R.post(S("/apps/encryption/ajax/changeRecoveryPassword"),{oldPassword:n.value,newPassword:r.value,confirmPassword:t.value}),n.value=r.value=t.value="",a.value?.reset()}catch(d){l.value=!0,C.error("Failed to update recovery key settings",{error:d})}finally{i.value=!1}}}return(d,p)=>(m(),P("form",{ref:"form",class:H(d.$style.settingsAdminRecoveryKeyChange),onSubmit:q(_,["prevent"])},[u(e(U),{label:e(o)("encryption","Change recovery key password")},{default:c(()=>[u(e(V),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=y=>n.value=y),required:"",name:"oldPassword",label:e(o)("encryption","Old recovery key password")},null,8,["modelValue","label"]),u(e(V),{modelValue:r.value,"onUpdate:modelValue":p[1]||(p[1]=y=>r.value=y),required:"",name:"password",label:e(o)("encryption","New recovery key password")},null,8,["modelValue","label"]),u(e(V),{modelValue:t.value,"onUpdate:modelValue":p[2]||(p[2]=y=>t.value=y),required:"",name:"confirmPassword",error:!v.value&&!!t.value,helperText:v.value||!t.value?"":e(o)("encryption","Passwords fields do not match"),label:e(o)("encryption","Repeat new recovery key password")},null,8,["modelValue","error","helperText","label"]),u(e(N),{type:"submit",variant:"primary"},{default:c(()=>[g(w(e(o)("encryption","Change recovery key password")),1)]),_:1}),l.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"),i=s(a.encryptHomeStorage),l=s(a.recoveryEnabled);return(n,r)=>(m(),f(e(B),{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},[u(J,{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=t=>i.value=t)},null,8,["modelValue"]),r[2]||(r[2]=z("br",null,null,-1)),e(a).masterKeyEnabled?h("",!0):(m(),f(L,{key:0,modelValue:l.value,"onUpdate:modelValue":r[1]||(r[1]=t=>l.value=t)},null,8,["modelValue"])),!e(a).masterKeyEnabled&&l.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