nextcloud/dist/encryption-settings_admin.mjs
Ferdinand Thiessen 7d8e640601
chore: compile assets
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-05-05 22:25:40 +02:00

2 lines
7.5 KiB
JavaScript

import{b as k,n as x,z as T,o as p,c as f,u as e,w as c,j as g,t as w,l as s,p as A,f as P,k as m,h,N,v as K,y as j,F as H,g as z,e as D}from"./preload-helper-CX9gtE7n.chunk.mjs";import{_ as F,l as I}from"./public-C1mLBHT3.chunk.mjs";import{t as o}from"./translation-DoG5ZELJ-CPJIGC2H.chunk.mjs";import"./PencilOutline-Bexowggr.chunk.mjs";import"./Web-lLWc6zap.chunk.mjs";import"./NcTextArea-CseOD9aM-Dr3vykGl.chunk.mjs";import"./NcBreadcrumbs-5gl8Syfa-BJLyzFWC.chunk.mjs";import"./NcDateTime.vue_vue_type_script_setup_true_lang-B4upiZjL-CDStkW4e.chunk.mjs";import"./NcModal-kyWZ3UFC-CV6Hvf6d.chunk.mjs";/* empty css */import"./NcAvatar-ruClKRzS-DbbQH8Qz.chunk.mjs";import"./NcContent-D69ktIEB-D1gmP6xt.chunk.mjs";import{N as U}from"./ArrowRight-JDdFcric.chunk.mjs";import"./TrashCanOutline-B-GxU5E3.chunk.mjs";import{b as S}from"./index-CziSTDUD.chunk.mjs";import{N as M}from"./NcCheckboxRadioSwitch-D0gFwEVl-DUWN1FjH.chunk.mjs";import"./Plus-BNgsg9Vm.chunk.mjs";import"./index-blkJtiu8.chunk.mjs";import"./TrayArrowDown-rkgZntG8.chunk.mjs";import"./index-CJNrZ-7b.chunk.mjs";import"./index-C6zIcU-d.chunk.mjs";import"./index-Ck6YKth1.chunk.mjs";import"./NcEmojiPicker-DGgqTnHp-BL4_K0PB.chunk.mjs";import"./NcEmptyContent-CDgWCt_m-DHBOrQzP.chunk.mjs";import"./index-DziQfluU.chunk.mjs";/* empty css */import"./NcInputField-CPL-a_MM-WQA5jsOf.chunk.mjs";import{N as E}from"./mdi-BjKyjJ9m.chunk.mjs";import{N as V}from"./NcPasswordField-BOLzDHBJ-Ocef6zuk.chunk.mjs";import"./index-DIXoyWI1.chunk.mjs";import{c as R}from"./index-BpWtOFbq.chunk.mjs";import"./NcTextField.vue_vue_type_script_setup_true_lang-B-4HNjYH-CTxKDSgI.chunk.mjs";import"./NcSelectTags-B3_tcJAf-CNiunM5T.chunk.mjs";import{N as B}from"./ContentCopy-DS0QzQtq.chunk.mjs";import"./NcUserBubble-BE6yD-R0-BI6ZwX-N.chunk.mjs";import"./NcUserStatusIcon-JWiuiAXe-FPvdKWWr.chunk.mjs";import"./emoji-V9hqFgPs-BoVPPNKM.chunk.mjs";import"./colors-BfjxNgsx-CknPG731.chunk.mjs";import{w as $}from"./index-DZVjGEW7.chunk.mjs";import{d as O}from"./index-C1xmmKTZ-BdqLiU2K.chunk.mjs";import{N as q,l as C,I as G}from"./types-Czen56-K.chunk.mjs";import"./util-BUyb4W9M.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(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"),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:N(_,["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=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:j(d.$style.settingsAdminRecoveryKeyChange),onSubmit:N(_,["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=F(Q,[["__cssModules",Y]]),ee=k({__name:"SettingsAdmin",setup(b){const a=I("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(H,{key:1},[m(J,{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=l=>i.value=l)},null,8,["modelValue"]),r[2]||(r[2]=z("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=D(ee);ae.mount("#encryption-settings-section");
//# sourceMappingURL=encryption-settings_admin.mjs.map