mirror of
https://github.com/nextcloud/server.git
synced 2026-10-28 15:15:54 +01:00
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
4 lines
6.6 KiB
JavaScript
4 lines
6.6 KiB
JavaScript
import{t as a}from"./fa-C4gSzJ4e.chunk.mjs";import{e as R,v,_ as J,o as l,k,u as e,w as u,p as d,s as r,t as i,f as m,H as F,q as c,J as E,I as P,h as W,A as M,i as T,a as X}from"./PencilOutline-BR0l7G4K.chunk.mjs";import{c as x,i as Y}from"./mediaPreloader-C5NbROsO.chunk.mjs";import{b as U}from"./index-DDSZxH3w.chunk.mjs";import{l as j,d as A,c as B}from"./zh-TW-BiAqRd9G.chunk.mjs";import{N as G}from"./NcCheckboxRadioSwitch-CEATWE9W.chunk.mjs";import{N as K}from"./NcSettingsSection-D9ixm13f.chunk.mjs";import{N as D}from"./sr-D7qLtxtL.chunk.mjs";import{N as Q}from"./NcInputField-Tq-JEdJ1.chunk.mjs";import{N as I}from"./ro-D53n9Q_a.chunk.mjs";import{N}from"./ja-CMHj6q78.chunk.mjs";import{N as Z}from"./NcProgressBar-BuGLdvDE.chunk.mjs";import{l as V}from"./logger-Dw0u1G2B.chunk.mjs";import"./modulepreload-polyfill-BxzAKjcf.chunk.mjs";import"./ko-DLpOya8T.chunk.mjs";import"./lt-C1YkRaIQ.chunk.mjs";import"./sl-DKKCQ2JF.chunk.mjs";import"./sv-CdUgJRmq.chunk.mjs";import"./MapMarkerOutline-K4T_-mXQ.chunk.mjs";import"./_l10n-DOS6IYK4.chunk.mjs";import"./nl-mGwpypBg.chunk.mjs";import"./de-B1io8Jaw.chunk.mjs";import"./vi-B_M7SG5J.chunk.mjs";import"./te-RIb03IRu.chunk.mjs";import"./NcActions-B1iID7Uy.chunk.mjs";import"./TrayArrowDown-CSoX9T4M.chunk.mjs";var h=(s=>(s[s.Unknown=0]="Unknown",s[s.Scheduled=1]="Scheduled",s[s.Running=2]="Running",s[s.Done=3]="Done",s[s.Error=4]="Error",s))(h||{});const $={class:"sanitize-filenames__progress-container"},ee=["disabled"],ae=["aria-label"],ie=["aria-label"],se={class:"sanitize-filenames__fields"},le={key:0,class:"hidden-visually"},te=R({__name:"SettingsSanitizeFilenames",setup(s){const{status:y}=j("files","filesCompatibilitySettings"),n=v(!1),w=v(10),f=v(y.status),o=v(y.processed),p=v(y.total),z=J(y.errors||{}),g=T(()=>o.value>0?Math.round(o.value*100/p.value):0),_=T(()=>f.value===h.Scheduled||f.value===h.Running);async function L(){if(!_.value)try{n.value=!0,await x.post(A("apps/files/api/v1/filenames/sanitization"),{limit:w.value}),f.value=h.Scheduled}catch(t){V.error("Failed to start filename sanitization.",{error:t}),Y(t)&&t.response?.data?.ocs?U(t.response.data.ocs.meta.message):U(a("files","Failed to start filename sanitization."))}finally{n.value=!1}}async function q(){if(!n.value)try{n.value=!0;const{data:t}=await x.get(A("apps/files/api/v1/filenames/sanitization"));f.value=t.ocs.data.status,p.value=t.ocs.data.total,o.value=t.ocs.data.processed,z.value=t.ocs.data.errors||{}}catch(t){V.error("Failed to refresh filename sanitization status.",{error:t}),U(a("files","Failed to refresh filename sanitization status."))}finally{n.value=!1}}return(t,b)=>_.value?(l(),k(e(N),{key:0},{default:u(()=>[d("div",$,[d("p",null,[r(i(e(a)("files","Filename sanitization in progress."))+" ",1),b[1]||(b[1]=d("br",null,null,-1)),o.value>0?(l(),m(F,{key:0},[r(i(e(a)("files","Currently {processedUsers} of {totalUsers} accounts are already processed.",{processedUsers:o.value,totalUsers:p.value})),1)],64)):(l(),m(F,{key:1},[r(i(e(a)("files","Preparing …")),1)],64))]),c(e(Z),{value:g.value,size:12},null,8,["value"]),c(e(D),{variant:"tertiary",onClick:q},E({default:u(()=>[r(" "+i(e(a)("files","Refresh")),1)]),_:2},[n.value?{name:"icon",fn:u(()=>[c(e(I))]),key:"0"}:void 0]),1024)])]),_:1})):f.value===e(h).Done?(l(),k(e(N),{key:1,type:"success"},{default:u(()=>[r(i(e(a)("files","All files have been sanitized for Windows filename support.")),1)]),_:1})):(l(),m("form",{key:2,class:"sanitize-filenames__form",disabled:n.value,onSubmit:M(L,["stop","prevent"])},[f.value===e(h).Error?(l(),k(e(N),{key:0,type:"error"},{default:u(()=>[r(i(e(a)("files","Some files could not be sanitized, please check your logs."))+" ",1),d("ul",{class:"sanitize-filenames__errors","aria-label":e(a)("files","Sanitization errors")},[(l(!0),m(F,null,P(Object.entries(z.value),([S,H])=>(l(),m("li",{key:S},[d("h4",null,i(S)+":",1),d("ul",{"aria-label":e(a)("files","Not sanitized filenames")},[(l(!0),m(F,null,P(H,C=>(l(),m("li",{key:C},i(C),1))),128))],8,ie)]))),128))],8,ae)]),_:1})):W("",!0),c(e(N),null,{default:u(()=>[r(i(e(a)("files","Windows filename support has been enabled."))+" ",1),b[2]||(b[2]=d("br",null,null,-1)),r(" "+i(e(a)("files","While this blocks users from creating new files with unsupported filenames, existing files are not yet renamed and thus still may break sync on Windows."))+" "+i(e(a)("files","You can trigger a rename of files with invalid filenames, this will be done in the background and may take some time."))+" "+i(e(a)("files","Please note that this may cause high workload on the sync clients.")),1)]),_:1}),d("fieldset",se,[c(e(Q),{modelValue:w.value,"onUpdate:modelValue":b[0]||(b[0]=S=>w.value=S),label:e(a)("files","Limit"),helperText:e(a)("files","This allows to configure how many users should be processed in one background job run."),min:"1",type:"number"},null,8,["modelValue","label","helperText"]),c(e(D),{type:"submit",variant:"error"},E({default:u(()=>[r(" "+i(e(a)("files","Sanitize filenames"))+" ",1),n.value?(l(),m("span",le,i(e(a)("files","(starting)")),1)):W("",!0)]),_:2},[n.value?{name:"icon",fn:u(()=>[c(e(I))]),key:"0"}:void 0]),1024)])],40,ee))}}),ne=B(te,[["__scopeId","data-v-0eec7b54"]]),oe={class:"hint"},re=R({__name:"SettingsAdmin",setup(s){const{docUrl:y,isRunningSanitization:n,windowsSupport:w}=j("files","filesCompatibilitySettings"),f=a("files","Allow to restrict filenames to ensure files can be synced with all clients. By default all filenames valid on POSIX (e.g. Linux or macOS) are allowed.")+`
|
|
`+a("files","After enabling the Windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner."),o=v(!1),p=v(w);async function z(g){if(!o.value)try{o.value=!0,await x.post(A("apps/files/api/v1/filenames/windows-compatibility"),{enabled:g}),p.value=g}catch(_){U(a("files","Failed to toggle Windows filename support")),V.error("Failed to toggle Windows filename support",{error:_})}finally{o.value=!1}}return(g,_)=>(l(),k(e(K),{docUrl:e(y),name:e(a)("files","Files compatibility"),description:f},{default:u(()=>[c(e(G),{modelValue:p.value,disabled:e(n),loading:o.value,type:"switch","onUpdate:modelValue":z},{default:u(()=>[r(i(e(a)("files","Enforce Windows compatibility")),1)]),_:1},8,["modelValue","disabled","loading"]),d("p",oe,i(e(a)("files","This will block filenames not valid on Windows systems, like using reserved names or special characters. But this will not enforce compatibility of case sensitivity.")),1),p.value?(l(),k(ne,{key:0})):W("",!0)]),_:1},8,["docUrl","name"]))}}),ue=B(re,[["__scopeId","data-v-1cd10912"]]),O=X(ue);O.config.globalProperties.t=a,O.mount("#files-admin-settings");
|
|
//# sourceMappingURL=files-settings-admin.mjs.map
|