Table works
This commit is contained in:
@ -0,0 +1,4 @@
|
||||
|
||||
.value_filter {
|
||||
width: 150px;
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
|
||||
|
||||
function pagination_link(name, value){
|
||||
let link_args = db_args;
|
||||
if (name && value){
|
||||
link_args[name] = value;
|
||||
}
|
||||
else if(name){
|
||||
delete link_args[name];
|
||||
}
|
||||
return '?' + $.param( link_args );
|
||||
}
|
||||
|
||||
$(".value_filter").change((e)=>{
|
||||
window.location = pagination_link($(e.target).attr('name').substr('filter_'.length), $(e.target).val())
|
||||
});
|
||||
|
||||
function enable_auto_refresh(){
|
||||
setInterval( () => {
|
||||
if($('#autoRefresh').prop('checked')){
|
||||
$.get(
|
||||
'/app/table/total' + pagination_link(),
|
||||
(v) => {
|
||||
if( v != db_total ){
|
||||
window.location = pagination_link()
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}, 1000);
|
||||
sessionStorage.setItem('auto_refresh', $('#autoRefresh').prop('checked'));
|
||||
}
|
||||
$("#autoRefresh").click(enable_auto_refresh);
|
||||
if(sessionStorage.hasOwnProperty('auto_refresh') && sessionStorage.getItem('auto_refresh') === 'true'){
|
||||
$("#autoRefresh").prop('checked', true);
|
||||
enable_auto_refresh()
|
||||
}
|
Reference in New Issue
Block a user