Repository: incubator-livy Updated Branches: refs/heads/master 257ccdfd6 -> 9d08a5867
LIVY-353. Web UI: Added link to Spark UI for Sessions running on Yarn PR moved from old repo https://github.com/cloudera/livy/pull/327 [LIVY-353](https://issues.cloudera.org/browse/LIVY-353) Followup to https://github.com/cloudera/livy/pull/319 adding a link to the Application Id that links to the Spark UI. The link is grabbed from session.appInfo.sparkUiUrl if it exists, otherwise no link is created. Screenshots With an appId without link (in this case before the UI is generated): ![no-link](https://cloud.githubusercontent.com/assets/13952758/25873597/0307dd40-34c4-11e7-9993-925cbf7c749b.png) With an appId link: ![link](https://cloud.githubusercontent.com/assets/13952758/25873599/0454c69a-34c4-11e7-85d2-31ebe993c5a3.png) What it links to: ![spark](https://cloud.githubusercontent.com/assets/13952758/25873602/05864318-34c4-11e7-8e2c-2222ef7f6116.png) Author: Alex Bozarth <ajboz...@us.ibm.com> Closes #4 from ajbozarth/ui-app-link. Project: http://git-wip-us.apache.org/repos/asf/incubator-livy/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-livy/commit/9d08a586 Tree: http://git-wip-us.apache.org/repos/asf/incubator-livy/tree/9d08a586 Diff: http://git-wip-us.apache.org/repos/asf/incubator-livy/diff/9d08a586 Branch: refs/heads/master Commit: 9d08a58671c50ce9d24ec62d43b743c62926fc1b Parents: 257ccdf Author: Alex Bozarth <ajboz...@us.ibm.com> Authored: Fri Jun 30 15:36:39 2017 +0800 Committer: jerryshao <ss...@hortonworks.com> Committed: Fri Jun 30 15:36:39 2017 +0800 ---------------------------------------------------------------------- .../com/cloudera/livy/server/ui/static/all-sessions.js | 13 +++++++++++-- .../cloudera/livy/server/ui/static/batches-table.html | 8 +++++++- .../cloudera/livy/server/ui/static/sessions-table.html | 8 +++++++- 3 files changed, 25 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/9d08a586/server/src/main/resources/com/cloudera/livy/server/ui/static/all-sessions.js ---------------------------------------------------------------------- diff --git a/server/src/main/resources/com/cloudera/livy/server/ui/static/all-sessions.js b/server/src/main/resources/com/cloudera/livy/server/ui/static/all-sessions.js index b0c6904..64dd86d 100644 --- a/server/src/main/resources/com/cloudera/livy/server/ui/static/all-sessions.js +++ b/server/src/main/resources/com/cloudera/livy/server/ui/static/all-sessions.js @@ -16,6 +16,15 @@ * limitations under the License. */ +function appIdLink(session) { + var appUiUrl = session.appInfo.sparkUiUrl; + if (appUiUrl != null) { + return '<a href="' + appUiUrl + '">' + session.appId + "</a>"; + } else { + return session.appId; + } +} + function tdWrap(str) { return "<td>" + str + "</td>"; } @@ -25,7 +34,7 @@ function loadSessionsTable(sessions) { $("#interactive-sessions .sessions-table-body").append( "<tr>" + tdWrap(session.id) + - tdWrap(session.appId) + + tdWrap(appIdLink(session)) + tdWrap(session.owner) + tdWrap(session.proxyUser) + tdWrap(session.kind) + @@ -40,7 +49,7 @@ function loadBatchesTable(sessions) { $("#batches .sessions-table-body").append( "<tr>" + tdWrap(session.id) + - tdWrap(session.appId) + + tdWrap(appIdLink(session)) + tdWrap(session.state) + "</tr>" ); http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/9d08a586/server/src/main/resources/com/cloudera/livy/server/ui/static/batches-table.html ---------------------------------------------------------------------- diff --git a/server/src/main/resources/com/cloudera/livy/server/ui/static/batches-table.html b/server/src/main/resources/com/cloudera/livy/server/ui/static/batches-table.html index 45efbd6..18c6ad8 100644 --- a/server/src/main/resources/com/cloudera/livy/server/ui/static/batches-table.html +++ b/server/src/main/resources/com/cloudera/livy/server/ui/static/batches-table.html @@ -22,7 +22,13 @@ <thead class="sessions-table-head"> <tr> <th>Batch Id</th> - <th>Application Id</th> + <th> + <span data-toggle="tooltip" + title="Spark Application Id for this session. + If available, links to Spark Application Web UI"> + Application Id + </span> + </th> <th> <span data-toggle="tooltip" title="Session State (not_started, starting, idle, busy, http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/9d08a586/server/src/main/resources/com/cloudera/livy/server/ui/static/sessions-table.html ---------------------------------------------------------------------- diff --git a/server/src/main/resources/com/cloudera/livy/server/ui/static/sessions-table.html b/server/src/main/resources/com/cloudera/livy/server/ui/static/sessions-table.html index 3452b4c..5884c13 100644 --- a/server/src/main/resources/com/cloudera/livy/server/ui/static/sessions-table.html +++ b/server/src/main/resources/com/cloudera/livy/server/ui/static/sessions-table.html @@ -22,7 +22,13 @@ <thead class="sessions-table-head"> <tr> <th>Session Id</th> - <th>Application Id</th> + <th> + <span data-toggle="tooltip" + title="Spark Application Id for this session. + If available, links to Spark Application Web UI"> + Application Id + </span> + </th> <th> <span data-toggle="tooltip" title="Remote user who submitted this session"> Owner