|
|
@@ -217,6 +217,7 @@ ${ layout.menubar(section='workflows', dashboard=True) }
|
|
|
var runningTableOffset = 1, completedTableOffset = 1;
|
|
|
var totalRunningJobs = 0, totalCompletedJobs = 0;
|
|
|
var PAGE_SIZE = 50;
|
|
|
+ var filterTimeout = null;
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
|
@@ -302,9 +303,10 @@ ${ layout.menubar(section='workflows', dashboard=True) }
|
|
|
});
|
|
|
|
|
|
$("#filterInput").keyup(function () {
|
|
|
- runningTable.fnFilter($(this).val());
|
|
|
- completedTable.fnFilter($(this).val());
|
|
|
- drawTable();
|
|
|
+ if (filterTimeout != null) {
|
|
|
+ clearTimeout(filterTimeout);
|
|
|
+ }
|
|
|
+ filterTimeout = setTimeout(refreshTables, 500);
|
|
|
});
|
|
|
|
|
|
|
|
|
@@ -332,9 +334,7 @@ ${ layout.menubar(section='workflows', dashboard=True) }
|
|
|
$("a.btn-status").click(function () {
|
|
|
refreshPagination();
|
|
|
$(this).toggleClass("active");
|
|
|
- refreshRunning();
|
|
|
- refreshCompleted();
|
|
|
- refreshProgress();
|
|
|
+ refreshTables;
|
|
|
});
|
|
|
|
|
|
$("a.btn-submitted").click(function () {
|
|
|
@@ -347,9 +347,7 @@ ${ layout.menubar(section='workflows', dashboard=True) }
|
|
|
refreshPagination();
|
|
|
$("a.btn-date").not(this).removeClass("active");
|
|
|
$(this).toggleClass("active");
|
|
|
- refreshRunning();
|
|
|
- refreshCompleted();
|
|
|
- refreshProgress();
|
|
|
+ refreshTables();
|
|
|
});
|
|
|
|
|
|
var hash = window.location.hash.replace(/(<([^>]+)>)/ig, "");
|
|
|
@@ -357,6 +355,12 @@ ${ layout.menubar(section='workflows', dashboard=True) }
|
|
|
$("a.btn-date[data-value='" + hash.split("=")[1] + "']").click();
|
|
|
}
|
|
|
|
|
|
+ function refreshTables() {
|
|
|
+ refreshRunning();
|
|
|
+ refreshCompleted();
|
|
|
+ refreshProgress();
|
|
|
+ }
|
|
|
+
|
|
|
function refreshPagination() {
|
|
|
runningTableOffset = 1;
|
|
|
completedTableOffset = 1;
|
|
|
@@ -407,6 +411,15 @@ ${ layout.menubar(section='workflows', dashboard=True) }
|
|
|
return daysFilter;
|
|
|
}
|
|
|
|
|
|
+ function getTextFilter() {
|
|
|
+ var filterBtn = $("#filterInput");
|
|
|
+ var textFilter = '';
|
|
|
+ if (filterBtn.val()) {
|
|
|
+ textFilter = '&text=' + filterBtn.val();
|
|
|
+ }
|
|
|
+ return textFilter;
|
|
|
+ }
|
|
|
+
|
|
|
$.fn.dataTableExt.sErrMode = "throw";
|
|
|
|
|
|
$.fn.dataTableExt.afnFiltering.push(PersistedButtonsFilters); // from dashboard-utils.js
|
|
|
@@ -441,7 +454,7 @@ ${ layout.menubar(section='workflows', dashboard=True) }
|
|
|
|
|
|
refreshRunning = function () {
|
|
|
window.clearTimeout(runningTimeout);
|
|
|
- $.getJSON(window.location.pathname + "?format=json&offset=" + runningTableOffset + getStatuses('running') + getDaysFilter(), function (data) {
|
|
|
+ $.getJSON(window.location.pathname + "?format=json&offset=" + runningTableOffset + getStatuses('running') + getDaysFilter() + getTextFilter(), function (data) {
|
|
|
if (data.jobs.length > 0) {
|
|
|
totalRunningJobs = data.total_jobs;
|
|
|
refreshPaginationButtons("running", totalRunningJobs);
|
|
|
@@ -549,7 +562,7 @@ ${ layout.menubar(section='workflows', dashboard=True) }
|
|
|
}
|
|
|
|
|
|
function refreshCompleted() {
|
|
|
- $.getJSON(window.location.pathname + "?format=json&offset=" + completedTableOffset + getStatuses('completed') + getDaysFilter(), function (data) {
|
|
|
+ $.getJSON(window.location.pathname + "?format=json&offset=" + completedTableOffset + getStatuses('completed') + getDaysFilter() + getTextFilter(), function (data) {
|
|
|
if(data.jobs.length > 0) {
|
|
|
totalCompletedJobs = data.total_jobs;
|
|
|
refreshPaginationButtons("completed", totalCompletedJobs);
|
|
|
@@ -578,7 +591,7 @@ ${ layout.menubar(section='workflows', dashboard=True) }
|
|
|
|
|
|
function refreshProgress() {
|
|
|
window.clearTimeout(progressTimeout);
|
|
|
- $.getJSON(window.location.pathname + "?format=json&type=progress&offset=" + runningTableOffset + getStatuses('running') + getDaysFilter(), function (data) {
|
|
|
+ $.getJSON(window.location.pathname + "?format=json&type=progress&offset=" + runningTableOffset + getStatuses('running') + getDaysFilter() + getTextFilter(), function (data) {
|
|
|
var nNodes = runningTable.fnGetNodes();
|
|
|
$(data.jobs).each(function (iWf, item) {
|
|
|
var wf = new Workflow(item);
|
|
|
@@ -605,9 +618,7 @@ ${ layout.menubar(section='workflows', dashboard=True) }
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- refreshRunning();
|
|
|
- refreshCompleted();
|
|
|
- refreshProgress();
|
|
|
+ refreshTables();
|
|
|
|
|
|
});
|
|
|
|