sarutak commented on a change in pull request #29757:
URL: https://github.com/apache/spark/pull/29757#discussion_r490657965
##########
File path: core/src/main/resources/org/apache/spark/ui/static/timeline-view.js
##########
@@ -42,26 +42,32 @@ function drawApplicationTimeline(groupArray, eventObjArray,
startTime, offset) {
setupZoomable("#application-timeline-zoom-lock", applicationTimeline);
setupExecutorEventAction();
+ function getIdForJobEntry(baseElem) {
+ var jobIdText =
$($(baseElem).find(".application-timeline-content")[0]).text();
+ var jobId = jobIdText.match("\\(Job (\\d+)\\)$")[1];
+ return jobId;
+ };
+
+ function getSelectorForJobEntry(jobId) {
+ return "#job-" + jobId;
+ };
+
function setupJobEventAction() {
$(".vis-item.vis-range.job.application-timeline-object").each(function() {
- var getSelectorForJobEntry = function(baseElem) {
- var jobIdText =
$($(baseElem).find(".application-timeline-content")[0]).text();
- var jobId = jobIdText.match("\\(Job (\\d+)\\)$")[1];
- return "#job-" + jobId;
- };
-
$(this).click(function() {
- var jobPagePath =
$(getSelectorForJobEntry(this)).find("a.name-link").attr("href");
- window.location.href = jobPagePath
+ var jobId = getIdForJobEntry(this);
+ // trim last '/' if exists and append '/job/' segment and id
+ var jobPagePath = window.location.pathname.replace(/\/$/, "/job/?id="
+ jobId);
Review comment:
It might be better to use the same logic as
[this](https://github.com/apache/spark/blob/v3.0.0/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js#L231)
to build paths.
##########
File path: core/src/main/resources/org/apache/spark/ui/static/timeline-view.js
##########
@@ -42,26 +42,32 @@ function drawApplicationTimeline(groupArray, eventObjArray,
startTime, offset) {
setupZoomable("#application-timeline-zoom-lock", applicationTimeline);
setupExecutorEventAction();
+ function getIdForJobEntry(baseElem) {
+ var jobIdText =
$($(baseElem).find(".application-timeline-content")[0]).text();
+ var jobId = jobIdText.match("\\(Job (\\d+)\\)$")[1];
+ return jobId;
+ };
Review comment:
nit: `;` is not needed at the end of functions here and other new
functions you added.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]