Skip to content

Commit

Permalink
Fix url link issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryshao committed Mar 4, 2016
1 parent f6ac7c3 commit 41add6a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
<tbody>
{{#applications}}
<tr>
<td class="rowGroupColumn"><span title="{{id}}"><a href="/history/{{id}}/{{num}}/jobs/">{{id}}</a></span></td>
<td class="rowGroupColumn"><span title="{{id}}"><a href="{{url}}">{{id}}</a></span></td>
<td class="rowGroupColumn">{{name}}</td>
{{#attempts}}
<td class="attemptIDSpan"><a href="/history/{{id}}/{{attemptId}}/jobs/">{{attemptId}}</a></td>
<td class="attemptIDSpan"><a href="/history/{{id}}/{{attemptId}}/">{{attemptId}}</a></td>
<td>{{startTime}}</td>
<td>{{endTime}}</td>
<td><span title="{{duration}}" class="durationClass">{{duration}}</span></td>
Expand Down
19 changes: 17 additions & 2 deletions core/src/main/resources/org/apache/spark/ui/static/historypage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 41add6a

Please sign in to comment.