From 90b1828160c4a5cf20a7ede241f81cc4dd6e686b Mon Sep 17 00:00:00 2001 From: kodi Date: Sat, 14 Mar 2026 16:08:36 +0100 Subject: [PATCH] task bij logs gezet --- webui/backend/data/tasks.db | Bin 233472 -> 233472 bytes .../test_ui_smoke_golden.cpython-313.pyc | Bin 45496 -> 45823 bytes .../tests/golden/test_ui_smoke_golden.py | 4 ++++ webui/html/app.js | 16 ++++++++++++++++ webui/html/index.html | 1 + 5 files changed, 21 insertions(+) diff --git a/webui/backend/data/tasks.db b/webui/backend/data/tasks.db index 7e5cf427f1abf71c65a720a78b61ae8070d09005..e356ce305143c970dd8346ecac8cee14a652ca8d 100644 GIT binary patch delta 673 zcma)(&1(};6vgMhacCx;B$HJM)^9}AKA1Q2-h5-bM+;dkyir$4IpN7b$4u=jlN z8tkQOZ`NS@3*4331lkCdtd^>?B@L@>I-AfnM5Ro|U3DUE$&ATzCfgsqo+yslR zC1}EllUM>+W`BiG6}Tt093CRnk&kj{XYXL#*A5Z4+lg9m^z%{fHQ_2 zL0qdVm`~goX!i6cY_!XdVM)<8wQX%jmRjgX_Pd2nBYDO|E8~`V63HtaR9hyjX-&tA zz-_1u*_Q2M%fW=+`FkM|u>V|0ld)(j_4ztlYQl=t`sih;yivJYX&8C-s*m2!L2XRT zc~m^k1Kwl4!*L>fA5%~G*mpdNdDpXT>T^o{1l;WPChGjE&*?9eT3D?c-wif@p}ee* z$tcxndVb&bfrBj(7Q+F1pJr%M4LoIe0d#3KHe*l>R Bvr7N~ delta 185 zcmV;q07n0Spbmhb4v-rG`jH$%0s4VpwO|3H-vL*b1>gZqmsH>ZWC8*Tm$={ogaP@J zF%b2)GU5T!4FOu01@HlDmvZm{O#x)LzVHE70ReTBF%WULhVlV^O$2uVEC81dKmzXt zz6GQOinshg0wDqczOyk9x&oIzTmlcb=S2b?Iss0X1%LvX2n|9F84U0PUALxy0?Y>i nIkPbkH3GM&iUM5q3v|UK0?qa)DK_W-u zL5X=D)c65n3;_=`6G;<|T)cRLq=}v+esIzl6HL4ib$41{GVhoFy!W4(%*%eE|L)MG zyB13krA5=Vm+_^!OzBqxy-*3O4KB%gz9r@yR z)eLD;98)mksD!$Zg{h~89>I6V9D0n^gWZhN8IJ{OV#-xHp^V1-mz3CO!k+^7Y%qHffxXG5E4f;%xc+6SG( zhYjr_OV}Zr34>x0VW(KE6LkTS+~@?$H{+mD#l2{$q6h&vC3#3v)wn#K^3>?PHTZRU z-er2HU7s4k;RpAPCf{;zjy(#Wp8NsxGpotJd?m*o2lSl7KNj3(*je3Qo^ScUmdsmj zTDB^LHB*jlgpaEn4zGMRvX^ONvn^`Lv~d(OMXd4Ewv{*1xHjPoDW Ci|N+@ delta 613 zcmezWlxfFfCce+Syj%=GaH(u-=7zS7d{3B}YQ!i1F;Uqp!BQ_Uxn4?Svag%KWO-JR z&F4i5YTaSOTx)J~80=;}T8Aho*OO|9tknK>w3Z$7C7#KfyZT@YtO?sZR|4tzQNokw_zHsQ15o-2kOrye^oszAZ!YmGWdaNQ4S;A=3^W02$Or^$ z+}sn$$iMl2LIWeC=H!MXRYol^sSP4G*C(Yh0yPUy{*kQB$T~S7TAA4*6ihQ(PJWQ0 z%4`+N4i>czI;LitxilT%jTYlNU&dv4!#hxo(r!i72pz@&lRfAf`yD0Fdcn$^;2I1%`A64bRPg z(z1CrR~Jh&Z@yX9qr!FqC|PX0IeYd@*2%&PzfPX9l7Djg3jWCri})wcTEIV9bSap> zxna>Qj>$8Y39@OeaJ#}`Jh^a{*yi@tpIJEym{`rfr?3WXZrbS0Xynbo=*l>Q3}Ehu7y$+ro{p-^%#t@)c-noNd|UlLFf*`76^Q{Y2LQkMzXSjP diff --git a/webui/backend/tests/golden/test_ui_smoke_golden.py b/webui/backend/tests/golden/test_ui_smoke_golden.py index ae633a0..9e27de0 100644 --- a/webui/backend/tests/golden/test_ui_smoke_golden.py +++ b/webui/backend/tests/golden/test_ui_smoke_golden.py @@ -74,6 +74,7 @@ class UiSmokeGoldenTest(unittest.TestCase): self.assertIn('id="download-modal-progress-bar"', body) self.assertIn('id="download-modal-count"', body) self.assertIn('id="download-modal-status"', body) + self.assertIn('id="download-modal-logs-btn"', body) self.assertIn('id="download-modal-cancel-btn"', body) self.assertIn('id="download-modal-close-btn"', body) self.assertIn('id="context-menu"', body) @@ -282,6 +283,7 @@ class UiSmokeGoldenTest(unittest.TestCase): self.assertIn('countText: "Archive task cancelled"', app_js) self.assertIn('statusText: "Cancelling download..."', app_js) self.assertIn('statusText: `Failed: ${err.message || "Archive download failed"}`', app_js) + self.assertIn('logsVisible: true,', app_js) self.assertIn('return `${task.done_items}/${task.total_items} top-level items`;', app_js) self.assertIn('return `Current: ${task.current_item}`;', app_js) self.assertIn('downloadProgressState.requestKey === requestKey', app_js) @@ -298,6 +300,8 @@ class UiSmokeGoldenTest(unittest.TestCase): self.assertIn('return "Multi-item ZIP";', app_js) self.assertIn('details.push(`Current: ${task.current_item}`);', app_js) self.assertIn('details.push(`${task.done_items}/${task.total_items} items`);', app_js) + self.assertIn('downloadModal.logsButton.onclick = () => {', app_js) + self.assertIn('openSettings("logs");', app_js) self.assertIn('function applyContextMenuSelection()', app_js) self.assertIn('function startContextMenuOpen()', app_js) self.assertIn('function startContextMenuEdit()', app_js) diff --git a/webui/html/app.js b/webui/html/app.js index 6d2d0e6..750c628 100644 --- a/webui/html/app.js +++ b/webui/html/app.js @@ -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) => { diff --git a/webui/html/index.html b/webui/html/index.html index 504dd5e..74f30e8 100644 --- a/webui/html/index.html +++ b/webui/html/index.html @@ -129,6 +129,7 @@