Harden backup and restore operations
This commit is contained in:
+17
-4
@@ -181,8 +181,12 @@
|
||||
const runTarget = run => {
|
||||
if(run.taskType==='backup'||run.taskType==='rsync') return state.config.jobs.find(job=>job.id===run.jobId)?.name || 'Unbekannter Job';
|
||||
if(['check','prune'].includes(run.taskType)) return state.config.repositories.find(repo=>repo.id===run.jobId)?.name || 'Unbekanntes Repository';
|
||||
if(run.taskType==='restore') {
|
||||
const parts=String(run.jobId||'').split('\u0000');
|
||||
if(run.taskType==='restore') {
|
||||
if(run.restore) {
|
||||
const repo=state.config.repositories.find(candidate=>candidate.id===run.restore.repositoryId)?.name || 'Repository';
|
||||
return `${repo} · ${String(run.restore.snapshotId||'').slice(0,12)} → ${run.restore.target||''}`;
|
||||
}
|
||||
const parts=String(run.jobId||'').split('\u0000');
|
||||
if(parts.length>=4) {
|
||||
const repo=state.config.repositories.find(candidate=>candidate.id===parts[0])?.name || 'Repository';
|
||||
return `${repo} · ${parts[1].slice(0,12)} → ${parts[2]}`;
|
||||
@@ -915,10 +919,19 @@
|
||||
const manual=e.target.closest('.bu-schedule')?.querySelector('.bu-schedule-manual');
|
||||
if(manual) manual.hidden=e.target.value!=='manual';
|
||||
}
|
||||
if (e.target.name === 'type' && e.target.closest('#bu-job-form')) {
|
||||
if (e.target.name === 'type' && e.target.closest('#bu-job-form')) {
|
||||
state.backupSelections=[]; state.workloadSelections=[];
|
||||
renderJobSpecific(e.target.value);
|
||||
}
|
||||
}
|
||||
if (e.target.name === 'inPlace' && e.target.closest('#bu-restore-form')) {
|
||||
const target=e.target.closest('form').querySelector('[name="target"]');
|
||||
const tree=e.target.closest('form').querySelector('#bu-dir-tree-restoreTarget');
|
||||
if(target) {
|
||||
if(e.target.checked) { target.dataset.stagingTarget=target.value; target.value='/'; target.readOnly=true; }
|
||||
else { target.value=target.dataset.stagingTarget||state.config.settings.restoreRoot; target.readOnly=false; }
|
||||
}
|
||||
if(tree) tree.hidden=e.target.checked;
|
||||
}
|
||||
if (e.target.classList.contains('bu-source-select')) {
|
||||
const path=e.target.value; const prefix=path.replace(/\/$/,'')+'/';
|
||||
if(e.target.checked) state.backupSelections=normalizeSourceSelections([...state.backupSelections.filter(selected=>!selected.startsWith(prefix)),path]);
|
||||
|
||||
Reference in New Issue
Block a user