Skip to content

Commit ac0b6a9

Browse files
ajbozarthpraveen-kanamarlapudi
authored andcommitted
LIVY-352. Web UI: Added pagination by updating to use JQuery DataTables
PR moved from old repo cloudera/livy#326 [LIVY-352](https://issues.cloudera.org/browse/LIVY-352) Followup to cloudera/livy#319 adding pagination and search by switching to use jQuery DataTables like the Spark Web UI. ![none](https://cloud.githubusercontent.com/assets/13952758/25873293/cdd1c466-34c2-11e7-95bd-67d24e775036.png) ![both](https://cloud.githubusercontent.com/assets/13952758/25873299/d02de820-34c2-11e7-93bf-af0b33e3c1f2.png) ![sessions](https://cloud.githubusercontent.com/assets/13952758/25873304/d582167a-34c2-11e7-9c0b-73620cf4bf80.png) ![batch](https://cloud.githubusercontent.com/assets/13952758/25873307/d71f7838-34c2-11e7-9d2b-1462af2f8f6e.png) Author: Alex Bozarth <ajbozart@us.ibm.com> Closes apache#3 from ajbozarth/ui-pagination.
1 parent 57309e6 commit ac0b6a9

File tree

7 files changed

+188
-2
lines changed

7 files changed

+188
-2
lines changed

Diff for: server/src/main/resources/com/cloudera/livy/server/ui/static/all-sessions.js

+6
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,15 @@ var numSessions = 0;
6060
var numBatches = 0;
6161

6262
$(document).ready(function () {
63+
$.extend( $.fn.dataTable.defaults, {
64+
stateSave: true,
65+
});
66+
6367
var sessionsReq = $.getJSON(location.origin + "/sessions", function(response) {
6468
if (response && response.total > 0) {
6569
$("#interactive-sessions").load("/static/sessions-table.html .sessions-template", function() {
6670
loadSessionsTable(response.sessions);
71+
$("#interactive-sessions-table").DataTable();
6772
$('#interactive-sessions [data-toggle="tooltip"]').tooltip();
6873
});
6974
}
@@ -74,6 +79,7 @@ $(document).ready(function () {
7479
if (response && response.total > 0) {
7580
$("#batches").load("/static/batches-table.html .sessions-template", function() {
7681
loadBatchesTable(response.sessions);
82+
$("#batches-table").DataTable();
7783
$('#batches [data-toggle="tooltip"]').tooltip();
7884
});
7985
}

Diff for: server/src/main/resources/com/cloudera/livy/server/ui/static/batches-table.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<h4 id="batches-header" class="sessions-template">Batch Sessions</h4>
2020

21-
<table class="table table-striped sessions-table sessions-template">
21+
<table id="batches-table" class="table table-striped sessions-table sessions-template">
2222
<thead class="sessions-table-head">
2323
<tr>
2424
<th>Batch Id</th>

Diff for: server/src/main/resources/com/cloudera/livy/server/ui/static/dataTables.bootstrap.min.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: server/src/main/resources/com/cloudera/livy/server/ui/static/dataTables.bootstrap.min.js

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)