0.10.2 Download Files

This commit is contained in:
2026-03-15 12:15:46 +00:00
parent 52ef155c7c
commit 7d6c154909
12 changed files with 1313 additions and 28 deletions

View File

@@ -370,6 +370,7 @@ export default function HistoryPage({ refreshToken = 0 }) {
const [deleteEntryPreview, setDeleteEntryPreview] = useState(null);
const [deleteEntryPreviewLoading, setDeleteEntryPreviewLoading] = useState(false);
const [deleteEntryTargetBusy, setDeleteEntryTargetBusy] = useState(null);
const [downloadBusyTarget, setDownloadBusyTarget] = useState(null);
const [loading, setLoading] = useState(false);
const [queuedJobIds, setQueuedJobIds] = useState([]);
const toastRef = useRef(null);
@@ -557,6 +558,28 @@ export default function HistoryPage({ refreshToken = 0 }) {
}
};
const handleDownloadArchive = async (row, target) => {
const jobId = Number(row?.id || selectedJob?.id || 0);
const normalizedTarget = String(target || '').trim().toLowerCase();
if (!jobId || !['raw', 'output'].includes(normalizedTarget)) {
return;
}
setDownloadBusyTarget(normalizedTarget);
try {
await api.downloadJobArchive(jobId, normalizedTarget);
} catch (error) {
toastRef.current?.show({
severity: 'error',
summary: 'Download fehlgeschlagen',
detail: error.message,
life: 4500
});
} finally {
setDownloadBusyTarget(null);
}
};
const handleReencode = async (row) => {
const title = row.title || row.detected_title || `Job #${row.id}`;
const confirmed = window.confirm(`RAW neu encodieren für "${title}" starten?`);
@@ -1169,15 +1192,18 @@ export default function HistoryPage({ refreshToken = 0 }) {
onRetry={handleRetry}
onDeleteFiles={handleDeleteFiles}
onDeleteEntry={handleDeleteEntry}
onDownloadArchive={handleDownloadArchive}
onRemoveFromQueue={handleRemoveFromQueue}
isQueued={Boolean(selectedJob?.id && queuedJobIdSet.has(normalizeJobId(selectedJob.id)))}
actionBusy={actionBusy}
reencodeBusy={reencodeBusyJobId === selectedJob?.id}
deleteEntryBusy={deleteEntryBusy}
downloadBusyTarget={downloadBusyTarget}
onHide={() => {
setDetailVisible(false);
setDetailLoading(false);
setLogLoadingMode(null);
setDownloadBusyTarget(null);
}}
/>