mirror of
https://github.com/nextcloud/server.git
synced 2026-11-26 16:15:53 +01:00
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
3 lines
7.0 KiB
JavaScript
3 lines
7.0 KiB
JavaScript
import{b as D,x as F,o as m,k as v,w as s,u as e,e as M,F as X,s as r,t as n,p as f,n as A,l as w,h as E,az as z,c as J}from"./hu-DWHOtuOL.chunk.mjs";import{c as j}from"./mediaPreloader-IgdcTrjQ.chunk.mjs";import{b as R}from"./vi-DCbjbq7D.chunk.mjs";import"./ja-B_wSKhBd.chunk.mjs";import"./check-CNg2q_FZ.chunk.mjs";import{f as S}from"./te-BBa5eL-s.chunk.mjs";import{N as b}from"./be-tarask-D0dFU7Qb.chunk.mjs";import{l as u,e as O,d as C}from"./nn-C3nLRifc.chunk.mjs";import{c as B}from"./index-CudfTzi1.chunk.mjs";import{N as k}from"./NcCheckboxRadioSwitch-lXFxHkmk.chunk.mjs";import{N as W}from"./NcSettingsSection-CeOxhPd5.chunk.mjs";import{l as P}from"./logger-Dr0trNDn.chunk.mjs";import{t}from"./tr-RNSdAsgP.chunk.mjs";import{s as G,a as K,b as Q}from"./ProfileService-DJ6eIGup.chunk.mjs";import{v as Y}from"./validate-uTPB_rL-.chunk.mjs";import"./th-U6oNDpWa.chunk.mjs";import"./sv-Ca8TyYKj.chunk.mjs";import"./sr-B-44tofW.chunk.mjs";import"./et-BGtPOYAk.chunk.mjs";import"./ru-CYHDXc7u.chunk.mjs";import"./Folder-Cny630PR.chunk.mjs";import"./sl-Bwt6lj0z.chunk.mjs";import"./_l10n-DLhPZC62.chunk.mjs";import"./NcPopover-C_eEJSnn.chunk.mjs";import"./lt-BxkpPQD9.chunk.mjs";import"./pl-SufSnQWy.chunk.mjs";import"./NcPasswordField-DVcpq7Cw.chunk.mjs";import"./NcInputField-DCo1-jGI.chunk.mjs";import"./Plus-DxU6VNeb.chunk.mjs";const Z=D({__name:"BackgroundJob",setup(H){const l=u("settings","lastCron"),g=u("settings","cronMaxAge",0),y=u("settings","cliBasedCronPossible",!0),o=u("settings","cliBasedCronUser","www-data"),a=u("settings","backgroundJobsDocUrl"),i=F(u("settings","backgroundJobsMode","cron"));let h=i.value;const x=S(l*1e3),V=S(g*1e3),I=t("settings","Use system cron service to call the cron.php file every 5 minutes.")+"<br>"+(y?t("settings",'The cron.php needs to be executed by the system account "{user}".',{user:o}):t("settings","The PHP POSIX extension is required. See {linkstart}PHP documentation{linkend} for more details.",{linkstart:'<a target="_blank" rel="noreferrer nofollow" class="external" href="https://www.php.net/manual/en/book.posix.php">',linkend:"</a>"},void 0,{escape:!1})),$=Date.now()/1e3-l>600,q=E(()=>Date.now()/1e3-g>12*3600&&i.value!=="cron"),L=E(()=>Date.now()/1e3-g>24*3600&&i.value==="cron");function U(p){return O("/apps/provisioning_api/api/v1/config/apps/{appId}/{key}",{appId:"core",key:p})}async function _(p){const d=U("backgroundjobs_mode");try{await B();const{data:c}=await j.post(d,{value:p});if(c.ocs?.meta?.status==="ok"){h=p,await N();return}}catch(c){P.error("Unable to update background job mode",{error:c})}i.value=h,R(t("settings","Unable to update background job mode"))}async function N(){const p=U("cronErrors");try{await B(),await j.delete(p)}catch(d){P.error(d)}}return(p,d)=>(m(),v(e(W),{name:e(t)("settings","Background jobs"),description:e(t)("settings","For the server to work properly, it's important to configure background jobs correctly. Cron is the recommended setting. Please see the documentation for more information."),docUrl:e(a)},{default:s(()=>[e(l)!==0?(m(),M(X,{key:0},[$?(m(),v(e(b),{key:0,type:"error"},{default:s(()=>[r(n(e(t)("settings","Last job execution ran {time}. Something seems wrong.",{time:e(x)})),1)]),_:1})):L.value?(m(),v(e(b),{key:1,type:"warning"},{default:s(()=>[r(n(e(t)("settings","Some jobs have not been executed since {maxAgeRelativeTime}. Please consider increasing the execution frequency.",{maxAgeRelativeTime:e(V)})),1)]),_:1})):q.value?(m(),v(e(b),{key:2,type:"warning"},{default:s(()=>[r(n(e(t)("settings","Some jobs have not been executed since {maxAgeRelativeTime}. Please consider switching to system cron.",{maxAgeRelativeTime:e(V)})),1)]),_:1})):(m(),v(e(b),{key:3,type:"success"},{default:s(()=>[r(n(e(t)("settings","Last job ran {relativeTime}.",{relativeTime:e(x)})),1)]),_:1}))],64)):(m(),v(e(b),{key:1,type:"error"},{default:s(()=>[r(n(e(t)("settings","Background job did not run yet!")),1)]),_:1})),f(e(k),{modelValue:i.value,"onUpdate:modelValue":[d[0]||(d[0]=c=>i.value=c),_],type:"radio",name:"backgroundJobsMode",value:"ajax",class:A(p.$style.ajaxSwitch)},{default:s(()=>[r(n(e(t)("settings","AJAX")),1)]),_:1},8,["modelValue","class"]),w("em",null,n(e(t)("settings","Execute one task with each page loaded. Use case: Single account instance.")),1),f(e(k),{modelValue:i.value,"onUpdate:modelValue":[d[1]||(d[1]=c=>i.value=c),_],type:"radio",name:"backgroundJobsMode",value:"webcron"},{default:s(()=>[r(n(e(t)("settings","Webcron")),1)]),_:1},8,["modelValue"]),w("em",null,n(e(t)("settings","cron.php is registered at a webcron service to call cron.php every 5 minutes over HTTP. Use case: Very small instance (1–5 accounts depending on the usage).")),1),f(e(k),{modelValue:i.value,"onUpdate:modelValue":[d[2]||(d[2]=c=>i.value=c),_],type:"radio",disabled:!e(y),value:"cron",name:"backgroundJobsMode"},{default:s(()=>[r(n(e(t)("settings","Cron (Recommended)")),1)]),_:1},8,["modelValue","disabled"]),w("em",{innerHTML:I})]),_:1},8,["name","description","docUrl"]))}}),ee="_ajaxSwitch_q8hw4_2",te={ajaxSwitch:ee},ae={$style:te},oe=C(Z,[["__cssModules",ae]]),ne={class:"inlineblock"},se=D({__name:"ProfileSettings",setup(H){const l=z({profileEnabledByDefault:u("settings","profileEnabledByDefault",!0),profilePickerEnabled:u("settings","profilePickerEnabled",!0),profilePrivate:u("settings","profilePrivate",!0)});async function g(y,o,a,i){if(Y(a))try{await o(a)}catch(h){P.error(i,{error:h}),l[y]=!a,R(i)}}return(y,o)=>(m(),M("div",{id:"profile-settings",class:A(["section",[y.$style.profileSettings]])},[w("h2",ne,n(e(t)("settings","Profile")),1),f(e(b),{type:"info"},{default:s(()=>[r(n(e(t)("settings","Enable or disable profile by default for new accounts.")),1)]),_:1}),f(e(k),{modelValue:l.profileEnabledByDefault,"onUpdate:modelValue":[o[0]||(o[0]=a=>l.profileEnabledByDefault=a),o[1]||(o[1]=a=>g("profileEnabledByDefault",e(G),a,e(t)("settings","Unable to update profile default setting")))],type:"switch"},{default:s(()=>[r(n(e(t)("settings","Enable by default")),1)]),_:1},8,["modelValue"]),f(e(b),{type:"info"},{default:s(()=>[r(n(e(t)("settings","Enable or disable the profile picker in the Smart Picker and the profile link previews.")),1)]),_:1}),f(e(k),{modelValue:l.profilePickerEnabled,"onUpdate:modelValue":[o[2]||(o[2]=a=>l.profilePickerEnabled=a),o[3]||(o[3]=a=>g("profilePickerEnabled",e(K),a,e(t)("settings","Unable to update profile picker setting")))],type:"switch"},{default:s(()=>[r(n(e(t)("settings","Enable the profile picker")),1)]),_:1},8,["modelValue"]),f(e(k),{modelValue:l.profilePrivate,"onUpdate:modelValue":[o[4]||(o[4]=a=>l.profilePrivate=a),o[5]||(o[5]=a=>g("profilePrivate",e(Q),a,e(t)("settings","Unable to update profile private setting")))],type:"switch"},{default:s(()=>[r(n(e(t)("settings","Prevent unauthenticated users from seeing user profiles")),1)]),_:1},8,["modelValue"])],2))}}),ie="_profileSettings_i4dun_2",re={profileSettings:ie},le={$style:re},de=C(se,[["__cssModules",le]]);J(oe).mount("#vue-admin-background-job");const T=document.getElementById("vue-admin-profile-settings");T&&J(de).mount(T);
|
||
//# sourceMappingURL=settings-admin-basic-settings.mjs.map
|