mirror of
https://github.com/nextcloud/server.git
synced 2026-11-25 15:16:20 +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"./tr-C7EGUBvz.chunk.mjs";import{b as O,x as v,ai as X,o as l,k as _,u as e,w as u,l as m,s as r,t as i,e as d,F as U,p as c,S as E,Q as P,g as W,L as Y,h as T,c as q}from"./hu-DWHOtuOL.chunk.mjs";import{c as x,i as G}from"./mediaPreloader-IgdcTrjQ.chunk.mjs";import{b as N}from"./vi-CN8rW5kN.chunk.mjs";import"./ja-Dv6yVwx7.chunk.mjs";import"./check-CNg2q_FZ.chunk.mjs";import"./te-BhThdr3E.chunk.mjs";import{N as F}from"./be-tarask-DEb7NwML.chunk.mjs";import{N as D}from"./et-CFbR2NZ1.chunk.mjs";import"./ru-Bytu4ZMd.chunk.mjs";import{l as R,e as V,d as j}from"./nn-C3nLRifc.chunk.mjs";import{N as H}from"./NcCheckboxRadioSwitch-DF-YzMmn.chunk.mjs";import{N as J}from"./NcSettingsSection-BfCHnOdy.chunk.mjs";import{N as K}from"./NcInputField-C10r-1xS.chunk.mjs";import{N as I}from"./Folder-A3wTtBsN.chunk.mjs";import{N as Z}from"./NcProgressBar-Ca5t3vQ1.chunk.mjs";import{l as A}from"./logger-CE3j10WE.chunk.mjs";import"./modulepreload-polyfill-BxzAKjcf.chunk.mjs";import"./th-U6oNDpWa.chunk.mjs";import"./sv-Ca8TyYKj.chunk.mjs";import"./sr-C7Yy9gNZ.chunk.mjs";import"./sl-DOaJlnOW.chunk.mjs";import"./_l10n-B80PineX.chunk.mjs";import"./NcPopover-Dw0WRapZ.chunk.mjs";import"./lt-DEN08chr.chunk.mjs";import"./pl-CvXGBwjh.chunk.mjs";import"./Plus-CL5HyIZN.chunk.mjs";var g=(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))(g||{});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=O({__name:"SettingsSanitizeFilenames",setup(s){const{status:y}=R("files","filesCompatibilitySettings"),n=v(!1),h=v(10),f=v(y.status),o=v(y.processed),p=v(y.total),z=X(y.errors||{}),w=T(()=>o.value>0?Math.round(o.value*100/p.value):0),k=T(()=>f.value===g.Scheduled||f.value===g.Running);async function B(){if(!k.value)try{n.value=!0,await x.post(V("apps/files/api/v1/filenames/sanitization"),{limit:h.value}),f.value=g.Scheduled}catch(t){A.error("Failed to start filename sanitization.",{error:t}),G(t)&&t.response?.data?.ocs?N(t.response.data.ocs.meta.message):N(a("files","Failed to start filename sanitization."))}finally{n.value=!1}}async function M(){if(!n.value)try{n.value=!0;const{data:t}=await x.get(V("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){A.error("Failed to refresh filename sanitization status.",{error:t}),N(a("files","Failed to refresh filename sanitization status."))}finally{n.value=!1}}return(t,b)=>k.value?(l(),_(e(F),{key:0},{default:u(()=>[m("div",$,[m("p",null,[r(i(e(a)("files","Filename sanitization in progress."))+" ",1),b[1]||(b[1]=m("br",null,null,-1)),o.value>0?(l(),d(U,{key:0},[r(i(e(a)("files","Currently {processedUsers} of {totalUsers} accounts are already processed.",{processedUsers:o.value,totalUsers:p.value})),1)],64)):(l(),d(U,{key:1},[r(i(e(a)("files","Preparing …")),1)],64))]),c(e(Z),{value:w.value,size:12},null,8,["value"]),c(e(D),{variant:"tertiary",onClick:M},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(g).Done?(l(),_(e(F),{key:1,type:"success"},{default:u(()=>[r(i(e(a)("files","All files have been sanitized for Windows filename support.")),1)]),_:1})):(l(),d("form",{key:2,class:"sanitize-filenames__form",disabled:n.value,onSubmit:Y(B,["stop","prevent"])},[f.value===e(g).Error?(l(),_(e(F),{key:0,type:"error"},{default:u(()=>[r(i(e(a)("files","Some files could not be sanitized, please check your logs."))+" ",1),m("ul",{class:"sanitize-filenames__errors","aria-label":e(a)("files","Sanitization errors")},[(l(!0),d(U,null,P(Object.entries(z.value),([S,Q])=>(l(),d("li",{key:S},[m("h4",null,i(S)+":",1),m("ul",{"aria-label":e(a)("files","Not sanitized filenames")},[(l(!0),d(U,null,P(Q,C=>(l(),d("li",{key:C},i(C),1))),128))],8,ie)]))),128))],8,ae)]),_:1})):W("",!0),c(e(F),null,{default:u(()=>[r(i(e(a)("files","Windows filename support has been enabled."))+" ",1),b[2]||(b[2]=m("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}),m("fieldset",se,[c(e(K),{modelValue:h.value,"onUpdate:modelValue":b[0]||(b[0]=S=>h.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(),d("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=j(te,[["__scopeId","data-v-58a24104"]]),oe={class:"hint"},re=O({__name:"SettingsAdmin",setup(s){const{docUrl:y,isRunningSanitization:n,windowsSupport:h}=R("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(h);async function z(w){if(!o.value)try{o.value=!0,await x.post(V("apps/files/api/v1/filenames/windows-compatibility"),{enabled:w}),p.value=w}catch(k){N(a("files","Failed to toggle Windows filename support")),A.error("Failed to toggle Windows filename support",{error:k})}finally{o.value=!1}}return(w,k)=>(l(),_(e(J),{docUrl:e(y),name:e(a)("files","Files compatibility"),description:f},{default:u(()=>[c(e(H),{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"]),m("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(),_(ne,{key:0})):W("",!0)]),_:1},8,["docUrl","name"]))}}),ue=j(re,[["__scopeId","data-v-32b9ae72"]]),L=q(ue);L.config.globalProperties.t=a,L.mount("#files-admin-settings");
|
|
//# sourceMappingURL=files-settings-admin.mjs.map
|