mirror of
https://github.com/nextcloud/server.git
synced 2026-03-21 10:00:33 -04:00
2 lines
7.4 KiB
JavaScript
2 lines
7.4 KiB
JavaScript
import{f as k,B as x,i as T,o as p,g as f,u as e,w as c,v as g,t as w,r as s,C as A,c as P,h as m,e as h,M as K,F as N,A as H,H as M,b as j,x as B}from"./runtime-dom.esm-bundler-CKxgtjB6.chunk.mjs";import{a as D,l as F}from"./index-BgmsSgl5.chunk.mjs";import{t as o}from"./translation-DoG5ZELJ-XUrtIRvk.chunk.mjs";import"./PencilOutline-Qk8GS-l0.chunk.mjs";import{g as S}from"./createElementId-DhjFt1I9-DdwCqgaq.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 U}from"./autolink-U5pBzLgI-D1NMH9bI.chunk.mjs";import"./Web-DS-WBH9c.chunk.mjs";import"./index-Bndk0DrU.chunk.mjs";import{N as I}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";/* empty css */import"./NcInputField-CPL-a_MM-R1bsVnGI.chunk.mjs";import{N as E}from"./mdi--cNatcgF.chunk.mjs";import{N as V}from"./NcPasswordField-BOLzDHBJ-CKSnPt2n.chunk.mjs";import{c as R}from"./index-2a6kOrDy.chunk.mjs";import"./TrashCanOutline-DmYYOQ4b.chunk.mjs";import"./index-CqVYsIAH.chunk.mjs";import{N as z}from"./ContentCopy-ljx8CODs.chunk.mjs";import"./NcUserBubble-BE6yD-R0-BAJg1c4w.chunk.mjs";import"./NcUserStatusIcon-JWiuiAXe-DUOABbOJ.chunk.mjs";import"./colors-BfjxNgsx-YlZbKUzS.chunk.mjs";import{w as $}from"./index-BShhF1iS.chunk.mjs";import{d as O}from"./index-C1xmmKTZ-DF4bDPEh.chunk.mjs";import{N as q,l as C,I as G}from"./types-QRkNTXge.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"),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=N(()=>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:K(_,["prevent"])},[m(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(()=>[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(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?(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=N(()=>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:K(_,["prevent"])},[m(e(q),{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(U),{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(z),{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?(p(),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?(p(),f(Z,{key:1})):h("",!0)],64))]),_:1},8,["name"]))}}),ae=B(ee);ae.mount("#encryption-settings-section");
|
|
//# sourceMappingURL=encryption-settings_admin.mjs.map
|