-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-8171] [Web UI] Javascript based infinite scrolling for the log page #10910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I spent some time looking into ways to use javascript to load the content rather than use a page refresh and all the solutions I found required that the file has to be available on the web-server itself, which is very difficult to do with a continuously updating log file. Instead I implemented a alteration to the current pagination that adds to the top (or bottom) of the log a page at a time rather than limiting you to read only a page at a time. By setting the scroll starting location at page load this simulates an infinite scroll even though the page is re-loading. I also set the log to scroll to the bottom on initial page load. Given this is inspired by but not exactly the original jira and does distinctly change the use of this page I would love to get peoples opinions on it's usability, look and feel, and if it's worth the change at all. |
|
Screenshot? Please include them for all UI changes. |
|
Test build #50050 has finished for PR 10910 at commit
|
|
Retest this please |
|
Test build #50065 has finished for PR 10910 at commit
|
|
So every time the user clicks "load more" it will request/fetch all of the log that has already been loaded again? (Just trying to understand the design). |
|
When the user clicks load more the page refreshes and on the new page load it reads a larger chunk of the file. |
|
This isn't quite what I had in mind when filing that JIRA; the UX that I envisioned was something where if a user clicks "load more" the Javascript requests only the new / additional portion log output from the backend then update the UI without reloading the page. |
|
I had that in mind too, I just had this implementation in my head as an alternative and wanted to see what you thought. If you'd rather stick with what we have for now and wait until we figure out a js solution, then we can close this PR. I'll also spend just a bit more time trying to find a js solution to fetching the file data before moving to another task. |
|
Yeah, let's close this for the time being and re-open when you have a new approach which is ready to be reviewed. |
|
Thanks @JoshRosen for rejecting my first version, making it did helped me find this new solution using js though. Few questions: |
|
@ckadner this was what I was showing you if you want to take a look |
|
Test build #50439 has finished for PR 10910 at commit
|
|
@JoshRosen opinions on the updated version? |
|
Just in case it fell through the cracks last week, what do people think of the new javascript-based log page? |
|
@tgravescs thanks for all the help on those other PRs, mind taking a look at this one? |
|
@sarutak @JoshRosen @tgravescs in case this slipped past you guys due to Spark Summit last week |
|
@JoshRosen If you have time to take a second look at this, it's been sitting in limbo for a while, thanks |
|
@sarutak @JoshRosen @tgravescs I know you guys are busy getting ready for Spark Summit West, but I was wondering if you had an eta on looking at this? It's been open for a couple months now, thanks. |
|
@ajbozarth I'll check it soon. |
|
|
||
| function tailLog() { | ||
| $(".log-content").scrollTop($(".log-content")[0].scrollHeight); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not good to repeat a query for the same dom-objects like $(.log-content).
Similar repetitions are in some places in this change.
|
@ajbozarth Sorry for having you wait. I've inspected quickly and left some comments. @JoshRosen I think this feature itself is useful but is this the feature you had in mind? |
|
@sarutak thanks for the feedback, I'll look through and address them as I have time over the next couple days |
|
@sarutak I just went through your comments and responded and made fixes. I'm currently testing locally and will push my changes later today. |
|
Test build #55251 has finished for PR 10910 at commit
|
|
@sarutak @JoshRosen What do you think of the latest changes? |
|
@ajbozarth Thank you for the update. I'll check it next Sunday or Monday. |
| url: "/log" + baseParams + "&offset=" + offset + "&byteLength=" + moreByteLength, | ||
| success: function (data) { | ||
| var oldHeight = $(".log-content")[0].scrollHeight; | ||
| var newlineIndex = data.indexOf('\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: semicolon.
|
@ajbozarth I've left some comments about very trivial nits, otherwise LGTM. |
| Previous 0 B | ||
| </button> | ||
| } | ||
| val curLogLength = endByte - startByte; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:semicolon is not needed here.
|
Fixed the semicolons, switching back and forth between js and scala when they're "optional" on both really messes with you. Thanks @sarutak |
|
Test build #56098 has finished for PR 10910 at commit
|
|
LGTM. If we have no other comments within 24 hours, I'll merge this. |
|
Merging this into |








Updated the log page by replacing the current pagination with a javascript-based infinite scroll solution