|
|
@@ -212,6 +212,7 @@ ${layout.menubar(section='coordinators', dashboard=True)}
|
|
|
var runningTableOffset = 1, completedTableOffset = 1;
|
|
|
var totalRunningJobs = 0, totalCompletedJobs = 0;
|
|
|
var PAGE_SIZE = 50;
|
|
|
+ var filterTimeout = null;
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
|
@@ -302,14 +303,18 @@ ${layout.menubar(section='coordinators', dashboard=True)}
|
|
|
});
|
|
|
|
|
|
$("#filterInput").keyup(function () {
|
|
|
- runningTable.fnFilter($(this).val());
|
|
|
- completedTable.fnFilter($(this).val());
|
|
|
-
|
|
|
var hash = "#";
|
|
|
if ($("a.btn-date.active").length > 0) {
|
|
|
hash += "date=" + $("a.btn-date.active").text();
|
|
|
}
|
|
|
window.location.hash = hash;
|
|
|
+
|
|
|
+ if (filterTimeout != null) {
|
|
|
+ clearTimeout(filterTimeout);
|
|
|
+ }
|
|
|
+ filterTimeout = setTimeout(refreshTables, 500);
|
|
|
+ refreshRunning();
|
|
|
+ refreshCompleted();
|
|
|
});
|
|
|
|
|
|
$("a.btn-pagination").on("click", function () {
|
|
|
@@ -351,6 +356,22 @@ ${layout.menubar(section='coordinators', dashboard=True)}
|
|
|
$("a.btn-date[data-value='" + hash.split("=")[1] + "']").click();
|
|
|
}
|
|
|
|
|
|
+ function refreshTables() {
|
|
|
+ refreshRunning();
|
|
|
+ refreshCompleted();
|
|
|
+ refreshProgress();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function getTextFilter() {
|
|
|
+ var filterBtn = $("#filterInput");
|
|
|
+ var textFilter = '';
|
|
|
+ if (filterBtn.val()) {
|
|
|
+ textFilter = '&text=' + filterBtn.val();
|
|
|
+ }
|
|
|
+ return textFilter;
|
|
|
+ }
|
|
|
+
|
|
|
function refreshPagination() {
|
|
|
runningTableOffset = 1;
|
|
|
completedTableOffset = 1;
|
|
|
@@ -423,7 +444,7 @@ ${layout.menubar(section='coordinators', dashboard=True)}
|
|
|
var numRunning = 0;
|
|
|
|
|
|
refreshRunning = function () {
|
|
|
- $.getJSON(window.location.pathname + "?format=json&offset=" + runningTableOffset + getStatuses('running'), function (data) {
|
|
|
+ $.getJSON(window.location.pathname + "?format=json&offset=" + runningTableOffset + getStatuses('running') + getTextFilter(), function (data) {
|
|
|
// Refresh pagination buttons
|
|
|
totalRunningJobs = data.total_jobs;
|
|
|
refreshPaginationButtons("running", totalRunningJobs);
|
|
|
@@ -535,7 +556,7 @@ ${layout.menubar(section='coordinators', dashboard=True)}
|
|
|
|
|
|
|
|
|
function refreshCompleted() {
|
|
|
- $.getJSON(window.location.pathname + "?format=json&offset=" + completedTableOffset + getStatuses('completed'), function (data) {
|
|
|
+ $.getJSON(window.location.pathname + "?format=json&offset=" + completedTableOffset + getStatuses('completed') + getTextFilter(), function (data) {
|
|
|
|
|
|
// Refresh pagination buttons
|
|
|
totalCompletedJobs = data.total_jobs;
|
|
|
@@ -570,7 +591,7 @@ ${layout.menubar(section='coordinators', dashboard=True)}
|
|
|
}
|
|
|
|
|
|
function refreshProgress() {
|
|
|
- $.getJSON(window.location.pathname + "?format=json&type=progress" + getStatuses('running'), function (data) {
|
|
|
+ $.getJSON(window.location.pathname + "?format=json&type=progress" + getStatuses('running') + getTextFilter(), function (data) {
|
|
|
var nNodes = runningTable.fnGetNodes();
|
|
|
$(data.jobs).each(function (iCoord, item) {
|
|
|
var coord = new Coordinator(item);
|
|
|
@@ -602,9 +623,7 @@ ${layout.menubar(section='coordinators', dashboard=True)}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- refreshRunning();
|
|
|
- refreshCompleted();
|
|
|
- refreshProgress();
|
|
|
+ refreshTables();
|
|
|
});
|
|
|
</script>
|
|
|
${ utils.bulk_dashboard_functions() }
|