Skip to content

Commit 350e4b9

Browse files
committed
Update the pipelines initialFilter parameter after a delay
1 parent 18809bf commit 350e4b9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

dashboard/pipeline.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
"search": {
9898
"search": getSearchParam(),
9999
},
100+
"searchDelay": 500,
100101
"rowId" : "id",
101102
"columns" : [ {
102103
"data" : "id"
@@ -161,6 +162,20 @@
161162
}, ]
162163
});
163164

165+
table.on('search.dt', function () {
166+
let timeout = null;
167+
clearTimeout(timeout);
168+
timeout = setTimeout(() => {
169+
clearTimeout(timeout);
170+
let url = new URL(document.URL);
171+
if (table.search() !== url.searchParams.get('initialFilter')) {
172+
url.searchParams.set('initialFilter', table.search());
173+
history.pushState(undefined, undefined, url.toString());
174+
console.log(url.toString())
175+
}
176+
}, 500);
177+
});
178+
164179
setTimeout(reloadTable, reloadInterval);
165180

166181
$('.dateFormatable').timeago();

0 commit comments

Comments
 (0)