task bij logs gezet
This commit is contained in:
@@ -342,6 +342,7 @@ function downloadModalElements() {
|
||||
count: document.getElementById("download-modal-count"),
|
||||
progressBar: document.getElementById("download-modal-progress-bar"),
|
||||
status: document.getElementById("download-modal-status"),
|
||||
logsButton: document.getElementById("download-modal-logs-btn"),
|
||||
cancelButton: document.getElementById("download-modal-cancel-btn"),
|
||||
closeButton: document.getElementById("download-modal-close-btn"),
|
||||
};
|
||||
@@ -464,6 +465,7 @@ function updateDownloadModalDisplay(info) {
|
||||
elements.count.textContent = info.countText || "";
|
||||
elements.status.textContent = info.statusText || "";
|
||||
elements.progressBar.style.width = `${Math.max(0, Math.min(100, info.percent || 0))}%`;
|
||||
elements.logsButton.classList.toggle("hidden", !info.logsVisible);
|
||||
elements.cancelButton.disabled = !!info.cancelDisabled;
|
||||
elements.cancelButton.classList.toggle("hidden", !info.cancelVisible);
|
||||
elements.closeButton.disabled = !!info.active;
|
||||
@@ -487,6 +489,7 @@ function openZipDownloadModal(selectedItems) {
|
||||
countText: "Waiting for archive task",
|
||||
statusText: "Requested",
|
||||
percent: 0,
|
||||
logsVisible: true,
|
||||
cancelVisible: true,
|
||||
cancelDisabled: true,
|
||||
});
|
||||
@@ -508,6 +511,7 @@ function openSingleFileDownloadModal(selectedItem) {
|
||||
countText: "Direct file download",
|
||||
statusText: "Requesting download...",
|
||||
percent: 0,
|
||||
logsVisible: true,
|
||||
cancelVisible: false,
|
||||
});
|
||||
}
|
||||
@@ -523,6 +527,7 @@ function markZipDownloadReady(fileName) {
|
||||
countText: "Browser download requested",
|
||||
statusText: "Ready",
|
||||
percent: 100,
|
||||
logsVisible: true,
|
||||
cancelVisible: false,
|
||||
});
|
||||
window.setTimeout(closeDownloadModal, 480);
|
||||
@@ -538,6 +543,7 @@ function markZipDownloadFailed(err) {
|
||||
countText: "Archive task failed",
|
||||
statusText: `Failed: ${err.message || "Archive download failed"}`,
|
||||
percent: 0,
|
||||
logsVisible: true,
|
||||
cancelVisible: false,
|
||||
});
|
||||
}
|
||||
@@ -552,6 +558,7 @@ function markZipDownloadCancelled() {
|
||||
countText: "Archive task cancelled",
|
||||
statusText: "Cancelled",
|
||||
percent: 0,
|
||||
logsVisible: true,
|
||||
cancelVisible: false,
|
||||
});
|
||||
}
|
||||
@@ -565,6 +572,7 @@ function markSingleFileDownloadRequested(fileName, path) {
|
||||
countText: "Browser download requested",
|
||||
statusText: "Download requested",
|
||||
percent: 0,
|
||||
logsVisible: true,
|
||||
cancelVisible: false,
|
||||
});
|
||||
window.setTimeout(closeDownloadModal, 480);
|
||||
@@ -579,6 +587,7 @@ function markSingleFileDownloadFailed(err, selectedItem) {
|
||||
countText: "Direct file download",
|
||||
statusText: `Failed: ${err.message || "Download failed"}`,
|
||||
percent: 0,
|
||||
logsVisible: true,
|
||||
cancelVisible: false,
|
||||
});
|
||||
}
|
||||
@@ -594,6 +603,7 @@ function updateZipDownloadTaskProgress(task) {
|
||||
countText: archiveTaskCountText(task),
|
||||
statusText: downloadProgressState.cancelRequested ? "Cancelling download..." : archiveTaskStatusLabel(task.status),
|
||||
percent: archiveTaskProgressPercent(task),
|
||||
logsVisible: true,
|
||||
cancelVisible: true,
|
||||
cancelDisabled: !downloadProgressState.taskId || downloadProgressState.cancelRequested,
|
||||
});
|
||||
@@ -641,6 +651,7 @@ function closeDownloadModal() {
|
||||
countText: "",
|
||||
statusText: "",
|
||||
percent: 0,
|
||||
logsVisible: false,
|
||||
cancelVisible: false,
|
||||
});
|
||||
setDownloadModalVisible(false);
|
||||
@@ -4564,6 +4575,11 @@ function setupEvents() {
|
||||
};
|
||||
}
|
||||
const downloadModal = downloadModalElements();
|
||||
if (downloadModal.logsButton) {
|
||||
downloadModal.logsButton.onclick = () => {
|
||||
openSettings("logs");
|
||||
};
|
||||
}
|
||||
if (downloadModal.cancelButton) {
|
||||
downloadModal.cancelButton.onclick = () => {
|
||||
requestArchiveDownloadCancel().catch((err) => {
|
||||
|
||||
Reference in New Issue
Block a user