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.6 KiB

import{b as k,p as x,A as T,o as p,c as f,u as e,w as c,k as g,t as w,n as s,q as A,g as P,l as m,i as h,M as q,x as K,z as H,F as M,h as j,f as z}from"./Web-BZ2JklCV.chunk.mjs";import{_ as D,l as F}from"./public-C1mLBHT3.chunk.mjs";import{t as o}from"./translation-DoG5ZELJ-BLSwckqD.chunk.mjs";import"./PencilOutline-o83_5df9.chunk.mjs";import"./createElementId-DhjFt1I9-BJ8VCiAP.chunk.mjs";import"./NcTextArea-Dxzj4zdb-B-tInaY7.chunk.mjs";import"./NcBreadcrumbs-B4eyDS9i-D2W116MI.chunk.mjs";import"./NcDateTime.vue_vue_type_script_setup_true_lang-BJuPH7S7-BLmJNB6M.chunk.mjs";import"./NcModal-DiDvgcU8-ipcbEsbA.chunk.mjs";/* empty css */import"./NcAvatar-1KxMUN7V-O4B_fvSD.chunk.mjs";import"./NcContent-BYh5hWDN-koRvYzL4.chunk.mjs";import{N}from"./logger-D3RVzcfQ-BsaAqGa-.chunk.mjs";import"./TrashCanOutline-D3q5Znem.chunk.mjs";import{b as S}from"./index-BRcsAfAF.chunk.mjs";import{N as I}from"./NcCheckboxRadioSwitch-DVdt5Hkq-CDEDAwyK.chunk.mjs";import"./Plus-C95waL-C.chunk.mjs";import"./index-ZLXZ0uMO.chunk.mjs";import"./TrayArrowDown-DWHGWSCH.chunk.mjs";import"./index-BMttdaO7.chunk.mjs";import"./index-Rl2t4geC.chunk.mjs";import"./index-pzPq5rLW.chunk.mjs";import"./NcEmojiPicker-UTxgju3f-CLlnL61P.chunk.mjs";import"./NcEmptyContent-CGAPqk4S-DbFJMPlV.chunk.mjs";import"./index-CyjNFHMj.chunk.mjs";/* empty css */import"./NcInputField-5Sg6EUP6-KBqzwnAo.chunk.mjs";import{N as E}from"./mdi-BSvbkO3J.chunk.mjs";import{N as V}from"./NcPasswordField-BFyzHTOO-CCspQ4tJ.chunk.mjs";import"./index-DtRnsKlZ.chunk.mjs";import{c as R}from"./index-BBPNbi37.chunk.mjs";import"./NcTextField.vue_vue_type_script_setup_true_lang-Bx2esFU2-CpE6wEiq.chunk.mjs";import"./NcSelectTags-I2hJaNax-D6dAEKaX.chunk.mjs";import{N as B}from"./ContentCopy-CADvdXoQ.chunk.mjs";import"./NcUserBubble-BXR7vT0V-DxglIHcv.chunk.mjs";import"./NcUserStatusIcon-BF5OEQFU-Ce1BleUh.chunk.mjs";import"./emoji-C8k9NUlo-C5D-rZyy.chunk.mjs";import"./colors-Cv9F-jWS-BA9aZC8_.chunk.mjs";import{w as $}from"./index-DeyonX7k.chunk.mjs";import{d as O}from"./index-D6T74FX_.chunk.mjs";import{N as U,l as C,I as G}from"./types-CzADGnJI.chunk.mjs";import"./ArrowRight-B2on5Ssv.chunk.mjs";import"./util-BcZIBtn7.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}),$(a,async(t,n)=>{if(t===n){i.value=!1;return}try{await R.post(S("/apps/encryption/ajax/setEncryptHomeStorage"),{encryptHomeStorage:t})}finally{i.value=!1}},{debounce:800}),(t,n)=>(p(),f(e(I),{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"),t=s(!1),n=s(!1),r=s(""),l=s(""),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="",i.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)=>(p(),P("form",{ref:"form",onSubmit:q(_,["prevent"])},[m(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(()=>[m(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"]),m(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"]),m(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?(p(),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),t=s(!1),n=s(""),r=s(""),l=s(""),v=K(()=>r.value===l.value);async function _(){if(!i.value&&v.value){t.value=!1,i.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{i.value=!1}}}return(d,u)=>(p(),P("form",{ref:"form",class:H(d.$style.settingsAdminRecoveryKeyChange),onSubmit:q(_,["prevent"])},[m(e(U),{label:e(o)("encryption","Change recovery key password")},{default:c(()=>[m(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"]),m(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"]),m(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"]),m(e(N),{type:"submit",variant:"primary"},{default:c(()=>[g(w(e(o)("encryption","Change recovery key password")),1)]),_:1}),t.value?(p(),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=D(Q,[["__cssModules",Y]]),ee=k({__name:"SettingsAdmin",setup(b){const a=F("encryption","adminSettings"),i=s(a.encryptHomeStorage),t=s(a.recoveryEnabled);return(n,r)=>(p(),f(e(B),{name:e(o)("encryption","Default encryption module")},{default:c(()=>[e(a).initStatus===e(G).NotInitialized&&!e(a).masterKeyEnabled?(p(),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})):(p(),P(M,{key:1},[m(J,{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=l=>i.value=l)},null,8,["modelValue"]),r[2]||(r[2]=j("br",null,null,-1)),e(a).masterKeyEnabled?h("",!0):(p(),f(L,{key:0,modelValue:t.value,"onUpdate:modelValue":r[1]||(r[1]=l=>t.value=l)},null,8,["modelValue"])),!e(a).masterKeyEnabled&&t.value?(p(),f(Z,{key:1})):h("",!0)],64))]),_:1},8,["name"]))}}),ae=z(ee);ae.mount("#encryption-settings-section");
//# sourceMappingURL=encryption-settings_admin.mjs.map