mthenw / frontail

📝 streaming logs to the browser. Sponsored by https://cloudash.dev
https://cloudash.dev
MIT License
1.8k stars 251 forks source link

Auto-scrolling doesn't work #159

Open Bagunda opened 5 years ago

Bagunda commented 5 years ago

Auto-scrolling doesn't work https://www.youtube.com/watch?v=iqamAAtSTu0

ravening commented 4 years ago

Facing the same issue. Autoscroll doesnt work and everytime I have to scroll down manually to see the latest logs

mthenw commented 4 years ago

@Bagunda @rakgenius which browser do you use?

andrelung commented 4 years ago

I am encountering the same issue with the latest chrome (76.0.3809.100). I might also add, that I am using frontail with openhabian

ravening commented 4 years ago

@mthenw Im using chrome browser Version 76.0.3809.100 (Official Build) (64-bit)

Bagunda commented 4 years ago

@Bagunda @rakgenius which browser do you use? Chrome. It doesn't work about 1.5 years

mthenw commented 4 years ago

Can you paste me the exact command that you are running (or openhabian is running)?

mthenw commented 4 years ago

@Bagunda I cannot see that on your video but what happens when the window is scrolled to the bottom and you refresh the page? Does it go back to top?

mthenw commented 4 years ago

@Bagunda @andrelung @rakgenius can I ask you to validate the fix from https://github.com/mthenw/frontail/pull/180?

andrelung commented 4 years ago

Openhabian is using the npm-based installation. Line 30 you can see how it is installed: https://github.com/openhab/openhabian/blob/master/functions/nodejs-apps.bash And here is the exact command (/service): https://github.com/openhab/openhabian/blob/master/includes/frontail.service

I'll try uninstalling the npm version and installing your fix later today.

Bagunda commented 4 years ago

Can you paste me the exact command that you are running (or openhabian is running)?

frontail -d -n 100 --ui-highlight --ui-highlight-preset /usr/lib/node_modules/frontail/preset/default.json /var/log/openhab2/openhab.log /var/log/openhab2/events.log or frontail -d -n 1000 --ui-highlight --ui-highlight-preset /usr/lib/node_modules/frontail/preset/default.json /var/log/openhab2/openhab.log /var/log/openhab2/events.log

Bagunda commented 4 years ago

@Bagunda I cannot see that on your video but what happens when the window is scrolled to the bottom and you refresh the page? Does it go back to top?

Here is new video https://www.youtube.com/watch?v=2Y6H5Qb7IGs

Bagunda commented 4 years ago

@Bagunda @andrelung @rakgenius can I ask you to validate the fix from #180?

Today I try fix #180. At the end of the video https://www.youtube.com/watch?v=2Y6H5Qb7IGs Autoscroll doesn't work.

mthenw commented 4 years ago

I merged the PR and release new version (4.7.0) as it fixes @andrelung issue.

@Bagunda could you scroll your window to the bottom and run the following command in the dev tools?

console.log(window.innerHeight, window.scrollY, document.body.offsetHeight)
Bagunda commented 4 years ago

console.log(window.innerHeight, window.scrollY, document.body.offsetHeight)

https://youtu.be/iKUkM_MkApc 2019-08-27_19-13-36

mthenw commented 4 years ago

OK, looks like I know the culprit. Basically, your view is zoomed in. That's why the measurements are different than usual. Let me try to fix it.

Bagunda commented 4 years ago

Basically, your view is zoomed in.

In the settings of windows 10, I zoomed thescale. Are you talking about this?

mthenw commented 4 years ago

@Bagunda yeah, that's probably it.

riotm0de commented 4 years ago

Openhabian 2.4 (stable) Frontail 4.8.0 Raspb. 3 B Chrome and Edge

no Auto-Scroll for me :( Using "Simple-Autoscroll" Extension for Chrome in the meanwhile.

radokristof commented 4 years ago

Same problem on a zoomed scale. On normal scale it works as it should...

sujitrp commented 4 years ago

This is browser issue . works good in firefox or edge browser

Wikibear commented 3 years ago

This is not a browser issue. If you check scrollY you get a float. This float is to small and you be stay all the time under body height value. What i recommand a math round in line 305 at app.js:

from

var wasScrolledBottom = window.innerHeight + window.scrollY >= document.body.offsetHeight;

to this:

var wasScrolledBottom = window.innerHeight + Math.round(window.scrollY) >= document.body.offsetHeight;

Maybe a button for auto scroll is a bit better.

I have this issue in all modern Browser like Edge, Chrom, Opera and Firefox.

NPM is version 4.9.1 with this bug.

ak2766 commented 2 years ago

No auto-scroll on Firefox (v94.0) on Linux...

Only change in Firefox is making fonts bigger - would that affect auto-scroll?