public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit 1/3] ui: logpanel: fix glitching on fast task logs
Date: Tue, 23 Nov 2021 08:49:33 +0100	[thread overview]
Message-ID: <20211123074935.736530-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20211123074935.736530-1-d.csapak@proxmox.com>

when we follow (scrollToEnd === true) a task log that produces many lines
per second, we often get a 'total' back that exceeds our start+limit.

in that case we do not want to pad the bottom of the task log with empty
lines, we only want that for finished task logs to preserve the scroll
bar position+size.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/panel/LogView.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/panel/LogView.js b/src/panel/LogView.js
index 1772737..bbf38ee 100644
--- a/src/panel/LogView.js
+++ b/src/panel/LogView.js
@@ -97,7 +97,9 @@ Ext.define('Proxmox.panel.LogView', {
 			lines[line.n - 1] = Ext.htmlEncode(line.t);
 		    });
 
-		    lines.length = total;
+		    if (!view.scrollToEnd) {
+			lines.length = total;
+		    }
 		    me.updateView(lines.join('<br>'), first - 1, total);
 		    me.running = false;
 		    if (me.requested) {
-- 
2.30.2





  reply	other threads:[~2021-11-23  7:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23  7:49 [pve-devel] [PATCH widget-toolkit 0/3] improve logpanel behaviour for fast tasks Dominik Csapak
2021-11-23  7:49 ` Dominik Csapak [this message]
2021-11-23  7:49 ` [pve-devel] [PATCH widget-toolkit 2/3] ui: logpanel: catch up to very fast task logs with api calls Dominik Csapak
2021-11-23  7:49 ` [pve-devel] [PATCH widget-toolkit 3/3] ui: logpanel: work around browser 'setTimeout' quirks Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211123074935.736530-2-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal