Fix authenticated writes behind fnOS gateway and record completed backup

这个提交包含在:
mac 于 2026-11-11 23:22:22 +08:00 提交
1 父节点 12df14ebf0
当前提交 1827628a93
8 个文件已更改
+80 -11

没有与搜索条件相匹配的文件

+1 -1
查看文件
@@ -20,7 +20,7 @@ const states={preflight:'准备中',copying:'正在拷贝',verifying_existing:'
function bytes(n){if(!n)return'0 B';const u=['B','KB','MB','GB','TB'],i=Math.min(4,Math.floor(Math.log(n)/Math.log(1000)));return(n/1000**i).toFixed(i>1?1:0)+' '+u[i]}
function duration(s){if(s==null)return'估算中';if(s<60)return'不足 1 分钟';if(s<3600)return Math.ceil(s/60)+' 分钟';return Math.floor(s/3600)+' 小时 '+Math.ceil(s%3600/60)+' 分钟'}
function error(message){$('error').textContent=message||'';$('error').style.display=message?'block':'none'}
async function api(action,args={},post=false){const url=API+action+(post?'':'?'+new URLSearchParams(args));const r=await fetch(url,{method:post?'POST':'GET',headers:post?{'Content-Type':'application/json','X-Dayu-Request':'1'}:{},body:post?JSON.stringify(args):undefined});const d=await r.json();if(!r.ok)throw Error(d.error||'操作失败');return d}
async function api(action,args={},post=false){const url=API+action+(post?'':'?'+new URLSearchParams(args));const r=await fetch(url,{method:post?'POST':'GET',headers:post?{'Content-Type':'application/json','X-Dayu-Request':'1','X-Dayu-Token':'__DAYU_CSRF__'}:{},body:post?JSON.stringify(args):undefined});const d=await r.json();if(!r.ok)throw Error(d.error||'操作失败');return d}
function button(name,fn){const b=document.createElement('button');b.textContent=name;b.onclick=fn;return b}
function folderRows(container,entries,source){container.replaceChildren();if(!entries.length){const e=document.createElement('div');e.className='empty';e.textContent=source?'当前目录下没有可选择的文件夹':'当前目录下没有子文件夹,可以直接选作目标';container.append(e);return}for(const entry of entries){const row=document.createElement('div');row.className='row';if(source){const check=document.createElement('input');check.type='checkbox';check.setAttribute('aria-label','选择 '+entry.name);check.checked=selected.has(entry.path);check.onchange=()=>{check.checked?selected.add(entry.path):selected.delete(entry.path);updateSelection()};row.append(check)}const icon=document.createElement('span');icon.className='foldericon';icon.textContent='▰';row.append(icon,button(entry.name,()=>source?browseSource(entry.path):browseDest(entry.path)));const arrow=document.createElement('span');arrow.className='arrow';arrow.textContent='›';row.append(arrow);container.append(row)}}
function updateSelection(){$('selection').textContent=selected.size?'已选 '+selected.size+' 个目录。同名文件会先保留,并在复制后校验。':'尚未选择源目录。同名文件会先保留,并在复制后校验。';$('start').disabled=!selected.size||!destPath||busy||loading}