From 77a85bcb0218b57ac47ffddd2cc08b1604adaa3f Mon Sep 17 00:00:00 2001 From: malvm Date: Wed, 5 Aug 2026 10:09:22 +0400 Subject: [PATCH] fix terminal --- src/yolo_webui/static/app.js | 14 +++++++++++--- src/yolo_webui/static/index.html | 4 ++-- src/yolo_webui/static/style.css | 5 +++-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/yolo_webui/static/app.js b/src/yolo_webui/static/app.js index 9163521..632499c 100755 --- a/src/yolo_webui/static/app.js +++ b/src/yolo_webui/static/app.js @@ -250,6 +250,14 @@ document.addEventListener('DOMContentLoaded', () => { mlflowEnabled.addEventListener('change', updateMlflowFields); // --- Logger --- + function scrollToLogBottom(container) { + if (!container) return; + container.scrollTop = container.scrollHeight; + if (container.lastElementChild && container.lastElementChild.scrollIntoView) { + container.lastElementChild.scrollIntoView({ block: 'end' }); + } + } + function addLogLine(message, level = 'info') { const line = document.createElement('div'); line.className = `log-line log-level-${level.toLowerCase()}`; @@ -257,7 +265,7 @@ document.addEventListener('DOMContentLoaded', () => { logContainer.appendChild(line); if (autoscrollCheck.checked) { - logContainer.scrollTop = logContainer.scrollHeight; + scrollToLogBottom(logContainer); } } @@ -381,7 +389,7 @@ document.addEventListener('DOMContentLoaded', () => { addLogLine(data.message, data.level); } if (autoscrollCheck && autoscrollCheck.checked) { - logContainer.scrollTop = logContainer.scrollHeight; + scrollToLogBottom(logContainer); } } else if (data.type === 'progress') { updateProgress(data.epoch, data.total_epochs, data.message); @@ -1024,7 +1032,7 @@ document.addEventListener('DOMContentLoaded', () => { exportLogContainer.appendChild(line); if (exportAutoscrollCheck.checked) { - exportLogContainer.scrollTop = exportLogContainer.scrollHeight; + scrollToLogBottom(exportLogContainer); } } diff --git a/src/yolo_webui/static/index.html b/src/yolo_webui/static/index.html index b8b95b8..48890c5 100755 --- a/src/yolo_webui/static/index.html +++ b/src/yolo_webui/static/index.html @@ -8,7 +8,7 @@ - +
@@ -536,6 +536,6 @@ - + diff --git a/src/yolo_webui/static/style.css b/src/yolo_webui/static/style.css index a564a9e..03c95ac 100755 --- a/src/yolo_webui/static/style.css +++ b/src/yolo_webui/static/style.css @@ -183,8 +183,9 @@ body { display: flex; flex-direction: column; gap: 1.25rem; + height: 100%; max-height: 100%; - overflow-y: auto; + overflow: hidden; } /* Custom Scrollbars */ @@ -768,7 +769,7 @@ body { display: flex; flex-direction: column; flex: 1; - min-height: 480px; + min-height: 0; overflow: hidden; }