From ee5193e34d17e0bc5ce4a9fa3d323685fe71dfaf Mon Sep 17 00:00:00 2001 From: Zhen Li Date: Thu, 18 Jun 2020 21:18:24 -0700 Subject: [PATCH] fix app id link for multi attempts app in history list page --- .../org/apache/spark/ui/static/historypage-template.html | 6 +++--- .../resources/org/apache/spark/ui/static/historypage.js | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/src/main/resources/org/apache/spark/ui/static/historypage-template.html b/core/src/main/resources/org/apache/spark/ui/static/historypage-template.html index 33eb7bfa671bc..7e9927d40c191 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/historypage-template.html +++ b/core/src/main/resources/org/apache/spark/ui/static/historypage-template.html @@ -77,12 +77,12 @@ {{#applications}} + {{#attempts}} {{version}} - {{id}} + {{id}} {{name}} - {{#attempts}} {{#hasMultipleAttempts}} - {{attemptId}} + {{attemptId}} {{/hasMultipleAttempts}} {{startTime}} {{#showCompletedColumns}} diff --git a/core/src/main/resources/org/apache/spark/ui/static/historypage.js b/core/src/main/resources/org/apache/spark/ui/static/historypage.js index 4df5f07f077d7..3a4c815029f6d 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/historypage.js +++ b/core/src/main/resources/org/apache/spark/ui/static/historypage.js @@ -130,7 +130,7 @@ $(document).ready(function() { if (app["attempts"].length > 1) { hasMultipleAttempts = true; } - var num = app["attempts"].length; + for (var j in app["attempts"]) { var attempt = app["attempts"][j]; attempt["startTime"] = formatTimeMillis(attempt["startTimeEpoch"]); @@ -140,7 +140,8 @@ $(document).ready(function() { (attempt.hasOwnProperty("attemptId") ? attempt["attemptId"] + "/" : "") + "logs"; attempt["durationMillisec"] = attempt["duration"]; attempt["duration"] = formatDuration(attempt["duration"]); - var app_clone = {"id" : id, "name" : name, "version": version, "num" : num, "attempts" : [attempt]}; + var hasAttemptId = attempt.hasOwnProperty("attemptId"); + var app_clone = {"id" : id, "name" : name, "version": version, "hasAttemptId" : hasAttemptId, "attempts" : [attempt]}; array.push(app_clone); } }