mirror of
https://github.com/nextcloud/server.git
synced 2026-02-19 02:38:40 -05:00
2 lines
7.3 KiB
JavaScript
2 lines
7.3 KiB
JavaScript
import{b as k,s as x,v as H,r as i,c as f,o as m,u as e,w as c,g,t as w,x as A,j as P,e as p,l as h,p as K,H as U,n as T,F as j,k as D,h as F}from"./runtime-dom.esm-bundler-DSTOTAEf.chunk.mjs";import{a as I,l as M}from"./index-DCpg1aui.chunk.mjs";import{t as o}from"./translation-DoG5ZELJ-2ffMJaM4.chunk.mjs";import"./PencilOutline-BbbiWpuA.chunk.mjs";import{c as q}from"./logger-D3RVzcfQ-u5jICcTJ.chunk.mjs";import"./index-Dfoiix6T.chunk.mjs";import{g as S}from"./createElementId-DhjFt1I9-DnDDFk77.chunk.mjs";import"./NcBreadcrumbs-DYfGaSjT-B0sOzfON.chunk.mjs";import"./NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-BZtT1htT.chunk.mjs";import{w as z}from"./index-RbJ3SLsu.chunk.mjs";import"./NcAvatar-DmUGApWA-JlRtP4v4.chunk.mjs";import"./NcRichText-CBMtJzE_-Dhx6yDK3.chunk.mjs";import"./mdi-Dg3BMFGG.chunk.mjs";import"./index-6_gsQFyp.chunk.mjs";import{N as B}from"./NcCheckboxRadioSwitch-BCSKF7Tk-C_RQDZ7j.chunk.mjs";import"./NcChip-D8tGFzRl-Hh2_NyPj.chunk.mjs";import"./NcColorPicker-Kc0JqRtp-BUWSVNT6.chunk.mjs";import"./TrayArrowDown-BXE7diwi.chunk.mjs";import"./NcSelect-Czzsi3P_-DQ1pX7Ad.chunk.mjs";import"./NcEmojiPicker-pM4Pg2yq-CCmupwRs.chunk.mjs";import"./Plus-D4QQbLoD.chunk.mjs";/* empty css */import"./NcInputField-Bwsh2aHY-CQ8dmik7.chunk.mjs";import{N as E}from"./NcNoteCard-CVhtNL04-xecBaCCz.chunk.mjs";import{N as V}from"./NcPasswordField-djttkA5Q-PkdHfBrA.chunk.mjs";import{c as R}from"./index-DKddA51s.chunk.mjs";import"./TrashCanOutline-MY5RRFZ7.chunk.mjs";import"./index-RGOW28oI.chunk.mjs";import{N as $}from"./ContentCopy-BuXj5niD.chunk.mjs";import"./NcUserBubble-DPAmU2_J-CCD2l4DH.chunk.mjs";import"./NcUserStatusIcon-CGEf7fej-DpJR4ABu.chunk.mjs";import"./colors-Go3zmZRD-CiwiiY9I.chunk.mjs";import{d as O}from"./index-JpgrUA2Z-CjbNveLz.chunk.mjs";import{N as C,l as N,I as G}from"./types-CWgCjZQh.chunk.mjs";import"./string_decoder-BO00msnV.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}),z(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,N.error("Failed to update recovery key settings",{error:d})}finally{t.value=!1}}}return(d,u)=>(m(),P("form",{ref:"form",onSubmit:U(_,["prevent"])},[p(e(C),{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(q),{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,N.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:U(_,["prevent"])},[p(e(C),{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(q),{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=I(Q,[["__cssModules",Y]]),ee=k({__name:"SettingsAdmin",setup(b){const a=M("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]=D("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=F(ee);ae.mount("#encryption-settings-section");
|
|
//# sourceMappingURL=encryption-settings_admin.mjs.map
|