Skip to content

Commit ab30590

Browse files
jerryshaoMarcelo Vanzin
authored andcommitted
[SPARK-20517][UI] Fix broken history UI download link
The download link in history server UI is concatenated with: ``` <td><a href="{{uiroot}}/api/v1/applications/{{id}}/{{num}}/logs" class="btn btn-info btn-mini">Download</a></td> ``` Here `num` field represents number of attempts, this is not equal to REST APIs. In the REST API, if attempt id is not existed the URL should be `api/v1/applications/<id>/logs`, otherwise the URL should be `api/v1/applications/<id>/<attemptId>/logs`. Using `<num>` to represent `<attemptId>` will lead to the issue of "no such app". Manual verification. CC ajbozarth can you please review this change, since you add this feature before? Thanks! Author: jerryshao <[email protected]> Closes #17795 from jerryshao/SPARK-20517.
1 parent 6b44c4d commit ab30590

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

core/src/main/resources/org/apache/spark/ui/static/historypage-template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<td><span title="{{duration}}" class="durationClass">{{duration}}</span></td>
7878
<td>{{sparkUser}}</td>
7979
<td>{{lastUpdated}}</td>
80-
<td><a href="{{uiroot}}/api/v1/applications/{{id}}/{{num}}/logs" class="btn btn-info btn-mini">Download</a></td>
80+
<td><a href="{{log}}" class="btn btn-info btn-mini">Download</a></td>
8181
{{/attempts}}
8282
</tr>
8383
{{/applications}}

core/src/main/resources/org/apache/spark/ui/static/historypage.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ $(document).ready(function() {
120120
attempt["startTime"] = formatDate(attempt["startTime"]);
121121
attempt["endTime"] = formatDate(attempt["endTime"]);
122122
attempt["lastUpdated"] = formatDate(attempt["lastUpdated"]);
123+
attempt["log"] = uiRoot + "/api/v1/applications/" + id + "/" +
124+
(attempt.hasOwnProperty("attemptId") ? attempt["attemptId"] + "/" : "") + "logs";
125+
123126
var app_clone = {"id" : id, "name" : name, "num" : num, "attempts" : [attempt]};
124127
array.push(app_clone);
125128
}

0 commit comments

Comments
 (0)