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 a2b3826dd324b..e5ed5b30724dd 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
@@ -64,10 +64,10 @@
{{#applications}}
- {{id}} |
+ {{id}} |
{{name}} |
{{#attempts}}
- {{attemptId}} |
+ {{attemptId}} |
{{startTime}} |
{{endTime}} |
{{duration}} |
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 167c8020850d5..4ff083146e9a9 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
@@ -123,13 +123,28 @@ $(document).ready(function() {
if (app["attempts"].length > 1) {
hasMultipleAttempts = true;
}
- var num = app["attempts"].length;
+
+ var maxAttemptId = null
for (j in app["attempts"]) {
var attempt = app["attempts"][j];
+ if (attempt['attemptId'] != null) {
+ if (maxAttemptId == null || attempt['attemptId'] > maxAttemptId) {
+ maxAttemptId = attempt['attemptId']
+ }
+ }
+
attempt["startTime"] = formatDate(attempt["startTime"]);
attempt["endTime"] = formatDate(attempt["endTime"]);
attempt["lastUpdated"] = formatDate(attempt["lastUpdated"]);
- var app_clone = {"id" : id, "name" : name, "num" : num, "attempts" : [attempt]};
+
+ var url = null
+ if (maxAttemptId == null) {
+ url = "/history/" + id + "/"
+ } else {
+ url = "/history/" + id + "/" + maxAttemptId + "/"
+ }
+
+ var app_clone = {"id" : id, "name" : name, "url" : url, "attempts" : [attempt]};
array.push(app_clone);
}
}