fix dashboard page jump around at refresh, save instance button

This commit is contained in:
mantaohuang 2020-12-20 13:50:54 -05:00
parent 8bed0a4b10
commit d3205be71c

View File

@ -112,7 +112,7 @@
<div class="card-header"> <div class="card-header">
<h4 class="card-title">Most Visited Pages</h4> <h4 class="card-title">Most Visited Pages</h4>
</div> </div>
<div class="table-responsive"> <div id="ovpn_table_container" class="table-responsive">
<table id="ovpn_table" class="table card-table table-vcenter"> <table id="ovpn_table" class="table card-table table-vcenter">
<!-- <thead> <!-- <thead>
<tr> <tr>
@ -353,11 +353,20 @@
}); });
}); });
$("#ovpn_table_container").height($("#ovpn_table").height()); // set fixed height for table container to prevent page from scrolling to top
}); });
} }
update_stat(); update_stat();
setInterval(update_stat, 1000); setInterval(update_stat, 1000);
function save_current_config(){
$.get("/save_instance", (data, textStatus)=>{
if(textStatus=="success"){
alert("saved")
}
});
}
</script> </script>